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

Implementation of the ItemGroupImpl class. More...

#include <arcane/core/internal/ItemGroupInternal.h>

Collaboration diagram for Arcane::ItemGroupInternal:

Classes

class  CheckNeedUpdateMutex
 Mutex to protect calls to ItemGroupImpl::_checkNeedUpdate(). More...

Public Member Functions

 ItemGroupInternal (IItemFamily *family, const String &name)
 ItemGroupInternal (IItemFamily *family, ItemGroupImpl *parent, const String &name)
const Stringname () const
const StringfullName () const
bool null () const
IMeshmesh () const
eItemKind kind () const
Integer maxLocalId () const
ItemInternalList items () const
ItemInfoListView itemInfoListView () const
Int32ArrayView itemsLocalId ()
Int32ConstArrayView itemsLocalId () const
Int32ArraymutableItemsLocalId ()
VariableArrayInt32variableItemsLocalid ()
Int64 timestamp () const
bool isContiguous () const
void checkIsContiguous ()
 Checks that the localIds() are contiguous.
void updateTimestamp ()
void setNeedRecompute ()
void applySimdPadding ()
 Apply padding for vectorization.
void checkUpdateSimdPadding ()
 Fills the last elements of the group to have a complete SIMD vector.
bool isAllItems () const
bool isOwn () const
Int32 nbItem () const
void checkValid ()
void _removeItems (SmallSpan< const Int32 > items_local_id)
void notifyExtendObservers (const Int32ConstArrayView *info)
void notifyReduceObservers (const Int32ConstArrayView *info)
void notifyCompactObservers (const Int32ConstArrayView *info)
void notifyInvalidateObservers ()
void resetSubGroups ()

Public Attributes

ItemGroupImplInternal m_internal_api
IMeshm_mesh = nullptr
 Associated group manager.
IItemFamilym_item_family = nullptr
 Associated family.
ItemGroupImplm_parent = nullptr
String m_variable_name
 Parent group (null group if none).
String m_full_name
 Full name of the group.
bool m_is_null = true
 true if the group is null
eItemKind m_kind = IK_Unknown
 Kind of the group entities.
String m_name
 Name of the group.
bool m_is_own = false
 true if the group contains only entities owned by us.
Int64 m_simd_timestamp = -1
 Time of the last modification for SIMD info calculation.
ItemGroupImplm_own_group = nullptr
 Items owned by the subdomain.
ItemGroupImplm_ghost_group = nullptr
 Items not owned by the subdomain.
ItemGroupImplm_interface_group = nullptr
 Items on the boundary of two subdomains.
ItemGroupImplm_node_group = nullptr
 Node group.
ItemGroupImplm_edge_group = nullptr
 Edge group.
ItemGroupImplm_face_group = nullptr
 Face group.
ItemGroupImplm_cell_group = nullptr
 Cell group.
ItemGroupImplm_inner_face_group = nullptr
 Inner face group.
ItemGroupImplm_outer_face_group = nullptr
ItemGroupImplm_active_cell_group = nullptr
 AMR.
ItemGroupImplm_own_active_cell_group = nullptr
 Active owned cell group.
ItemGroupImplm_active_face_group = nullptr
 Active face group.
ItemGroupImplm_own_active_face_group = nullptr
 Active owned face group.
ItemGroupImplm_inner_active_face_group = nullptr
 Active inner face group.
ItemGroupImplm_outer_active_face_group = nullptr
 Active outer face group.
std::map< Integer, ItemGroupImpl * > m_level_cell_group
 Level cell group.
std::map< Integer, ItemGroupImpl * > m_own_level_cell_group
 Level owned cell group.
std::map< String, AutoRefT< ItemGroupImpl > > m_sub_groups
 Set of all sub-groups.
bool m_need_recompute = false
 True if the group needs to be recalculated.
bool m_need_invalidate_on_recompute = false
 True if invalidate observers must be activated upon recalculation.
bool m_transaction_mode = false
 True if the group is in direct transaction mode.
bool m_is_local_to_sub_domain = false
 True if the group is local to the subdomain.
IFunctorm_compute_functor = nullptr
 Group computation function.
bool m_is_all_items = false
 Indicates if it is the group of all entities.
bool m_is_constituent_group = false
 Indicates if the group is associated with a constituent (IMeshComponent).
SharedPtrT< GroupIndexTablem_group_index_table
 Hash table of item local id to its enumeration position.
Ref< IVariableSynchronizerm_synchronizer
 Group synchronizer.
UniqueArray< Int32m_items_index_in_all_group
std::map< const void *, IItemGroupObserver * > m_observers
 localids -> index (ONLY ALLITEMS)
bool m_observer_need_info = false
 Synthesis of observer need for transition information.
UniqueArray< Int32m_local_buffer { MemoryUtils::getAllocatorForMostlyReadOnlyData() }
Array< Int32 > * m_items_local_id = &m_local_buffer
 List of local IDs of the entities in this group.
VariableArrayInt32m_variable_items_local_id = nullptr
bool m_is_contiguous = false
bool m_is_check_simd_padding = true
 True if the localIds are consecutive.
bool m_is_print_check_simd_padding = false
bool m_is_print_apply_simd_padding = false
bool m_is_print_stack_apply_simd_padding = false
CheckNeedUpdateMutex m_check_need_update_mutex
 Mutex to protect updates.
ItemGroupSubPartsByType m_sub_parts_by_type
 Sub-part of a group based on its type.

Private Member Functions

void _notifyDirectRemoveItems (SmallSpan< const Int32 > removed_ids, Int32 nb_remaining)
void _init ()

Private Attributes

Int64 m_timestamp = -1
 Time of the last modification.

Friends

class ItemGroupImplInternal

Detailed Description

Implementation of the ItemGroupImpl class.

The container holding the list of group entities is either a variable in the case of a standard group, or a simple array in the case of a group having a parent. Indeed, groups having parents are dynamically generated groups (for example, the group of own entities) and are therefore not always present in all sub-domains (a variable must always exist in all sub-domains). Furthermore, their value does not need to be saved during a protection.

Todo
add notion of generated group, with the following properties:
  • these groups must not be transferred from one subdomain to another
  • they cannot be modified directly.

Definition at line 135 of file ItemGroupInternal.h.

Constructor & Destructor Documentation

◆ ItemGroupInternal() [1/3]

Arcane::ItemGroupInternal::ItemGroupInternal ( )

Definition at line 38 of file ItemGroupInternal.cc.

◆ ItemGroupInternal() [2/3]

Arcane::ItemGroupInternal::ItemGroupInternal ( IItemFamily * family,
const String & name )

Definition at line 49 of file ItemGroupInternal.cc.

◆ ItemGroupInternal() [3/3]

Arcane::ItemGroupInternal::ItemGroupInternal ( IItemFamily * family,
ItemGroupImpl * parent,
const String & name )

Definition at line 66 of file ItemGroupInternal.cc.

◆ ~ItemGroupInternal()

Arcane::ItemGroupInternal::~ItemGroupInternal ( )

Definition at line 84 of file ItemGroupInternal.cc.

Member Function Documentation

◆ _init()

void Arcane::ItemGroupInternal::_init ( )
private

Definition at line 99 of file ItemGroupInternal.cc.

◆ _notifyDirectRemoveItems()

void Arcane::ItemGroupInternal::_notifyDirectRemoveItems ( SmallSpan< const Int32 > removed_ids,
Int32 nb_remaining )
private

Definition at line 520 of file ItemGroupInternal.cc.

◆ _removeItems()

void Arcane::ItemGroupInternal::_removeItems ( SmallSpan< const Int32 > items_local_id)

Definition at line 355 of file ItemGroupInternal.cc.

◆ applySimdPadding()

void Arcane::ItemGroupInternal::applySimdPadding ( )

Apply padding for vectorization.

Definition at line 288 of file ItemGroupInternal.cc.

References Arcane::platform::getStackTrace(), Arcane::ITraceMng::info(), m_item_family, and m_name.

Referenced by checkUpdateSimdPadding().

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

◆ checkIsContiguous()

void Arcane::ItemGroupInternal::checkIsContiguous ( )

Checks that the localIds() are contiguous.

Definition at line 263 of file ItemGroupInternal.cc.

References Arcane::ConstArrayView< T >::empty(), and Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ checkUpdateSimdPadding()

void Arcane::ItemGroupInternal::checkUpdateSimdPadding ( )

Fills the last elements of the group to have a complete SIMD vector.

For vectorization to work, the number of elements in the group must be a multiple of the size of a SIMD vector. If this is not the case, the last values of the localId() array are filled with the last element.

For example, suppose a SIMD vector size of 8 (which is the maximum currently with AVX512) and a group grp of 13 elements. The group must therefore be filled as follows:

Int32 last_local_id = grp[12];
grp[13] = grp[14] = grp[15] = last_local_id.
std::int32_t Int32
Signed integer type of 32 bits.

Note that the group size remains 13 elements. The additional padding is only for iterations via ENUMERATE_SIMD. Since the localId() array is allocated with the alignment allocator, it is guaranteed that the allocated memory is sufficient for padding.

Todo
Do not do this in all checkNeedUpdate() but implement a method that returns a specific enumerator for vectorization.

Definition at line 331 of file ItemGroupInternal.cc.

References applySimdPadding(), Arcane::ITraceMng::info(), m_is_check_simd_padding, m_item_family, and m_simd_timestamp.

Here is the call graph for this function:

◆ checkValid()

void Arcane::ItemGroupInternal::checkValid ( )

Definition at line 444 of file ItemGroupInternal.cc.

◆ fullName()

const String & Arcane::ItemGroupInternal::fullName ( ) const
inline

Definition at line 209 of file ItemGroupInternal.h.

◆ isAllItems()

bool Arcane::ItemGroupInternal::isAllItems ( ) const
inline

Definition at line 247 of file ItemGroupInternal.h.

◆ isContiguous()

bool Arcane::ItemGroupInternal::isContiguous ( ) const
inline

Definition at line 223 of file ItemGroupInternal.h.

◆ isOwn()

bool Arcane::ItemGroupInternal::isOwn ( ) const
inline

Definition at line 248 of file ItemGroupInternal.h.

◆ itemInfoListView()

ItemInfoListView Arcane::ItemGroupInternal::itemInfoListView ( ) const

Definition at line 155 of file ItemGroupInternal.cc.

◆ items()

ItemInternalList Arcane::ItemGroupInternal::items ( ) const

Definition at line 135 of file ItemGroupInternal.cc.

◆ itemsLocalId() [1/2]

Int32ArrayView Arcane::ItemGroupInternal::itemsLocalId ( )
inline

Definition at line 217 of file ItemGroupInternal.h.

◆ itemsLocalId() [2/2]

Int32ConstArrayView Arcane::ItemGroupInternal::itemsLocalId ( ) const
inline

Definition at line 218 of file ItemGroupInternal.h.

◆ kind()

eItemKind Arcane::ItemGroupInternal::kind ( ) const
inline

Definition at line 212 of file ItemGroupInternal.h.

◆ maxLocalId()

Int32 Arcane::ItemGroupInternal::maxLocalId ( ) const

Definition at line 146 of file ItemGroupInternal.cc.

◆ mesh()

IMesh * Arcane::ItemGroupInternal::mesh ( ) const
inline

Definition at line 211 of file ItemGroupInternal.h.

◆ mutableItemsLocalId()

Int32Array & Arcane::ItemGroupInternal::mutableItemsLocalId ( )
inline

Definition at line 219 of file ItemGroupInternal.h.

◆ name()

const String & Arcane::ItemGroupInternal::name ( ) const
inline

Definition at line 208 of file ItemGroupInternal.h.

◆ nbItem()

Int32 Arcane::ItemGroupInternal::nbItem ( ) const
inline

Definition at line 249 of file ItemGroupInternal.h.

◆ notifyCompactObservers()

void Arcane::ItemGroupInternal::notifyCompactObservers ( const Int32ConstArrayView * info)

Definition at line 226 of file ItemGroupInternal.cc.

◆ notifyExtendObservers()

void Arcane::ItemGroupInternal::notifyExtendObservers ( const Int32ConstArrayView * info)

Definition at line 196 of file ItemGroupInternal.cc.

◆ notifyInvalidateObservers()

void Arcane::ItemGroupInternal::notifyInvalidateObservers ( )

Definition at line 241 of file ItemGroupInternal.cc.

◆ notifyReduceObservers()

void Arcane::ItemGroupInternal::notifyReduceObservers ( const Int32ConstArrayView * info)

Definition at line 211 of file ItemGroupInternal.cc.

◆ null()

bool Arcane::ItemGroupInternal::null ( ) const
inline

Definition at line 210 of file ItemGroupInternal.h.

◆ resetSubGroups()

void Arcane::ItemGroupInternal::resetSubGroups ( )

Definition at line 166 of file ItemGroupInternal.cc.

◆ setNeedRecompute()

void Arcane::ItemGroupInternal::setNeedRecompute ( )
inline

Definition at line 232 of file ItemGroupInternal.h.

◆ timestamp()

Int64 Arcane::ItemGroupInternal::timestamp ( ) const
inline

Definition at line 222 of file ItemGroupInternal.h.

◆ updateTimestamp()

void Arcane::ItemGroupInternal::updateTimestamp ( )
inline

Definition at line 226 of file ItemGroupInternal.h.

◆ variableItemsLocalid()

VariableArrayInt32 * Arcane::ItemGroupInternal::variableItemsLocalid ( )
inline

Definition at line 220 of file ItemGroupInternal.h.

◆ ItemGroupImplInternal

friend class ItemGroupImplInternal
friend

Definition at line 137 of file ItemGroupInternal.h.

Member Data Documentation

◆ m_active_cell_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_active_cell_group = nullptr

AMR.

Active cell group

Definition at line 293 of file ItemGroupInternal.h.

◆ m_active_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_active_face_group = nullptr

Active face group.

Definition at line 295 of file ItemGroupInternal.h.

◆ m_cell_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_cell_group = nullptr

Cell group.

Definition at line 287 of file ItemGroupInternal.h.

◆ m_check_need_update_mutex

CheckNeedUpdateMutex Arcane::ItemGroupInternal::m_check_need_update_mutex

Mutex to protect updates.

Definition at line 340 of file ItemGroupInternal.h.

◆ m_compute_functor

IFunctor* Arcane::ItemGroupInternal::m_compute_functor = nullptr

Group computation function.

Definition at line 308 of file ItemGroupInternal.h.

◆ m_edge_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_edge_group = nullptr

Edge group.

Definition at line 285 of file ItemGroupInternal.h.

◆ m_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_face_group = nullptr

Face group.

Definition at line 286 of file ItemGroupInternal.h.

◆ m_full_name

String Arcane::ItemGroupInternal::m_full_name

Full name of the group.

Definition at line 267 of file ItemGroupInternal.h.

◆ m_ghost_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_ghost_group = nullptr

Items not owned by the subdomain.

Definition at line 282 of file ItemGroupInternal.h.

◆ m_group_index_table

SharedPtrT<GroupIndexTable> Arcane::ItemGroupInternal::m_group_index_table

Hash table of item local id to its enumeration position.

Definition at line 311 of file ItemGroupInternal.h.

◆ m_inner_active_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_inner_active_face_group = nullptr

Active inner face group.

Definition at line 297 of file ItemGroupInternal.h.

◆ m_inner_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_inner_face_group = nullptr

Inner face group.

Definition at line 288 of file ItemGroupInternal.h.

◆ m_interface_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_interface_group = nullptr

Items on the boundary of two subdomains.

Definition at line 283 of file ItemGroupInternal.h.

◆ m_internal_api

ItemGroupImplInternal Arcane::ItemGroupInternal::m_internal_api

Definition at line 262 of file ItemGroupInternal.h.

◆ m_is_all_items

bool Arcane::ItemGroupInternal::m_is_all_items = false

Indicates if it is the group of all entities.

Definition at line 309 of file ItemGroupInternal.h.

◆ m_is_check_simd_padding

bool Arcane::ItemGroupInternal::m_is_check_simd_padding = true

True if the localIds are consecutive.

Definition at line 332 of file ItemGroupInternal.h.

Referenced by checkUpdateSimdPadding().

◆ m_is_constituent_group

bool Arcane::ItemGroupInternal::m_is_constituent_group = false

Indicates if the group is associated with a constituent (IMeshComponent).

Definition at line 310 of file ItemGroupInternal.h.

◆ m_is_contiguous

bool Arcane::ItemGroupInternal::m_is_contiguous = false

Definition at line 331 of file ItemGroupInternal.h.

◆ m_is_local_to_sub_domain

bool Arcane::ItemGroupInternal::m_is_local_to_sub_domain = false

True if the group is local to the subdomain.

Definition at line 307 of file ItemGroupInternal.h.

◆ m_is_null

bool Arcane::ItemGroupInternal::m_is_null = true

true if the group is null

Definition at line 268 of file ItemGroupInternal.h.

◆ m_is_own

bool Arcane::ItemGroupInternal::m_is_own = false

true if the group contains only entities owned by us.

Definition at line 271 of file ItemGroupInternal.h.

◆ m_is_print_apply_simd_padding

bool Arcane::ItemGroupInternal::m_is_print_apply_simd_padding = false

Definition at line 334 of file ItemGroupInternal.h.

◆ m_is_print_check_simd_padding

bool Arcane::ItemGroupInternal::m_is_print_check_simd_padding = false

Definition at line 333 of file ItemGroupInternal.h.

◆ m_is_print_stack_apply_simd_padding

bool Arcane::ItemGroupInternal::m_is_print_stack_apply_simd_padding = false

Definition at line 335 of file ItemGroupInternal.h.

◆ m_item_family

IItemFamily* Arcane::ItemGroupInternal::m_item_family = nullptr

Associated family.

Definition at line 264 of file ItemGroupInternal.h.

Referenced by applySimdPadding(), and checkUpdateSimdPadding().

◆ m_items_index_in_all_group

UniqueArray<Int32> Arcane::ItemGroupInternal::m_items_index_in_all_group

Definition at line 315 of file ItemGroupInternal.h.

◆ m_items_local_id

Array<Int32>* Arcane::ItemGroupInternal::m_items_local_id = &m_local_buffer

List of local IDs of the entities in this group.

Definition at line 329 of file ItemGroupInternal.h.

◆ m_kind

eItemKind Arcane::ItemGroupInternal::m_kind = IK_Unknown

Kind of the group entities.

Definition at line 269 of file ItemGroupInternal.h.

◆ m_level_cell_group

std::map<Integer, ItemGroupImpl*> Arcane::ItemGroupInternal::m_level_cell_group

Level cell group.

Definition at line 299 of file ItemGroupInternal.h.

◆ m_local_buffer

UniqueArray<Int32> Arcane::ItemGroupInternal::m_local_buffer { MemoryUtils::getAllocatorForMostlyReadOnlyData() }

Definition at line 328 of file ItemGroupInternal.h.

◆ m_mesh

IMesh* Arcane::ItemGroupInternal::m_mesh = nullptr

Associated group manager.

Definition at line 263 of file ItemGroupInternal.h.

◆ m_name

String Arcane::ItemGroupInternal::m_name

Name of the group.

Definition at line 270 of file ItemGroupInternal.h.

Referenced by applySimdPadding().

◆ m_need_invalidate_on_recompute

bool Arcane::ItemGroupInternal::m_need_invalidate_on_recompute = false

True if invalidate observers must be activated upon recalculation.

Definition at line 305 of file ItemGroupInternal.h.

◆ m_need_recompute

bool Arcane::ItemGroupInternal::m_need_recompute = false

True if the group needs to be recalculated.

Definition at line 304 of file ItemGroupInternal.h.

◆ m_node_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_node_group = nullptr

Node group.

Definition at line 284 of file ItemGroupInternal.h.

◆ m_observer_need_info

bool Arcane::ItemGroupInternal::m_observer_need_info = false

Synthesis of observer need for transition information.

Definition at line 318 of file ItemGroupInternal.h.

◆ m_observers

std::map<const void*, IItemGroupObserver*> Arcane::ItemGroupInternal::m_observers

localids -> index (ONLY ALLITEMS)

Group observers

Definition at line 317 of file ItemGroupInternal.h.

◆ m_outer_active_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_outer_active_face_group = nullptr

Active outer face group.

Definition at line 298 of file ItemGroupInternal.h.

◆ m_outer_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_outer_face_group = nullptr

Outer face group

Definition at line 289 of file ItemGroupInternal.h.

◆ m_own_active_cell_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_own_active_cell_group = nullptr

Active owned cell group.

Definition at line 294 of file ItemGroupInternal.h.

◆ m_own_active_face_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_own_active_face_group = nullptr

Active owned face group.

Definition at line 296 of file ItemGroupInternal.h.

◆ m_own_group

ItemGroupImpl* Arcane::ItemGroupInternal::m_own_group = nullptr

Items owned by the subdomain.

Definition at line 281 of file ItemGroupInternal.h.

◆ m_own_level_cell_group

std::map<Integer, ItemGroupImpl*> Arcane::ItemGroupInternal::m_own_level_cell_group

Level owned cell group.

Definition at line 300 of file ItemGroupInternal.h.

◆ m_parent

ItemGroupImpl* Arcane::ItemGroupInternal::m_parent = nullptr

Definition at line 265 of file ItemGroupInternal.h.

◆ m_simd_timestamp

Int64 Arcane::ItemGroupInternal::m_simd_timestamp = -1

Time of the last modification for SIMD info calculation.

Definition at line 279 of file ItemGroupInternal.h.

Referenced by checkUpdateSimdPadding().

◆ m_sub_groups

std::map<String, AutoRefT<ItemGroupImpl> > Arcane::ItemGroupInternal::m_sub_groups

Set of all sub-groups.

Definition at line 303 of file ItemGroupInternal.h.

◆ m_sub_parts_by_type

ItemGroupSubPartsByType Arcane::ItemGroupInternal::m_sub_parts_by_type

Sub-part of a group based on its type.

Definition at line 345 of file ItemGroupInternal.h.

◆ m_synchronizer

Ref<IVariableSynchronizer> Arcane::ItemGroupInternal::m_synchronizer

Group synchronizer.

Definition at line 312 of file ItemGroupInternal.h.

◆ m_timestamp

Int64 Arcane::ItemGroupInternal::m_timestamp = -1
private

Time of the last modification.

Definition at line 275 of file ItemGroupInternal.h.

◆ m_transaction_mode

bool Arcane::ItemGroupInternal::m_transaction_mode = false

True if the group is in direct transaction mode.

Definition at line 306 of file ItemGroupInternal.h.

◆ m_variable_items_local_id

VariableArrayInt32* Arcane::ItemGroupInternal::m_variable_items_local_id = nullptr

Definition at line 330 of file ItemGroupInternal.h.

◆ m_variable_name

String Arcane::ItemGroupInternal::m_variable_name

Parent group (null group if none).

Name of the variable containing the group item indices

Definition at line 266 of file ItemGroupInternal.h.


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