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 |
|
|
8 |
– |
#include "../../inc/SimSetup.hpp" |
9 |
– |
#include "../../inc/SimInfo.hpp" |
10 |
– |
#include "../../inc/Atom.hpp" |
11 |
– |
#include "../../inc/Integrator.hpp" |
12 |
– |
#include "../../inc/Thermo.hpp" |
13 |
– |
#include "../../inc/ReadWrite.hpp" |
14 |
– |
|
16 |
|
char* program_name; |
17 |
|
using namespace std; |
18 |
|
|
37 |
|
int n_LRI; |
38 |
|
int n_exclude; |
39 |
|
|
40 |
+ |
// first things first, all of the initializations |
41 |
|
|
42 |
< |
srand48( 1337 ); // initialize the random number generator. |
42 |
> |
MPI_Init( &argc, &argv ); // the MPI communicators |
43 |
> |
initSimError(); // the error handler |
44 |
> |
srand48( 1337 ); // the random number generator. |
45 |
|
|
46 |
|
|
47 |
< |
program_name = argv[0]; /*save the program name in case we need it*/ |
44 |
< |
if( argc < 2 ){ |
45 |
< |
cerr<< "Error, bass file is needed to run.\n"; |
46 |
< |
exit(8); |
47 |
< |
} |
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 |
< |
entry_plug = new SimInfo; |
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 |
< |
|
75 |
> |
|
76 |
|
entry_plug->the_integrator->integrate(); |
77 |
< |
|
77 |
> |
|
78 |
> |
strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); |
79 |
> |
MPIcheckPoint(); |
80 |
> |
|
81 |
> |
MPI_Finalize(); |
82 |
|
return 0 ; |
83 |
|
} |
84 |
|
|