| 68 | |
| 69 | |
| 70 | void NFilesIter::SetDynamic(int deciderproc) |
| 71 | { |
| 72 | deciderProc = deciderproc; |
| 73 | // ---- we have to check currentDeciderIndex here also in case of |
| 74 | // ---- different nfiles for plots and checkpoints |
| 75 | if(currentDeciderIndex >= availableDeciders.size() || currentDeciderIndex < 0) { |
| 76 | currentDeciderIndex = 0; |
| 77 | } |
| 78 | if( ! availableDeciders.empty()) { |
| 79 | if(deciderProc < 0 || deciderProc >= nProcs) { |
| 80 | deciderProc = availableDeciders[currentDeciderIndex]; |
| 81 | } |
| 82 | if(NFilesIter::WhichSetPosition(deciderProc, nProcs, nOutFiles, groupSets) == 0) { |
| 83 | // ---- the decider cannot have set position zero |
| 84 | deciderProc = availableDeciders[currentDeciderIndex]; |
| 85 | } |
| 86 | } |
| 87 | currentDeciderIndex += nSets - 1; |
| 88 | if(currentDeciderIndex >= availableDeciders.size() || currentDeciderIndex < 0) { |
| 89 | currentDeciderIndex = 0; |
| 90 | } |
| 91 | #if 0 |
| 92 | // The following has no effect because WhichSetPostion is a pure function and |
| 93 | // its return type is not used. So not sure why this is here in the first place. |
| 94 | if(myProc == deciderProc) { |
| 95 | NFilesIter::WhichSetPosition(myProc, nProcs, nOutFiles, groupSets); |
| 96 | } |
| 97 | #endif |
| 98 | |
| 99 | deciderTag = ParallelDescriptor::SeqNum(); |
| 100 | coordinatorTag = ParallelDescriptor::SeqNum(); |
| 101 | doneTag = ParallelDescriptor::SeqNum(); |
| 102 | writeTag = ParallelDescriptor::SeqNum(); |
| 103 | remainingWriters = nProcs; |
| 104 | useStaticSetSelection = false; |
| 105 | if(nOutFiles == nProcs) { |
| 106 | useStaticSetSelection = true; |
| 107 | coordinatorProc = ParallelDescriptor::IOProcessorNumber(); |
| 108 | } else { |
| 109 | fileNumbersWriteOrder.clear(); |
| 110 | fileNumbersWriteOrder.resize(nOutFiles); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | |
| 115 | void NFilesIter::SetSparseFPP(const Vector<int> &ranksToWrite) |
no test coverage detected