--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/03/27 17:32:03 420 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/03/27 19:21:42 422 @@ -248,6 +248,9 @@ void SimSetup::createSim( void ){ int localMol, allMol; int local_atoms, local_bonds, local_bends, local_torsions, local_SRI; + + int* mol2proc = mpiSim->getMolToProcMap(); + int* molCompType = mpiSim->getMolComponentType(); allMol = 0; localMol = 0; @@ -259,8 +262,7 @@ void SimSetup::createSim( void ){ for( j=0; jgetMyMolStart() <= allMol && - allMol <= mpiSim->getMyMolEnd() ){ + if( mol2proc[j] == worldRank ){ local_atoms += comp_stamps[i]->getNAtoms(); local_bonds += comp_stamps[i]->getNBonds(); @@ -279,7 +281,7 @@ void SimSetup::createSim( void ){ if( local_atoms != simnfo->n_atoms ){ sprintf( painCave.errMsg, "SimSetup error: mpiSim's localAtom (%d) and SimSetup's" - " localAtom (%d) are note equal.\n", + " localAtom (%d) are not equal.\n", simnfo->n_atoms, local_atoms ); painCave.isFatal = 1; @@ -304,8 +306,36 @@ void SimSetup::createSim( void ){ Atom::createArrays(simnfo->n_atoms); the_atoms = new Atom*[simnfo->n_atoms]; the_molecules = new Molecule[simnfo->n_mol]; + int molIndex; + + // initialize the molecule's stampID's + +#ifdef IS_MPI + + + molIndex = 0; + for(i=0; igetTotNmol(); i++){ + + if(mol2proc[i] == worldRank ){ + the_molecules[molIndex].setStampID( molCompType[i] ); + molIndex++; + } + } + +#else // is_mpi + + molIndex = 0; + for(i=0; in_SRI ){ Exclude::createArray(simnfo->n_SRI); the_excludes = new Exclude*[simnfo->n_SRI]; @@ -326,7 +356,6 @@ void SimSetup::createSim( void ){ // set the arrays into the SimInfo object simnfo->atoms = the_atoms; - simnfo->sr_interactions = the_sris; simnfo->nGlobalExcludes = 0; simnfo->excludes = the_excludes; @@ -383,25 +412,12 @@ void SimSetup::createSim( void ){ the_ff->setSimInfo( simnfo ); - makeAtoms(); + makeMolecules(); simnfo->identArray = new int[simnfo->n_atoms]; for(i=0; in_atoms; i++){ simnfo->identArray[i] = the_atoms[i]->getIdent(); } - if( tot_bonds ){ - makeBonds(); - } - - if( tot_bends ){ - makeBends(); - } - - if( tot_torsions ){ - makeTorsions(); - } - - if (the_globals->getUseRF() ) { simnfo->useReactionField = 1;