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

Protection Manager. More...

Inheritance diagram for Arcane::CheckpointMng:
Collaboration diagram for Arcane::CheckpointMng:

Public Member Functions

 CheckpointMng (ISubDomain *)
void readCheckpoint () override
 Reads a checkpoint.
void readDefaultCheckpoint () override
 Reads a default checkpoint.
CheckpointInfo readDefaultCheckpointInfo () override
 Reads default checkpoint information.
void readCheckpoint (ICheckpointReader *reader) override
 Reads a checkpoint.
void readCheckpoint (ByteConstArrayView infos) override
 Reads a checkpoint.
void readCheckpoint (const CheckpointInfo &checkpoint_infos) override
 Reads a checkpoint.
CheckpointInfo readCheckpointInfo (Span< const Byte > infos, const String &buf_name) override
 Reads checkpoint information.
void writeCheckpoint (ICheckpointWriter *writer) override
 Writes a default checkpoint using the writer.
void writeCheckpoint (ICheckpointWriter *writer, ByteArray &infos) override
 Writes a checkpoint using the writer.
void writeDefaultCheckpoint (ICheckpointWriter *writer) override
 Writes a checkpoint using the writer.
IObservablewriteObservable () override
 Write observable.
IObservablereadObservable () override
 Read observable.
void build ()
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::ICheckpointMng
virtual ~ICheckpointMng ()=default
 Frees resources.

Private Member Functions

void _writeCheckpointInfoFile (ICheckpointWriter *checkpoint_writer, ByteArray &infos)
CheckpointInfo _readCheckpointInfo (Span< const Byte > infos, const String &info_file_name)
void _readCheckpoint (const CheckpointInfo &checkpoint_info)
void _readCheckpoint (const CheckpointReadInfo &infos)
bool _checkChangingNbSubDomain (const CheckpointInfo &ci)
 Checks if the number of sub-domains has changed between the checkpoint and the current allocation.
void _applyNbSubDomainChange (const CheckpointInfo &ci, ICheckpointReader2 *reader)
void _changeItemsOwner (IMesh *mesh, Int32ConstArrayView old_ranks_to_new_ranks)

Private Attributes

ISubDomainm_sub_domain
IObservablem_write_observable
 Observable for writing.
IObservablem_read_observable
 Observable for reading.

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Protection Manager.

Definition at line 68 of file CheckpointMng.cc.

Constructor & Destructor Documentation

◆ CheckpointMng()

Arcane::CheckpointMng::CheckpointMng ( ISubDomain * sd)

Definition at line 129 of file CheckpointMng.cc.

◆ ~CheckpointMng()

Arcane::CheckpointMng::~CheckpointMng ( )
override

Definition at line 141 of file CheckpointMng.cc.

Member Function Documentation

◆ _applyNbSubDomainChange()

void Arcane::CheckpointMng::_applyNbSubDomainChange ( const CheckpointInfo & ci,
ICheckpointReader2 * reader )
private

Definition at line 545 of file CheckpointMng.cc.

◆ _changeItemsOwner()

void Arcane::CheckpointMng::_changeItemsOwner ( IMesh * mesh,
Int32ConstArrayView old_ranks_to_new_ranks )
private

Definition at line 525 of file CheckpointMng.cc.

◆ _checkChangingNbSubDomain()

bool Arcane::CheckpointMng::_checkChangingNbSubDomain ( const CheckpointInfo & ci)
private

Checks if the number of sub-domains has changed between the checkpoint and the current allocation.

Definition at line 488 of file CheckpointMng.cc.

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

Here is the call graph for this function:

◆ _readCheckpoint() [1/2]

void Arcane::CheckpointMng::_readCheckpoint ( const CheckpointInfo & checkpoint_info)
private

Definition at line 320 of file CheckpointMng.cc.

◆ _readCheckpoint() [2/2]

void Arcane::CheckpointMng::_readCheckpoint ( const CheckpointReadInfo & infos)
private

Definition at line 184 of file CheckpointMng.cc.

◆ _readCheckpointInfo()

CheckpointInfo Arcane::CheckpointMng::_readCheckpointInfo ( Span< const Byte > infos,
const String & info_file_name )
private

Definition at line 243 of file CheckpointMng.cc.

◆ _writeCheckpointInfoFile()

void Arcane::CheckpointMng::_writeCheckpointInfoFile ( ICheckpointWriter * checkpoint_writer,
ByteArray & infos )
private

< Info about protections

Definition at line 428 of file CheckpointMng.cc.

References Arcane::ICheckpointWriter::baseDirectoryName(), Arcane::ICheckpointWriter::checkpointTimes(), Arcane::XmlNode::clear(), Arcane::IParallelMng::commSize(), Arcane::IRessourceMng::createXmlDocument(), Arcane::IParallelReplication::nbReplication(), Arcane::ISubDomain::parallelMng(), Arcane::ICheckpointWriter::readerMetaData(), Arcane::ICheckpointWriter::readerServiceName(), Arcane::IParallelMng::replication(), Arcane::IBase::ressourceMng(), Arcane::XmlNode::setAttrValue(), and Arcane::ConstArrayView< T >::size().

Referenced by writeCheckpoint().

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

◆ build()

void Arcane::CheckpointMng::build ( )

Definition at line 157 of file CheckpointMng.cc.

◆ readCheckpoint() [1/4]

void Arcane::CheckpointMng::readCheckpoint ( )
overridevirtual

Reads a checkpoint.

This operation is collective.

Deprecated
Use readDefaultCheckpoint() instead

Implements Arcane::ICheckpointMng.

Definition at line 165 of file CheckpointMng.cc.

References readDefaultCheckpoint().

Here is the call graph for this function:

◆ readCheckpoint() [2/4]

void Arcane::CheckpointMng::readCheckpoint ( ByteConstArrayView infos)
overridevirtual

Reads a checkpoint.

Reads a checkpoint whose reading information is in infos.

Deprecated
Instead, use the following code:
ICheckpointMng* cm = ...;
CheckpointInfo checkpoint_info = cm->readChekpointInfo(buffer);
cm->readChekpoint(checkpoint_info);
Information about a checkpoint.
Interface of the checkpoint information manager.
View of an array of elements of type T.
Definition Span.h:635

Implements Arcane::ICheckpointMng.

Definition at line 220 of file CheckpointMng.cc.

◆ readCheckpoint() [3/4]

void Arcane::CheckpointMng::readCheckpoint ( const CheckpointInfo & checkpoint_info)
overridevirtual

Reads a checkpoint.

Reads a checkpoint whose information is in checkpoint_infos.

Implements Arcane::ICheckpointMng.

Definition at line 311 of file CheckpointMng.cc.

◆ readCheckpoint() [4/4]

void Arcane::CheckpointMng::readCheckpoint ( ICheckpointReader * reader)
overridevirtual

Reads a checkpoint.

Reads a checkpoint from the reader.

Implements Arcane::ICheckpointMng.

Definition at line 174 of file CheckpointMng.cc.

References m_read_observable.

◆ readCheckpointInfo()

CheckpointInfo Arcane::CheckpointMng::readCheckpointInfo ( Span< const Byte > infos,
const String & buf_name )
overridevirtual

Reads checkpoint information.

Reads the information of a checkpoint contained in the infos buffer. buf_name contains the name of the buffer used in displays in case of an error.

Implements Arcane::ICheckpointMng.

Definition at line 230 of file CheckpointMng.cc.

References Arcane::String::null().

Here is the call graph for this function:

◆ readDefaultCheckpoint()

void Arcane::CheckpointMng::readDefaultCheckpoint ( )
overridevirtual

Reads a default checkpoint.

This operation is collective.

In the default implementation, the information for resumption is stored in a file named 'checkpoint_info.xml' located in the case's export directory (ISubDomain::exportDirectory()).

Deprecated
Instead, use the following code:
ICheckpointMng* cm = ...;
CheckpointInfo checkpoint_info = cm->readDefaultChekpointInfo();
cm->readChekpoint(checkpoint_info);

Implements Arcane::ICheckpointMng.

Definition at line 210 of file CheckpointMng.cc.

References readDefaultCheckpointInfo().

Referenced by readCheckpoint().

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

◆ readDefaultCheckpointInfo()

CheckpointInfo Arcane::CheckpointMng::readDefaultCheckpointInfo ( )
overridevirtual

Reads default checkpoint information.

This operation is collective.

In the default implementation, the information for resumption is stored in a file named 'checkpoint_info.xml' located in the case's export directory (ISubDomain::exportDirectory()).

After reading the information, it is possible to call readCheckpoint(const CheckpointInfo& checkpoint_info) to read the checkpoint.

Implements Arcane::ICheckpointMng.

Definition at line 194 of file CheckpointMng.cc.

References Arcane::IIOMng::collectiveRead().

Referenced by readDefaultCheckpoint().

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

◆ readObservable()

IObservable * Arcane::CheckpointMng::readObservable ( )
inlineoverridevirtual

Read observable.

Observers registered in this observable are called after a complete checkpoint read.

Implements Arcane::ICheckpointMng.

Definition at line 92 of file CheckpointMng.cc.

References m_read_observable.

◆ writeCheckpoint() [1/2]

void Arcane::CheckpointMng::writeCheckpoint ( ICheckpointWriter * writer)
overridevirtual

Writes a default checkpoint using the writer.

This operation is collective.

Deprecated
Use writeDefaultCheckpoint() instead.

Implements Arcane::ICheckpointMng.

Definition at line 389 of file CheckpointMng.cc.

References writeDefaultCheckpoint().

Referenced by writeDefaultCheckpoint().

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

◆ writeCheckpoint() [2/2]

void Arcane::CheckpointMng::writeCheckpoint ( ICheckpointWriter * writer,
ByteArray & infos )
overridevirtual

Writes a checkpoint using the writer.

This operation is collective.

The information required to read it back is stored in the infos array passed as an argument. It is then possible to read a checkpoint back via readCheckpoint(ByteConstArrayView).

The default implementation stores in infos an XML file containing, among other things, the name of the corresponding reader, the number of subdomains, ...

Implements Arcane::ICheckpointMng.

Definition at line 417 of file CheckpointMng.cc.

References _writeCheckpointInfoFile(), and m_write_observable.

Here is the call graph for this function:

◆ writeDefaultCheckpoint()

void Arcane::CheckpointMng::writeDefaultCheckpoint ( ICheckpointWriter * writer)
overridevirtual

Writes a checkpoint using the writer.

This operation is collective.

This is a standard checkpoint that can be read back via readDefaultCheckpoint().

See also
readDefaultCheckpoint

Implements Arcane::ICheckpointMng.

Definition at line 398 of file CheckpointMng.cc.

References ARCANE_THROW, Arcane::Directory::file(), Arcane::String::localstr(), Arcane::AbstractArray< T >::size(), Arcane::Array< T >::unguardedBasePointer(), and writeCheckpoint().

Referenced by writeCheckpoint().

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

◆ writeObservable()

IObservable * Arcane::CheckpointMng::writeObservable ( )
inlineoverridevirtual

Write observable.

Observers registered in this observable are called before writing a checkpoint.

Implements Arcane::ICheckpointMng.

Definition at line 91 of file CheckpointMng.cc.

References m_write_observable.

Member Data Documentation

◆ m_read_observable

IObservable* Arcane::CheckpointMng::m_read_observable
private

Observable for reading.

Definition at line 102 of file CheckpointMng.cc.

Referenced by readCheckpoint(), and readObservable().

◆ m_sub_domain

ISubDomain* Arcane::CheckpointMng::m_sub_domain
private

Definition at line 100 of file CheckpointMng.cc.

◆ m_write_observable

IObservable* Arcane::CheckpointMng::m_write_observable
private

Observable for writing.

Definition at line 101 of file CheckpointMng.cc.

Referenced by writeCheckpoint(), and writeObservable().


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