Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType > Class Template Reference

Class allowing access to the shared elements of the variable in shared memory. More...

#include <arcane/core/MachineShMemWinVariable.h>

Public Member Functions

 MachineShMemWinMeshVariableArrayT (MeshVariableArrayRefT< ItemType, DataType > var)
 Constructor.
ConstArrayView< Int32machineRanks () const
 Method to get the ranks that possess a segment in the window.
void barrier () const
 Method to wait until all processes/threads on the node call this method to continue execution.
Span2< DataType > view (Int32 rank) const
 Method to get a view of the variable from another subdomain on the node.
Span< DataType > operator() (Int32 rank, Int32 notlocal_id)
 Method to get the array of an item from another subdomain.
void updateVariable ()
 Method to update this object after a change in the mesh and/or after a resizing of the variable.

Detailed Description

template<class ItemType, class DataType>
class Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >

Class allowing access to the shared elements of the variable in shared memory.

It is necessary that this variable be allocated in shared memory with the property "IVariable::PInShMem".

This class works for mesh array variables.

If the mesh and/or the variable size changes when an object of this type is used, it is necessary to call the updateVariable() method.

Definition at line 331 of file MachineShMemWinVariable.h.

Constructor & Destructor Documentation

◆ MachineShMemWinMeshVariableArrayT()

template<class ItemType, class DataType>
Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >::MachineShMemWinMeshVariableArrayT ( MeshVariableArrayRefT< ItemType, DataType > var)
explicit

Constructor.

Parameters
varVariable having the property "IVariable::PInShMem".

Definition at line 234 of file MachineShMemWinVariable.cc.

References Arcane::makeRef(), and updateVariable().

Member Function Documentation

◆ barrier()

template<class ItemType, class DataType>
void Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >::barrier ( ) const

Method to wait until all processes/threads on the node call this method to continue execution.

Definition at line 263 of file MachineShMemWinVariable.cc.

◆ machineRanks()

template<class ItemType, class DataType>
ConstArrayView< Int32 > Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >::machineRanks ( ) const

Method to get the ranks that possess a segment in the window.

Non-collective call.

Returns
A view containing the rank IDs.

Definition at line 253 of file MachineShMemWinVariable.cc.

◆ operator()()

template<class ItemType, class DataType>
Span< DataType > Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >::operator() ( Int32 rank,
Int32 notlocal_id )

Method to get the array of an item from another subdomain.

Warning
Attention: the local_id corresponds to the local_id of the subdomain rank! Absolutely do not use a local_id from our subdomain to access the elements of the view!
Note
If multiple iterations are necessary for the same rank, it is preferable to retrieve a view via segmentView(Int32 rank).

Non-collective call.

Parameters
rankThe rank of the targeted variable's subdomain.
notlocal_idThe local_id of the subdomain rank.
Returns
The item array.

Definition at line 284 of file MachineShMemWinVariable.cc.

References Arcane::asSpan(), and Arcane::SpanImpl< T, SizeType, Extent >::data().

◆ updateVariable()

template<class ItemType, class DataType>
void Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >::updateVariable ( )

Method to update this object after a change in the mesh and/or after a resizing of the variable.

Collective call.

Definition at line 297 of file MachineShMemWinVariable.cc.

Referenced by MachineShMemWinMeshVariableArrayT().

◆ view()

template<class ItemType, class DataType>
Span2< DataType > Arcane::MachineShMemWinMeshVariableArrayT< ItemType, DataType >::view ( Int32 rank) const

Method to get a view of the variable from another subdomain on the node.

Equivalent to "var.asArray()" but from another subdomain. The first index corresponds to the local_id, the second index is the position of the element in the item array.

Warning
Attention: to access the elements of the view, it is necessary to use the local_ids of the other subdomain! Do not use the local_ids of our subdomain!

Non-collective call.

Parameters
rankThe subdomain rank.
Returns
A 2D view.

Definition at line 273 of file MachineShMemWinVariable.cc.

References Arcane::asSpan(), and Arcane::SpanImpl< T, SizeType, Extent >::data().


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