| 1 |
+ |
#define _LARGEFILE_SOURCE64 |
| 2 |
|
#define _FILE_OFFSET_BITS 64 |
| 3 |
|
|
| 4 |
|
#include <string.h> |
| 96 |
|
indexArray.push_back(make_pair(i, atoms[i]->getGlobalIndex())); |
| 97 |
|
|
| 98 |
|
sort(indexArray.begin(), indexArray.end(), indexSortingCriterion); |
| 98 |
– |
|
| 99 |
– |
//for (int i = 0; i < mpiSim->getMyNlocal(); i++) { |
| 100 |
– |
// printf("node %d has global %d at local %d\n", worldRank, indexArray[i].second, indexArray[i].first); |
| 101 |
– |
//} |
| 102 |
– |
|
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
#endif |
| 106 |
|
vector<ofstream*> fileStreams; |
| 107 |
|
|
| 108 |
|
#ifdef IS_MPI |
| 109 |
< |
printf("Hello from node %d\n", worldRank); |
| 110 |
< |
sortByGlobalIndex(); |
| 115 |
< |
if(worldRank == 0 ){ |
| 116 |
< |
|
| 109 |
> |
if(worldRank == 0 ){ |
| 110 |
> |
#endif |
| 111 |
|
finalOut.open( entry_plug->finalName, ios::out | ios::trunc ); |
| 112 |
|
if( !finalOut ){ |
| 113 |
|
sprintf( painCave.errMsg, |
| 116 |
|
painCave.isFatal = 1; |
| 117 |
|
simError(); |
| 118 |
|
} |
| 119 |
+ |
#ifdef IS_MPI |
| 120 |
|
} |
| 121 |
|
#endif // is_mpi |
| 122 |
|
|
| 138 |
|
|
| 139 |
|
#ifdef IS_MPI |
| 140 |
|
if(worldRank == 0 ){ |
| 141 |
+ |
#endif // is_mpi |
| 142 |
|
|
| 143 |
|
finalOut.open( entry_plug->finalName, ios::out | ios::trunc ); |
| 144 |
|
|
| 150 |
|
simError(); |
| 151 |
|
} |
| 152 |
|
|
| 153 |
+ |
#ifdef IS_MPI |
| 154 |
|
} |
| 155 |
|
#endif // is_mpi |
| 156 |
|
|
| 391 |
|
haveError = 0; |
| 392 |
|
which_atom = i; |
| 393 |
|
|
| 397 |
– |
//local_index = -1; |
| 398 |
– |
|
| 399 |
– |
//for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
| 400 |
– |
// if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
| 401 |
– |
//} |
| 402 |
– |
|
| 403 |
– |
//if (local_index != -1) { |
| 404 |
– |
|
| 394 |
|
local_index = indexArray[currentIndex].first; |
| 395 |
|
|
| 396 |
|
if (which_atom == indexArray[currentIndex].second) { |
| 519 |
|
} |
| 520 |
|
which_atom = i; |
| 521 |
|
|
| 533 |
– |
//local_index = -1; |
| 534 |
– |
|
| 535 |
– |
//for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
| 536 |
– |
// if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
| 537 |
– |
//} |
| 538 |
– |
|
| 539 |
– |
//if (local_index != -1) { |
| 540 |
– |
|
| 522 |
|
local_index = indexArray[currentIndex].first; |
| 523 |
|
|
| 524 |
|
if (which_atom == indexArray[currentIndex].second) { |