--- branches/mmeineke/mpiBASS/mpiBASS.cpp 2002/11/19 19:57:06 179 +++ trunk/mpiBASS/mpiBASS.cpp 2002/11/26 21:00:25 186 @@ -3,15 +3,16 @@ #include #include #include +// #include +#include "simError.h" +#include "SimSetup.hpp" +#include "SimInfo.hpp" +#include "Atom.hpp" +#include "Integrator.hpp" +#include "Thermo.hpp" +#include "ReadWrite.hpp" -#include "../../inc/SimSetup.hpp" -#include "../../inc/SimInfo.hpp" -#include "../../inc/Atom.hpp" -#include "../../inc/Integrator.hpp" -#include "../../inc/Thermo.hpp" -#include "../../inc/ReadWrite.hpp" - char* program_name; using namespace std; @@ -36,29 +37,48 @@ int main(int argc,char* argv[]){ int n_LRI; int n_exclude; + // first things first, all of the initializations - srand48( 1337 ); // initialize the random number generator. + MPI_Init( &argc, &argv ); // the MPI communicators + initSimError(); // the error handler + srand48( 1337 ); // the random number generator. - program_name = argv[0]; /*save the program name in case we need it*/ - if( argc < 2 ){ - cerr<< "Error, bass file is needed to run.\n"; - exit(8); - } + // check command line arguments, and set the input file + program_name = argv[0]; // save the program name in case we need it + if( worldRank == 0 ){ + if( argc < 2 ){ + strcpy( painCave.errMsg, "Error, bass file is needed to run.\n" ); + painCave.isFatal = 1; + simError(); + } + } + in_name = argv[1]; - entry_plug = new SimInfo; + + strcpy( checkPointMsg, "Successful number of arguments" ); + MPIcheckPoint(); + + // create the simulation objects, and get the show on the road + + entry_plug = new SimInfo; startMe = new SimSetup; + startMe->setSimInfo( entry_plug ); startMe->parseFile( in_name ); startMe->createSim(); delete startMe; - + entry_plug->the_integrator->integrate(); - + + strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); + MPIcheckPoint(); + + MPI_Finalize(); return 0 ; }