--- trunk/mdtools/interface_implementation/LJ_FF.cpp 2003/01/30 15:20:21 253 +++ trunk/mdtools/interface_implementation/LJ_FF.cpp 2003/02/04 20:15:48 263 @@ -9,7 +9,6 @@ using namespace std; #include "SRI.hpp" #include "simError.h" - // Declare the structures that will be passed by the parser and MPI typedef struct{ @@ -25,7 +24,6 @@ int parseAtomLJ( char *lineBuffer, int lineNum, atomSt int parseAtomLJ( char *lineBuffer, int lineNum, atomStruct &info ); #ifdef IS_MPI - #include "mpiForceField.h" MPI_Datatype mpiAtomStructType; @@ -72,6 +70,7 @@ LJ_FF* currentLJwrap; //**************************************************************** // begins the actual forcefield stuff. //**************************************************************** + LJ_FF::LJ_FF(){ @@ -351,10 +350,19 @@ void LJ_FF::initializeAtoms( void ){ "LJ_FF atom structures read successfully." ); MPIcheckPoint(); - currentAtomType = headAtomType; + currentAtomType = headAtomType->next; //skip the first element who is a place holder. while( currentAtomType != NULL ){ currentAtomType->duplicate( info ); + + + sendFrcStruct( &info, mpiAtomStructType ); + + sprintf( checkPointMsg, + "successfully sent lJ force type: \"%s\"\n", + info.name ); + MPIcheckPoint(); + currentAtomType = currentAtomType->next; } info.last = 1; @@ -370,9 +378,15 @@ void LJ_FF::initializeAtoms( void ){ headAtomType = new LinkedType; recieveFrcStruct( &info, mpiAtomStructType ); + while( !info.last ){ + + headAtomType->add( info ); + + MPIcheckPoint(); + recieveFrcStruct( &info, mpiAtomStructType ); } } @@ -438,7 +452,7 @@ void LJ_FF::initializeAtoms( void ){ #ifdef IS_MPI double tempBig = bigSigma; - MPI::COMM_WORLD::Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX ); + MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX ); #endif //is_mpi //calc rCut and rList @@ -626,8 +640,8 @@ void LJ_FF::doForces( int calcPot ){ doLJfortran( pos, frc, &(entry_plug->lrPot), &passedCalcPot ); - // fprintf( stderr, -// "lrPot = %lf\n", entry_plug->lrPot ); + // fprintf( stderr, + // "lrPot = %lf\n", entry_plug->lrPot ); }