ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimCreator.cpp
(Generate patch)

Comparing:
trunk/src/brains/SimCreator.cpp (file contents), Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
branches/development/src/brains/SimCreator.cpp (file contents), Revision 1597 by gezelter, Tue Jul 26 15:49:24 2011 UTC

# Line 234 | Line 234 | namespace OpenMD {
234    
235    SimInfo*  SimCreator::createSim(const std::string & mdFileName,
236                                    bool loadInitCoords) {
237 <
237 >    
238      const int bufferSize = 65535;
239      char buffer[bufferSize];
240      int lineNo = 0;
# Line 369 | Line 369 | namespace OpenMD {
369      }
370      
371      ff->parse(forcefieldFileName);
372    ff->setFortranForceOptions();
372      //create SimInfo
373      SimInfo * info = new SimInfo(ff, simParams);
374  
# Line 387 | Line 386 | namespace OpenMD {
386      //create the molecules
387      createMolecules(info);
388      
390    
389      //allocate memory for DataStorage(circular reference, need to
390      //break it)
391      info->setSnapshotManager(new SimSnapshotManager(info));
# Line 413 | Line 411 | namespace OpenMD {
411      
412      if (loadInitCoords)
413        loadCoordinates(info, mdFileName);    
416    
414      return info;
415    }
416    
# Line 592 | Line 589 | namespace OpenMD {
589        MPI_Bcast(&molToProcMap[0], nGlobalMols, MPI_INT, 0, MPI_COMM_WORLD);
590      }
591      
592 +    cerr << "molToProcMap:\n";
593 +    for (int i = 0; i < molToProcMap.size(); i++) {
594 +      cerr << "m = " << i << " mtpr[m] = " << molToProcMap[i] <<"\n";
595 +    }
596 +
597      info->setMolToProcMap(molToProcMap);
598      sprintf(checkPointMsg,
599              "Successfully divided the molecules among the processors.\n");
# Line 711 | Line 713 | namespace OpenMD {
713      }
714      
715      //fill globalGroupMembership
716 <    std::vector<int> globalGroupMembership(info->getNGlobalAtoms(), 0);
716 >    std::vector<int> globalGroupMembership(info->getNGlobalAtoms(), -1);
717      for(mol = info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) {        
718        for (cg = mol->beginCutoffGroup(ci); cg != NULL; cg = mol->nextCutoffGroup(ci)) {
719          
# Line 721 | Line 723 | namespace OpenMD {
723          
724        }      
725      }
726 <    
726 >  
727   #ifdef IS_MPI    
728      // Since the globalGroupMembership has been zero filled and we've only
729      // poked values into the atoms we know, we can do an Allreduce
# Line 730 | Line 732 | namespace OpenMD {
732      // docs said we could.
733      std::vector<int> tmpGroupMembership(info->getNGlobalAtoms(), 0);
734      MPI_Allreduce(&globalGroupMembership[0], &tmpGroupMembership[0], nGlobalAtoms,
735 <                  MPI_INT, MPI_SUM, MPI_COMM_WORLD);
735 >                  MPI_INT, MPI_MAX, MPI_COMM_WORLD);
736      info->setGlobalGroupMembership(tmpGroupMembership);
737 +
738 +    cerr << "ggm:\n";
739 +    for (int i = 0; i < tmpGroupMembership.size(); i++)
740 +      cerr << "i = " << i << "\t ggm(i) = " << tmpGroupMembership[i] << "\n";
741 +
742   #else
743      info->setGlobalGroupMembership(globalGroupMembership);
744   #endif
# Line 791 | Line 798 | namespace OpenMD {
798          globalIO++;
799        }
800      }
801 <    
801 >    cerr << "ioi2io:\n";
802 >    for (int i = 0; i < IOIndexToIntegrableObject.size(); i++) {
803 >      if (IOIndexToIntegrableObject[i] != NULL) {
804 >        cerr << "i = " << i << "globalIOindex = " << IOIndexToIntegrableObject[i]->getGlobalIntegrableObjectIndex() << "\n";
805 >      }
806 >    }
807 >      
808      info->setIOIndexToIntegrableObject(IOIndexToIntegrableObject);
809      
810    }
811    
812    void SimCreator::loadCoordinates(SimInfo* info, const std::string& mdFileName) {
813      Globals* simParams;
814 +
815      simParams = info->getSimParams();
816      
803    
817      DumpReader reader(info, mdFileName);
818      int nframes = reader.getNFrames();
819 <    
819 >
820      if (nframes > 0) {
821        reader.readFrame(nframes - 1);
822      } else {
# Line 814 | Line 827 | namespace OpenMD {
827        painCave.isFatal = 1;
828        simError();
829      }
817    
830      //copy the current snapshot to previous snapshot
831      info->getSnapshotManager()->advance();
832    }

Comparing:
trunk/src/brains/SimCreator.cpp (property svn:keywords), Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
branches/development/src/brains/SimCreator.cpp (property svn:keywords), Revision 1597 by gezelter, Tue Jul 26 15:49:24 2011 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines