Ignore:
Timestamp:
05/31/17 19:42:49 (7 years ago)
Author:
yushan
Message:

bug fixed in MPI_Gather(v)

Location:
XIOS/dev/branch_yushan_merged/extern/src_ep_dev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_gather.cpp

    r1147 r1151  
    326326 
    327327    if(!comm.mpi_comm) return 0; 
     328     
     329    MPI_Bcast(&recvcount, 1, MPI_INT, root, comm); 
    328330 
    329331    assert(static_cast< ::MPI_Datatype>(sendtype) == static_cast< ::MPI_Datatype>(recvtype) && sendcount == recvcount); 
  • XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_gatherv.cpp

    r1147 r1151  
    348348    mpi_size = comm.ep_comm_ptr->size_rank_info[2].second; 
    349349     
     350     
     351     
    350352    if(ep_size == mpi_size)  
    351353      return ::MPI_Gatherv(sendbuf, sendcount, static_cast< ::MPI_Datatype>(datatype), recvbuf, recvcounts, displs, 
    352354                              static_cast< ::MPI_Datatype>(datatype), root, static_cast< ::MPI_Comm>(comm.mpi_comm)); 
     355 
     356    if(ep_rank != root) 
     357    { 
     358      recvcounts = new int[ep_size]; 
     359      displs = new int[ep_size]; 
     360    } 
     361     
     362    MPI_Bcast(const_cast< int* >(displs),     ep_size, MPI_INT, root, comm); 
     363    MPI_Bcast(const_cast< int* >(recvcounts), ep_size, MPI_INT, root, comm); 
     364                               
    353365 
    354366    int recv_plus_displs[ep_size]; 
     
    365377      assert(recv_plus_displs[ep_rank-ep_rank_loc+num_ep-1] >= displs[ep_rank-ep_rank_loc+num_ep-2]); 
    366378    } 
    367  
    368     if(ep_rank != root) 
    369     { 
    370       recvcounts = new int[ep_size]; 
    371       displs = new int[ep_size]; 
    372     } 
    373      
    374     MPI_Bcast(const_cast< int* >(recvcounts), ep_size, MPI_INT, root, comm); 
    375     MPI_Bcast(const_cast< int* >(displs), ep_size, MPI_INT, root, comm); 
    376379 
    377380 
Note: See TracChangeset for help on using the changeset viewer.