--- trunk/mdtools/interface_implementation/SimSetup.cpp 2002/12/06 21:20:42 198 +++ trunk/mdtools/interface_implementation/SimSetup.cpp 2002/12/10 21:41:26 202 @@ -73,7 +73,7 @@ void SimSetup::createSim( void ){ MakeStamps *the_stamps; Globals* the_globals; - int i; + int i, j; // get the stamps and globals; the_stamps = stamps; @@ -213,10 +213,10 @@ void SimSetup::createSim( void ){ tot_bends = 0; tot_torsions = 0; for( i=0; igetNAtoms(); - tot_bonds += components_nmol[i] * comp_stamps[i]->getNBonds(); - tot_bends += components_nmol[i] * comp_stamps[i]->getNBends(); + + tot_atoms += components_nmol[i] * comp_stamps[i]->getNAtoms(); + tot_bonds += components_nmol[i] * comp_stamps[i]->getNBonds(); + tot_bends += components_nmol[i] * comp_stamps[i]->getNBends(); tot_torsions += components_nmol[i] * comp_stamps[i]->getNTorsions(); } @@ -234,9 +234,40 @@ void SimSetup::createSim( void ){ // divide the molecules among processors here. - new mpiSimulation( simnfo ); + mpiSimulation* mpiSim = new mpiSimulation( simnfo ); - simnfo->mpiSim->divideLabor( n_components, comp_stamps, components_nmol ); + mpiSim->divideLabor(); + + // set up the local variables + + int localMol; + int local_atoms, local_bonds, local_bends, local_torsions, local_SRI; + + localMol = 0; + local_atoms = 0; + local_bonds = 0; + local_bends = 0; + local_torsions = 0; + for( i=0; igetMyMolStart() <= j && + j <= mpiSim->getMyMolEnd() ){ + + local_atoms += comp_stamps[i]->getNAtoms(); + local_bonds += comp_stamps[i]->getNBonds(); + local_bends += comp_stamps[i]->getNBends(); + local_torsions += comp_stamps[i]->getNTorsions(); + localMol++; + } + } + } + + + + simnfo->n_atoms = mpiSim->getMyNlocal(); + #endif // is_mpi @@ -562,6 +593,7 @@ void SimSetup::makeAtoms( void ){ the_molecules[molIndex].setNMembers( nMemb ); the_molecules[molIndex].setStartAtom( molStart ); the_molecules[molIndex].setEndAtom( molEnd ); + the_molecules[molIndex].setStampID( i ); molIndex++; }