Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __WEIPA_FILEWRITER_H__
00015 #define __WEIPA_FILEWRITER_H__
00016
00017 #include <weipa/weipa.h>
00018
00019 #include <fstream>
00020
00021 namespace weipa {
00022
00023 class FileWriter
00024 {
00025 public:
00026 FileWriter();
00027
00028 #if HAVE_MPI
00029 FileWriter(MPI_Comm comm);
00030 #endif
00031
00032 bool openFile(std::string filename);
00033 bool writeOrdered(std::ostringstream& oss);
00034 bool writeShared(std::ostringstream& oss);
00035 void close();
00036
00037 private:
00038 int mpiRank, mpiSize;
00039 #if HAVE_MPI
00040 MPI_Comm mpiComm;
00041 MPI_File fileHandle;
00042 #else
00043 void* mpiComm;
00044 #endif
00045 std::ofstream ofs;
00046 };
00047
00048 }
00049
00050 #endif // __WEIPA_FILEWRITER_H__
00051