| 246 | |
| 247 | |
| 248 | void asynchSendArray(qcomp* send, qindex numElems, int pairRank) { |
| 249 | #if COMPILE_MPI |
| 250 | |
| 251 | // we will not track nor wait for the asynch send; instead, the caller will later comm_sync() |
| 252 | MPI_Request nullReq = MPI_REQUEST_NULL; |
| 253 | |
| 254 | // divide the data into multiple messages |
| 255 | auto [messageSize, numMessages] = dividePow2PayloadIntoMessages(numElems); |
| 256 | |
| 257 | // asynchronously send the uniquely-tagged messages |
| 258 | for (qindex m=0; m<numMessages; m++) { |
| 259 | int tag = static_cast<int>(m); // gauranteed int, but m*messageSize needs qindex |
| 260 | MPI_Isend(&send[m*messageSize], messageSize, MPI_QCOMP, pairRank, tag, MPI_COMM_WORLD, &nullReq); |
| 261 | } |
| 262 | |
| 263 | #else |
| 264 | error_commButEnvNotDistributed(); |
| 265 | #endif |
| 266 | } |
| 267 | |
| 268 | |
| 269 | void receiveArray(qcomp* dest, qindex numElems, int pairRank) { |
no test coverage detected