ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/mpi_implementation/mpiSimulation.cpp
(Generate patch)

Comparing trunk/mdtools/mpi_implementation/mpiSimulation.cpp (file contents):
Revision 195 by chuckv, Thu Dec 5 18:53:40 2002 UTC vs.
Revision 196 by chuckv, Thu Dec 5 21:37:51 2002 UTC

# Line 35 | Line 35 | void mpiSimulation::divideLabor(int nComponents, Molec
35    int nTarget;
36    int molIndex, atomIndex, compIndex, compStart;
37    int done;
38 <  int nLocal;
38 >  int nLocal, molLocal;
39    int i;
40    int smallDiff, bigDiff;
41  
# Line 54 | Line 54 | void mpiSimulation::divideLabor(int nComponents, Molec
54      
55      done = 0;
56      nLocal = 0;
57 +    molLocal = 0;
58  
59      if( i == myNode ){
60        myMolStart = molIndex;
# Line 71 | Line 72 | void mpiSimulation::divideLabor(int nComponents, Molec
72        nLocal += compStamps[compIndex]->getNAtoms();
73        atomIndex += compStamps[compIndex]->getNAtoms();
74        molIndex++;
75 +      molLocal++;
76        
77        if ( nLocal == nTarget ) done = 1;
78        
# Line 83 | Line 85 | void mpiSimulation::divideLabor(int nComponents, Molec
85          if( bigDiff < smallDiff ) done = 1;
86          else{
87            molIndex--;
88 +          molLocal--;
89            atomIndex -= compStamps[compIndex]->getNAtoms();
90            nLocal -= compStamps[compIndex]->getNAtoms();
91            done = 1;
# Line 94 | Line 97 | void mpiSimulation::divideLabor(int nComponents, Molec
97        myMolEnd = (molIndex - 1);
98        myAtomEnd = (atomIndex - 1);
99        myNlocal = nLocal;
100 +      myMol = molLocal;
101      }
102      
103      numerator = (double)( entryPlug->n_atoms - atomIndex );
# Line 107 | Line 111 | void mpiSimulation::divideLabor(int nComponents, Molec
111        myAtomStart = atomIndex;
112  
113        nLocal = 0;
114 +      molLocal = 0;
115        while( compIndex < nComponents ){
116          
117          if( (molIndex-compStart) >= componentsNmol[compIndex] ){
# Line 118 | Line 123 | void mpiSimulation::divideLabor(int nComponents, Molec
123          nLocal += compStamps[compIndex]->getNAtoms();
124          atomIndex += compStamps[compIndex]->getNAtoms();
125          molIndex++;
126 +        molLocal++;
127        }
128        
129        myMolEnd = (molIndex - 1);
130        myAtomEnd = (atomIndex - 1);
131 <      myNlocal = nLocal;  
131 >      myNlocal = nLocal;  
132 >      myMol = molLocal;
133    }
134  
135  
# Line 141 | Line 148 | void mpiSimulation::divideLabor(int nComponents, Molec
148    sprintf( checkPointMsg,
149             "Successfully divided the molecules among the processors.\n" );
150    MPIcheckPoint();
151 +
152 +  // lets create the identity array
153   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines