| 9 |
|
|
| 10 |
|
#ifdef IS_MPI |
| 11 |
|
#include <mpi.h> |
| 12 |
< |
#include "mpiSimulation.hpp" |
| 12 |
> |
#include "brains/mpiSimulation.hpp" |
| 13 |
|
|
| 14 |
|
namespace dWrite{ |
| 15 |
|
void DieDieDie( void ); |
| 18 |
|
using namespace dWrite; |
| 19 |
|
#endif //is_mpi |
| 20 |
|
|
| 21 |
< |
#include "ReadWrite.hpp" |
| 22 |
< |
#include "simError.h" |
| 21 |
> |
#include "io/ReadWrite.hpp" |
| 22 |
> |
#include "utils/simError.h" |
| 23 |
|
|
| 24 |
|
DumpWriter::DumpWriter( SimInfo* the_entry_plug ){ |
| 25 |
|
|
| 299 |
|
for(k = 0; k < outFile.size(); k++) |
| 300 |
|
*outFile[k] << writeLine; |
| 301 |
|
} |
| 302 |
< |
|
| 303 |
< |
} |
| 302 |
> |
|
| 303 |
> |
} |
| 304 |
|
|
| 305 |
|
#else // is_mpi |
| 306 |
|
|
| 333 |
|
for (i = 0; i < nProc; i++) |
| 334 |
|
potatoes[i] = 0; |
| 335 |
|
|
| 336 |
< |
for(k = 0; k < outFile.size(); k++){ |
| 337 |
< |
*outFile[k] << nTotObjects << "\n"; |
| 338 |
< |
|
| 339 |
< |
*outFile[k] << currentTime << ";\t" |
| 340 |
< |
<< entry_plug->Hmat[0][0] << "\t" |
| 341 |
< |
<< entry_plug->Hmat[1][0] << "\t" |
| 342 |
< |
<< entry_plug->Hmat[2][0] << ";\t" |
| 343 |
< |
|
| 344 |
< |
<< entry_plug->Hmat[0][1] << "\t" |
| 345 |
< |
<< entry_plug->Hmat[1][1] << "\t" |
| 346 |
< |
<< entry_plug->Hmat[2][1] << ";\t" |
| 347 |
< |
|
| 348 |
< |
<< entry_plug->Hmat[0][2] << "\t" |
| 349 |
< |
<< entry_plug->Hmat[1][2] << "\t" |
| 350 |
< |
<< entry_plug->Hmat[2][2] << ";"; |
| 351 |
< |
|
| 352 |
< |
*outFile[k] << entry_plug->the_integrator->getAdditionalParameters() << endl; |
| 353 |
< |
} |
| 354 |
< |
|
| 336 |
> |
for(k = 0; k < outFile.size(); k++){ |
| 337 |
> |
*outFile[k] << nTotObjects << "\n"; |
| 338 |
> |
|
| 339 |
> |
*outFile[k] << currentTime << ";\t" |
| 340 |
> |
<< entry_plug->Hmat[0][0] << "\t" |
| 341 |
> |
<< entry_plug->Hmat[1][0] << "\t" |
| 342 |
> |
<< entry_plug->Hmat[2][0] << ";\t" |
| 343 |
> |
|
| 344 |
> |
<< entry_plug->Hmat[0][1] << "\t" |
| 345 |
> |
<< entry_plug->Hmat[1][1] << "\t" |
| 346 |
> |
<< entry_plug->Hmat[2][1] << ";\t" |
| 347 |
> |
|
| 348 |
> |
<< entry_plug->Hmat[0][2] << "\t" |
| 349 |
> |
<< entry_plug->Hmat[1][2] << "\t" |
| 350 |
> |
<< entry_plug->Hmat[2][2] << ";"; |
| 351 |
> |
|
| 352 |
> |
*outFile[k] << entry_plug->the_integrator->getAdditionalParameters() |
| 353 |
> |
<< endl; |
| 354 |
> |
} |
| 355 |
> |
|
| 356 |
|
currentIndex = 0; |
| 357 |
< |
|
| 357 |
> |
|
| 358 |
|
for (i = 0 ; i < mpiSim->getNMolGlobal(); i++ ) { |
| 359 |
|
|
| 360 |
|
// Get the Node number which has this atom; |
| 368 |
|
// so wrap this processor potato back to 0: |
| 369 |
|
|
| 370 |
|
potatoes[which_node] = 0; |
| 371 |
< |
MPI_Send(&potatoes[which_node], 1, MPI_INT, which_node, 0, MPI_COMM_WORLD); |
| 371 |
> |
MPI_Send(&potatoes[which_node], 1, MPI_INT, which_node, 0, |
| 372 |
> |
MPI_COMM_WORLD); |
| 373 |
|
|
| 374 |
|
} |
| 375 |
|
|
| 451 |
|
|
| 452 |
|
}// end for(int l =0) |
| 453 |
|
potatoes[which_node] = myPotato; |
| 454 |
< |
|
| 454 |
> |
|
| 455 |
|
} |
| 456 |
|
else { |
| 457 |
< |
|
| 457 |
> |
|
| 458 |
|
haveError = 0; |
| 459 |
|
|
| 460 |
|
local_index = indexArray[currentIndex].first; |
| 461 |
< |
|
| 462 |
< |
integrableObjects = (entry_plug->molecules[local_index]).getIntegrableObjects(); |
| 461 |
> |
|
| 462 |
> |
integrableObjects = (entry_plug->molecules[local_index]).getIntegrableObjects(); |
| 463 |
|
|
| 464 |
|
for(iter= integrableObjects.begin(); iter != integrableObjects.end(); ++iter){ |
| 465 |
|
sd = *iter; |
| 589 |
|
nCurObj = integrableObjects.size(); |
| 590 |
|
|
| 591 |
|
MPI_Send(&nCurObj, 1, MPI_INT, 0, |
| 592 |
< |
myPotato, MPI_COMM_WORLD); |
| 592 |
> |
myPotato, MPI_COMM_WORLD); |
| 593 |
|
myPotato++; |
| 594 |
|
|
| 595 |
|
for( iter = integrableObjects.begin(); iter != integrableObjects.end(); iter++){ |
| 672 |
|
} |
| 673 |
|
|
| 674 |
|
sprintf( checkPointMsg, |
| 675 |
< |
"Sucessfully took a dump.\n"); |
| 675 |
> |
"Successfully took a dump.\n"); |
| 676 |
|
MPIcheckPoint(); |
| 677 |
|
|
| 678 |
< |
} |
| 677 |
< |
|
| 678 |
< |
|
| 678 |
> |
} |
| 679 |
|
|
| 680 |
|
#endif // is_mpi |
| 681 |
|
} |