ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mpiBASS/mpiBASS.cpp
Revision: 186
Committed: Tue Nov 26 21:00:25 2002 UTC (21 years, 7 months ago) by mmeineke
File size: 1689 byte(s)
Log Message:
if the libMPImdtools is working this should be the code to run it.

File Contents

# User Rev Content
1 mmeineke 179 #include <iostream>
2     #include <fstream>
3     #include <cstdlib>
4     #include <cmath>
5     #include <cstring>
6 mmeineke 186 // #include <mpi.h>
7 mmeineke 179
8 mmeineke 182 #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 mmeineke 179
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 mmeineke 182 // first things first, all of the initializations
41 mmeineke 179
42 mmeineke 182 MPI_Init( &argc, &argv ); // the MPI communicators
43     initSimError(); // the error handler
44     srand48( 1337 ); // the random number generator.
45 mmeineke 179
46    
47 mmeineke 182 // 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 mmeineke 179 }
58 mmeineke 186
59 mmeineke 182 in_name = argv[1];
60    
61     strcpy( checkPointMsg, "Successful number of arguments" );
62     MPIcheckPoint();
63 mmeineke 179
64    
65 mmeineke 182 // create the simulation objects, and get the show on the road
66    
67 mmeineke 179 entry_plug = new SimInfo;
68 mmeineke 182 startMe = new SimSetup;
69 mmeineke 179
70     startMe->setSimInfo( entry_plug );
71     startMe->parseFile( in_name );
72     startMe->createSim();
73    
74 mmeineke 186 delete startMe;
75    
76     entry_plug->the_integrator->integrate();
77    
78 mmeineke 182 strcpy( checkPointMsg, "Oh what a lovely Tea Party!" );
79     MPIcheckPoint();
80 mmeineke 186
81 mmeineke 182 MPI_Finalize();
82 mmeineke 179 return 0 ;
83     }
84    
85