Changeset 1063 for XIOS/dev/branch_yushan/extern/src_ep_dev/ep_barrier.cpp
- Timestamp:
- 02/27/17 14:19:19 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_barrier.cpp
r1037 r1063 1 1 #include "ep_lib.hpp" 2 2 #include <mpi.h> 3 //#include "ep_declaration.hpp"3 #include "ep_declaration.hpp" 4 4 5 5 namespace ep_lib 6 6 { 7 7 8 9 10 8 int MPI_Barrier(MPI_Comm comm) 11 9 { 10 if(comm.is_intercomm) return MPI_Barrier_intercomm(comm); 12 11 13 12 if(comm.is_ep) … … 20 19 { 21 20 ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm > (comm.mpi_comm); 21 22 22 ::MPI_Barrier(mpi_comm); 23 23 } … … 27 27 return 0; 28 28 } 29 else if(comm.mpi_comm != 0)29 else if(comm.mpi_comm != MPI_COMM_NULL_STD ) 30 30 { 31 31 ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm> (comm.mpi_comm); … … 37 37 } 38 38 39 40 int MPI_Barrier_intercomm(MPI_Comm comm) 41 { 42 43 int ep_rank_loc = comm.ep_comm_ptr->size_rank_info[1].first; 44 45 MPI_Barrier_local(comm); 46 47 if(ep_rank_loc == 0) 48 { 49 ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm > (comm.ep_comm_ptr->intercomm->mpi_inter_comm); 50 ::MPI_Barrier(mpi_comm); 51 } 52 53 MPI_Barrier_local(comm); 54 55 return 0; 56 57 } 58 59 39 60 int MPI_Barrier_local(MPI_Comm comm) 40 61 { 41 //Message_Check(comm);62 Message_Check(comm); 42 63 comm.ep_barrier->wait(); 43 64 }
Note: See TracChangeset
for help on using the changeset viewer.