Changeset 1646 for XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_gatherv.cpp
- Timestamp:
- 01/31/19 12:12:52 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_gatherv.cpp
r1603 r1646 1 #ifdef _usingEP 1 2 /*! 2 3 \file ep_gather.cpp … … 93 94 else MPI_Gather_local(&sendcount, 1, MPI_INT, local_recvcounts.data(), 0, comm); 94 95 95 96 97 //if(is_root) printf("rank %d =================local_recvcounts = %d %d\n", ep_rank, local_recvcounts[0], local_recvcounts[1]); 98 //if(!is_root && ep_rank_loc==0 && mpi_rank != root_mpi_rank) printf("rank %d =================local_recvcounts = %d %d\n", ep_rank, local_recvcounts[0], local_recvcounts[1]); 96 99 97 100 if(is_master) … … 108 111 else MPI_Gatherv_local(sendbuf, sendcount, sendtype, local_recvbuf, local_recvcounts.data(), local_displs.data(), 0, comm); 109 112 113 114 //if(is_root) printf("rank %d =================local_recvbuf = %d %d\n", ep_rank, static_cast<int*>(local_recvbuf)[0], static_cast<int*>(local_recvbuf)[1]); 115 //if(!is_root && ep_rank_loc==0 && mpi_rank != root_mpi_rank && ep_rank!=6) printf("rank %d =================local_recvbuf = %d %d\n", ep_rank, static_cast<int*>(local_recvbuf)[0], static_cast<int*>(local_recvbuf)[1]); 116 //if(!is_root && ep_rank_loc==0 && mpi_rank != root_mpi_rank && ep_rank==6) printf("rank %d =================local_recvbuf = %d %d %d\n", ep_rank, static_cast<int*>(local_recvbuf)[0], static_cast<int*>(local_recvbuf)[1], static_cast<int*>(local_recvbuf)[2]); 110 117 111 118 void* tmp_recvbuf; 112 119 int tmp_recvbuf_size = std::accumulate(recvcounts, recvcounts+ep_size, 0); 120 121 113 122 114 123 if(is_root) tmp_recvbuf = new void*[datasize * tmp_recvbuf_size]; … … 121 130 if(is_master) 122 131 { 132 int sendcount_mpi = 0; 133 for(int i=0; i<num_ep; i++) 134 { 135 sendcount_mpi += local_recvcounts[i]; 136 } 137 123 138 for(int i=0; i<ep_size; i++) 124 139 { … … 130 145 131 146 132 ::MPI_Gatherv(local_recvbuf, sendcount*num_ep, to_mpi_type(sendtype), tmp_recvbuf, mpi_recvcounts.data(), mpi_displs.data(), to_mpi_type(recvtype), root_mpi_rank, to_mpi_comm(comm->mpi_comm)); 147 ::MPI_Gatherv(local_recvbuf, sendcount_mpi, to_mpi_type(sendtype), tmp_recvbuf, mpi_recvcounts.data(), mpi_displs.data(), to_mpi_type(recvtype), root_mpi_rank, to_mpi_comm(comm->mpi_comm)); 148 //printf("****************** rank %d, sendcount*num_ep = %d, sendcount_mpi = %d\n", ep_rank, sendcount*num_ep, sendcount_mpi); 149 150 /*if(is_root) printf("rank %d =================tmp_recvbuf = %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", ep_rank, static_cast<int*>(tmp_recvbuf)[0], static_cast<int*>(tmp_recvbuf)[1], static_cast<int*>(tmp_recvbuf)[2], 151 static_cast<int*>(tmp_recvbuf)[3], static_cast<int*>(tmp_recvbuf)[4], static_cast<int*>(tmp_recvbuf)[5], 152 static_cast<int*>(tmp_recvbuf)[6], static_cast<int*>(tmp_recvbuf)[7], static_cast<int*>(tmp_recvbuf)[8], 153 static_cast<int*>(tmp_recvbuf)[9], static_cast<int*>(tmp_recvbuf)[10], static_cast<int*>(tmp_recvbuf)[11], 154 static_cast<int*>(tmp_recvbuf)[12], static_cast<int*>(tmp_recvbuf)[13], static_cast<int*>(tmp_recvbuf)[14], 155 static_cast<int*>(tmp_recvbuf)[15], static_cast<int*>(tmp_recvbuf)[16]);*/ 133 156 } 134 157 … … 174 197 175 198 } 199 #endif
Note: See TracChangeset
for help on using the changeset viewer.