87 |
|
} |
88 |
|
|
89 |
|
int DumpReader::getNFrames(void) { |
90 |
– |
#ifdef IS_MPI |
90 |
|
|
91 |
< |
if (worldRank == 0) { |
92 |
< |
#endif |
91 |
> |
if (!isScanned_) |
92 |
> |
scanFile(); |
93 |
|
|
94 |
< |
if (!isScanned_) |
96 |
< |
scanFile(); |
97 |
< |
|
98 |
< |
return nframes_; |
99 |
< |
#ifdef IS_MPI |
100 |
< |
} |
101 |
< |
#endif |
94 |
> |
return nframes_; |
95 |
|
} |
96 |
|
|
97 |
|
void DumpReader::scanFile(void) { |
162 |
|
|
163 |
|
delete currPos; |
164 |
|
rewind(inFile_); |
165 |
< |
|
173 |
< |
isScanned_ = true; |
174 |
< |
|
165 |
> |
|
166 |
|
nframes_ = framePos_.size(); |
167 |
|
#ifdef IS_MPI |
177 |
– |
MPI_Bcast(&nframes_, 1, MPI_INT, 0, MPI_COMM_WORLD); |
178 |
– |
|
168 |
|
} |
169 |
+ |
|
170 |
+ |
MPI_Bcast(&nframes_, 1, MPI_INT, 0, MPI_COMM_WORLD); |
171 |
|
|
172 |
|
strcpy(checkPointMsg, "Successfully scanned DumpFile\n"); |
173 |
|
MPIcheckPoint(); |
174 |
|
|
175 |
|
#endif // is_mpi |
176 |
|
|
177 |
+ |
isScanned_ = true; |
178 |
|
} |
179 |
|
|
180 |
|
void DumpReader::readFrame(int whichFrame) { |