Manages the serialization/deserialization of variables within a family. More...
#include <arcane/mesh/ItemFamilyVariableSerializer.h>
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. | |
| IItemFamily * | family () 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. | |
| 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 |
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 | |
| IItemFamily * | m_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... | |
Manages the serialization/deserialization of variables within a family.
Definition at line 44 of file ItemFamilyVariableSerializer.h.
| Arcane::mesh::ItemFamilyVariableSerializer::ItemFamilyVariableSerializer | ( | IItemFamily * | family | ) |
Definition at line 62 of file ItemFamilyVariableSerializer.cc.
| Arcane::mesh::ItemFamilyVariableSerializer::~ItemFamilyVariableSerializer | ( | ) |
Definition at line 72 of file ItemFamilyVariableSerializer.cc.
|
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().
|
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().
|
inlineprotected |
Definition at line 64 of file ItemFamilyVariableSerializer.h.
|
private |
Serialise une variable partielle.
This method is not very performant and must be optimized. For now, the operation is as follows for sending
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().
|
inlineoverridevirtual |
Associated family.
Implements Arcane::IItemFamilySerializeStep.
Definition at line 60 of file ItemFamilyVariableSerializer.h.
|
inlineoverridevirtual |
Performs end-of-exchange processing.
Implements Arcane::IItemFamilySerializeStep.
Definition at line 58 of file ItemFamilyVariableSerializer.h.
|
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().
|
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.
|
inlineoverridevirtual |
Serialization phase where this instance is involved.
Implements Arcane::IItemFamilySerializeStep.
Definition at line 59 of file ItemFamilyVariableSerializer.h.
|
overridevirtual |
During serialization, rank is the rank of the target. During deserialization, rank is the rank of the sender.
Implements Arcane::IItemFamilySerializeStep.
Definition at line 200 of file ItemFamilyVariableSerializer.cc.
References _checkSerialization(), _checkSerializationVariable(), _serializePartialVariable(), Arcane::Array< T >::add(), Arcane::arcaneIsDebug(), Arcane::TraceAccessor::debug(), ENUMERATE_ITEM, Arcane::Trace::High, Arcane::Trace::Highest, Arcane::TraceAccessor::info(), Arcane::ItemFamilySerializeArgs::localIds(), m_variables_to_exchange, Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ItemFamilySerializeArgs::rank(), Arcane::Array< T >::reserve(), Arcane::ItemFamilySerializeArgs::serializer(), Arcane::AbstractArray< T >::size(), Arcane::ConstArrayView< T >::size(), Arcane::ItemVector::size(), Arcane::MeshToMeshTransposer::transpose(), and Arcane::IItemFamily::view().
|
private |
Definition at line 68 of file ItemFamilyVariableSerializer.h.
|
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().