Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::VariablePrivate Class Reference
Inheritance diagram for Arcane::VariablePrivate:
Collaboration diagram for Arcane::VariablePrivate:

Public Member Functions

 VariablePrivate (const VariableBuildInfo &v, const VariableInfo &vi, Variable *var)
void serializeHashId (ISerializer *sbuf)
 Serializes the hashid.
Implementation of IVariableInternal
String computeComparisonHashCollective (IHashAlgorithm *hash_algo, IData *sorted_data) override
 Calculates the comparison hash for the variable.
void changeAllocator (const MemoryAllocationOptions &alloc_info) override
 Changes the variable's allocator.
void resize (const VariableResizeArgs &resize_args) override
 Resizes the variable by adding additional capacity.
VariableComparerResults compareVariable (const VariableComparerArgs &compare_args) override
 Applies the comparison method specified by compare_args.
IParallelMngreplicaParallelMng () const
 Returns the IParallelMng of the mesh replica associated with the variable.

Public Attributes

ISubDomainm_sub_domain = nullptr
IDataFactoryMngm_data_factory_mng = nullptr
MeshHandle m_mesh_handle
 Mesh (can be null).
Ref< IDatam_data
 Variable data.
ItemGroup m_item_group
 Entity group to which the variable is associated.
IItemFamilym_item_family = nullptr
 Entity family (can be null).
VariableInfo m_infos
 Characteristic information of the variable.
int m_property = 0
 Properties of the variable.
bool m_is_partial = false
 True if the variable is partial.
bool m_need_property_update = false
bool m_is_used = false
 Usage status of the variable.
bool m_has_valid_data = false
 True if the data is valid.
Real m_last_update_time = 0.0
 Physical time of the last update.
VariableRefm_first_reference = nullptr
Integer m_nb_reference = 0
 First reference on the variable.
UniqueArray< VariableDependInfom_depends
 List of dependencies for this variable.
Int64 m_modified_time = 0
 Tag of the last modification.
ScopedPtrT< IVariableComputeFunctionm_compute_function
 Calculation function.
AutoDetachObservable m_write_observable
 Write observable.
AutoDetachObservable m_read_observable
 Read observable.
AutoDetachObservable m_on_size_changed_observable
 Resize observable.
std::map< String, Stringm_tags
 List of tags.
bool m_has_recursive_depend = true
 True if dependencies are recursive.
bool m_want_shrink = false
Variablem_variable = nullptr
 Associated variable.

Static Public Attributes

static std::atomic< Int64modified_time_global_value = 1

Private Member Functions

void _setHashId ()

Private Attributes

Byte m_hash_id [HASHID_SIZE]
 Hash of the variable to check serialization consistency.

Static Private Attributes

static const int HASHID_SIZE = 64

Detailed Description

Definition at line 86 of file Variable.cc.

Constructor & Destructor Documentation

◆ VariablePrivate()

Arcane::VariablePrivate::VariablePrivate ( const VariableBuildInfo & v,
const VariableInfo & vi,
Variable * var )

Definition at line 216 of file Variable.cc.

Member Function Documentation

◆ _setHashId()

void Arcane::VariablePrivate::_setHashId ( )
inlineprivate

Definition at line 180 of file Variable.cc.

◆ changeAllocator()

void Arcane::VariablePrivate::changeAllocator ( const MemoryAllocationOptions & alloc_info)
overridevirtual

Changes the variable's allocator.

Currently valid only for 1D variables. Does nothing for others.

Warning
For experimental use only.

Implements Arcane::IVariableInternal.

Definition at line 1486 of file Variable.cc.

References Arcane::INumericDataInternal::changeAllocator(), m_data, and m_variable.

Here is the call graph for this function:

◆ compareVariable()

VariableComparerResults Arcane::VariablePrivate::compareVariable ( const VariableComparerArgs & compare_args)
overridevirtual

Applies the comparison method specified by compare_args.

Implements Arcane::IVariableInternal.

Definition at line 1508 of file Variable.cc.

References m_variable.

◆ computeComparisonHashCollective()

String Arcane::VariablePrivate::computeComparisonHashCollective ( IHashAlgorithm * hash_algo,
IData * sorted_data )
overridevirtual

Calculates the comparison hash for the variable.

sorted_data must be sorted according to uniqueId() and also by rank of the IParallelMng associated with the variable.

This method is collective, but only the master rank (the one for which IParallelMng::isMasterIO() is true) returns a valid hash. The others return a null string.

It also returns a null string if the data is not numeric (if sorted_data->_commonInternal()->numericData()==nullptr) or if the variable is not associated with a mesh entity.

Implements Arcane::IVariableInternal.

Definition at line 1452 of file Variable.cc.

References Arcane::IData::_commonInternal(), ARCANE_CHECK_POINTER, Arcane::asBytes(), Arccore::asSpan(), Arcane::ConstMemoryView::bytes(), Arcane::IParallelMng::commRank(), Arcane::IHashAlgorithm::computeHash(), Arcane::IParallelMng::gatherVariable(), m_item_family, Arcane::IParallelMng::masterIORank(), Arcane::INumericDataInternal::memoryView(), Arcane::IDataInternal::numericData(), and Arcane::Convert::toHexaString().

Here is the call graph for this function:

◆ replicaParallelMng()

IParallelMng * Arcane::VariablePrivate::replicaParallelMng ( ) const
virtual

Returns the IParallelMng of the mesh replica associated with the variable.

Returns nullptr if there is no replication.

Implements Arcane::IVariableInternal.

Definition at line 1517 of file Variable.cc.

References Arcane::IParallelReplication::hasReplication(), m_variable, Arcane::IParallelReplication::replicaParallelMng(), and Arcane::IParallelMng::replication().

Here is the call graph for this function:

◆ resize()

void Arcane::VariablePrivate::resize ( const VariableResizeArgs & resize_args)
overridevirtual

Resizes the variable by adding additional capacity.

Implements Arcane::IVariableInternal.

Definition at line 1499 of file Variable.cc.

References m_variable.

◆ serializeHashId()

void Arcane::VariablePrivate::serializeHashId ( ISerializer * sbuf)
inline

Serializes the hashid.

During deserialization, verifies that the hashid is correct and throws an exception if not.

Definition at line 133 of file Variable.cc.

References ARCANE_FATAL, Arcane::Byte, Arcane::ISerializer::getSpan(), m_hash_id, m_infos, Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ISerializer::ModePut, Arcane::ISerializer::putSpan(), and Arcane::ISerializer::reserveSpan().

Here is the call graph for this function:

Member Data Documentation

◆ HASHID_SIZE

const int Arcane::VariablePrivate::HASHID_SIZE = 64
staticprivate

Definition at line 170 of file Variable.cc.

◆ m_compute_function

ScopedPtrT<IVariableComputeFunction> Arcane::VariablePrivate::m_compute_function

Calculation function.

Definition at line 116 of file Variable.cc.

◆ m_data

Ref<IData> Arcane::VariablePrivate::m_data

Variable data.

Definition at line 102 of file Variable.cc.

Referenced by changeAllocator().

◆ m_data_factory_mng

IDataFactoryMng* Arcane::VariablePrivate::m_data_factory_mng = nullptr

Definition at line 100 of file Variable.cc.

◆ m_depends

UniqueArray<VariableDependInfo> Arcane::VariablePrivate::m_depends

List of dependencies for this variable.

Definition at line 114 of file Variable.cc.

◆ m_first_reference

VariableRef* Arcane::VariablePrivate::m_first_reference = nullptr

Definition at line 112 of file Variable.cc.

◆ m_has_recursive_depend

bool Arcane::VariablePrivate::m_has_recursive_depend = true

True if dependencies are recursive.

Definition at line 121 of file Variable.cc.

◆ m_has_valid_data

bool Arcane::VariablePrivate::m_has_valid_data = false

True if the data is valid.

Definition at line 110 of file Variable.cc.

◆ m_hash_id

Byte Arcane::VariablePrivate::m_hash_id[HASHID_SIZE]
private

Hash of the variable to check serialization consistency.

The first 16 bytes are the hash of the name in hexadecimal format (derived from an Int64) and the following are the full name (fullName()), possibly truncated, of the variable. Any remaining characters are '~'.

Definition at line 178 of file Variable.cc.

Referenced by serializeHashId().

◆ m_infos

VariableInfo Arcane::VariablePrivate::m_infos

Characteristic information of the variable.

Definition at line 105 of file Variable.cc.

Referenced by serializeHashId().

◆ m_is_partial

bool Arcane::VariablePrivate::m_is_partial = false

True if the variable is partial.

Definition at line 107 of file Variable.cc.

◆ m_is_used

bool Arcane::VariablePrivate::m_is_used = false

Usage status of the variable.

Definition at line 109 of file Variable.cc.

Referenced by Arcane::Variable::_checkSwapIsValid().

◆ m_item_family

IItemFamily* Arcane::VariablePrivate::m_item_family = nullptr

Entity family (can be null).

Definition at line 104 of file Variable.cc.

Referenced by computeComparisonHashCollective().

◆ m_item_group

ItemGroup Arcane::VariablePrivate::m_item_group

Entity group to which the variable is associated.

Definition at line 103 of file Variable.cc.

◆ m_last_update_time

Real Arcane::VariablePrivate::m_last_update_time = 0.0

Physical time of the last update.

Definition at line 111 of file Variable.cc.

◆ m_mesh_handle

MeshHandle Arcane::VariablePrivate::m_mesh_handle

Mesh (can be null).

Definition at line 101 of file Variable.cc.

◆ m_modified_time

Int64 Arcane::VariablePrivate::m_modified_time = 0

Tag of the last modification.

Definition at line 115 of file Variable.cc.

◆ m_nb_reference

Integer Arcane::VariablePrivate::m_nb_reference = 0

First reference on the variable.

Definition at line 113 of file Variable.cc.

◆ m_need_property_update

bool Arcane::VariablePrivate::m_need_property_update = false

Definition at line 108 of file Variable.cc.

◆ m_on_size_changed_observable

AutoDetachObservable Arcane::VariablePrivate::m_on_size_changed_observable

Resize observable.

Definition at line 119 of file Variable.cc.

◆ m_property

int Arcane::VariablePrivate::m_property = 0

Properties of the variable.

Definition at line 106 of file Variable.cc.

◆ m_read_observable

AutoDetachObservable Arcane::VariablePrivate::m_read_observable

Read observable.

Definition at line 118 of file Variable.cc.

◆ m_sub_domain

ISubDomain* Arcane::VariablePrivate::m_sub_domain = nullptr

Definition at line 99 of file Variable.cc.

◆ m_tags

std::map<String, String> Arcane::VariablePrivate::m_tags

List of tags.

Definition at line 120 of file Variable.cc.

◆ m_variable

Variable* Arcane::VariablePrivate::m_variable = nullptr

Associated variable.

Definition at line 123 of file Variable.cc.

Referenced by changeAllocator(), compareVariable(), replicaParallelMng(), and resize().

◆ m_want_shrink

bool Arcane::VariablePrivate::m_want_shrink = false

Definition at line 122 of file Variable.cc.

◆ m_write_observable

AutoDetachObservable Arcane::VariablePrivate::m_write_observable

Write observable.

Definition at line 117 of file Variable.cc.

◆ modified_time_global_value

std::atomic< Int64 > Arcane::VariablePrivate::modified_time_global_value = 1
static

Definition at line 95 of file Variable.cc.


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