--- trunk/mdtools/interface_implementation/SimSetup.cpp 2003/01/27 19:28:21 248 +++ trunk/mdtools/interface_implementation/SimSetup.cpp 2003/02/03 21:15:59 261 @@ -189,7 +189,7 @@ void SimSetup::createSim( void ){ if( currentStamp == NULL ){ sprintf( painCave.errMsg, "SimSetup error: Component \"%s\" was not found in the " - "list of declared molecules\n" + "list of declared molecules\n", id ); painCave.isFatal = 1; simError(); @@ -238,8 +238,12 @@ void SimSetup::createSim( void ){ mpiSim = new mpiSimulation( simnfo ); - mpiSim->divideLabor(); + + + globalIndex = mpiSim->divideLabor(); + + // set up the local variables int localMol, allMol; @@ -392,7 +396,7 @@ void SimSetup::createSim( void ){ the_ff->setSimInfo( simnfo ); makeAtoms(); - + // if( tot_bonds ){ makeBonds(); } @@ -567,7 +571,7 @@ void SimSetup::createSim( void ){ // new AllLong( simnfo ); - if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo ); + if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo, the_ff ); if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo ); if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo ); if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); @@ -645,6 +649,14 @@ void SimSetup::makeAtoms( void ){ } } +#ifdef IS_MPI + for( i=0; igetMyNlocal(); i++ ) the_atoms[i]->setGlobalIndex( globalIndex[i] ); + + delete[] globalIndex; + + mpiSim->mpiRefresh(); +#endif //IS_MPI + the_ff->initializeAtoms(); } @@ -657,7 +669,7 @@ void SimSetup::makeBonds( void ){ the_bonds = new bond_pair[tot_bonds]; index = 0; offset = 0; - molIndex = 0;g1 + molIndex = 0; for( i=0; i