Changeset 1532 for XIOS/dev/branch_openmp/extern
- Timestamp:
- 06/08/18 17:23:42 (6 years ago)
- Location:
- XIOS/dev/branch_openmp/extern/ep_dev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_lib_endpoint.hpp
r1527 r1532 16 16 17 17 int MPI_Comm_dup_endpoint(MPI_Comm comm, MPI_Comm *newcomm); 18 19 int MPI_Iprobe_endpoint(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status); 20 int MPI_Improbe_endpoint(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status); 18 21 19 22 } -
XIOS/dev/branch_openmp/extern/ep_dev/ep_message.cpp
r1527 r1532 67 67 #pragma omp critical (_query0) 68 68 { 69 MPI_Iprobe ((*(*it))->ep_src, (*(*it))->ep_tag, ((*(*it))->comm), &probed, &status);69 MPI_Iprobe_endpoint((*(*it))->ep_src, (*(*it))->ep_tag, ((*(*it))->comm), &probed, &status); 70 70 if(probed) 71 71 { … … 77 77 78 78 79 MPI_Improbe ((*(*it))->ep_src, (*(*it))->ep_tag, (*(*it))->comm, &probed, message, &status);79 MPI_Improbe_endpoint((*(*it))->ep_src, (*(*it))->ep_tag, (*(*it))->comm, &probed, message, &status); 80 80 81 81 } … … 196 196 continue; 197 197 } 198 199 if((*(*it))->state == 2)200 {201 EP_PendingRequests->erase(it);202 203 memcheck("EP_PendingRequests["<<ep_rank<<"]->size() = " << EP_PendingRequests->size());204 it = EP_PendingRequests->begin();205 continue;206 }207 198 208 199 if((*(*it))->ep_src>6) … … 217 208 218 209 } 210 -
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 -
XIOS/dev/branch_openmp/extern/ep_dev/ep_recv.cpp
r1527 r1532 106 106 memcheck("delete " << (*message)->mpi_message << " : in ep_lib::MPI_Mrecv, delete (*message)->mpi_message"); 107 107 delete (*message)->mpi_message; 108 memcheck("delete " << *message << " : in ep_lib::MPI_Imrecv, delete *message"); 109 delete *message; 108 110 109 111 #ifdef _check_sum … … 130 132 memcheck("delete " << (*message)->mpi_message << " : in ep_lib::MPI_Imrecv, delete (*message)->mpi_message"); 131 133 delete (*message)->mpi_message; 134 132 135 133 136 #ifdef _check_sum -
XIOS/dev/branch_openmp/extern/ep_dev/main.cpp
r1527 r1532 144 144 145 145 if(rank == 0) printf(" \t Test iP2P for intercomm \t OK\n"); 146 147 if(color==2 && split_rank==0) 148 { 149 double sendbuf[9]={1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9}; 150 MPI_Request send_request; 151 MPI_Status send_status; 152 MPI_Isend(sendbuf, 9, MPI_DOUBLE, 0, 10, inter_comm, &send_request); 153 MPI_Wait(&send_request, &send_status); 154 } 155 156 if(color==1 && split_rank==0) 157 { 158 double recvbuf[9]; 159 MPI_Request recv_request; 160 MPI_Status recv_status; 161 int probed = false; 162 MPI_Message message; 163 while(!probed) 164 { 165 MPI_Improbe(0, 10, inter_comm, &probed, &message, &recv_status); 166 } 167 MPI_Mrecv(recvbuf, 9, MPI_DOUBLE, &message, &recv_status); 168 for(int i=0; i<9; i++) 169 { 170 printf("==========recvbuf[%d] = %lf\n", i, recvbuf[i]); 171 } 172 } 173 174 146 175 147 176 … … 1546 1575 1547 1576 } 1577
Note: See TracChangeset
for help on using the changeset viewer.