mcIdType nbOfNodeIdsLoc(globalNodeIds->getNumberOfTuples());
ci.allGather(&nbOfNodeIdsLoc,1,MPI_ID_TYPE,nbOfElems.get(),1,MPI_ID_TYPE,comm);
// loop to avoid to all procs to have all the nodes per proc
- int nbOfCollectiveCalls = size;// this parameter controls the memory peak
+ int nbOfCollectiveCalls = 1;// this parameter controls the memory peak
std::vector< MCAuto<DataArrayIdType> > tabs(size);
for(int subDiv = 0 ; subDiv < nbOfCollectiveCalls ; ++subDiv)
{
std::unique_ptr<int[]> nbOfElemsInt( CommInterface::ToIntArray<mcIdType>(nbOfElemsSp,size) );
std::unique_ptr<int[]> offsetsIn( CommInterface::ComputeOffset(nbOfElemsInt,size) );
mcIdType startGlobalNodeIds,endGlobalNodeIds;
- DataArray::GetSlice(0,globalNodeIds->getNumberOfTuples(),1,subDiv,size,startGlobalNodeIds,endGlobalNodeIds);
+ DataArray::GetSlice(0,globalNodeIds->getNumberOfTuples(),1,subDiv,nbOfCollectiveCalls,startGlobalNodeIds,endGlobalNodeIds);
ci.allGatherV(globalNodeIds->begin()+startGlobalNodeIds,FromIdType<int>(endGlobalNodeIds-startGlobalNodeIds),MPI_ID_TYPE,allGlobalNodeIds.get(),nbOfElemsInt.get(),offsetsIn.get(),MPI_ID_TYPE,comm);
mcIdType offset(0);
for(int curRk = 0 ; curRk < size ; ++curRk)