- Timestamp:
- 05/29/17 16:15:38 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_gather.cpp
r1134 r1147 352 352 353 353 void *local_gather_recvbuf; 354 void *master_recvbuf; 355 if(ep_rank_loc == 0 && mpi_rank == root_mpi_rank && root_ep_loc != 0) master_recvbuf = new void*[sizeof(recvbuf)]; 354 356 355 357 if(ep_rank_loc==0) … … 381 383 } 382 384 383 384 ::MPI_Gatherv(local_gather_recvbuf, count*num_ep, static_cast< ::MPI_Datatype>(datatype), recvbuf, gatherv_recvcnt, 385 if(root_ep_loc != 0) // gather to root_master 386 { 387 ::MPI_Gatherv(local_gather_recvbuf, count*num_ep, static_cast< ::MPI_Datatype>(datatype), master_recvbuf, gatherv_recvcnt, 385 388 gatherv_displs, static_cast< ::MPI_Datatype>(datatype), root_mpi_rank, static_cast< ::MPI_Comm>(comm.mpi_comm)); 389 } 390 else 391 { 392 ::MPI_Gatherv(local_gather_recvbuf, count*num_ep, static_cast< ::MPI_Datatype>(datatype), recvbuf, gatherv_recvcnt, 393 gatherv_displs, static_cast< ::MPI_Datatype>(datatype), root_mpi_rank, static_cast< ::MPI_Comm>(comm.mpi_comm)); 394 } 386 395 387 396 delete[] gatherv_recvcnt; … … 392 401 if(root_ep_loc != 0 && mpi_rank == root_mpi_rank) // root is not master, master send to root and root receive from master 393 402 { 394 innode_memcpy(0, recvbuf, root_ep_loc, recvbuf, count*ep_size, datatype, comm); 403 innode_memcpy(0, master_recvbuf, root_ep_loc, recvbuf, count*ep_size, datatype, comm); 404 if(ep_rank_loc == 0 ) delete[] master_recvbuf; 395 405 } 396 406 … … 399 409 if(ep_rank_loc==0) 400 410 { 411 401 412 if(datatype == MPI_INT) 402 413 {
Note: See TracChangeset
for help on using the changeset viewer.