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