ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/interface_implementation/SimSetup.cpp
(Generate patch)

Comparing trunk/mdtools/interface_implementation/SimSetup.cpp (file contents):
Revision 128 by chuckv, Thu Oct 3 21:52:46 2002 UTC vs.
Revision 176 by mmeineke, Thu Nov 14 22:00:44 2002 UTC

# Line 6 | Line 6
6   #include "parse_me.h"
7   #include "LRI.hpp"
8   #include "Integrator.hpp"
9 < #include "mpiInterface.h"
9 > #include "simError.h"
10  
11 + #ifdef IS_MPI
12 + #include "mpiBASS.h"
13 + #include "bassDiag.hpp"
14 + #endif
15 +
16   SimSetup::SimSetup(){
17    stamps = new MakeStamps();
18    globals = new Globals();
19 +  
20 + #ifdef IS_MPI
21 +  strcpy( checkPointMsg, "SimSetup creation successful" );
22 +  MPIcheckPoint();
23 + #endif // IS_MPI
24   }
25  
26   SimSetup::~SimSetup(){
# Line 20 | Line 30 | void SimSetup::parseFile( char* fileName ){
30  
31   void SimSetup::parseFile( char* fileName ){
32  
33 <  inFileName = fileName;
34 <  set_interface_stamps( stamps, globals );
35 < #ifdef MPI
36 <  mpiEventInit();
33 > #ifdef IS_MPI
34 >  if( worldRank == 0 ){
35 > #endif // is_mpi
36 >    
37 >    inFileName = fileName;
38 >    set_interface_stamps( stamps, globals );
39 >    
40 > #ifdef IS_MPI
41 >    mpiEventInit();
42   #endif
43 <  yacc_BASS( fileName );
44 < #ifdef MPI
45 <  throwMPIEvent(NULL);
43 >
44 >    yacc_BASS( fileName );
45 >
46 > #ifdef IS_MPI
47 >    throwMPIEvent(NULL);
48 >  }
49 >  else receiveParse();
50   #endif
51  
52   }
53  
54 < #ifdef MPI
54 > #ifdef IS_MPI
55   void SimSetup::receiveParse(void){
56  
57      set_interface_stamps( stamps, globals );
58      mpiEventInit();
59 +    MPIcheckPoint();
60      mpiEventLoop();
61  
62   }
43 #endif
63  
64 +
65   void SimSetup::testMe(void){
66    bassDiag* dumpMe = new bassDiag(globals,stamps);
67    dumpMe->dumpStamps();
68    delete dumpMe;
69   }
70 + #endif
71  
72   void SimSetup::createSim( void ){
73  
# Line 72 | Line 93 | void SimSetup::createSim( void ){
93    else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF();
94    else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF();
95    else{
96 <    std::cerr<< "SimSetup Error. Unrecognized force field -> "
97 <             << force_field << "\n";
98 <    exit(8);
96 >    sprintf( painCave.errMsg,
97 >             "SimSetup Error. Unrecognized force field -> %s\n",
98 >             force_field );
99 >    painCave.isFatal = 1;
100 >    simError();
101    }
102  
103 + #ifdef IS_MPI
104 +  strcpy( checkPointMsg, "ForceField creation successful" );
105 +  MPIcheckPoint();
106 + #endif // is_mpi
107 +
108    // get the components and calculate the tot_nMol and indvidual n_mol
109    the_components = the_globals->getComponents();
110    components_nmol = new int[n_components];
# Line 152 | Line 180 | void SimSetup::createSim( void ){
180    // create the atom and short range interaction arrays
181  
182    the_atoms = new Atom*[tot_atoms];
183 +  Atom::createArrays(tot_atoms);
184    the_molecules = new Molecule[tot_nmol];
185  
186  
# Line 388 | Line 417 | void SimSetup::makeAtoms( void ){
417          current_atom = comp_stamps[i]->getAtom( k );
418          if( current_atom->haveOrientation() ){
419  
420 <          dAtom = new DirectionalAtom;
420 >          dAtom = new DirectionalAtom(index);
421            simnfo->n_oriented++;
422            the_atoms[index] = dAtom;
423  
# Line 408 | Line 437 | void SimSetup::makeAtoms( void ){
437            dAtom->setSUz( uz );
438          }
439          else{
440 <          the_atoms[index] = new GeneralAtom;
440 >          the_atoms[index] = new GeneralAtom(index);
441          }
442          the_atoms[index]->setType( current_atom->getType() );
443          the_atoms[index]->setIndex( index );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines