| 1 | #include <iostream> | 
| 2 | #include <fstream> | 
| 3 | #include <cstdlib> | 
| 4 | #include <cmath> | 
| 5 | #include <cstring> | 
| 6 | #include <mpi.h> | 
| 7 |  | 
| 8 | #include "simError.h" | 
| 9 | #include "SimSetup.hpp" | 
| 10 | #include "SimInfo.hpp" | 
| 11 | #include "Atom.hpp" | 
| 12 | #include "Integrator.hpp" | 
| 13 | #include "Thermo.hpp" | 
| 14 | #include "ReadWrite.hpp" | 
| 15 |  | 
| 16 | char* program_name; | 
| 17 | using namespace std; | 
| 18 |  | 
| 19 | int main(int argc,char* argv[]){ | 
| 20 |  | 
| 21 | int i; | 
| 22 | unsigned int n_atoms, eo, xo; | 
| 23 | char* in_name; | 
| 24 | SimSetup* startMe; | 
| 25 | SimInfo* entry_plug; | 
| 26 | Thermo* tStats; | 
| 27 | int hand_made = 0; | 
| 28 |  | 
| 29 | Atom** atoms; | 
| 30 | SRI** the_sris; | 
| 31 | LRI** the_lris; | 
| 32 |  | 
| 33 | int n_bonds; | 
| 34 | int n_bends; | 
| 35 | int n_torsions; | 
| 36 | int n_SRI; | 
| 37 | int n_LRI; | 
| 38 | int n_exclude; | 
| 39 |  | 
| 40 | // first things first, all of the initializations | 
| 41 |  | 
| 42 | MPI_Init( &argc, &argv ); // the MPI communicators | 
| 43 | initSimError();           // the error handler | 
| 44 | srand48( 1337 );          // the random number generator. | 
| 45 |  | 
| 46 |  | 
| 47 | // check command line arguments, and set the input file | 
| 48 |  | 
| 49 | program_name = argv[0]; // save the program name in case we need it | 
| 50 |  | 
| 51 | if( worldRank == 0 ){ | 
| 52 | if( argc < 2 ){ | 
| 53 | strcpy( painCave.errMsg, "Error, bass file is needed to run.\n" ); | 
| 54 | painCave.isFatal = 1; | 
| 55 | simError(); | 
| 56 | } | 
| 57 | } | 
| 58 |  | 
| 59 | in_name = argv[1]; | 
| 60 |  | 
| 61 | strcpy( checkPointMsg, "Successful number of arguments" ); | 
| 62 | MPIcheckPoint(); | 
| 63 |  | 
| 64 |  | 
| 65 | // create the simulation objects, and get the show on the road | 
| 66 |  | 
| 67 | entry_plug = new SimInfo; | 
| 68 | startMe = new SimSetup; | 
| 69 |  | 
| 70 | startMe->setSimInfo( entry_plug ); | 
| 71 | startMe->parseFile( in_name ); | 
| 72 | startMe->createSim(); | 
| 73 |  | 
| 74 | delete startMe; | 
| 75 |  | 
| 76 | entry_plug->the_integrator->integrate(); | 
| 77 |  | 
| 78 | strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); | 
| 79 | MPIcheckPoint(); | 
| 80 |  | 
| 81 | MPI_Finalize(); | 
| 82 | return 0 ; | 
| 83 | } | 
| 84 |  | 
| 85 |  |