ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/io/basic_ifstrstream.hpp
(Generate patch)

Comparing trunk/OOPSE-4/src/io/basic_ifstrstream.hpp (file contents):
Revision 1582 by tim, Fri Oct 15 20:42:25 2004 UTC vs.
Revision 1583 by tim, Fri Oct 15 21:10:50 2004 UTC

# Line 33 | Line 33
33   #ifndef IO_IFSTRSTREAM_HPP
34   #define IO_IFSTRSTREAM_HPP
35  
36 + #include <cassert>
37   #include <cstring>
38   #include <fstream>
39   #include <sstream>
# Line 209 | Line 210 | class basic_ifstrstream : public basic_istream<_CharT,
210  
211                      //check the filename is the same
212                      filenameLen = strlen(filename);
213 <                    commStatus = MPI_Bcast(filenameLen, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
214 <                    commStatus = MPI_Bcast(filename, filenameLen, MPI_CHAR, masterNode, MPI_COMM_WORLD);    
213 >                    commStatus = MPI_Bcast(&filenameLen, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
214 >                    commStatus = MPI_Bcast((void*)filename, filenameLen, MPI_CHAR, masterNode, MPI_COMM_WORLD);    
215  
216                      diffFilename = 0;
217 <                    commStatus = MPI_Allreduce(diffFilename, error, 1,  MPI_INT,  MPI_COMM_WORLD);            
217 >                    commStatus = MPI_Allreduce(&diffFilename, &error, 1,  MPI_INT, MPI_SUM,  MPI_COMM_WORLD);            
218  
219                      //if file names are different just return false
220                      if (error > 0)
# Line 225 | Line 226 | class basic_ifstrstream : public basic_istream<_CharT,
226  
227                  if (fin.is_open()) {
228                      
229 <                    fin.in.seekg(0, ios::end);
229 >                    fin.seekg(0, ios::end);
230                      fileSize = fin.tellg();
231 <
231 >                    fin.seekg(0, ios::beg);
232 >                    
233                      // '\0' need one more char
234                      fbuf = new char[fileSize+1];
235                      
# Line 272 | Line 274 | class basic_ifstrstream : public basic_istream<_CharT,
274               } else{
275                      //check file name
276                      if (checkFilename) {
277 <                        commStatus = MPI_Bcast(filenameLen, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
277 >                        commStatus = MPI_Bcast(&filenameLen, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
278  
279                          char * masterFilename = new char[filenameLen];
280                          commStatus = MPI_Bcast(masterFilename, filenameLen, MPI_CHAR, masterNode, MPI_COMM_WORLD);    
# Line 284 | Line 286 | class basic_ifstrstream : public basic_istream<_CharT,
286  
287                          delete masterFilename;
288                          
289 <                        commStatus = MPI_Allreduce(diffFilename, error, 1,  MPI_INT,  MPI_COMM_WORLD);    
289 >                        commStatus = MPI_Allreduce(&diffFilename, &error, 1,  MPI_INT,  MPI_SUM, MPI_COMM_WORLD);    
290  
291                          if (error > 0)
292                              return false;                        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines