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

Simple reader. More...

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

Inheritance diagram for Arcane::impl::BasicReader:
Collaboration diagram for Arcane::impl::BasicReader:

Classes

class  IItemGroupFinder
 Interface to find the group associated with a variable based on this metadata. More...

Public Member Functions

 BasicReader (IApplication *app, IParallelMng *pm, Int32 forced_rank_to_read, const String &path, bool want_parallel)
void beginRead (const VariableCollection &vars) override
void endRead () override
String metaData () override
 Metadata.
void read (IVariable *v, IData *data) override
 Reads the data data of the variable var.
void fillMetaData (ByteArray &bytes) override
 Fills bytes with the metadata content.
void beginRead (const DataReaderInfo &infos) override
 Notifies the start of data reading.
void read (const VariableDataReadInfo &infos) override
 Reads the data specified by infos.
void initialize ()
void setItemGroupFinder (IItemGroupFinder *group_finder)
void fillComparisonHash (std::map< String, String > &comparison_hash_map)
 Fills the argument with pairs (variable_name, hash_value).
IHashAlgorithmcomparisonHashAlgorithm () const
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::IDataReader
virtual ~IDataReader ()=default
 Frees resources.
Public Member Functions inherited from Arcane::IDataReader2
virtual ~IDataReader2 ()
 Releases resources.

Private Member Functions

void _directReadVal (VariableMetaData *varmd, IData *data)
Ref< ParallelDataReader_getReader (VariableMetaData *varmd)
void _setRanksToRead ()
Ref< IGenericReader_readOwnMetaDataAndCreateReader (Int32 rank)

Private Attributes

bool m_want_parallel = false
Integer m_nb_written_part = 0
Int32 m_version = -1
Int32 m_first_rank_to_read = -1
Int32 m_nb_rank_to_read = -1
Int32 m_forced_rank_to_read = -1
std::map< String, Ref< ParallelDataReader > > m_parallel_data_readers
UniqueArray< Ref< IGenericReader > > m_global_readers
IItemGroupFinderm_item_group_finder
Ref< KeyValueTextReaderm_forced_rank_to_read_text_reader
 Reader for the first rank to read.
Ref< IDataCompressorm_data_compressor
Ref< IHashAlgorithmm_comparison_hash_algorithm

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 reader.

Definition at line 33 of file BasicReader.h.

Constructor & Destructor Documentation

◆ BasicReader()

Arcane::impl::BasicReader::BasicReader ( IApplication * app,
IParallelMng * pm,
Int32 forced_rank_to_read,
const String & path,
bool want_parallel )

Definition at line 38 of file BasicReader.cc.

Member Function Documentation

◆ _directReadVal()

void Arcane::impl::BasicReader::_directReadVal ( VariableMetaData * varmd,
IData * data )
private

Definition at line 136 of file BasicReader.cc.

◆ _getReader()

Ref< ParallelDataReader > Arcane::impl::BasicReader::_getReader ( VariableMetaData * varmd)
private

Definition at line 211 of file BasicReader.cc.

◆ _readOwnMetaDataAndCreateReader()

Ref< IGenericReader > Arcane::impl::BasicReader::_readOwnMetaDataAndCreateReader ( Int32 rank)
private

Definition at line 402 of file BasicReader.cc.

◆ _setRanksToRead()

void Arcane::impl::BasicReader::_setRanksToRead ( )
private

Definition at line 352 of file BasicReader.cc.

◆ beginRead() [1/2]

void Arcane::impl::BasicReader::beginRead ( const DataReaderInfo & infos)
overridevirtual

Notifies the start of data reading.

Implements Arcane::IDataReader2.

Definition at line 439 of file BasicReader.cc.

References Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ beginRead() [2/2]

void Arcane::impl::BasicReader::beginRead ( const VariableCollection & vars)
overridevirtual

Implements Arcane::IDataReader.

Definition at line 429 of file BasicReader.cc.

◆ comparisonHashAlgorithm()

IHashAlgorithm * Arcane::impl::BasicReader::comparisonHashAlgorithm ( ) const
inline

Definition at line 76 of file BasicReader.h.

◆ endRead()

