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

Manages the serialization/deserialization of variables within a family. More...

#include <arcane/mesh/ItemFamilyVariableSerializer.h>

Inheritance diagram for Arcane::mesh::ItemFamilyVariableSerializer:
Collaboration diagram for Arcane::mesh::ItemFamilyVariableSerializer:

Public Member Functions

 ItemFamilyVariableSerializer (IItemFamily *family)
void initialize () override
 Initializes the instance before the start of exchanges.
void notifyAction (const NotifyActionArgs &) override
 Notifies the instance that we are entering a certain phase of the exchange.
void serialize (const ItemFamilySerializeArgs &args) override
void finalize () override
 Performs end-of-exchange processing.
ePhase phase () const override
 Serialization phase where this instance is involved.
IItemFamilyfamily () const override
 Associated family.
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

Protected Member Functions

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

Private Member Functions

void _serializePartialVariable (IVariable *var, ISerializer *sbuf, Int32ConstArrayView local_ids)
 Serialise une variable partielle.
void _checkSerialization (ISerializer *sbuf, Int32ConstArrayView local_ids)
 Serializes a magic number and the number of entities to verify that deserialization is correct.
void _checkSerializationVariable (ISerializer *sbuf, IVariable *var)
 Serializes the variable name to verify that deserialization is correct.

Private Attributes

IItemFamilym_item_family
UniqueArray< IVariable * > m_variables_to_exchange
 List of variables to exchange.

Additional Inherited Members

Public Types inherited from Arcane::IItemFamilySerializeStep
enum  ePhase { PH_Item , PH_Group , PH_Variable }
 Serialization phase. More...
enum class  eAction { AC_BeginPrepareSend , AC_EndPrepareSend , AC_BeginReceive , AC_EndReceive }
 Action during serialization. More...

Detailed Description

Manages the serialization/deserialization of variables within a family.

Definition at line 44 of file ItemFamilyVariableSerializer.h.

Constructor & Destructor Documentation

◆ ItemFamilyVariableSerializer()

Arcane::mesh::ItemFamilyVariableSerializer::ItemFamilyVariableSerializer ( IItemFamily * family)

Definition at line 62 of file ItemFamilyVariableSerializer.cc.

◆ ~ItemFamilyVariableSerializer()

Arcane::mesh::ItemFamilyVariableSerializer::~ItemFamilyVariableSerializer ( )

Definition at line 72 of file ItemFamilyVariableSerializer.cc.

Member Function Documentation

◆ _checkSerialization()

void Arcane::mesh::ItemFamilyVariableSerializer::_checkSerialization ( ISerializer * sbuf,
Int32ConstArrayView local_ids )
private

Serializes a magic number and the number of entities to verify that deserialization is correct.

Definition at line 131 of file ItemFamilyVariableSerializer.cc.

References ARCANE_FATAL, Arcane::ISerializer::getInteger(), Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ISerializer::ModePut, Arcane::ISerializer::put(), and Arcane::ConstArrayView< T >::size().

Referenced by serialize().

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

◆ _checkSerializationVariable()

void Arcane::mesh::ItemFamilyVariableSerializer::_checkSerializationVariable ( ISerializer * sbuf,
IVariable * var )
private

Serializes the variable name to verify that deserialization is correct.

Definition at line 171 of file ItemFamilyVariableSerializer.cc.

References ARCANE_FATAL, Arcane::IVariable::fullName(), Arcane::ISerializer::get(), Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ISerializer::ModePut, Arcane::ISerializer::put(), and Arcane::ISerializer::reserve().

Referenced by serialize().

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

◆ _family()

IItemFamily * Arcane::mesh::ItemFamilyVariableSerializer::_family ( ) const
inlineprotected

Definition at line 64 of file ItemFamilyVariableSerializer.h.

◆ _serializePartialVariable()

void Arcane::mesh::ItemFamilyVariableSerializer::_serializePartialVariable ( IVariable * var,
ISerializer * sbuf,
Int32ConstArrayView local_ids )
private

Serialise une variable partielle.

This method is not very performant and must be optimized. For now, the operation is as follows for sending

  • determines the list of entities to send based on the new owner of the entities.
  • serializes the uniqueId() of these entities
  • serializes the variable. For receiving:
  • builds a hash map uniqueId() -> index in the variable
  • deserializes the uniqueId() and converts them to indices
  • deserializes the variable.

TODO: avoid sending all IDs for every variable TODO: use the information from ItemGroupsSerializer2 if possible to know the list of entities to send.

Definition at line 280 of file ItemFamilyVariableSerializer.cc.

References Arcane::Array< T >::add(), ARCANE_FATAL, ENUMERATE_ITEM, Arcane::IVariable::fullName(), Arcane::ISerializer::getInt64(), Arcane::ISerializer::getSpan(), Arcane::Int64, Arcane::IVariable::itemGroup(), Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::lookup(), Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ISerializer::ModePut, Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::nocheckAdd(), Arcane::ISerializer::putInt64(), Arcane::ISerializer::putSpan(), Arcane::ISerializer::reserveInt64(), Arcane::ISerializer::reserveSpan(), Arcane::Array< T >::resize(), Arcane::IVariable::serialize(), Arcane::AbstractArray< T >::size(), Arcane::ConstArrayView< T >::size(), and Arcane::ItemGroup::size().

Referenced by serialize().

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

◆ family()

IItemFamily * Arcane::mesh::ItemFamilyVariableSerializer::family ( ) const
inlineoverridevirtual

Associated family.

Implements Arcane::IItemFamilySerializeStep.

Definition at line 60 of file ItemFamilyVariableSerializer.h.

◆ finalize()

void Arcane::mesh::ItemFamilyVariableSerializer::finalize ( )
inlineoverridevirtual

Performs end-of-exchange processing.

Implements Arcane::IItemFamilySerializeStep.

Definition at line 58 of file ItemFamilyVariableSerializer.h.

◆ initialize()

void Arcane::mesh::ItemFamilyVariableSerializer::initialize ( )
overridevirtual

Initializes the instance before the start of exchanges.

Implements Arcane::IItemFamilySerializeStep.

Definition at line 80 of file ItemFamilyVariableSerializer.cc.

References Arcane::Array< T >::add(), Arcane::TraceAccessor::debug(), Arcane::IItemFamily::fullName(), Arcane::IVariable::fullName(), Arcane::Trace::High, Arcane::TraceAccessor::info(), Arcane::IVariable::itemFamily(), m_variables_to_exchange, Arcane::IVariable::PNoExchange, Arcane::IVariable::property(), Arcane::AbstractArray< T >::size(), and Arcane::IVariableMng::usedVariables().

Here is the call graph for this function:

◆ notifyAction()

void Arcane::mesh::ItemFamilyVariableSerializer::notifyAction ( const NotifyActionArgs & args)
inlineoverridevirtual

Notifies the instance that we are entering a certain phase of the exchange.

Implements Arcane::IItemFamilySerializeStep.

Definition at line 56 of file ItemFamilyVariableSerializer.h.

◆ phase()

ePhase Arcane::mesh::ItemFamilyVariableSerializer::phase ( ) const
inlineoverridevirtual

Serialization phase where this instance is involved.

Implements Arcane::IItemFamilySerializeStep.

Definition at line 59 of file ItemFamilyVariableSerializer.h.

◆ serialize()

Member Data Documentation

◆ m_item_family

IItemFamily* Arcane::mesh::ItemFamilyVariableSerializer::m_item_family
private

Definition at line 68 of file ItemFamilyVariableSerializer.h.

◆ m_variables_to_exchange

UniqueArray<IVariable*> Arcane::mesh::ItemFamilyVariableSerializer::m_variables_to_exchange
private

List of variables to exchange.

IMPORTANT: This list must be identical for all sub-domains otherwise the deserializations will give incorrect results.

Definition at line 75 of file ItemFamilyVariableSerializer.h.

Referenced by initialize(), and serialize().


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