--- trunk/mdtools/interface_implementation/SimSetup.cpp 2002/11/26 21:04:43 189 +++ trunk/mdtools/interface_implementation/SimSetup.cpp 2002/12/05 18:53:40 195 @@ -191,17 +191,30 @@ void SimSetup::createSim( void ){ simnfo->n_bends = tot_bends; simnfo->n_torsions = tot_torsions; simnfo->n_SRI = tot_SRI; + simnfo->n_mol = tot_nmol; + +#ifdef IS_MPI + + // divide the molecules among processors here. + + new mpiSimulation( simnfo ); + + simnfo->mpiSim->divideLabor( n_components, comp_stamps, components_nmol ); + +#endif // is_mpi + + // create the atom and short range interaction arrays - Atom::createArrays(tot_atoms); - the_atoms = new Atom*[tot_atoms]; - the_molecules = new Molecule[tot_nmol]; + Atom::createArrays(simnfo->n_atoms); + the_atoms = new Atom*[simnfo->n_atoms]; + the_molecules = new Molecule[simnfo->n_mol]; - if( tot_SRI ){ - the_sris = new SRI*[tot_SRI]; - the_excludes = new ex_pair[tot_SRI]; + if( simnfo->n_SRI ){ + the_sris = new SRI*[simnfo->n_SRI]; + the_excludes = new ex_pair[simnfo->n_SRI]; } // set the arrays into the SimInfo object @@ -230,7 +243,6 @@ void SimSetup::createSim( void ){ makeTorsions(); } - // makeMolecules(); // get some of the tricky things that may still be in the globals @@ -314,11 +326,24 @@ void SimSetup::createSim( void ){ // delete fileInit; // } // else{ + +#ifdef IS_MPI + + // no init from bass + + sprintf( painCave.errMsg, + "Cannot intialize a parallel simulation without an initial configuration file.\n" ); + painCave.isFatal; + simError(); + +#else initFromBass(); + +#endif // is_mpi #ifdef IS_MPI - strcpy( checkPointMsg, "initFromBass successfully created the lattice" ); + strcpy( checkPointMsg, "Successfully read in the initial configuration" ); MPIcheckPoint(); #endif // is_mpi