Changeset 1295 for XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp
- Timestamp:
- 10/06/17 13:56:33 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp
r1289 r1295 9 9 #include <mpi.h> 10 10 #include "ep_declaration.hpp" 11 #include "ep_mpi.hpp" 11 12 12 13 using namespace std; … … 20 21 int Message_Check(MPI_Comm comm) 21 22 { 22 int myRank;23 MPI_Comm_rank(comm, &myRank);24 25 23 if(!comm.is_ep) return 0; 26 24 … … 38 36 { 39 37 Debug("Message probing for intracomm\n"); 40 ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm> (comm.mpi_comm); 38 39 41 40 #ifdef _openmpi 42 41 #pragma omp critical (_mpi_call) 43 42 { 44 ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &status);43 ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status); 45 44 if(flag) 46 45 { … … 48 47 mpi_source = status.MPI_SOURCE; 49 48 int tag = status.MPI_TAG; 50 ::MPI_Mprobe(mpi_source, tag, mpi_comm, &message, &status);49 ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status); 51 50 52 51 } 53 52 } 54 53 #elif _intelmpi 55 #pragma omp critical (_mpi_call) 56 ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status); 54 ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status); 57 55 #endif 58 56 … … 68 66 69 67 msg_block->ep_src = get_ep_rank(comm, src_loc, src_mpi); 70 int dest_mpi = comm.ep_comm_ptr->size_rank_info[2].first;71 int ep_dest = get_ep_rank(comm, dest_loc, dest_mpi);72 68 msg_block->mpi_status = new ::MPI_Status(status); 73 69 … … 79 75 { 80 76 #pragma omp flush 81 ptr_comm_target->ep_comm_ptr->message_queue->push_back(*msg_block); 82 77 comm.ep_comm_ptr->comm_list[dest_loc].ep_comm_ptr->message_queue->push_back(*msg_block); 83 78 #pragma omp flush 84 79 } … … 110 105 { 111 106 Debug("Message probing for intracomm\n"); 112 ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm> (comm.ep_comm_ptr->intercomm->mpi_inter_comm); // => mpi_intercomm 113 107 114 108 #ifdef _openmpi 115 109 #pragma omp critical (_mpi_call) 116 110 { 117 ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &status);111 ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &status); 118 112 if(flag) 119 113 { … … 121 115 mpi_source = status.MPI_SOURCE; 122 116 int tag = status.MPI_TAG; 123 ::MPI_Mprobe(mpi_source, tag, mpi_comm, &message, &status);117 ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &message, &status); 124 118 125 119 } 126 120 } 127 121 #elif _intelmpi 128 #pragma omp critical (_mpi_call) 129 ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status); 122 ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &message, &status); 130 123 #endif 131 124 … … 153 146 { 154 147 #pragma omp flush 155 ptr_comm_target->ep_comm_ptr->message_queue->push_back(*msg_block);148 comm.ep_comm_ptr->comm_list[dest_loc].ep_comm_ptr->message_queue->push_back(*msg_block); 156 149 #pragma omp flush 157 150 } … … 167 160 { 168 161 Debug("Message probing for intracomm\n"); 169 ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm> (comm.mpi_comm);162 170 163 #ifdef _openmpi 171 164 #pragma omp critical (_mpi_call) 172 165 { 173 ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &status);166 ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status); 174 167 if(flag) 175 168 { … … 177 170 mpi_source = status.MPI_SOURCE; 178 171 int tag = status.MPI_TAG; 179 ::MPI_Mprobe(mpi_source, tag, mpi_comm, &message, &status);172 ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status); 180 173 181 174 } 182 175 } 183 176 #elif _intelmpi 184 #pragma omp critical (_mpi_call) 185 ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag, &message, &status); 177 ::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status); 186 178 #endif 187 179 … … 196 188 int dest_loc = bitset<8> (status.MPI_TAG) .to_ulong(); 197 189 int src_mpi = status.MPI_SOURCE; 198 int current_inter = comm.ep_comm_ptr->intercomm->local_rank_map->at(current_ep_rank).first;199 190 200 191 msg_block->ep_src = get_ep_rank_intercomm(comm, src_loc, src_mpi); … … 209 200 { 210 201 #pragma omp flush 211 ptr_comm_target->ep_comm_ptr->message_queue->push_back(*msg_block);202 comm.ep_comm_ptr->comm_list[dest_loc].ep_comm_ptr->message_queue->push_back(*msg_block); 212 203 #pragma omp flush 213 204 }
Note: See TracChangeset
for help on using the changeset viewer.