130 |
|
// write out header and node 0's coordinates |
131 |
|
|
132 |
|
if( worldRank == 0 ){ |
133 |
< |
outFile << entry_plug->mpiSim->getTotAtoms() << "\n"; |
133 |
> |
outFile << mpiSim->getTotAtoms() << "\n"; |
134 |
|
|
135 |
|
outFile << currentTime << "\t" |
136 |
|
<< entry_plug->box_x << "\t" |
170 |
|
else |
171 |
|
strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); |
172 |
|
|
173 |
< |
outfile << writeLine; |
173 |
> |
outFile << writeLine; |
174 |
|
masterIndex++; |
175 |
|
} |
176 |
|
outFile.flush(); |
177 |
|
} |
178 |
|
|
179 |
< |
for (procIndex = 1; procIndex < entry_plug->mpiSim->getNumberProcessors(); |
179 |
> |
for (procIndex = 1; procIndex < mpiSim->getNumberProcessors(); |
180 |
|
procIndex++){ |
181 |
|
|
182 |
|
if( worldRank == 0 ){ |
208 |
|
|
209 |
|
// recieve the nodes writeLines |
210 |
|
|
211 |
< |
for ( i = nodeAtomStart; i <= nodeAtomEnd, i++){ |
211 |
> |
for ( i = nodeAtomsStart; i <= nodeAtomsEnd; i++){ |
212 |
|
|
213 |
< |
mpiErr = MPI_Recv(&read_buffer,BUFFERSIZE,MPI_CHAR,procIndex, |
213 |
> |
mpiErr = MPI_Recv(writeLine,BUFFERSIZE,MPI_CHAR,procIndex, |
214 |
|
MPI_ANY_TAG,MPI_COMM_WORLD,istatus ); |
215 |
|
|
216 |
|
outFile << writeLine; |
220 |
|
|
221 |
|
else if( worldRank == procIndex ){ |
222 |
|
|
223 |
< |
nodeAtomStart = entry_plug->mpiSim->getMyAtomStart(); |
224 |
< |
nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd(); |
223 |
> |
nodeAtomsStart = mpiSim->getMyAtomStart(); |
224 |
> |
nodeAtomsEnd = mpiSim->getMyAtomEnd(); |
225 |
|
|
226 |
|
mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG, |
227 |
|
MPI_COMM_WORLD); |
230 |
|
|
231 |
|
mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,MPI_ANY_TAG, |
232 |
|
MPI_COMM_WORLD, istatus); |
233 |
< |
if (sendError) mpiCheckpoint(); |
233 |
> |
if (sendError) MPIcheckPoint(); |
234 |
|
|
235 |
|
// send current node's configuration line by line. |
236 |
|
|
273 |
|
|
274 |
|
sprintf(checkPointMsg,"Node %d sent dump configuration.", |
275 |
|
procIndex); |
276 |
< |
mpiCheckPoint(); |
276 |
> |
MPIcheckPoint(); |
277 |
|
} |
278 |
|
|
279 |
|
#endif // is_mpi |
318 |
|
#ifdef IS_MPI |
319 |
|
} |
320 |
|
|
321 |
< |
sprintf(checkPointMsg,"Opened file for final configuration\n",procIndex); |
322 |
< |
mpiCheckPoint(); |
321 |
> |
sprintf(checkPointMsg,"Opened file for final configuration\n"); |
322 |
> |
MPIcheckPoint(); |
323 |
|
|
324 |
|
#endif //is_mpi |
325 |
|
|
329 |
|
|
330 |
|
finalOut << nAtoms << "\n"; |
331 |
|
|
332 |
< |
finalOut << currentTime << "\t" |
333 |
< |
<< entry_plug->box_x << "\t" |
334 |
< |
<< entry_plug->box_y << "\t" |
335 |
< |
<< entry_plug->box_z << "\n"; |
332 |
> |
finalOut << entry_plug->box_x << "\t" |
333 |
> |
<< entry_plug->box_y << "\t" |
334 |
> |
<< entry_plug->box_z << "\n"; |
335 |
|
|
336 |
|
for( i=0; i<nAtoms; i++ ){ |
337 |
|
|
384 |
|
// write out header and node 0's coordinates |
385 |
|
|
386 |
|
if( worldRank == 0 ){ |
387 |
< |
finalOut << entry_plug->mpiSim->getTotAtoms() << "\n"; |
387 |
> |
finalOut << mpiSim->getTotAtoms() << "\n"; |
388 |
|
|
389 |
< |
finalOut << currentTime << "\t" |
390 |
< |
<< entry_plug->box_x << "\t" |
391 |
< |
<< entry_plug->box_y << "\t" |
392 |
< |
<< entry_plug->box_z << "\n"; |
394 |
< |
|
389 |
> |
finalOut << entry_plug->box_x << "\t" |
390 |
> |
<< entry_plug->box_y << "\t" |
391 |
> |
<< entry_plug->box_z << "\n"; |
392 |
> |
|
393 |
|
masterIndex = 0; |
394 |
|
for( i=0; i<nAtoms; i++ ){ |
395 |
|
|
423 |
|
else |
424 |
|
strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); |
425 |
|
|
426 |
< |
outfile << writeLine; |
426 |
> |
outFile << writeLine; |
427 |
|
masterIndex++; |
428 |
|
} |
429 |
|
finalOut.flush(); |
430 |
|
} |
431 |
|
|
432 |
< |
for (procIndex = 1; procIndex < entry_plug->mpiSim->getNumberProcessors(); |
432 |
> |
for (procIndex = 1; procIndex < mpiSim->getNumberProcessors(); |
433 |
|
procIndex++){ |
434 |
|
|
435 |
|
if( worldRank == 0 ){ |
461 |
|
|
462 |
|
// recieve the nodes writeLines |
463 |
|
|
464 |
< |
for ( i = nodeAtomStart; i <= nodeAtomEnd, i++){ |
464 |
> |
for ( i = nodeAtomsStart; i <= nodeAtomsEnd; i++){ |
465 |
|
|
466 |
< |
mpiErr = MPI_Recv(&read_buffer,BUFFERSIZE,MPI_CHAR,procIndex, |
466 |
> |
mpiErr = MPI_Recv(writeLine,BUFFERSIZE,MPI_CHAR,procIndex, |
467 |
|
MPI_ANY_TAG,MPI_COMM_WORLD,istatus ); |
468 |
|
|
469 |
|
finalOut << writeLine; |
475 |
|
|
476 |
|
else if( worldRank == procIndex ){ |
477 |
|
|
478 |
< |
nodeAtomStart = entry_plug->mpiSim->getMyAtomStart(); |
479 |
< |
nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd(); |
478 |
> |
nodeAtomsStart = mpiSim->getMyAtomStart(); |
479 |
> |
nodeAtomsEnd = mpiSim->getMyAtomEnd(); |
480 |
|
|
481 |
|
mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG, |
482 |
|
MPI_COMM_WORLD); |
485 |
|
|
486 |
|
mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,MPI_ANY_TAG, |
487 |
|
MPI_COMM_WORLD, istatus); |
488 |
< |
if (sendError) mpiCheckpoint(); |
488 |
> |
if (sendError) MPIcheckPoint(); |
489 |
|
|
490 |
|
// send current node's configuration line by line. |
491 |
|
|
528 |
|
|
529 |
|
sprintf(checkPointMsg,"Node %d sent dump configuration.", |
530 |
|
procIndex); |
531 |
< |
mpiCheckPoint(); |
531 |
> |
MPIcheckPoint(); |
532 |
|
} |
533 |
|
|
534 |
|
if( worldRank == 0 ) finalOut.close(); |