@@ -7034,6 +7034,8 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7034
7034
ESMC_LogDefault.Write(msg.str(), ESMC_LOGMSG_DEBUG);
7035
7035
}
7036
7036
// Step-2: Total exchange between SSI roots
7037
+ char *xferSsiSBC = NULL;
7038
+ std::vector<char> xferSsiSendBuffer;
7037
7039
if (mpi_c_ssi_roots != MPI_COMM_NULL){
7038
7040
// - SSI roots prepare local xferPetMap
7039
7041
std::map<int,int> xferPetMap;
@@ -7071,8 +7073,8 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7071
7073
bufferSize = inCount * size;
7072
7074
bufferSize *= npets - ssiLocalPetCount;
7073
7075
bufferSize *= ssiLocalPetCount;
7074
- std::vector<char> xferSsiSendBuffer(bufferSize);
7075
- char * xferSsiSBC = (char *)&(xferSsiSendBuffer[0]);
7076
+ xferSsiSendBuffer.resize (bufferSize);
7077
+ xferSsiSBC = (char *)&(xferSsiSendBuffer[0]);
7076
7078
int localSsi; // rank of local SSI's root, same as SSI index
7077
7079
MPI_Comm_rank(mpi_c_ssi_roots, &localSsi);
7078
7080
{
@@ -7134,7 +7136,7 @@ int VMK::alltoall(void *in, int inCount, void *out, int outCount,
7134
7136
}
7135
7137
// Step-3: SSI roots scatter xfer data to PETs on their SSI
7136
7138
// - SSI roots scatter xfer data to their SSI PETs from other SSI
7137
- MPI_Scatter(xferSsiBC , (npets-ssiLocalPetCount)*inCount, mpitype,
7139
+ MPI_Scatter(xferSsiSBC , (npets-ssiLocalPetCount)*inCount, mpitype,
7138
7140
xferBC, (npets-ssiLocalPetCount)*outCount, mpitype, 0, mpi_c_ssi);
7139
7141
// - Each PET upacks the xferBuffer into its "out" data.
7140
7142
char *outC = (char *)out;
0 commit comments