| 158 |
|
|
| 159 |
|
#else // is_mpi |
| 160 |
|
|
| 161 |
< |
// first thing first, suspend fatalities. |
| 162 |
< |
painCave.isEventLoop = 1; |
| 161 |
> |
/* code to find maximum tag value */ |
| 162 |
> |
int *tagub, flag, MAXTAG; |
| 163 |
> |
MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, &tagub, &flag); |
| 164 |
> |
if (flag) { |
| 165 |
> |
MAXTAG = *tagub; |
| 166 |
> |
} else { |
| 167 |
> |
MAXTAG = 32767; |
| 168 |
> |
} |
| 169 |
|
|
| 164 |
– |
int myStatus; // 1 = wakeup & success; 0 = error; -1 = AllDone |
| 170 |
|
int haveError; |
| 171 |
|
|
| 172 |
|
MPI_Status istatus; |
| 193 |
|
outFile << entry_plug->the_integrator->getAdditionalParameters(); |
| 194 |
|
outFile << endl; |
| 195 |
|
outFile.flush(); |
| 196 |
+ |
|
| 197 |
+ |
tag = 0; |
| 198 |
+ |
|
| 199 |
|
for (i = 0 ; i < mpiSim->getTotAtoms(); i++ ) { |
| 192 |
– |
// Get the Node number which has this atom; |
| 200 |
|
|
| 201 |
+ |
if (tag + 2 >= MAXTAG) { |
| 202 |
+ |
// The tag was going to exceed the maximum value, so wrap around to 0: |
| 203 |
+ |
tag = 0; |
| 204 |
+ |
// Send the newly zeroed tag on to the other nodes: |
| 205 |
+ |
MPI_Bcast(&tag, 1, MPI_INT, 0, MPI_COMM_WORLD); |
| 206 |
+ |
} |
| 207 |
+ |
|
| 208 |
+ |
// Get the Node number which has this atom; |
| 209 |
+ |
|
| 210 |
|
which_node = AtomToProcMap[i]; |
| 211 |
< |
|
| 211 |
> |
|
| 212 |
|
if (which_node != 0) { |
| 213 |
|
|
| 198 |
– |
atomTypeTag = 4*i; |
| 199 |
– |
atomIsDirectionalTag = 4*i + 1; |
| 200 |
– |
atomTransDataTag = 4*i + 2; |
| 201 |
– |
atomOrientDataTag = 4*i + 3; |
| 202 |
– |
|
| 214 |
|
MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
| 215 |
|
atomTypeTag, MPI_COMM_WORLD, &istatus); |
| 216 |
|
|