Changeset 1527 for XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
- Timestamp:
- 06/08/18 15:59:53 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
r1522 r1527 8 8 int MPI_Iprobe_mpi(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 9 9 { 10 ::MPI_Status mpi_status; 11 12 ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_status); 13 14 status->mpi_status = new ::MPI_Status(mpi_status); 10 15 status->ep_src = src; 11 16 status->ep_tag = tag; 12 return ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, to_mpi_status_ptr(*status));13 17 } 18 19 20 int MPI_Improbe_mpi(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status) 21 { 22 ::MPI_Status mpi_status; 23 ::MPI_Message mpi_message; 24 25 #ifdef _openmpi 26 #pragma omp critical (_mpi_call) 27 { 28 ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_status); 29 if(*flag) 30 { 31 ::MPI_Mprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), &mpi_message, &mpi_status); 32 } 33 } 34 #elif _intelmpi 35 ::MPI_Improbe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_message, &mpi_status); 36 #endif 37 38 status->mpi_status = new ::MPI_Status(mpi_status); 39 status->ep_src = src; 40 status->ep_tag = tag; 41 42 (*message)->mpi_message = &message; 43 (*message)->ep_src = src; 44 (*message)->ep_tag = tag; 45 } 46 47 48 14 49 15 50 int MPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) … … 24 59 { 25 60 Debug("MPI_Iprobe with EP\n"); 26 61 27 62 *flag = false; 28 63 … … 53 88 } 54 89 90 91 55 92 56 93 … … 63 100 { 64 101 Debug("calling MPI_Improbe MPI\n"); 65 66 ::MPI_Status mpi_status; 67 ::MPI_Message mpi_message; 68 69 #ifdef _openmpi 70 #pragma omp critical (_mpi_call) 71 { 72 ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_status); 73 if(*flag) 74 { 75 ::MPI_Mprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), &mpi_message, &mpi_status); 76 } 77 } 78 #elif _intelmpi 79 ::MPI_Improbe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_message, &mpi_status); 80 #endif 81 82 status->mpi_status = &mpi_status; 83 status->ep_src = src; 84 status->ep_tag = tag; 85 86 (*message)->mpi_message = &message; 87 (*message)->ep_src = src; 88 (*message)->ep_tag = tag; 89 90 91 return 0; 92 } 93 94 102 return MPI_Improbe_mpi(src, tag, comm, flag, message, status); 103 } 95 104 96 105 #pragma omp flush
Note: See TracChangeset
for help on using the changeset viewer.