--- trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/08/07 21:47:18 670 +++ trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2003/09/25 19:27:15 787 @@ -26,7 +26,8 @@ using namespace initFile; #endif // is_mpi -InitializeFromFile :: InitializeFromFile( char *in_name ){ +InitializeFromFile::InitializeFromFile( char *in_name ){ + #ifdef IS_MPI if (worldRank == 0) { #endif @@ -48,7 +49,7 @@ InitializeFromFile :: InitializeFromFile( char *in_nam return; } -InitializeFromFile :: ~InitializeFromFile( ){ +InitializeFromFile::~InitializeFromFile( ){ #ifdef IS_MPI if (worldRank == 0) { #endif @@ -71,18 +72,19 @@ void InitializeFromFile :: readInit( SimInfo* the_simn void InitializeFromFile :: readInit( SimInfo* the_simnfo ){ - int i, j, done, which_node, which_atom; // loop counter + int i, j; + +#ifdef IS_MPI + int done, which_node, which_atom; // loop counter +#endif //is_mpi const int BUFFERSIZE = 2000; // size of the read buffer int n_atoms; // the number of atoms char read_buffer[BUFFERSIZE]; //the line buffer for reading -#ifdef IS_MPI - char send_buffer[BUFFERSIZE]; -#endif char *eof_test; // ptr to see when we reach the end of the file char *parseErr; - int procIndex; + double currTime; double boxMat[9]; double theBoxMat3[3][3]; @@ -102,9 +104,6 @@ void InitializeFromFile :: readInit( SimInfo* the_simn n_atoms = atoi( read_buffer ); - Atom **atoms = simnfo->atoms; - DirectionalAtom* dAtom; - if( n_atoms != simnfo->n_atoms ){ sprintf( painCave.errMsg, "Initialize from File error. %s n_atoms, %d, " @@ -180,16 +179,13 @@ void InitializeFromFile :: readInit( SimInfo* the_simn eof_test = fgets(read_buffer, sizeof(read_buffer), c_in_file); if( eof_test == NULL ){ sprintf( painCave.errMsg, - "Error reading 1st line of %d \n ",c_in_name); + "Error reading 1st line of %s \n ",c_in_name); haveError = 1; simError(); } n_atoms = atoi( read_buffer ); - Atom **atoms = simnfo->atoms; - DirectionalAtom* dAtom; - // Check to see that the number of atoms in the intial configuration file is the // same as declared in simBass. @@ -332,9 +328,11 @@ char* InitializeFromFile::parseDumpLine(char* readLine Atom **atoms = simnfo->atoms; DirectionalAtom* dAtom; - int j, n_atoms, atomIndex; + int n_atoms, atomIndex; #ifdef IS_MPI + int j; + n_atoms = mpiSim->getTotAtoms(); atomIndex=-1; for (j=0; j < mpiSim->getMyNlocal(); j++) { @@ -543,7 +541,6 @@ char* InitializeFromFile::parseBoxLine(char* readLine, double &time ){ char *foo; // the pointer to the current string token - int j; // set the string tokenizer