Changeset 1520 for XIOS/dev/branch_openmp/extern/src_ep_dev/ep_barrier.cpp
- Timestamp:
- 06/04/18 19:25:08 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_barrier.cpp
r1354 r1520 9 9 int MPI_Barrier(MPI_Comm comm) 10 10 { 11 if(comm .is_intercomm) return MPI_Barrier_intercomm(comm);11 if(comm->is_intercomm) return MPI_Barrier_intercomm(comm); 12 12 13 if(comm .is_ep)13 if(comm->is_ep) 14 14 { 15 int ep_rank_loc = comm.ep_comm_ptr->size_rank_info[1].first; 16 17 MPI_Barrier_local(comm); 18 19 if(ep_rank_loc == 0) 20 { 21 ::MPI_Comm mpi_comm = to_mpi_comm(comm.mpi_comm); 22 23 ::MPI_Barrier(mpi_comm); 24 } 25 26 MPI_Barrier_local(comm); 27 28 return 0; 29 } 30 else if(comm.mpi_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL.mpi_comm)) 31 { 32 ::MPI_Comm mpi_comm = to_mpi_comm(comm.mpi_comm); 33 ::MPI_Barrier(mpi_comm); 34 return 0; 15 return MPI_Barrier_intracomm(comm); 35 16 } 36 17 37 else return 0; 18 19 return MPI_Barrier_mpi(comm); 20 38 21 } 39 22 40 41 int MPI_Barrier_intercomm(MPI_Comm comm) 23 int MPI_Barrier_intracomm(MPI_Comm comm) 42 24 { 43 44 int ep_rank_loc = comm.ep_comm_ptr->size_rank_info[1].first; 25 int ep_rank_loc = comm->ep_comm_ptr->size_rank_info[1].first; 45 26 46 27 MPI_Barrier_local(comm); … … 48 29 if(ep_rank_loc == 0) 49 30 { 50 ::MPI_Comm mpi_comm = to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm); 31 ::MPI_Comm mpi_comm = to_mpi_comm(comm->mpi_comm); 32 51 33 ::MPI_Barrier(mpi_comm); 52 34 } … … 55 37 56 38 return 0; 39 } 57 40 41 int MPI_Barrier_intercomm(MPI_Comm comm) 42 { 43 MPI_Barrier_local(comm); 44 45 if(comm->ep_comm_ptr->intercomm->size_rank_info[1].first == 0) 46 ::MPI_Barrier(to_mpi_comm(comm->ep_comm_ptr->intercomm->mpi_inter_comm)); 47 48 MPI_Barrier_local(comm); 49 } 50 51 int MPI_Barrier_mpi(MPI_Comm comm) 52 { 53 return ::MPI_Barrier(to_mpi_comm(comm->mpi_comm)); 58 54 } 59 55 … … 61 57 int MPI_Barrier_local(MPI_Comm comm) 62 58 { 63 //Message_Check(comm); 64 comm.ep_barrier->wait(); 59 comm->ep_barrier->wait(); 65 60 } 66 61
Note: See TracChangeset
for help on using the changeset viewer.