Changeset 1522 for XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
- Timestamp:
- 06/05/18 19:14:40 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
r1503 r1522 6 6 namespace ep_lib 7 7 { 8 int MPI_Iprobe_mpi(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 9 { 10 status->ep_src = src; 11 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 } 8 14 9 15 int MPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 10 16 { 11 *flag = false;12 13 17 if(!comm->is_ep) 14 18 { 15 Debug("calling MPI_Iprobe MPI\n"); 16 ::MPI_Status mpi_status; 17 ::MPI_Iprobe(src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm->mpi_comm), flag, &mpi_status); 19 Debug("MPI_Iprobe with MPI\n"); 20 return MPI_Iprobe_mpi(src, tag, comm, flag, status); 21 } 22 23 else 24 { 25 Debug("MPI_Iprobe with EP\n"); 26 27 *flag = false; 28 29 Message_Check(comm); 18 30 19 status->mpi_status = &mpi_status; 20 status->ep_src = src; 21 status->ep_tag = tag; 22 return 0; 23 } 31 #pragma omp flush 24 32 25 Debug("calling MPI_Iprobe EP\n"); 26 Message_Check(comm); 27 28 #pragma omp flush 29 30 #pragma omp critical (_query) 31 if(!comm->ep_comm_ptr->message_queue->empty()) 32 { 33 #pragma omp critical (_query) 33 34 for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 34 35 { … … 39 40 { 40 41 Debug("find message\n"); 41 *flag = true;42 42 43 43 ::MPI_Status mpi_status = *(static_cast< ::MPI_Status *>((*it)->mpi_status)); 44 45 status->mpi_status = (*it)->mpi_status; 44 status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 46 45 status->ep_src = (*it)->ep_src; 47 46 status->ep_tag = (*it)->ep_tag; 48 47 48 *flag = true; 49 49 break; 50 50 } 51 51 } 52 52 } 53 54 return 0;55 53 } 56 54
Note: See TracChangeset
for help on using the changeset viewer.