void Arcane::impl::BasicReader::endRead ( )
inlineoverridevirtual

Implements Arcane::IDataReader.

Definition at line 60 of file BasicReader.h.

◆ fillComparisonHash()

void Arcane::impl::BasicReader::fillComparisonHash ( std::map< String, String > & comparison_hash_map)

Fills the argument with pairs (variable_name, hash_value).

This is only valid for rank 0

Definition at line 266 of file BasicReader.cc.

◆ fillMetaData()

void Arcane::impl::BasicReader::fillMetaData ( ByteArray & bytes)
overridevirtual

Fills bytes with the metadata content.

Implements Arcane::IDataReader2.

Definition at line 328 of file BasicReader.cc.

References Arcane::asWritableBytes(), Arcane::TraceAccessor::info(), m_forced_rank_to_read_text_reader, and Arcane::platform::readAllFile().

Referenced by metaData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void Arcane::impl::BasicReader::initialize ( )

Definition at line 55 of file BasicReader.cc.

◆ metaData()

String Arcane::impl::BasicReader::metaData ( )
overridevirtual

Metadata.

Implements Arcane::IDataReader.

Definition at line 315 of file BasicReader.cc.

References fillMetaData(), and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ read() [1/2]

void Arcane::impl::BasicReader::read ( const VariableDataReadInfo & infos)
overridevirtual

Reads the data specified by infos.

Implements Arcane::IDataReader2.

Definition at line 299 of file BasicReader.cc.

References Arcane::VariableMetaData::fullName(), and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ read() [2/2]

void Arcane::impl::BasicReader::read ( IVariable * var,
IData * data )
overridevirtual

Reads the data data of the variable var.

Implements Arcane::IDataReader.

Definition at line 284 of file BasicReader.cc.

References Arcane::IVariable::createMetaDataRef(), Arcane::IVariable::fullName(), Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::get(), Arcane::TraceAccessor::info(), and Arcane::IVariable::isPartial().

Here is the call graph for this function:

◆ setItemGroupFinder()

void Arcane::impl::BasicReader::setItemGroupFinder ( IItemGroupFinder * group_finder)
inline

Definition at line 71 of file BasicReader.h.

Member Data Documentation

◆ m_comparison_hash_algorithm

Ref<IHashAlgorithm> Arcane::impl::BasicReader::m_comparison_hash_algorithm
private

Definition at line 93 of file BasicReader.h.

◆ m_data_compressor

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

Definition at line 92 of file BasicReader.h.

◆ m_first_rank_to_read

Int32 Arcane::impl::BasicReader::m_first_rank_to_read = -1
private

Definition at line 84 of file BasicReader.h.

◆ m_forced_rank_to_read

Int32 Arcane::impl::BasicReader::m_forced_rank_to_read = -1
private

Definition at line 86 of file BasicReader.h.

◆ m_forced_rank_to_read_text_reader

Ref<KeyValueTextReader> Arcane::impl::BasicReader::m_forced_rank_to_read_text_reader
private

Reader for the first rank to read.

Definition at line 91 of file BasicReader.h.

Referenced by fillMetaData().

◆ m_global_readers

UniqueArray<Ref<IGenericReader> > Arcane::impl::BasicReader::m_global_readers
private

Definition at line 89 of file BasicReader.h.

◆ m_item_group_finder

IItemGroupFinder* Arcane::impl::BasicReader::m_item_group_finder
private

Definition at line 90 of file BasicReader.h.

◆ m_nb_rank_to_read

Int32 Arcane::impl::BasicReader::m_nb_rank_to_read = -1
private

Definition at line 85 of file BasicReader.h.

◆ m_nb_written_part

Integer Arcane::impl::BasicReader::m_nb_written_part = 0
private

Definition at line 81 of file BasicReader.h.

◆ m_parallel_data_readers

std::map<String, Ref<ParallelDataReader> > Arcane::impl::BasicReader::m_parallel_data_readers
private

Definition at line 88 of file BasicReader.h.

◆ m_version

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

Definition at line 82 of file BasicReader.h.

◆ m_want_parallel

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

Definition at line 80 of file BasicReader.h.


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