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 1593 by gezelter, Fri Jul 15 21:35:14 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 711 | Line 708 | namespace OpenMD {
708      }
709      
710      //fill globalGroupMembership
711 <    std::vector<int> globalGroupMembership(info->getNGlobalAtoms(), 0);
711 >    std::vector<int> globalGroupMembership(info->getNGlobalAtoms(), -1);
712      for(mol = info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) {        
713        for (cg = mol->beginCutoffGroup(ci); cg != NULL; cg = mol->nextCutoffGroup(ci)) {
714          
# Line 721 | Line 718 | namespace OpenMD {
718          
719        }      
720      }
721 <    
721 >  
722   #ifdef IS_MPI    
723      // Since the globalGroupMembership has been zero filled and we've only
724      // poked values into the atoms we know, we can do an Allreduce
# Line 730 | Line 727 | namespace OpenMD {
727      // docs said we could.
728      std::vector<int> tmpGroupMembership(info->getNGlobalAtoms(), 0);
729      MPI_Allreduce(&globalGroupMembership[0], &tmpGroupMembership[0], nGlobalAtoms,
730 <                  MPI_INT, MPI_SUM, MPI_COMM_WORLD);
730 >                  MPI_INT, MPI_MAX, MPI_COMM_WORLD);
731      info->setGlobalGroupMembership(tmpGroupMembership);
732 +
733 +    cerr << "ggm:\n";
734 +    for (int i = 0; i < tmpGroupMembership.size(); i++)
735 +      cerr << "i = " << i << "\t ggm(i) = " << tmpGroupMembership[i] << "\n";
736 +
737   #else
738      info->setGlobalGroupMembership(globalGroupMembership);
739   #endif
# Line 798 | Line 800 | namespace OpenMD {
800    
801    void SimCreator::loadCoordinates(SimInfo* info, const std::string& mdFileName) {
802      Globals* simParams;
803 +
804      simParams = info->getSimParams();
805      
803    
806      DumpReader reader(info, mdFileName);
807      int nframes = reader.getNFrames();
808 <    
808 >
809      if (nframes > 0) {
810        reader.readFrame(nframes - 1);
811      } else {
# Line 814 | Line 816 | namespace OpenMD {
816        painCave.isFatal = 1;
817        simError();
818      }
817    
819      //copy the current snapshot to previous snapshot
820      info->getSnapshotManager()->advance();
821    }

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 1593 by gezelter, Fri Jul 15 21:35:14 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines