| 6 |
|
#include "parse_me.h" |
| 7 |
|
#include "LRI.hpp" |
| 8 |
|
#include "Integrator.hpp" |
| 9 |
– |
#include "mpiInterface.h" |
| 9 |
|
|
| 10 |
+ |
#ifdef IS_MPI |
| 11 |
+ |
#include "mpiBASS.h" |
| 12 |
+ |
#include "bassDiag.hpp" |
| 13 |
+ |
#endif |
| 14 |
+ |
|
| 15 |
|
SimSetup::SimSetup(){ |
| 16 |
|
stamps = new MakeStamps(); |
| 17 |
|
globals = new Globals(); |
| 18 |
+ |
|
| 19 |
+ |
#ifdef IS_MPI |
| 20 |
+ |
strcpy( checkPointMsg, "SimSetup creation successful" ); |
| 21 |
+ |
MPIcheckPoint(); |
| 22 |
+ |
#endif IS_MPI |
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
SimSetup::~SimSetup(){ |
| 29 |
|
|
| 30 |
|
void SimSetup::parseFile( char* fileName ){ |
| 31 |
|
|
| 32 |
< |
inFileName = fileName; |
| 33 |
< |
set_interface_stamps( stamps, globals ); |
| 34 |
< |
#ifdef MPI |
| 35 |
< |
mpiEventInit(); |
| 32 |
> |
#ifdef IS_MPI |
| 33 |
> |
if( worldRank == 0 ){ |
| 34 |
> |
#endif // is_mpi |
| 35 |
> |
|
| 36 |
> |
inFileName = fileName; |
| 37 |
> |
set_interface_stamps( stamps, globals ); |
| 38 |
> |
|
| 39 |
> |
#ifdef IS_MPI |
| 40 |
> |
mpiEventInit(); |
| 41 |
|
#endif |
| 42 |
< |
yacc_BASS( fileName ); |
| 43 |
< |
#ifdef MPI |
| 44 |
< |
throwMPIEvent(NULL); |
| 42 |
> |
|
| 43 |
> |
yacc_BASS( fileName ); |
| 44 |
> |
|
| 45 |
> |
#ifdef IS_MPI |
| 46 |
> |
throwMPIEvent(NULL); |
| 47 |
> |
} |
| 48 |
> |
else recieveParse(); |
| 49 |
|
#endif |
| 50 |
|
|
| 51 |
|
} |
| 52 |
|
|
| 53 |
< |
#ifdef MPI |
| 53 |
> |
#ifdef IS_MPI |
| 54 |
|
void SimSetup::receiveParse(void){ |
| 55 |
|
|
| 56 |
|
set_interface_stamps( stamps, globals ); |
| 57 |
|
mpiEventInit(); |
| 58 |
+ |
MPIcheckPoint(); |
| 59 |
|
mpiEventLoop(); |
| 60 |
|
|
| 61 |
|
} |
| 62 |
< |
#endif |
| 62 |
> |
|
| 63 |
|
|
| 64 |
+ |
void SimSetup::testMe(void){ |
| 65 |
+ |
bassDiag* dumpMe = new bassDiag(globals,stamps); |
| 66 |
+ |
dumpMe->dumpStamps(); |
| 67 |
+ |
delete dumpMe; |
| 68 |
+ |
} |
| 69 |
+ |
#endif |
| 70 |
|
void SimSetup::createSim( void ){ |
| 71 |
|
|
| 72 |
|
MakeStamps *the_stamps; |
| 171 |
|
// create the atom and short range interaction arrays |
| 172 |
|
|
| 173 |
|
the_atoms = new Atom*[tot_atoms]; |
| 174 |
+ |
Atom::createArrays(tot_atoms); |
| 175 |
|
the_molecules = new Molecule[tot_nmol]; |
| 176 |
|
|
| 177 |
|
|
| 408 |
|
current_atom = comp_stamps[i]->getAtom( k ); |
| 409 |
|
if( current_atom->haveOrientation() ){ |
| 410 |
|
|
| 411 |
< |
dAtom = new DirectionalAtom; |
| 411 |
> |
dAtom = new DirectionalAtom(index); |
| 412 |
|
simnfo->n_oriented++; |
| 413 |
|
the_atoms[index] = dAtom; |
| 414 |
|
|
| 428 |
|
dAtom->setSUz( uz ); |
| 429 |
|
} |
| 430 |
|
else{ |
| 431 |
< |
the_atoms[index] = new GeneralAtom; |
| 431 |
> |
the_atoms[index] = new GeneralAtom(index); |
| 432 |
|
} |
| 433 |
|
the_atoms[index]->setType( current_atom->getType() ); |
| 434 |
|
the_atoms[index]->setIndex( index ); |