ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/src/oopse.cpp
Revision: 787
Committed: Thu Sep 25 19:27:15 2003 UTC (20 years, 9 months ago) by mmeineke
File size: 1519 byte(s)
Log Message:
cleaned things with gcc -Wall and g++ -Wall

File Contents

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