Changeset 1532 for XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
- Timestamp:
- 06/08/18 17:23:42 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
r1527 r1532 46 46 47 47 48 49 50 48 int MPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 51 49 { … … 55 53 return MPI_Iprobe_mpi(src, tag, comm, flag, status); 56 54 } 55 56 if(comm->is_intercomm) 57 { 58 src = comm->inter_rank_map->at(src); 59 } 57 60 58 else 61 return MPI_Iprobe_endpoint(src, tag, comm, flag, status); 62 } 63 64 int MPI_Iprobe_endpoint(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status) 65 { 66 Debug("MPI_Iprobe with EP\n"); 67 68 *flag = false; 69 70 Message_Check(comm); 71 72 #pragma omp flush 73 74 #pragma omp critical (_query) 75 for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 59 76 { 60 Debug("MPI_Iprobe with EP\n"); 77 bool src_matched = src<0? true: (*it)->ep_src == src; 78 bool tag_matched = tag<0? true: (*it)->ep_tag == tag; 79 80 if(src_matched && tag_matched) 81 { 82 Debug("find message\n"); 83 84 status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 85 status->ep_src = (*it)->ep_src; 86 status->ep_tag = (*it)->ep_tag; 61 87 62 *flag = false; 63 64 Message_Check(comm); 65 66 #pragma omp flush 67 68 #pragma omp critical (_query) 69 for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it) 70 { 71 bool src_matched = src<0? true: (*it)->ep_src == src; 72 bool tag_matched = tag<0? true: (*it)->ep_tag == tag; 73 74 if(src_matched && tag_matched) 75 { 76 Debug("find message\n"); 77 78 79 status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status)); 80 status->ep_src = (*it)->ep_src; 81 status->ep_tag = (*it)->ep_tag; 82 83 *flag = true; 84 break; 85 } 88 *flag = true; 89 break; 86 90 } 87 91 } … … 90 94 91 95 96 int MPI_Improbe(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status) 97 { 98 if(!comm->is_ep) 99 { 100 Debug("MPI_Iprobe with MPI\n"); 101 return MPI_Improbe_mpi(src, tag, comm, flag, message, status); 102 } 103 104 if(comm->is_intercomm) 105 { 106 src = comm->inter_rank_map->at(src); 107 *message = new ep_message; 108 printf("============= new *message = %p\n", *message); 109 } 110 111 return MPI_Improbe_endpoint(src, tag, comm, flag, message, status); 112 } 92 113 93 114 94 int MPI_Improbe(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status) 115 116 int MPI_Improbe_endpoint(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status) 95 117 { 96 118 int ep_rank_loc = comm->ep_comm_ptr->size_rank_info[1].first; 97 119 int mpi_rank = comm->ep_comm_ptr->size_rank_info[2].first; 120 98 121 *flag = false; 99 if(!comm->is_ep) 100 { 101 Debug("calling MPI_Improbe MPI\n"); 102 return MPI_Improbe_mpi(src, tag, comm, flag, message, status); 103 } 104 122 123 Message_Check(comm); 124 105 125 #pragma omp flush 106 126 … … 155 175 } 156 176 177
Note: See TracChangeset
for help on using the changeset viewer.