# | Line 95 | Line 95 | void DumpWriter::sortByGlobalIndex(){ | |
---|---|---|
95 | indexArray.push_back(make_pair(i, atoms[i]->getGlobalIndex())); | |
96 | ||
97 | 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 | – | |
98 | } | |
99 | ||
100 | #endif | |
# | Line 110 | Line 105 | void DumpWriter::writeDump(double currentTime){ | |
105 | vector<ofstream*> fileStreams; | |
106 | ||
107 | #ifdef IS_MPI | |
113 | – | printf("Hello from node %d\n", worldRank); |
114 | – | sortByGlobalIndex(); |
108 | if(worldRank == 0 ){ | |
109 | < | |
109 | > | #endif |
110 | finalOut.open( entry_plug->finalName, ios::out | ios::trunc ); | |
111 | if( !finalOut ){ | |
112 | sprintf( painCave.errMsg, | |
# | Line 122 | Line 115 | void DumpWriter::writeDump(double currentTime){ | |
115 | painCave.isFatal = 1; | |
116 | simError(); | |
117 | } | |
118 | + | #ifdef IS_MPI |
119 | } | |
120 | #endif // is_mpi | |
121 | ||
# | Line 395 | Line 389 | void DumpWriter::writeFrame( vector<ofstream*>& outFil | |
389 | ||
390 | haveError = 0; | |
391 | which_atom = i; | |
398 | – | |
399 | – | //local_index = -1; |
400 | – | |
401 | – | //for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
402 | – | // if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
403 | – | //} |
392 | ||
405 | – | //if (local_index != -1) { |
406 | – | |
393 | local_index = indexArray[currentIndex].first; | |
394 | ||
395 | if (which_atom == indexArray[currentIndex].second) { | |
# | Line 532 | Line 518 | void DumpWriter::writeFrame( vector<ofstream*>& outFil | |
518 | } | |
519 | which_atom = i; | |
520 | ||
535 | – | //local_index = -1; |
536 | – | |
537 | – | //for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) { |
538 | – | // if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; |
539 | – | //} |
540 | – | |
541 | – | //if (local_index != -1) { |
542 | – | |
521 | local_index = indexArray[currentIndex].first; | |
522 | ||
523 | if (which_atom == indexArray[currentIndex].second) { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |