| 161 |
|
#else // is_mpi |
| 162 |
|
|
| 163 |
|
/* code to find maximum tag value */ |
| 164 |
+ |
|
| 165 |
|
int *tagub, flag, MAXTAG; |
| 166 |
|
MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, &tagub, &flag); |
| 167 |
|
if (flag) { |
| 228 |
|
MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
| 229 |
|
myPotato, MPI_COMM_WORLD, &istatus); |
| 230 |
|
|
| 231 |
< |
strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); |
| 231 |
> |
//strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); |
| 232 |
|
|
| 233 |
|
// Null terminate the atomTypeString just in case: |
| 234 |
|
|
| 235 |
< |
atomTypeString[strlen(atomTypeString) - 1] = '\0'; |
| 236 |
< |
|
| 235 |
> |
//atomTypeString[strlen(atomTypeString) - 1] = '\0'; |
| 236 |
> |
atomTypeString = MPIatomTypeString; |
| 237 |
> |
|
| 238 |
|
myPotato++; |
| 239 |
|
|
| 240 |
|
MPI_Recv(&isDirectional, 1, MPI_INT, which_node, |
| 359 |
|
sprintf( checkPointMsg, |
| 360 |
|
"Sucessfully took a dump.\n"); |
| 361 |
|
MPIcheckPoint(); |
| 362 |
< |
|
| 362 |
> |
delete[] potatoes; |
| 363 |
|
} else { |
| 364 |
|
|
| 365 |
|
// worldRank != 0, so I'm a remote node. |
| 383 |
|
MPI_Recv(&myPotato, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &istatus); |
| 384 |
|
|
| 385 |
|
} |
| 386 |
< |
|
| 387 |
< |
local_index=-1; |
| 386 |
> |
which_atom = i; |
| 387 |
> |
local_index=-1; |
| 388 |
|
for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
| 389 |
|
if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
| 390 |
|
} |
| 661 |
|
MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
| 662 |
|
myPotato, MPI_COMM_WORLD, &istatus); |
| 663 |
|
|
| 664 |
< |
strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); |
| 665 |
< |
|
| 664 |
< |
// Null terminate the atomTypeString just in case: |
| 665 |
< |
|
| 666 |
< |
atomTypeString[strlen(atomTypeString) - 1] = '\0'; |
| 667 |
< |
|
| 664 |
> |
atomTypeString = MPIatomTypeString; |
| 665 |
> |
|
| 666 |
|
myPotato++; |
| 667 |
|
|
| 668 |
|
MPI_Recv(&isDirectional, 1, MPI_INT, which_node, |
| 786 |
|
finalOut.flush(); |
| 787 |
|
sprintf( checkPointMsg, |
| 788 |
|
"Sucessfully took a dump.\n"); |
| 789 |
+ |
delete[] potatoes; |
| 790 |
+ |
|
| 791 |
|
MPIcheckPoint(); |
| 792 |
|
|
| 793 |
|
} else { |
| 813 |
|
MPI_Recv(&myPotato, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &istatus); |
| 814 |
|
|
| 815 |
|
} |
| 816 |
< |
|
| 816 |
> |
which_atom = i; |
| 817 |
|
local_index=-1; |
| 818 |
|
for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
| 819 |
|
if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |