|
| global_vector () noexcept |
|
| global_vector (size_type count) |
|
| global_vector (size_type count, const value_type &value) |
|
template<typename InputIterator > |
| global_vector (InputIterator first, InputIterator last) |
|
| global_vector (std::initializer_list< T > il) |
|
| global_vector (const global_vector_options &opts) noexcept |
|
| global_vector (const global_vector_options &opts, size_type count) |
|
| global_vector (const global_vector_options &opts, size_type count, const T &value) |
|
template<typename InputIterator , typename = std::enable_if_t<std::is_convertible_v<typename std::iterator_traits<InputIterator>::iterator_category, std::input_iterator_tag>>> |
| global_vector (const global_vector_options &opts, InputIterator first, InputIterator last) |
|
| global_vector (const global_vector_options &opts, std::initializer_list< T > il) |
|
| ~global_vector () |
|
| global_vector (const this_t &other) |
|
this_t & | operator= (const this_t &other) |
|
| global_vector (this_t &&other) noexcept |
|
this_t & | operator= (this_t &&other) noexcept |
|
pointer | data () noexcept |
|
const_pointer | data () const noexcept |
|
size_type | size () const noexcept |
|
size_type | capacity () const noexcept |
|
global_vector_options | options () const noexcept |
|
iterator | begin () noexcept |
|
iterator | end () noexcept |
|
const_iterator | begin () const noexcept |
|
const_iterator | end () const noexcept |
|
const_iterator | cbegin () const noexcept |
|
const_iterator | cend () const noexcept |
|
reverse_iterator | rbegin () const noexcept |
|
reverse_iterator | rend () const noexcept |
|
const_reverse_iterator | rbegin () noexcept |
|
const_reverse_iterator | rend () noexcept |
|
const_reverse_iterator | crbegin () const noexcept |
|
const_reverse_iterator | crend () const noexcept |
|
reference | operator[] (size_type i) |
|
const_reference | operator[] (size_type i) const |
|
reference | at (size_type i) |
|
const_reference | at (size_type i) const |
|
reference | front () |
|
reference | back () |
|
const_reference | front () const |
|
const_reference | back () const |
|
bool | empty () const noexcept |
|
void | swap (this_t &other) noexcept |
|
void | clear () |
|
void | reserve (size_type new_cap) |
|
void | resize (size_type count) |
|
void | resize (size_type count, const value_type &value) |
|
void | push_back (const value_type &value) |
|
void | push_back (value_type &&value) |
|
template<typename... Args> |
reference | emplace_back (Args &&... args) |
|
void | pop_back () |
|
iterator | insert (const_iterator position, const T &x) |
|
iterator | insert (const_iterator position, T &&x) |
|
iterator | insert (const_iterator position, size_type n, const T &x) |
|
template<typename InputIterator , typename = std::enable_if_t<std::is_convertible_v<typename std::iterator_traits<InputIterator>::iterator_category, std::input_iterator_tag>>> |
iterator | insert (const_iterator position, InputIterator first, InputIterator last) |
|
iterator | insert (const_iterator position, std::initializer_list< T > il) |
|
template<typename... Args> |
iterator | emplace (const_iterator position, Args &&... args) |
|
template<typename T>
class ityr::global_vector< T >
Global vector to manage a global memory region.
A global vector is a container for managing a contiguous global memory region. This resembles the standard std::vector
container and has some extensions for global memory.
As a global vector manages global memory, its elements cannot be directly accessed. Access to its elements must be granted by checkout/checkin operations (e.g., ityr::make_checkout()
).
A global vector can accept ityr::global_vector_options
as the first argument when initialized. Global vectors have two types (collective or noncollective), which can be configured with the ityr::global_vector_options::collective
option.
- A collective global vector must be allocated and deallocated by all processes collectively, either in the SPMD region or in the root thread. Its global memory is distributed to the processes by following the memory distribution policy. Some operations that modify the vector capacity (e.g.,
push_back()
) are not permitted in the fork-join region (except for the root thread) for collective global vectors.
- A noncollective global vector can be independently allocated and deallocated in each process. Its memory is allocated in the local process and can be deallocated from any other processes.
Once allocated, both global vectors can be uniformly accessed by global iterators, for example.
Example:
s_coll.begin(), s_coll.end(), v_noncoll.
begin(), 0);
});
Global span to represent a view of a global memory range.
Definition: global_span.hpp:33
Global vector to manage a global memory region.
Definition: global_vector.hpp:129
iterator begin() noexcept
Definition: global_vector.hpp:233
constexpr parallel_policy par
Default parallel execution policy for iterator-based loop functions.
Definition: execution.hpp:89
bool is_spmd()
Return true if the current execution context is within the SPMD region.
Definition: ityr.hpp:143
auto root_exec(Fn &&fn, Args &&... args)
Spawn the root thread (collective).
Definition: root_exec.hpp:47
Reducer::accumulator_type transform_reduce(const ExecutionPolicy &policy, ForwardIterator first, ForwardIterator last, Reducer reducer, UnaryTransformOp unary_transform_op)
Calculate reduction while transforming each element.
Definition: parallel_reduce.hpp:167
In addition, the construction and destruction of vector elements can also be parallelized by setting the ityr::global_vector_options::parallel_construct
and ityr::global_vector_options::parallel_destruct
options. The cutoff count for leaf tasks can be configured by the ityr::global_vector_options::cutoff_count
option. Destruction for elements may be skipped if T
is trivially destructive.
- See also
- std::vector – cppreference.com
-
ityr::global_vector_options
-
ityr::global_span
.