--- trunk/OOPSE/libmdtools/mpiSimulation.cpp 2004/05/27 18:59:17 1203 +++ trunk/OOPSE/libmdtools/mpiSimulation.cpp 2004/06/01 18:42:58 1214 @@ -394,15 +394,25 @@ void mpiSimulation::mpiRefresh( void ){ void mpiSimulation::mpiRefresh( void ){ int isError, i; - int *globalAtomIndex = new int[parallelData->nAtomsLocal]; + int *localToGlobalAtomIndex = new int[parallelData->nAtomsLocal]; + int *localToGlobalGroupIndex = new int[parallelData->nGroupsLocal]; - // Fortran indexing needs to be increased by 1 in order to get the 2 languages to - // not barf + // Fortran indexing needs to be increased by 1 in order to get the 2 + // languages to not barf - for(i=0; inAtomsLocal; i++) globalAtomIndex[i] = entryPlug->atoms[i]->getGlobalIndex()+1; + for(i = 0; i < parallelData->nAtomsLocal; i++) + localToGlobalAtomIndex[i] = globalAtomIndex[i] + 1; + + for(i = 0; i < parallelData->nGroupsLocal; i++) + localToGlobalGroupIndex[i] = globalGroupIndex[i] + 1; isError = 0; - setFsimParallel( parallelData, &(entryPlug->n_atoms), globalAtomIndex, &isError ); + + setFsimParallel( parallelData, + &(parallelData->nAtomsLocal), localToGlobalAtomIndex, + &(parallelData->nGroupsLocal), localToGlobalGroupIndex, + &isError ); + if( isError ){ sprintf( painCave.errMsg, @@ -411,7 +421,8 @@ void mpiSimulation::mpiRefresh( void ){ simError(); } - delete[] globalAtomIndex; + delete[] localToGlobalGroupIndex; + delete[] localToGlobalAtomIndex; sprintf( checkPointMsg,