ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/io/DumpReader.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/io/DumpReader.cpp (file contents):
Revision 1885 by tim, Tue Dec 14 21:57:47 2004 UTC vs.
Revision 1886 by tim, Wed Dec 15 16:13:35 2004 UTC

# Line 87 | Line 87 | int DumpReader::getNFrames(void) {
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) {
# Line 169 | Line 162 | 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) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines