@@ -7009,12 +7009,6 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7009
7009
memcpy(xferBC+inCount*size*j, inC+inCount*size*i, inCount*size);
7010
7010
++j;
7011
7011
}
7012
- {
7013
- std::stringstream msg;
7014
- msg << "VMK::alltoall(): line=" << __LINE__
7015
- << " inCount=" << inCount;
7016
- ESMC_LogDefault.Write(msg.str(), ESMC_LOGMSG_DEBUG);
7017
- }
7018
7012
// - SSI roots gather xfer data from their SSI PETs toward other SSI
7019
7013
char *xferSsiBC = NULL;
7020
7014
std::vector<char> xferSsiBuffer;
@@ -7027,15 +7021,7 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7027
7021
}
7028
7022
MPI_Gather(xferBC, (npets-ssiLocalPetCount)*inCount, mpitype,
7029
7023
xferSsiBC, (npets-ssiLocalPetCount)*outCount, mpitype, 0, mpi_c_ssi);
7030
- {
7031
- std::stringstream msg;
7032
- msg << "VMK::alltoall(): line=" << __LINE__
7033
- << " gathered into xferSsiBuffer bytes =" << bufferSize;
7034
- ESMC_LogDefault.Write(msg.str(), ESMC_LOGMSG_DEBUG);
7035
- }
7036
7024
// Step-2: Total exchange between SSI roots
7037
- char *xferSsiSBC = NULL;
7038
- std::vector<char> xferSsiSendBuffer;
7039
7025
if (mpi_c_ssi_roots != MPI_COMM_NULL){
7040
7026
// - SSI roots prepare local xferPetMap
7041
7027
std::map<int,int> xferPetMap;
@@ -7073,16 +7059,10 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7073
7059
bufferSize = inCount * size;
7074
7060
bufferSize *= npets - ssiLocalPetCount;
7075
7061
bufferSize *= ssiLocalPetCount;
7076
- xferSsiSendBuffer.resize (bufferSize);
7077
- xferSsiSBC = (char *)&(xferSsiSendBuffer[0]);
7062
+ std::vector<char> xferSsiSendBuffer(bufferSize);
7063
+ char * xferSsiSBC = (char *)&(xferSsiSendBuffer[0]);
7078
7064
int localSsi; // rank of local SSI's root, same as SSI index
7079
7065
MPI_Comm_rank(mpi_c_ssi_roots, &localSsi);
7080
- {
7081
- std::stringstream msg;
7082
- msg << "VMK::alltoall(): line=" << __LINE__
7083
- << " localSsi=" << localSsi;
7084
- ESMC_LogDefault.Write(msg.str(), ESMC_LOGMSG_DEBUG);
7085
- }
7086
7066
std::vector<int> xferInCounts(ssiCount);
7087
7067
std::vector<int> xferInOffsets(ssiCount);
7088
7068
std::vector<int> xferOutCounts(ssiCount);
@@ -7118,25 +7098,10 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7118
7098
MPI_Alltoallv(xferSsiSBC, &(xferInCounts[0]), &(xferInOffsets[0]),
7119
7099
mpitype, xferSsiBC, &(xferOutCounts[0]), &(xferOutOffsets[0]),
7120
7100
mpitype, mpi_c_ssi_roots);
7121
- // - SSI roots re-arrange data for scattering to PETs on same SSI
7122
- for (int i=0; i<ssiCount; i++){
7123
- // data block received from PETs in SSI i
7124
- if (i == localSsi) continue; // no self communication for local SSI
7125
- for (int k=0; k<ssiLocalPetCounts[i]; k++){
7126
- // data block from local PET k on SSI i to local SSI
7127
- for (int l=0; l<ssiLocalPetCount; l++){
7128
- // data block from local PET k on SSI i to SSI local PET l
7129
- memcpy(xferSsiSBC+inCount*size*(npets-ssiLocalPetCount)*l
7130
- +inCount*size*xferPetMap[ssiLocalPetLists[offsets[i]+k]],
7131
- xferSsiBC+inCount*size*j, inCount*size);
7132
- ++j;
7133
- }
7134
- }
7135
- }
7136
7101
}
7137
7102
// Step-3: SSI roots scatter xfer data to PETs on their SSI
7138
7103
// - SSI roots scatter xfer data to their SSI PETs from other SSI
7139
- MPI_Scatter(xferSsiSBC , (npets-ssiLocalPetCount)*inCount, mpitype,
7104
+ MPI_Scatter(xferSsiBC , (npets-ssiLocalPetCount)*inCount, mpitype,
7140
7105
xferBC, (npets-ssiLocalPetCount)*outCount, mpitype, 0, mpi_c_ssi);
7141
7106
// - Each PET upacks the xferBuffer into its "out" data.
7142
7107
char *outC = (char *)out;
0 commit comments