--- trunk/OOPSE-1.0/src/oopse.cpp 2004/07/27 16:13:29 1418 +++ trunk/OOPSE-1.0/src/oopse.cpp 2004/07/27 18:14:16 1419 @@ -1,10 +1,12 @@ -#ifdef IS_MPI #include #include #include #include #include + +#ifdef IS_MPI #include +#endif #ifdef PROFILE #include "mdProfile.hpp" @@ -30,7 +32,9 @@ int main(int argc,char* argv[]){ // first things first, all of the initializations +#ifdef IS_MPI MPI_Init( &argc, &argv ); // the MPI communicators +#endif initSimError(); // the error handler srand48( 1337 ); // the random number generator. @@ -43,7 +47,9 @@ int main(int argc,char* argv[]){ program_name = argv[0]; // save the program name in case we need it +#ifdef IS_MPI if( worldRank == 0 ){ +#endif std::cerr << " +----------------------------------------------------------------------+\n" << " | ____ ____ ____ _____ ______ The OpenSource, Object-oriented |\n" << @@ -64,46 +70,65 @@ int main(int argc,char* argv[]){ "\n"; if( argc < 2 ){ - strcpy( painCave.errMsg, "Error, bass file is needed to run.\n" ); + strcpy( painCave.errMsg, "Error, a meta-data file is needed to run.\n" ); painCave.isFatal = 1; simError(); } +#ifdef IS_MPI } +#endif in_name = argv[1]; +#ifdef IS_MPI strcpy( checkPointMsg, "Successful number of arguments" ); MPIcheckPoint(); +#endif // create the simulation objects, and get the show on the road - - entry_plug = new SimInfo; - startMe = new SimSetup; - + + entry_plug = new SimInfo(); + startMe = new SimSetup(); + startMe->setSimInfo( entry_plug ); +#ifdef PROFILE + startProfile( pro1 ); +#endif //profile startMe->parseFile( in_name ); +#ifdef PROFILE + endProfile( pro1 ); + + startProfile( pro2 ); +#endif //profile startMe->createSim(); - delete startMe; +#ifdef PROFILE + endProfile( pro2 ); + + startProfile( pro3 ); +#endif //profile + if (!entry_plug->has_minimizer) entry_plug->the_integrator->integrate(); else entry_plug->the_minimizer->minimize(); - #ifdef PROFILE + endProfile( pro3 ); + writeProfiles(); #endif //profile +#ifdef IS_MPI strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); MPIcheckPoint(); MPI_Finalize(); +#endif + return 0 ; } - -#endif