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 |
|
|
54 |
|
|
55 |
|
done = 0; |
56 |
|
nLocal = 0; |
57 |
+ |
molLocal = 0; |
58 |
|
|
59 |
|
if( i == myNode ){ |
60 |
|
myMolStart = molIndex; |
72 |
|
nLocal += compStamps[compIndex]->getNAtoms(); |
73 |
|
atomIndex += compStamps[compIndex]->getNAtoms(); |
74 |
|
molIndex++; |
75 |
+ |
molLocal++; |
76 |
|
|
77 |
|
if ( nLocal == nTarget ) done = 1; |
78 |
|
|
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; |
97 |
|
myMolEnd = (molIndex - 1); |
98 |
|
myAtomEnd = (atomIndex - 1); |
99 |
|
myNlocal = nLocal; |
100 |
+ |
myMol = molLocal; |
101 |
|
} |
102 |
|
|
103 |
|
numerator = (double)( entryPlug->n_atoms - atomIndex ); |
111 |
|
myAtomStart = atomIndex; |
112 |
|
|
113 |
|
nLocal = 0; |
114 |
+ |
molLocal = 0; |
115 |
|
while( compIndex < nComponents ){ |
116 |
|
|
117 |
|
if( (molIndex-compStart) >= componentsNmol[compIndex] ){ |
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 |
|
|
148 |
|
sprintf( checkPointMsg, |
149 |
|
"Successfully divided the molecules among the processors.\n" ); |
150 |
|
MPIcheckPoint(); |
151 |
+ |
|
152 |
+ |
// lets create the identity array |
153 |
|
} |