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

Comparing branches/development/src/brains/SimCreator.cpp (file contents):
Revision 1874 by gezelter, Wed May 15 15:09:35 2013 UTC vs.
Revision 1875 by gezelter, Fri May 17 14:41:42 2013 UTC

# Line 510 | Line 510 | namespace OpenMD {
510    
511   #ifdef IS_MPI
512    void SimCreator::divideMolecules(SimInfo *info) {
513    RealType numerator;
514    RealType denominator;
515    RealType precast;
516    RealType x;
517    RealType y;
513      RealType a;
514      int nProcessors;
515      std::vector<int> atomsPerProc;
# Line 556 | Line 551 | namespace OpenMD {
551      atomsPerProc.insert(atomsPerProc.end(), nProcessors, 0);
552      
553      if (worldRank == 0) {
554 <      numerator = info->getNGlobalAtoms();
555 <      denominator = nProcessors;
556 <      precast = numerator / denominator;
554 >      RealType numerator = info->getNGlobalAtoms();
555 >      RealType denominator = nProcessors;
556 >      RealType precast = numerator / denominator;
557        int nTarget = (int)(precast + 0.5);
558        
559        for(int i = 0; i < nGlobalMols; i++) {
# Line 624 | Line 619 | namespace OpenMD {
619            //           Pacc(x) = exp(- a * x)
620            // where a = penalty / (average atoms per molecule)
621            
622 <          x = (RealType)(new_atoms - nTarget);
623 <          y = myRandom->rand();
622 >          RealType x = (RealType)(new_atoms - nTarget);
623 >          RealType y = myRandom->rand();
624            
625            if (y < exp(- a * x)) {
626              molToProcMap[i] = which_proc;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines