Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::impl::BasicWriter Class Reference

Simple read/write. More...

#include <arcane/std/internal/BasicWriter.h>

Inheritance diagram for Arcane::impl::BasicWriter:
Collaboration diagram for Arcane::impl::BasicWriter:

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.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () 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< IDataCompressorm_data_compressor
Ref< IHashAlgorithmm_compare_hash_algorithm
Ref< IHashAlgorithmm_hash_algorithm
Ref< KeyValueTextWriterm_text_writer
ParallelDataWriterList m_parallel_data_writers
std::set< ItemGroupm_written_groups
ScopedPtrT< IGenericWriterm_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
IApplicationm_application = nullptr
IParallelMngm_parallel_mng = nullptr
eOpenMode m_open_mode = OpenModeRead
String m_path
Integer m_verbose_level = 0

Detailed Description

Simple read/write.

Definition at line 35 of file BasicWriter.h.

Constructor & Destructor Documentation

◆ BasicWriter()

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.

Member Function Documentation

◆ _checkNoInit()

void Arcane::impl::BasicWriter::_checkNoInit ( )
private

Definition at line 114 of file BasicWriter.cc.

◆ _computeCompareHash()

String Arcane::impl::BasicWriter::_computeCompareHash ( IVariable * var,
IData * write_data )
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.

Returns
the hash as a string if a hash algorithm is specified.

Definition at line 193 of file BasicWriter.cc.

References Arcane::IVariable::_internalApi(), and Arcane::IVariableInternal::computeComparisonHashCollective().

Here is the call graph for this function:

◆ _directWriteVal()

void Arcane::impl::BasicWriter::_directWriteVal ( IVariable * v,
IData * data )
private

Definition at line 133 of file BasicWriter.cc.

◆ _endWriteV3()

void Arcane::impl::BasicWriter::_endWriteV3 ( )
private

Definition at line 251 of file BasicWriter.cc.

◆ _getWriter()

Ref< ParallelDataWriter > Arcane::impl::BasicWriter::_getWriter ( IVariable * var)
private

Definition at line 124 of file BasicWriter.cc.

◆ beginWrite()

void Arcane::impl::BasicWriter::beginWrite ( const VariableCollection & vars)
overridevirtual

Implementation of IDataWriter.

Implements Arcane::IDataWriter.

Definition at line 240 of file BasicWriter.cc.

◆ endWrite()

void Arcane::impl::BasicWriter::endWrite ( )
overridevirtual

Implements Arcane::IDataWriter.

Definition at line 305 of file BasicWriter.cc.

◆ initialize()

void Arcane::impl::BasicWriter::initialize ( )

Definition at line 55 of file BasicWriter.cc.

◆ setCompareHashAlgorithm()

void Arcane::impl::BasicWriter::setCompareHashAlgorithm ( Ref< IHashAlgorithm > hash_algo)
inline

Sets the hash calculation service for comparison. Must be called before initialize()

Definition at line 63 of file BasicWriter.h.

◆ setDataCompressor()

void Arcane::impl::BasicWriter::setDataCompressor ( Ref< IDataCompressor > data_compressor)
inline

Sets the compression service. Must be called before initialize().

Definition at line 56 of file BasicWriter.h.

◆ setMetaData()

void Arcane::impl::BasicWriter::setMetaData ( const String & meta_data)
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().

Here is the call graph for this function:

◆ setSaveValues()

void Arcane::impl::BasicWriter::setSaveValues ( bool v)
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.

◆ write()

void Arcane::impl::BasicWriter::write ( IVariable * var,
IData * data )
overridevirtual

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().

Here is the call graph for this function:

Member Data Documentation

◆ m_compare_hash_algorithm

Ref<IHashAlgorithm> Arcane::impl::BasicWriter::m_compare_hash_algorithm
private

Definition at line 87 of file BasicWriter.h.

◆ m_data_compressor

Ref<IDataCompressor> Arcane::impl::BasicWriter::m_data_compressor
private

Definition at line 86 of file BasicWriter.h.

◆ m_global_writer

ScopedPtrT<IGenericWriter> Arcane::impl::BasicWriter::m_global_writer
private

Definition at line 94 of file BasicWriter.h.

◆ m_hash_algorithm

Ref<IHashAlgorithm> Arcane::impl::BasicWriter::m_hash_algorithm
private

Definition at line 88 of file BasicWriter.h.

◆ m_is_gather

bool Arcane::impl::BasicWriter::m_is_gather = false
private

Definition at line 80 of file BasicWriter.h.

◆ m_is_init

bool Arcane::impl::BasicWriter::m_is_init = false
private

Definition at line 81 of file BasicWriter.h.

◆ m_is_save_values

bool Arcane::impl::BasicWriter::m_is_save_values = true
private

Indicates whether to save the values.

Definition at line 83 of file BasicWriter.h.

Referenced by setSaveValues().

◆ m_parallel_data_writers

ParallelDataWriterList Arcane::impl::BasicWriter::m_parallel_data_writers
private

Definition at line 91 of file BasicWriter.h.

◆ m_text_writer

Ref<KeyValueTextWriter> Arcane::impl::BasicWriter::m_text_writer
private

Definition at line 89 of file BasicWriter.h.

◆ m_version

Int32 Arcane::impl::BasicWriter::m_version = -1
private

Definition at line 84 of file BasicWriter.h.

◆ m_want_parallel

bool Arcane::impl::BasicWriter::m_want_parallel = false
private

Definition at line 79 of file BasicWriter.h.

◆ m_written_groups

std::set<ItemGroup> Arcane::impl::BasicWriter::m_written_groups
private

Definition at line 92 of file BasicWriter.h.


The documentation for this class was generated from the following files: