Writer for restartable data, to be read by the RestartableDataReader. More...
#include <RestartableDataWriter.h>
Public Member Functions | |
RestartableDataWriter (MooseApp &app, RestartableDataMap &data) | |
RestartableDataWriter (MooseApp &app, std::vector< RestartableDataMap > &data) | |
void | write (std::ostream &header_stream, std::ostream &data_stream) |
Writes the restartable data to header stream header_stream and data stream data_stream . More... | |
std::vector< std::filesystem::path > | write (const std::filesystem::path &folder_base) |
Writes the restartable data to the folder with base folder_base . More... | |
PerfGraph & | perfGraph () |
Get the PerfGraph. More... | |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Static Public Member Functions | |
static const std::string & | getRestartableExt () |
static const std::string & | restartableDataFile () |
static std::filesystem::path | restartableDataFile (const std::filesystem::path &folder_base) |
static const std::string & | restartableHeaderFile () |
static std::filesystem::path | restartableHeaderFile (const std::filesystem::path &folder_base) |
static std::filesystem::path | restartableDataFolder (const std::filesystem::path &folder_base) |
static InputParameters | validParams () |
Protected Types | |
typedef int | COMPARE_HASH_CODE_TYPE |
The type to used for comparing hash codes (sanity checking) More... | |
Protected Member Functions | |
RestartableDataMap & | currentData (const THREAD_ID tid) |
std::size_t | dataSize () const |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level) const |
Call to register a named section for timing. More... | |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const |
Call to register a named section for timing. More... | |
std::string | timedSectionName (const std::string §ion_name) const |
Protected Attributes | |
const std::variant< RestartableDataMap *, std::vector< RestartableDataMap > * > | _data |
The data we wish to act on This is a variant so that we can act on threaded and non-threaded data. More... | |
MooseApp & | _pg_moose_app |
The MooseApp that owns the PerfGraph. More... | |
const std::string | _prefix |
A prefix to use for all sections. More... | |
const Parallel::Communicator & | _communicator |
Static Protected Attributes | |
static const unsigned int | CURRENT_BACKUP_FILE_VERSION = 4 |
The current version for the backup file. More... | |
Writer for restartable data, to be read by the RestartableDataReader.
Definition at line 17 of file RestartableDataWriter.h.
|
protectedinherited |
The type to used for comparing hash codes (sanity checking)
Definition at line 84 of file RestartableDataIO.h.
RestartableDataWriter::RestartableDataWriter | ( | MooseApp & | app, |
RestartableDataMap & | data | ||
) |
Definition at line 18 of file RestartableDataWriter.C.
RestartableDataWriter::RestartableDataWriter | ( | MooseApp & | app, |
std::vector< RestartableDataMap > & | data | ||
) |
Definition at line 23 of file RestartableDataWriter.C.
|
protectedinherited |
tid
This exists so that we can support threaded and non-threaded data in _data
Definition at line 33 of file RestartableDataIO.C.
Referenced by RestartableDataReader::restore(), RestartableDataReader::restoreData(), and write().
|
protectedinherited |
Definition at line 43 of file RestartableDataIO.C.
Referenced by RestartableDataIO::currentData(), RestartableDataReader::readHeader(), RestartableDataReader::restore(), and write().
|
staticinherited |
Definition at line 51 of file RestartableDataIO.C.
Referenced by RestartableDataIO::restartableDataFolder().
|
inherited |
Get the PerfGraph.
Definition at line 78 of file PerfGraphInterface.C.
Referenced by CommonOutputAction::act(), PerfGraphData::finalize(), and PerfGraphOutput::output().
|
protectedinherited |
Call to register a named section for timing.
section_name | The name of the code section to be timed |
level | The importance of the timer - lower is more important (0 will always come out) |
Definition at line 53 of file PerfGraphInterface.C.
|
protectedinherited |
Call to register a named section for timing.
section_name | The name of the code section to be timed |
level | The importance of the timer - lower is more important (0 will always come out) |
live_message | The message to be printed to the screen during execution |
print_dots | Whether or not progress dots should be printed for this section |
Definition at line 64 of file PerfGraphInterface.C.
|
staticinherited |
Definition at line 58 of file RestartableDataIO.C.
Referenced by RestartableDataReader::isAvailable(), RestartableDataIO::restartableDataFile(), RestartableDataReader::setInput(), and write().
|
staticinherited |
folder_base
Does not append .rd to the folder base
Definition at line 80 of file RestartableDataIO.C.
|
staticinherited |
folder_base
This just appends .rd
Definition at line 72 of file RestartableDataIO.C.
Referenced by MooseApp::metaDataFolderBase(), and MooseApp::restartFolderBase().
|
staticinherited |
Definition at line 65 of file RestartableDataIO.C.
Referenced by RestartableDataIO::restartableHeaderFile(), RestartableDataReader::setInput(), and write().
|
staticinherited |
folder_base
Does not append .rd to the folder base
Definition at line 86 of file RestartableDataIO.C.
|
protectedinherited |
section_name
.Optionally adds a prefix if one is defined.
Definition at line 47 of file PerfGraphInterface.C.
Referenced by PerfGraphInterface::registerTimedSection().
|
staticinherited |
Definition at line 16 of file PerfGraphInterface.C.
Referenced by Convergence::validParams().
void RestartableDataWriter::write | ( | std::ostream & | header_stream, |
std::ostream & | data_stream | ||
) |
Writes the restartable data to header stream header_stream
and data stream data_stream
.
Definition at line 29 of file RestartableDataWriter.C.
Referenced by MooseApp::backup(), write(), and MooseApp::writeRestartableMetaData().
std::vector< std::filesystem::path > RestartableDataWriter::write | ( | const std::filesystem::path & | folder_base | ) |
Writes the restartable data to the folder with base folder_base
.
Definition at line 87 of file RestartableDataWriter.C.
|
protectedinherited |
The data we wish to act on This is a variant so that we can act on threaded and non-threaded data.
Definition at line 79 of file RestartableDataIO.h.
Referenced by RestartableDataIO::currentData(), and RestartableDataIO::dataSize().
|
protectedinherited |
The MooseApp that owns the PerfGraph.
Definition at line 124 of file PerfGraphInterface.h.
Referenced by PerfGraphInterface::perfGraph().
|
protectedinherited |
A prefix to use for all sections.
Definition at line 127 of file PerfGraphInterface.h.
Referenced by PerfGraphInterface::timedSectionName().
|
staticprotectedinherited |
The current version for the backup file.
Definition at line 82 of file RestartableDataIO.h.
Referenced by RestartableDataReader::readHeader(), and write().