Simple read/write. More...
#include <arcane/std/internal/BasicWriter.h>
Public Member Functions | |
| BasicWriter (IApplication *app, IParallelMng *pm, const String &path, eOpenMode open_mode, Integer version, bool want_parallel) | |
| Public Member Functions inherited from Arcane::impl::BasicReaderWriterCommon | |
| BasicReaderWriterCommon (IApplication *app, IParallelMng *pm, const String &path, eOpenMode open_mode) | |
| Public Member Functions inherited from Arcane::TraceAccessor | |
| TraceAccessor (ITraceMng *m) | |
| Constructs an accessor via the trace manager m. | |
| TraceAccessor (const TraceAccessor &rhs) | |
| Copy constructor. | |
| TraceAccessor & | operator= (const TraceAccessor &rhs) |
| Copy assignment operator. | |
| virtual | ~TraceAccessor () |
| Frees resources. | |
| ITraceMng * | traceMng () const |
| Trace manager. | |
| TraceMessage | info () const |
| Flow for an information message. | |
| TraceMessage | pinfo () const |
| Flow for a parallel information message. | |
| TraceMessage | info (char category) const |
| Flow for an information message of a given category. | |
| TraceMessage | pinfo (char category) const |
| Flow for a parallel information message of a given category. | |
| TraceMessage | info (bool v) const |
| Flow for an information message. | |
| TraceMessage | warning () const |
| Flow for a warning message. | |
| TraceMessage | pwarning () const |
| TraceMessage | error () const |
| Flow for an error message. | |
| TraceMessage | perror () const |
| TraceMessage | log () const |
| Flow for a log message. | |
| TraceMessage | plog () const |
| Flow for a log message. | |
| TraceMessage | logdate () const |
| Flow for a log message preceded by the date. | |
| TraceMessage | fatal () const |
| Flow for a fatal error message. | |
| TraceMessage | pfatal () const |
| Flow for a parallel fatal error message. | |
| TraceMessageDbg | debug (Trace::eDebugLevel=Trace::Medium) const |
| Flow for a debug message. | |
| Trace::eDebugLevel | configDbgLevel () const |
| Debug level of the configuration file. | |
| TraceMessage | info (Int32 verbose_level) const |
| Flow for an information message of a given level. | |
| TraceMessage | linfo () const |
| Flow for an information message with the local information level of this instance. | |
| TraceMessage | linfo (Int32 relative_level) const |
| Flow for an information message with the local information level of this instance. | |
| void | fatalMessage (const StandaloneTraceMessage &o) const |
| Public Member Functions inherited from Arcane::IDataWriter | |
| virtual | ~IDataWriter ()=default |
| Frees resources. | |
| bool | m_want_parallel = false |
| bool | m_is_gather = false |
| bool | m_is_init = false |
| bool | m_is_save_values = true |
| Indicates whether to save the values. | |
| Int32 | m_version = -1 |
| Ref< IDataCompressor > | m_data_compressor |
| Ref< IHashAlgorithm > | m_compare_hash_algorithm |
| Ref< IHashAlgorithm > | m_hash_algorithm |
| Ref< KeyValueTextWriter > | m_text_writer |
| ParallelDataWriterList | m_parallel_data_writers |
| std::set< ItemGroup > | m_written_groups |
| ScopedPtrT< IGenericWriter > | m_global_writer |
| void | beginWrite (const VariableCollection &vars) override |
| Implementation of IDataWriter. | |
| void | endWrite () override |
| void | setMetaData (const String &meta_data) override |
| Sets the metadata information. | |
| void | write (IVariable *v, IData *data) override |
| Writes the data data of the variable var. | |
| void | setDataCompressor (Ref< IDataCompressor > data_compressor) |
| Sets the compression service. Must be called before initialize(). | |
| void | setCompareHashAlgorithm (Ref< IHashAlgorithm > hash_algo) |
| void | setSaveValues (bool v) |
| void | initialize () |
| void | _directWriteVal (IVariable *v, IData *data) |
| String | _computeCompareHash (IVariable *var, IData *write_data) |
| Calculates a comparison hash for the variable. | |
| Ref< ParallelDataWriter > | _getWriter (IVariable *var) |
| void | _endWriteV3 () |
| void | _checkNoInit () |
Additional Inherited Members | |
| Public Types inherited from Arcane::impl::BasicReaderWriterCommon | |
| enum | eOpenMode { OpenModeRead , OpenModeTruncate , OpenModeAppend } |
| Protected Member Functions inherited from Arcane::impl::BasicReaderWriterCommon | |
| String | _getMetaDataFileName (Int32 rank) const |
| Protected Member Functions inherited from Arcane::TraceAccessor | |
| void | _setLocalVerboseLevel (Int32 v) |
| Int32 | _localVerboseLevel () const |
| Static Protected Member Functions inherited from Arcane::impl::BasicReaderWriterCommon | |
| static String | _getArcaneDBTag () |
| static String | _getOwnMetatadaFile (const String &path, Int32 rank) |
| static String | _getArcaneDBFile (const String &path, Int32 rank) |
| static String | _getBasicVariableFile (Int32 version, const String &path, Int32 rank) |
| static String | _getBasicGroupFile (const String &path, const String &name, Int32 rank) |
| static Ref< IDataCompressor > | _createDeflater (IApplication *app, const String &name) |
| static Ref< IHashAlgorithm > | _createHashAlgorithm (IApplication *app, const String &name) |
| static void | _fillUniqueIds (const ItemGroup &group, Array< Int64 > &uids) |
| Protected Attributes inherited from Arcane::impl::BasicReaderWriterCommon | |
| IApplication * | m_application = nullptr |
| IParallelMng * | m_parallel_mng = nullptr |
| eOpenMode | m_open_mode = OpenModeRead |
| String | m_path |
| Integer | m_verbose_level = 0 |
Simple read/write.
Definition at line 35 of file BasicWriter.h.
| Arcane::impl::BasicWriter::BasicWriter | ( | IApplication * | app, |
| IParallelMng * | pm, | ||
| const String & | path, | ||
| eOpenMode | open_mode, | ||
| Integer | version, | ||
| bool | want_parallel ) |
Definition at line 43 of file BasicWriter.cc.
|
private |
Definition at line 114 of file BasicWriter.cc.
|
private |
Calculates a comparison hash for the variable.
The master rank retrieves an array containing the concatenation of the variable's values for all ranks and calculates a hash on this array.
Since this array is sorted according to the uniqueId(), it can be used to directly compare the variable's value.
Definition at line 193 of file BasicWriter.cc.
References Arcane::IVariable::_internalApi(), and Arcane::IVariableInternal::computeComparisonHashCollective().
Definition at line 133 of file BasicWriter.cc.
|
private |
Definition at line 251 of file BasicWriter.cc.
|
private |
Definition at line 124 of file BasicWriter.cc.
|
overridevirtual |
Implementation of IDataWriter.
Implements Arcane::IDataWriter.
Definition at line 240 of file BasicWriter.cc.
|
overridevirtual |
Implements Arcane::IDataWriter.
Definition at line 305 of file BasicWriter.cc.
| void Arcane::impl::BasicWriter::initialize | ( | ) |
Definition at line 55 of file BasicWriter.cc.
|
inline |
Sets the hash calculation service for comparison. Must be called before initialize()
Definition at line 63 of file BasicWriter.h.
|
inline |
Sets the compression service. Must be called before initialize().
Definition at line 56 of file BasicWriter.h.
|
overridevirtual |
Sets the metadata information.
Implements Arcane::IDataWriter.
Definition at line 218 of file BasicWriter.cc.
References Arcane::asBytes(), Arcane::String::localstr(), Arcane::String::utf8(), and Arcane::String::writeBytes().
|
inline |
Indicates whether to save the values of variables and groups. If false, only saves the hashes
Definition at line 70 of file BasicWriter.h.
References m_is_save_values.
Writes the data data of the variable var.
Implements Arcane::IDataWriter.
Definition at line 205 of file BasicWriter.cc.
References Arcane::TraceAccessor::info(), and Arcane::IVariable::isPartial().
|
private |
Definition at line 87 of file BasicWriter.h.
|
private |
Definition at line 86 of file BasicWriter.h.
|
private |
Definition at line 94 of file BasicWriter.h.
|
private |
Definition at line 88 of file BasicWriter.h.
|
private |
Definition at line 80 of file BasicWriter.h.
|
private |
Definition at line 81 of file BasicWriter.h.
|
private |
Indicates whether to save the values.
Definition at line 83 of file BasicWriter.h.
Referenced by setSaveValues().
|
private |
Definition at line 91 of file BasicWriter.h.
|
private |
Definition at line 89 of file BasicWriter.h.
|
private |
Definition at line 84 of file BasicWriter.h.
|
private |
Definition at line 79 of file BasicWriter.h.
|
private |
Definition at line 92 of file BasicWriter.h.