1 |
|
2 |
#ifdef IS_MPI |
3 |
#include <mpi.h> |
4 |
#endif |
5 |
|
6 |
#include "utils/simError.h" |
7 |
#include "brains/SimCreator.hpp" |
8 |
#include "brains/SimInfo.hpp" |
9 |
#include "integrators/IntegratorFactory.hpp" |
10 |
|
11 |
using namespace std; |
12 |
|
13 |
int main(int argc,char* argv[]){ |
14 |
|
15 |
// first things first, all of the initializations |
16 |
|
17 |
#ifdef IS_MPI |
18 |
MPI_Init( &argc, &argv ); // the MPI communicators |
19 |
#endif |
20 |
|
21 |
initSimError(); // the error handler |
22 |
srand48( 1337 ); // the random number generator. |
23 |
|
24 |
#ifdef IS_MPI |
25 |
if( worldRank == 0 ){ |
26 |
#endif |
27 |
std::cerr << |
28 |
" +----------------------------------------------------------------------+\n" << |
29 |
" | ____ ____ ____ _____ ______ The OpenSource, Object-oriented |\n" << |
30 |
" | / __ \\/ __ \\/ __ \\/ ___// ____/ Parallel Simulation Engine. |\n" << |
31 |
" | / / / / / / / /_/ /\\__ \\/ __/ |\n" << |
32 |
" | / /_/ / /_/ / ____/___/ / /___ Copyright 2004 by the |\n" << |
33 |
" | \\____/\\____/_/ /____/_____/ University of Notre Dame. |\n" << |
34 |
" | http://www.oopse.org |\n" << |
35 |
" | |\n" << |
36 |
" | OOPSE is an OpenScience project. All source code is available for |\n" << |
37 |
" | any use subject to only one condition: |\n" << |
38 |
" | |\n" << |
39 |
" | Any published work resulting from the use of this code must cite the |\n" << |
40 |
" | following paper: M. A. Meineke, C. F. Vardeman II, T. Lin, |\n" << |
41 |
" | C. J. Fennell, and J. D. Gezelter, |\n" << |
42 |
" | J. Comp. Chem. XX, XXXX (2004). |\n" << |
43 |
" +----------------------------------------------------------------------+\n" << |
44 |
"\n"; |
45 |
|
46 |
if( argc < 2 ){ |
47 |
strcpy( painCave.errMsg, "Error, a meta-data file is needed to run.\n" ); |
48 |
painCave.isFatal = 1; |
49 |
simError(); |
50 |
} |
51 |
#ifdef IS_MPI |
52 |
} |
53 |
#endif |
54 |
|
55 |
#ifdef IS_MPI |
56 |
strcpy( checkPointMsg, "Successful number of arguments" ); |
57 |
MPIcheckPoint(); |
58 |
#endif |
59 |
|
60 |
|
61 |
//create simulation model |
62 |
SimCreator creator; |
63 |
SimInfo* info = creator.createSim(argv[1]); |
64 |
|
65 |
//create Integrator |
66 |
//Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(); |
67 |
|
68 |
//Thermodynamic Integration Method |
69 |
//ForceManager* fman = new ThermodynamicForceManager(info); |
70 |
//myIntegrator->setForceManager(fman); |
71 |
|
72 |
|
73 |
//Zconstraint-Method |
74 |
//ForceManager* fman = new ZconstraintForceManager(info); |
75 |
//myIntegrator->setForceManager(fman); |
76 |
|
77 |
//myIntegrator->run(); |
78 |
//delete myIntegrator; |
79 |
|
80 |
//minimizer |
81 |
// Minimizer* minimizer = MinimizerFactory::getInstance()->createMininizer(); |
82 |
//minimizer->run(); |
83 |
//delete minimizer |
84 |
|
85 |
delete info; |
86 |
|
87 |
#ifdef IS_MPI |
88 |
strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); |
89 |
MPIcheckPoint(); |
90 |
|
91 |
MPI_Finalize(); |
92 |
#endif |
93 |
|
94 |
return 0 ; |
95 |
} |