| 11 | 
  | 
#include "ReadWrite.hpp" | 
| 12 | 
  | 
#include "simError.h" | 
| 13 | 
  | 
 | 
| 14 | 
+ | 
#ifdef IS_MPI | 
| 15 | 
+ | 
#include "mpiSimulation.hpp" | 
| 16 | 
+ | 
#endif // is_mpi | 
| 17 | 
  | 
 | 
| 18 | 
  | 
InitializeFromFile :: InitializeFromFile( char *in_name ){ | 
| 19 | 
  | 
#ifdef IS_MPI | 
| 73 | 
  | 
  char *parseErr; | 
| 74 | 
  | 
 | 
| 75 | 
  | 
 | 
| 76 | 
< | 
  entry_plug = the_entry_plug | 
| 76 | 
> | 
  entry_plug = the_entry_plug; | 
| 77 | 
  | 
 | 
| 78 | 
  | 
 | 
| 79 | 
  | 
#ifndef IS_MPI | 
| 161 | 
  | 
    // Check to see that the number of atoms in the intial configuration file is the | 
| 162 | 
  | 
    // same as declared in simBass. | 
| 163 | 
  | 
     | 
| 164 | 
< | 
    if( n_atoms != entry_plug->mpiSim->getTotAtoms() ){ | 
| 164 | 
> | 
    if( n_atoms != mpiSim->getTotAtoms() ){ | 
| 165 | 
  | 
      sprintf( painCave.errMsg, | 
| 166 | 
  | 
               "Initialize from File error. %s n_atoms, %d, " | 
| 167 | 
  | 
               "does not match the BASS file's n_atoms, %d.\n", | 
| 182 | 
  | 
   | 
| 183 | 
  | 
    // Read Proc 0 share of the xyz file... | 
| 184 | 
  | 
    masterIndex = 0; | 
| 185 | 
< | 
    for( i=0; i <= entry_plug->mpiSim->getMyAtomEnd(); i++){ | 
| 185 | 
> | 
    for( i=0; i <= mpiSim->getMyAtomEnd(); i++){ | 
| 186 | 
  | 
     | 
| 187 | 
  | 
      eof_test = fgets(read_buffer, sizeof(read_buffer), c_in_file); | 
| 188 | 
  | 
      if(eof_test == NULL){ | 
| 260 | 
  | 
 | 
| 261 | 
  | 
 | 
| 262 | 
  | 
    else if(worldRank == procIndex){ | 
| 263 | 
< | 
      nodeAtomStart = entry_plug->mpiSim->getMyAtomStart(); | 
| 264 | 
< | 
      nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd(); | 
| 263 | 
> | 
      nodeAtomStart = mpiSim->getMyAtomStart(); | 
| 264 | 
> | 
      nodeAtomEnd = mpiSim->getMyAtomEnd(); | 
| 265 | 
  | 
      mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG,MPI_COMM_WORLD); | 
| 266 | 
  | 
      mpiErr = MPI_Send(&nodeAtomsEnd,1,MPI_INT,0,MPI_ANY_TAG,MPI_COMM_WORLD); | 
| 267 | 
  | 
       | 
| 298 | 
  | 
} | 
| 299 | 
  | 
 | 
| 300 | 
  | 
 | 
| 301 | 
< | 
char* IntitializeFromFile::parseDumpLine(char* readLine, int atomIndex){ | 
| 301 | 
> | 
char* InitializeFromFile::parseDumpLine(char* readLine, int atomIndex){ | 
| 302 | 
  | 
 | 
| 303 | 
  | 
  char *foo; // the pointer to the current string token  | 
| 304 | 
  | 
   | 
| 314 | 
  | 
  int n_atoms; | 
| 315 | 
  | 
 | 
| 316 | 
  | 
#ifdef IS_MPI | 
| 317 | 
< | 
  n_atoms = entry_plug->mpiSim->getTotAtoms(); | 
| 317 | 
> | 
  n_atoms = mpiSim->getTotAtoms(); | 
| 318 | 
  | 
#else | 
| 319 | 
  | 
  n_atoms = entry_plug->n_atoms; | 
| 320 | 
< | 
#endi // is_mpi | 
| 320 | 
> | 
#endif // is_mpi | 
| 321 | 
  | 
 | 
| 322 | 
  | 
 | 
| 323 | 
  | 
  // set the string tokenizer |