Class allowing the creation of a shared memory window between sub-domains of the same node. More...
#include <arcane/core/MachineShMemWin.h>
Public Member Functions | |
| MachineShMemWin (IParallelMng *pm, Int64 nb_elem_segment) | |
| Constructor. | |
| MachineShMemWin (IParallelMng *pm) | |
| Constructor. | |
| ConstArrayView< Int32 > | machineRanks () const |
| Method to obtain 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. | |
| Span< Type > | segmentView () |
| Method to obtain a view of our segment. | |
| Span< Type > | segmentView (Int32 rank) |
| Method to obtain a view of the segment of another sub-domain on the node. | |
| Span< const Type > | segmentConstView () const |
| Method to obtain a view of our segment. | |
| Span< const Type > | segmentConstView (Int32 rank) const |
| Method to obtain a view of the segment of another sub-domain on the node. | |
| void | add (Span< const Type > elem) |
| Method to add elements to our segment. | |
| void | add () |
| Method to be called by the sub-domain(s) that do not wish to add elements to their segment. | |
| void | addToAnotherSegment (Int32 rank, Span< const Type > elem) |
| Method to add elements to the segment of another sub-domain. | |
| void | addToAnotherSegment () |
| Method to be called by the sub-domain(s) that do not wish to add elements to the segment of another sub-domain. | |
| void | reserve (Int64 new_capacity) |
| Method to reserve memory space in our segment. | |
| void | reserve () |
| Method to be called by the sub-domain(s) that do not wish to reserve more memory for their segments. | |
| void | resize (Int64 new_nb_elem) |
| Method to resize our segment. | |
| void | resize () |
| Method to be called by the sub-domain(s) that do not wish to resize their segments. | |
| void | shrink () |
| Method to reduce the reserved memory space for the segments to the minimum necessary. | |
Class allowing the creation of a shared memory window between sub-domains of the same node.
The segments of this window are not contiguous in memory and can be resized.
The add() method allows adding elements iteratively.
| Type | The type of the window elements. |
Definition at line 46 of file MachineShMemWin.h.
|
inline |
Constructor.
| pm | The parallelMng to use. |
| nb_elem_segment | The initial number of elements. |
Definition at line 56 of file MachineShMemWin.h.
|
inlineexplicit |
|
inline |
Method to be called by the sub-domain(s) that do not wish to add elements to their segment.
Collective call.
See the documentation for add(Span<const std::byte> elem).
Definition at line 173 of file MachineShMemWin.h.
|
inline |
Method to add elements to our segment.
Collective call.
If the segment is too small, it will be resized.
Sub-domains that do not wish to add elements can call the add() method without parameters or this method with an empty view.
| elem | The elements to add. |
Definition at line 157 of file MachineShMemWin.h.
References Arcane::SpanImpl< T, SizeType, Extent >::data(), and Arcane::SpanImpl< T, SizeType, Extent >::sizeBytes().
|
inline |
Method to be called by the sub-domain(s) that do not wish to add elements to the segment of another sub-domain.
Collective call.
See the documentation for addToAnotherSegment(Int32 rank, Span<const Type> elem).
Definition at line 213 of file MachineShMemWin.h.
|
inline |
Method to add elements to the segment of another sub-domain.
Collective call.
Two sub-domains must not add elements to the same sub-domain segment.
If the target segment is too small, it will be resized.
Sub-domains that do not wish to add elements can call the addToAnotherSegment() method without parameters.
| rank | The rank of the sub-domain with the segment to modify. |
| elem | The elements to add. |
Definition at line 197 of file MachineShMemWin.h.
References Arcane::SpanImpl< T, SizeType, Extent >::data(), and Arcane::SpanImpl< T, SizeType, Extent >::sizeBytes().
|
inline |
Method to wait until all processes/threads on the node call this method to continue execution.
Definition at line 87 of file MachineShMemWin.h.
|
inline |
Method to obtain the ranks that possess a segment in the window.
Non-collective call.
Definition at line 78 of file MachineShMemWin.h.
|
inline |
Method to be called by the sub-domain(s) that do not wish to reserve more memory for their segments.
Collective call.
See the documentation for reserve(Int64 new_capacity).
Definition at line 254 of file MachineShMemWin.h.
|
inline |
Method to reserve memory space in our segment.
Collective call.
This method does nothing if new_capacity is less than the memory already allocated for the segment. For sub-domains that do not wish to increase the memory space available for their segment, it is possible to set the parameter new_capacity to 0 or use the reserve() method (without arguments).
The reserved space will have a size greater than or equal to new_capacity.
This method does not resize the segment; you must always use the add() method to add elements.
To resize the segment, the resize(Int64 new_size) method is available.
| new_capacity | The requested new capacity. |
Definition at line 241 of file MachineShMemWin.h.
|
inline |
Method to be called by the sub-domain(s) that do not wish to resize their segments.
Collective call.
See the documentation for resize(Int64 new_nb_elem).
Definition at line 286 of file MachineShMemWin.h.
|
inline |
Method to resize our segment.
Collective call.
If the provided size is less than the current size of the segment, elements located after the provided size will be deleted.
For sub-domains that do not wish to resize their segment, it is possible to set the argument new_size to -1 or call the method resize() (without arguments).
| new_nb_elem | The new size. |
Definition at line 273 of file MachineShMemWin.h.
|
inline |
Method to obtain a view of our segment.
Non-collective call.
Definition at line 124 of file MachineShMemWin.h.
References Arcane::asSpan().
|
inline |
Method to obtain a view of the segment of another sub-domain on the node.
Non-collective call.
| rank | The rank of the sub-domain. |
Definition at line 138 of file MachineShMemWin.h.
References Arcane::asSpan().
|
inline |
Method to obtain a view of our segment.
Non-collective call.
Definition at line 98 of file MachineShMemWin.h.
References Arcane::asSpan().
|
inline |
Method to obtain a view of the segment of another sub-domain on the node.
Non-collective call.
| rank | The rank of the sub-domain. |
Definition at line 112 of file MachineShMemWin.h.
References Arcane::asSpan().
|
inline |
Method to reduce the reserved memory space for the segments to the minimum necessary.
Collective call.
Definition at line 297 of file MachineShMemWin.h.