# | Line 10 | Line 10 | |
---|---|---|
10 | ||
11 | #ifdef IS_MPI | |
12 | #include "mpiBASS.h" | |
13 | + | #include "mpiSimulation.hpp" |
14 | #include "bassDiag.hpp" | |
15 | #endif | |
16 | ||
# | Line 92 | Line 93 | void SimSetup::createSim( void ){ | |
93 | if( !strcmp( force_field, "TraPPE" ) ) the_ff = new TraPPEFF(); | |
94 | else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); | |
95 | else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); | |
96 | + | else if( !strcmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); |
97 | else{ | |
98 | sprintf( painCave.errMsg, | |
99 | "SimSetup Error. Unrecognized force field -> %s\n", | |
# | Line 234 | Line 236 | void SimSetup::createSim( void ){ | |
236 | ||
237 | // divide the molecules among processors here. | |
238 | ||
239 | < | mpiSimulation* mpiSim = new mpiSimulation( simnfo ); |
239 | > | mpiSim = new mpiSimulation( simnfo ); |
240 | ||
241 | mpiSim->divideLabor(); | |
242 | ||
# | Line 405 | Line 407 | void SimSetup::createSim( void ){ | |
407 | ||
408 | ||
409 | ||
410 | < | // if( the_globals->haveInitialConfig() ){ |
411 | < | // InitializeFromFile* fileInit; |
412 | < | // fileInit = new InitializeFromFile( the_globals->getInitialConfig() ); |
413 | < | |
414 | < | // fileInit->read_xyz( simnfo ); // default velocities on |
410 | > | if( the_globals->haveInitialConfig() ){ |
411 | > | |
412 | > | InitializeFromFile* fileInit; |
413 | > | #ifdef IS_MPI // is_mpi |
414 | > | if( worldRank == 0 ){ |
415 | > | #endif //is_mpi |
416 | > | fileInit = new InitializeFromFile( the_globals->getInitialConfig() ); |
417 | > | #ifdef IS_MPI |
418 | > | }else fileInit = new InitializeFromFile( NULL ); |
419 | > | #endif |
420 | > | fileInit->read_xyz( simnfo ); // default velocities on |
421 | ||
422 | < | // delete fileInit; |
423 | < | // } |
424 | < | // else{ |
422 | > | delete fileInit; |
423 | > | } |
424 | > | else{ |
425 | ||
426 | #ifdef IS_MPI | |
427 | ||
# | Line 428 | Line 436 | void SimSetup::createSim( void ){ | |
436 | ||
437 | initFromBass(); | |
438 | ||
439 | < | #endif // is_mpi |
440 | < | |
439 | > | |
440 | > | #endif |
441 | > | } |
442 | > | |
443 | #ifdef IS_MPI | |
444 | strcpy( checkPointMsg, "Successfully read in the initial configuration" ); | |
445 | MPIcheckPoint(); | |
# | Line 439 | Line 449 | void SimSetup::createSim( void ){ | |
449 | ||
450 | ||
451 | ||
452 | < | // } |
452 | > | |
453 | ||
454 | #ifdef IS_MPI | |
455 | if( worldRank == 0 ){ | |
# | Line 575 | Line 585 | void SimSetup::makeAtoms( void ){ | |
585 | for( j=0; j<components_nmol[i]; j++ ){ | |
586 | ||
587 | #ifdef IS_MPI | |
588 | < | if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
589 | < | molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
588 | > | if( mpiSim->getMyMolStart() <= molIndex && |
589 | > | molIndex <= mpiSim->getMyMolEnd() ){ |
590 | #endif // is_mpi | |
591 | ||
592 | molStart = index; | |
# | Line 642 | Line 652 | void SimSetup::makeBonds( void ){ | |
652 | the_bonds = new bond_pair[tot_bonds]; | |
653 | index = 0; | |
654 | offset = 0; | |
655 | < | molIndex = 0; |
655 | > | molIndex = 0;g1 |
656 | > | |
657 | for( i=0; i<n_components; i++ ){ | |
658 | ||
659 | for( j=0; j<components_nmol[i]; j++ ){ | |
660 | ||
661 | #ifdef IS_MPI | |
662 | < | if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
663 | < | molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
662 | > | if( mpiSim->getMyMolStart() <= molIndex && |
663 | > | molIndex <= mpiSim->getMyMolEnd() ){ |
664 | #endif // is_mpi | |
665 | ||
666 | for( k=0; k<comp_stamps[i]->getNBonds(); k++ ){ | |
# | Line 692 | Line 703 | void SimSetup::makeBends( void ){ | |
703 | for( j=0; j<components_nmol[i]; j++ ){ | |
704 | ||
705 | #ifdef IS_MPI | |
706 | < | if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
707 | < | molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
706 | > | if( mpiSim->getMyMolStart() <= molIndex && |
707 | > | molIndex <= mpiSim->getMyMolEnd() ){ |
708 | #endif // is_mpi | |
709 | ||
710 | for( k=0; k<comp_stamps[i]->getNBends(); k++ ){ | |
# | Line 737 | Line 748 | void SimSetup::makeTorsions( void ){ | |
748 | for( j=0; j<components_nmol[i]; j++ ){ | |
749 | ||
750 | #ifdef IS_MPI | |
751 | < | if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
752 | < | molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
751 | > | if( mpiSim->getMyMolStart() <= molIndex && |
752 | > | molIndex <= mpiSim->getMyMolEnd() ){ |
753 | #endif // is_mpi | |
754 | ||
755 | for( k=0; k<comp_stamps[i]->getNTorsions(); k++ ){ |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |