--- trunk/mdtools/interface_implementation/SimSetup.cpp 2002/10/17 21:59:12 144 +++ trunk/mdtools/interface_implementation/SimSetup.cpp 2002/11/05 22:04:46 164 @@ -15,6 +15,11 @@ SimSetup::SimSetup(){ SimSetup::SimSetup(){ stamps = new MakeStamps(); globals = new Globals(); + +#ifdef IS_MPI + strcpy( checkPointMsg, "SimSetup creation successful" ); + MPIcheckPoint(); +#endif IS_MPI } SimSetup::~SimSetup(){ @@ -24,14 +29,23 @@ void SimSetup::parseFile( char* fileName ){ void SimSetup::parseFile( char* fileName ){ - inFileName = fileName; - set_interface_stamps( stamps, globals ); #ifdef IS_MPI - mpiEventInit(); -#endif - yacc_BASS( fileName ); + if( worldRank == 0 ){ +#endif // is_mpi + + inFileName = fileName; + set_interface_stamps( stamps, globals ); + +#ifdef IS_MPI + mpiEventInit(); +#endif + + yacc_BASS( fileName ); + #ifdef IS_MPI - throwMPIEvent(NULL); + throwMPIEvent(NULL); + } + else recieveParse(); #endif } @@ -41,6 +55,7 @@ void SimSetup::receiveParse(void){ set_interface_stamps( stamps, globals ); mpiEventInit(); + MPIcheckPoint(); mpiEventLoop(); } @@ -156,6 +171,7 @@ void SimSetup::createSim( void ){ // create the atom and short range interaction arrays the_atoms = new Atom*[tot_atoms]; + Atom::createArrays(tot_atoms); the_molecules = new Molecule[tot_nmol]; @@ -392,7 +408,7 @@ void SimSetup::makeAtoms( void ){ current_atom = comp_stamps[i]->getAtom( k ); if( current_atom->haveOrientation() ){ - dAtom = new DirectionalAtom; + dAtom = new DirectionalAtom(index); simnfo->n_oriented++; the_atoms[index] = dAtom; @@ -412,7 +428,7 @@ void SimSetup::makeAtoms( void ){ dAtom->setSUz( uz ); } else{ - the_atoms[index] = new GeneralAtom; + the_atoms[index] = new GeneralAtom(index); } the_atoms[index]->setType( current_atom->getType() ); the_atoms[index]->setIndex( index );