Class allowing the creation of a shared memory window between the subdomains of the same node. More...
#include <arcane/core/MachineShMemWinBase.h>
Public Member Functions | |
| MachineShMemWinBase (IParallelMng *pm, Int64 sizeof_segment, Int32 sizeof_elem) | |
| 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< std::byte > | segmentView () |
| Method to obtain a view of our segment. | |
| Span< std::byte > | segmentView (Int32 rank) |
| Method to obtain a view of the segment of another subdomain on the node. | |
| Span< const std::byte > | segmentConstView () const |
| Method to obtain a view of our segment. | |
| Span< const std::byte > | segmentConstView (Int32 rank) const |
| Method to obtain a view of the segment of another subdomain on the node. | |
| void | add (Span< const std::byte > elem) |
| Method to add elements into our segment. | |
| void | add () |
| Method to be called by the subdomain(s) that do not wish to add elements to its segment. | |
| void | addToAnotherSegment (Int32 rank, Span< const std::byte > elem) |
| Method to add elements into the segment of another subdomain. | |
| void | addToAnotherSegment () |
| Method to be called by the subdomain(s) that do not wish to add elements into the segment of another subdomain. | |
| void | reserve (Int64 new_nb_elem_segment_capacity) |
| Method to reserve memory space in our segment. | |
| void | reserve () |
| Method to be called by the subdomain(s) that do not wish to reserve more memory for their segments. | |
| void | resize (Int64 new_nb_elem_segment) |
| Method to resize our segment. | |
| void | resize () |
| Method to be called by the subdomain(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 the subdomains of the same node.
The segments of this window are not contiguous in memory and can be resized.
The add() method allows elements to be added iteratively.
Definition at line 52 of file MachineShMemWinBase.h.
| Arcane::MachineShMemWinBase::MachineShMemWinBase | ( | IParallelMng * | pm, |
| Int64 | sizeof_segment, | ||
| Int32 | sizeof_elem ) |
Constructor.
| pm | The parallelMng to use. |
| sizeof_segment | The total size of our segment (in bytes / must be divisible by sizeof_elem). |
| sizeof_elem | The size of an element in our segment (in bytes). |
Definition at line 33 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::add | ( | ) |
Method to be called by the subdomain(s) that do not wish to add elements to its segment.
Collective call.
See the documentation for add(Span<const std::byte> elem).
Definition at line 106 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::add | ( | Span< const std::byte > | elem | ) |
Method to add elements into our segment.
Collective call.
If the segment is too small, it will be resized.
Subdomains 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 97 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::addToAnotherSegment | ( | ) |
Method to be called by the subdomain(s) that do not wish to add elements into the segment of another subdomain.
Collective call.
See the documentation for addToAnotherSegment(Int32 rank, Span<const Type> elem).
Definition at line 124 of file MachineShMemWinBase.cc.
Method to add elements into the segment of another subdomain.
Collective call.
Two subdomains must not add elements to the same subdomain segment.
If the target segment is too small, it will be resized.
Subdomains that do not wish to add elements can call the addToAnotherSegment() method without parameters.
| rank | The rank of the subdomain whose segment is to be modified. |
| elem | The elements to add. |
Definition at line 115 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::barrier | ( | ) | const |
Method to wait until all processes/threads on the node call this method to continue execution.
Definition at line 52 of file MachineShMemWinBase.cc.
| ConstArrayView< Int32 > Arcane::MachineShMemWinBase::machineRanks | ( | ) | const |
Method to obtain the ranks that possess a segment in the window.
Non-collective call.
Definition at line 43 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::reserve | ( | ) |
Method to be called by the subdomain(s) that do not wish to reserve more memory for their segments.
Collective call.
See the documentation for reserve(Int64 new_nb_elem_segment_capacity).
Definition at line 142 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::reserve | ( | Int64 | new_nb_elem_segment_capacity | ) |
Method to reserve memory space in our segment.
Collective call.
This method does nothing if new_capacity is less than the memory space already allocated for the segment. For subdomains that do not wish to increase the available memory space for their segment, it is possible to set the new_capacity parameter 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_nb_elem_segment_capacity | The requested new capacity (in number of elements, not in bytes). |
Definition at line 133 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::resize | ( | ) |
Method to be called by the subdomain(s) that do not wish to resize their segments.
Collective call.
See the documentation for resize(Int64 new_nb_elem_segment).
Definition at line 160 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::resize | ( | Int64 | new_nb_elem_segment | ) |
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 subdomains that do not wish to resize their segment, it is possible to set the new_size argument to -1 or call the method resize() (without arguments).
| new_nb_elem_segment | The new size (in number of elements, not in bytes). |
Definition at line 151 of file MachineShMemWinBase.cc.
| Span< const std::byte > Arcane::MachineShMemWinBase::segmentConstView | ( | ) | const |
Method to obtain a view of our segment.
Non-collective call.
Definition at line 79 of file MachineShMemWinBase.cc.
Method to obtain a view of the segment of another subdomain on the node.
Non-collective call.
| rank | The rank of the subdomain. |
Definition at line 88 of file MachineShMemWinBase.cc.
| Span< std::byte > Arcane::MachineShMemWinBase::segmentView | ( | ) |
Method to obtain a view of our segment.
Non-collective call.
Definition at line 61 of file MachineShMemWinBase.cc.
Method to obtain a view of the segment of another subdomain on the node.
Non-collective call.
| rank | The rank of the subdomain. |
Definition at line 70 of file MachineShMemWinBase.cc.
| void Arcane::MachineShMemWinBase::shrink | ( | ) |
Method to reduce the reserved memory space for the segments to the minimum necessary.
Collective call.
Definition at line 169 of file MachineShMemWinBase.cc.