#include <CFileWriter.hpp>
|
| unsigned long | DetermineFilesize (std::string filename) |
| | Determine the file size.
|
| |
| 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.
|
| |
| 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 collectively, although only one processor writes its data.
|
| |
| 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, although only one processor writes the string.
|
| |
| 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.
|
| |
| bool | WriteMPIStringAll (const std::string &str) |
| | Write a string of each rank to the file, one after the other in rank order.
|
| |
| bool | OpenMPIFile (string val_filename, bool append=false) |
| | Open a file to write using MPI I/O. Already existing file is deleted.
|
| |
| bool | CloseMPIFile () |
| | Close a file using MPI I/O.
|
| |
◆ CFileWriter() [1/2]
Construct a file writer using field names, the data sorter and the file extension.
- Parameters
-
| [in] | valDataSorter | - The parallel sorted data to write |
| [in] | valFileExt | - The file extension. |
◆ CFileWriter() [2/2]
| CFileWriter::CFileWriter |
( |
string |
valFileExt | ) |
|
Construct a file writer using field names, file extension.
- Parameters
-
| [in] | valFileExt | - The file extension to be attached to the filename |
◆ ~CFileWriter()
| CFileWriter::~CFileWriter |
( |
| ) |
|
|
virtualdefault |
◆ CloseMPIFile()
| bool CFileWriter::CloseMPIFile |
( |
| ) |
|
|
protected |
Close a file using MPI I/O.
- Returns
- Boolean indicating whether the closing was successful.
◆ DetermineFilesize()
| unsigned long CFileWriter::DetermineFilesize |
( |
std::string |
filename | ) |
|
|
inlineprotected |
Determine the file size.
- Parameters
-
| [in] | filename | - Name of the file. |
- Returns
◆ GetBandwidth()
| su2double CFileWriter::GetBandwidth |
( |
| ) |
const |
|
inline |
Get the bandwith used for the last writing.
◆ GetFilesize()
Get the filesize of the last written file.
◆ GetRankOffset()
| std::pair< unsigned long, unsigned long > CFileWriter::GetRankOffset |
( |
unsigned long |
localCount | ) |
const |
|
protected |
Get the position of the data of this rank in an array that holds the data of all ranks in rank order.
- Note
- Collective call, all ranks must call it.
- Parameters
-
| [in] | localCount | - The size of the data of this rank. |
- Returns
- The offset of this rank (the size of the data of the ranks before it) and the total size over all ranks.
◆ GetUsedTime()
Get the used time of the last file writing.
- Returns
- The time used to write to file.
◆ OpenMPIFile()
| bool CFileWriter::OpenMPIFile |
( |
string |
val_filename, |
|
|
bool |
append = false |
|
) |
| |
|
protected |
Open a file to write using MPI I/O. Already existing file is deleted.
- Parameters
-
| [in] | val_filename | - The name of the file |
- Returns
- Boolean indicating whether the opening was successful.
◆ WriteData()
| virtual void CFileWriter::WriteData |
( |
string |
val_filename | ) |
|
|
inlinevirtual |
Write sorted data to file.
- Parameters
-
| [in] | val_filename | - The name of the file |
Reimplemented in CSU2BinaryFileWriter, CCGNSFileWriter, CCSVFileWriter, CParaviewBinaryFileWriter, CParaviewFileWriter, CParaviewVTMFileWriter, CParaviewXMLFileWriter, CSTLFileWriter, CSU2FileWriter, CSU2MeshBinaryFileWriter, CSU2MeshFileWriter, CTecplotBinaryFileWriter, and CTecplotFileWriter.
◆ WriteMPIBinaryData()
| bool CFileWriter::WriteMPIBinaryData |
( |
const void * |
data, |
|
|
unsigned long |
sizeInBytes, |
|
|
unsigned short |
processor |
|
) |
| |
|
protected |
Write a binary data array to a currently opened file using MPI I/O. Note: routine must be called collectively, although only one processor writes its data.
- Parameters
-
| [in] | data | - Pointer to the beginning of the data. Can be NULL for all processors that do not write. |
| [in] | sizeInBytes | - The size of the data in bytes. |
| [in] | processor | - Rank of the processor that should write its data. |
- Returns
- Boolean indicating whether the writing was successful.
◆ WriteMPIBinaryDataAll()
| bool CFileWriter::WriteMPIBinaryDataAll |
( |
const void * |
data, |
|
|
unsigned long |
sizeInBytes, |
|
|
unsigned long |
totalSizeInBytes, |
|
|
unsigned long |
offset |
|
) |
| |
|
protected |
Collectively write a binary data array distributed over all processors to file using MPI I/O.
- Parameters
-
| [in] | data | - Pointer to the data to write. |
| sizeInBytes | - The size of the data in bytes on this processor. |
| totalSizeInBytes | - The total size of the array accumulated over all processors. |
| offset | - The offset in bytes of the chunk of data the current processor owns within the global array. |
- Returns
- Boolean indicating whether the writing was successful.
◆ WriteMPIString()
| bool CFileWriter::WriteMPIString |
( |
const std::string & |
str, |
|
|
unsigned short |
processor |
|
) |
| |
|
protected |
Write a string to a currently opened file using MPI I/O. Note: routine must be called collectively, although only one processor writes the string.
- Parameters
-
| [in] | str | - The string to write to file. |
| [in] | processor | - Rank of the processor that should the string. |
- Returns
◆ WriteMPIStringAll()
| bool CFileWriter::WriteMPIStringAll |
( |
const std::string & |
str | ) |
|
|
protected |
Write a string of each rank to the file, one after the other in rank order.
- Parameters
-
| [in] | str | - The string of this rank. |
- Returns
TRUE if the writing was successful.
◆ bandwidth
◆ dataSorter
The parallel data sorter.
◆ fhw
The file handle for writing.
◆ fileExt
| std::string CFileWriter::fileExt |
|
protected |
The file extension to be attached to the filename.
◆ fileSize
Size of the last written file
◆ rank
◆ size
The MPI size, aka the number of processors.
◆ startTime
Start time for time measurement
◆ stopTime
Stop time for time measurement
◆ usedTime
Used time for time measurement
The documentation for this class was generated from the following files: