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

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

#include <arcane/core/MachineShMemWinVariable.h>

Public Member Functions

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.
MDSpan< DataType, typename MDDimType< Extents::rank()+1 >::DimType > view (Int32 rank) const
 Method to get a view of the variable from another subdomain on the node.
MDSpan< DataType, Extents > operator() (Int32 rank, Int32 notlocal_id)
 Method to get the multi-dimensional 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.

Protected Member Functions

 MachineShMemWinMDVariableT (MeshVariableArrayRefT< ItemType, DataType > var)
 Constructor.

Detailed Description

template<class ItemType, class DataType, class Extents>
class Arcane::MachineShMemWinMDVariableT< ItemType, DataType, Extents >

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

This class cannot be used directly. It is necessary to use one of the following classes:

Definition at line 437 of file MachineShMemWinVariable.h.

Constructor & Destructor Documentation

◆ MachineShMemWinMDVariableT()

template<class ItemType, class DataType, class Extents>
Arcane::MachineShMemWinMDVariableT< ItemType, DataType, Extents >::MachineShMemWinMDVariableT ( MeshVariableArrayRefT< ItemType, DataType > var)
explicitprotected

Constructor.

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

Definition at line 313 of file MachineShMemWinVariable.cc.

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

Referenced by Arcane::MachineShMemWinMeshMDVariableT< ItemType, DataType, Extents >::MachineShMemWinMeshMDVariableT().

Member Function Documentation

◆ barrier()

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

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

Definition at line 342 of file MachineShMemWinVariable.cc.

◆ machineRanks()

template<class ItemType, class DataType, class Extents>
ConstArrayView< Int32 > Arcane::MachineShMemWinMDVariableT< ItemType, DataType, Extents >::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 332 of file MachineShMemWinVariable.cc.

◆ operator()()

template<class ItemType, class DataType, class Extents>
MDSpan< DataType, Extents > Arcane::MachineShMemWinMDVariableT< ItemType, DataType, Extents >::operator() ( Int32 rank,
Int32 notlocal_id )

Method to get the multi-dimensional 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 view(Int32 rank).

Non-collective call.

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

Definition at line 379 of file MachineShMemWinVariable.cc.

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

◆ updateVariable()

template<class ItemType, class DataType, class Extents>
void Arcane::MachineShMemWinMDVariableT< ItemType, DataType, Extents >::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 393 of file MachineShMemWinVariable.cc.

References Arcane::SpanImpl< T, SizeType, Extent >::copy().

Referenced by MachineShMemWinMDVariableT().

◆ view()

template<class ItemType, class DataType, class Extents>
MDSpan< DataType, typename MDDimType< Extents::rank()+1 >::DimType > Arcane::MachineShMemWinMDVariableT< ItemType, DataType, Extents >::view ( Int32 rank) const

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

The first index corresponds to the local_id, the other indices are 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 view.

Definition at line 352 of file MachineShMemWinVariable.cc.

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


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