29#include "../../../../Common/include/parallelization/mpi_structure.hpp"
30#include "../../../../Common/include/option_structure.hpp"
38#include "../../output/filewriter/CParallelDataSorter.hpp"
73 int rc = stat(filename.c_str(), &stat_buf);
74 return rc == 0 ? stat_buf.st_size : -1;
151 bool WriteMPIBinaryDataAll(
const void *data,
unsigned long sizeInBytes,
unsigned long totalSizeInBytes,
unsigned long offset);
161 bool WriteMPIBinaryData(
const void *data,
unsigned long sizeInBytes,
unsigned short processor);
170 bool WriteMPIString(
const std::string& str,
unsigned short processor);
178 std::pair<unsigned long, unsigned long>
GetRankOffset(
unsigned long localCount)
const;
192 bool OpenMPIFile(
string val_filename,
bool append =
false);
Definition CFileWriter.hpp:42
unsigned long DetermineFilesize(std::string filename)
Determine the file size.
Definition CFileWriter.hpp:71
virtual void WriteData(string val_filename)
Write sorted data to file.
Definition CFileWriter.hpp:123
std::pair< unsigned long, unsigned long > GetRankOffset(unsigned long localCount) const
Get the position of the data of this rank in an array that holds the data of all ranks in rank order.
Definition CParallelFileWriter.cpp:279
bool CloseMPIFile()
Close a file using MPI I/O.
Definition CParallelFileWriter.cpp:298
su2double fileSize
Size of the last written file
Definition CFileWriter.hpp:64
su2double startTime
Start time for time measurement
Definition CFileWriter.hpp:60
su2double GetBandwidth() const
Get the bandwith used for the last writing.
Definition CFileWriter.hpp:128
FILE * fhw
The file handle for writing.
Definition CFileWriter.hpp:97
CParallelDataSorter * dataSorter
The parallel data sorter.
Definition CFileWriter.hpp:80
int rank
The MPI rank.
Definition CFileWriter.hpp:48
bool WriteMPIBinaryDataAll(const void *data, unsigned long sizeInBytes, unsigned long totalSizeInBytes, unsigned long offset)
Collectively write a binary data array distributed over all processors to file using MPI I/O.
Definition CParallelFileWriter.cpp:59
su2double usedTime
Used time for time measurement
Definition CFileWriter.hpp:62
int size
The MPI size, aka the number of processors.
Definition CFileWriter.hpp:53
su2double GetFilesize() const
Get the filesize of the last written file.
Definition CFileWriter.hpp:133
su2double stopTime
Stop time for time measurement
Definition CFileWriter.hpp:61
bool WriteMPIStringAll(const std::string &str)
Write a string of each rank to the file, one after the other in rank order.
Definition CParallelFileWriter.cpp:288
su2double GetUsedTime() const
Get the used time of the last file writing.
Definition CFileWriter.hpp:139
bool WriteMPIBinaryData(const void *data, unsigned long sizeInBytes, unsigned short processor)
Write a binary data array to a currently opened file using MPI I/O. Note: routine must be called coll...
Definition CParallelFileWriter.cpp:122
std::string fileExt
The file extension to be attached to the filename.
Definition CFileWriter.hpp:58
bool WriteMPIString(const std::string &str, unsigned short processor)
Write a string to a currently opened file using MPI I/O. Note: routine must be called collectively,...
Definition CParallelFileWriter.cpp:166
bool OpenMPIFile(string val_filename, bool append=false)
Open a file to write using MPI I/O. Already existing file is deleted.
Definition CParallelFileWriter.cpp:211
su2double bandwidth
Used bandwidth
Definition CFileWriter.hpp:63
virtual ~CFileWriter()
Destructor.
Definition CParallelDataSorter.hpp:39
passivedouble su2double
Definition code_config.hpp:181