DASH
0.3.0
|
Functions | |
template<typename GlobIter , typename UnaryPredicate > | |
bool | dash::all_of (GlobIter first, GlobIter last, UnaryPredicate p) |
Check whether all element in the range satisfy predicate p . More... | |
template<typename GlobIter , typename UnaryPredicate > | |
bool | dash::any_of (GlobIter first, GlobIter last, UnaryPredicate p) |
Check whether any element in the range satisfies predicate p . More... | |
template<class LocalInputIter , typename = typename std::enable_if< !dash::detail::is_global_iterator<LocalInputIter>::value >::type> | |
void | dash::broadcast (LocalInputIter in_first, LocalInputIter in_last, dash::team_unit_t root, dash::Team &team=dash::Team::All()) |
Broadcast the local range of elements [in_first , in_last ) from unit root to all other units in team . More... | |
template<class ValueType > | |
ValueType | dash::broadcast (dash::Shared< ValueType > &shared) |
Broadcast the value stored in dash::Shared from the unit owning the value to all other units with access to the shared object. More... | |
template<typename T > | |
void | dash::broadcast (Coarray< T > &coarr, const team_unit_t &root) |
Broadcasts the value on root to all other members of this co_array. More... | |
template<typename ValueType , class InputIt , class OutputIt > | |
OutputIt | dash::copy (InputIt in_first, InputIt in_last, OutputIt out_first) |
Copies the elements in the range, defined by [in_first, in_last), to another range beginning at out_first . More... | |
template<typename ValueType , class GlobInputIt > | |
dash::Future< ValueType * > | dash::copy_async (InputIt in_first, InputIt in_last, OutputIt out_first) |
Asynchronous variant of dash::copy . More... | |
template<typename GlobIter > | |
bool | dash::equal (GlobIter first_1, GlobIter last_1, GlobIter first_2) |
Returns true if the range [first1, last1) is equal to the range [first2, first2 + (last1 - first1)), and false otherwise. More... | |
template<typename GlobIter , class BinaryPredicate > | |
bool | dash::equal (GlobIter first_1, GlobIter last_1, GlobIter first_2, BinaryPredicate) |
Returns true if the range [first1, last1) is equal to the range [first2, first2 + (last1 - first1)) with respect to a specified predicate, and false otherwise. More... | |
template<typename GlobIterType > | |
void | dash::fill (GlobIterType first, GlobIterType last, const typename GlobIterType::value_type &value) |
Assigns the given value to the elements in the range [first, last) More... | |
template<typename GlobIter , typename ElementType > | |
GlobIter | dash::find (GlobIter first, GlobIter last, const ElementType &value) |
Returns an iterator to the first element in the range [first,last) that compares equal to val . More... | |
template<typename GlobIter , typename UnaryPredicate > | |
GlobIter | dash::find_if (GlobIter first, GlobIter last, UnaryPredicate predicate) |
Returns an iterator to the first element in the range [first,last) that satisfies the predicate p . More... | |
template<typename GlobIter , class UnaryPredicate > | |
GlobIter | dash::find_if_not (GlobIter first, GlobIter last, UnaryPredicate predicate) |
Returns an iterator to the first element in the range [first,last) that does not satisfy the predicate p . More... | |
template<typename GlobInputIt , class UnaryFunction > | |
void | dash::for_each (const GlobInputIt &first, const GlobInputIt &last, UnaryFunction func) |
Invoke a function on every element in a range distributed by a pattern. More... | |
template<typename GlobInputIt , class UnaryFunctionWithIndex > | |
void | dash::for_each_with_index (const GlobInputIt &first, const GlobInputIt &last, UnaryFunctionWithIndex func) |
Invoke a function on every element in a range distributed by a pattern. More... | |
template<typename GlobInputIt , class UnaryFunction > | |
void | dash::generate (GlobInputIt first, GlobInputIt last, UnaryFunction gen) |
Assigns each element in range [first, last) a value generated by the given function object g. More... | |
template<typename GlobInputIt , class UnaryFunction > | |
void | dash::generate_with_index (GlobInputIt first, GlobInputIt last, UnaryFunction gen) |
Assigns each element in range [first, last) a value generated by the given function object g. More... | |
template<class GlobInputIter > | |
std::enable_if< !GlobInputIter::has_view::value, LocalIndexRange< typename GlobInputIter::pattern_type::index_type >>::type | dash::local_index_range (const GlobInputIter &first, const GlobInputIter &last) |
Resolves the local index range between global iterators. More... | |
template<class GlobIterType > | |
LocalRange< const typename GlobIterType::value_type > | dash::local_range (const GlobIterType &first, const GlobIterType &last) |
Resolves the local address range between global iterators. More... | |
template<class ElementType , class Compare = std::less<const ElementType &>> | |
const ElementType * | dash::min_element (const ElementType *l_range_begin, const ElementType *l_range_end, Compare compare=std::less< const ElementType &>()) |
Finds an iterator pointing to the element with the smallest value in the range [first,last). More... | |
template<typename GlobInputIt , class Compare = std::less< const typename dash::iterator_traits<GlobInputIt>::value_type &>> | |
GlobInputIt | dash::min_element (const typename std::enable_if< dash::iterator_traits< GlobInputIt >::is_global_iterator::value, GlobInputIt >::type &first, const GlobInputIt &last, Compare compare=Compare()) |
Finds an iterator pointing to the element with the smallest value in the range [first,last). More... | |
template<class GlobIter , class Compare = std::greater<const typename GlobIter::value_type &>> | |
GlobIter | dash::max_element (const GlobIter &first, const GlobIter &last, Compare compare=Compare()) |
Finds an iterator pointing to the element with the greatest value in the range [first,last). More... | |
template<class ElementType , class Compare = std::greater<ElementType &>> | |
const ElementType * | dash::max_element (const ElementType *first, const ElementType *last, Compare compare=Compare()) |
Finds an iterator pointing to the element with the greatest value in the range [first,last). More... | |
template<class LocalInputIter , class InitType , class BinaryOperation = dash::plus<typename std::iterator_traits<LocalInputIter>::value_type>, typename = typename std::enable_if< !dash::detail::is_global_iterator<LocalInputIter>::value >::type> | |
std::iterator_traits< LocalInputIter >::value_type | dash::reduce (LocalInputIter in_first, LocalInputIter in_last, InitType init, BinaryOperation binary_op=BinaryOperation(), bool non_empty=true, dash::Team &team=dash::Team::All()) |
Accumulate values in each process' range [in_first, in_last) using the provided binary reduce function binary_op , which must be commutative and associative. More... | |
template<class LocalInputIter , class InitType = typename std::iterator_traits<LocalInputIter>::value_type, typename = typename std::enable_if< !dash::detail::is_global_iterator<LocalInputIter>::value >::type> | |
std::iterator_traits< LocalInputIter >::value_type | dash::reduce (LocalInputIter in_first, LocalInputIter in_last, InitType init, bool non_empty, dash::Team &team=dash::Team::All()) |
Accumulate values across the local ranges [in_first,in_last) of each process as the sum of all values in the range. More... | |
template<class GlobInputIt , class InitType = typename dash::iterator_traits<GlobInputIt>::value_type, class BinaryOperation = dash::plus<typename dash::iterator_traits<GlobInputIt>::value_type>, typename = typename std::enable_if< dash::detail::is_global_iterator<GlobInputIt>::value >::type> | |
dash::iterator_traits< GlobInputIt >::value_type | dash::reduce (GlobInputIt in_first, GlobInputIt in_last, InitType init, BinaryOperation binary_op=BinaryOperation()) |
Accumulate values in the global range [in_first, in_last) using the provided binary reduce function binary_op , which must be commutative and linear. More... | |
template<class GlobRandomIt > | |
void | dash::sort (GlobRandomIt begin, GlobRandomIt end) |
Sorts the elements in the range, defined by [begin, end) in ascending order. More... | |
template<class GlobRandomIt , class SortableHash > | |
void | dash::sort (GlobRandomIt begin, GlobRandomIt end, SortableHash hash) |
Sorts the elements in the range, defined by [begin, end) in ascending order. More... | |
template<typename ValueType , class InputIt , class OutputIt , class UnaryOperation > | |
OutputIt | dash::transform (InputIt in_first, InputIt in_last, OutputIt out_first, UnaryOperation unary_op) |
Apply a given function to elements in a range and store the result in another range, beginning at out_first . More... | |
template<class InputIt1 , class GlobInputIt , class GlobOutputIt , class BinaryOperation > | |
GlobOutputIt | dash::transform (InputIt1 in_a_first, InputIt1 in_a_last, GlobInputIt in_b_first, GlobOutputIt out_first, BinaryOperation binary_op) |
Apply a given function to pairs of elements from two ranges and store the result in another range, beginning at out_first . More... | |
DASH algorithms library defines functions for a variety of purposes (e.g. searching, sorting, counting, manipulating) that operate on DASH containers.
bool dash::all_of | ( | GlobIter | first, |
GlobIter | last, | ||
UnaryPredicate | p | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/AllOf.h>
Check whether all element in the range satisfy predicate p
.
true
if all elements satisfy p
, false
otherwise.first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
p | Predicate applied to the elements in range [first, last) |
Definition at line 24 of file AllOf.h.
References dash::find_if_not().
bool dash::any_of | ( | GlobIter | first, |
GlobIter | last, | ||
UnaryPredicate | p | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/AnyOf.h>
Check whether any element in the range satisfies predicate p
.
true
if at least one element satisfies p
, false
otherwise.first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
p | Predicate applied to the elements in range [first, last) |
Definition at line 23 of file AnyOf.h.
References dash::find_if().
void dash::broadcast | ( | LocalInputIter | in_first, |
LocalInputIter | in_last, | ||
dash::team_unit_t | root, | ||
dash::Team & | team = dash::Team::All() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Bcast.h>
Broadcast the local range of elements [in_first
, in_last
) from unit root
to all other units in team
.
If the range is not contiguous, a local copy of the data is created, broadcast, and copied into the range on all unit except for root
.
The range has to have the same size on all units.
This operation overwrites the values in the range on all units except for root
.
Collective operation.
in_first | Local iterator describing the beginning of the range to broadcast. |
in_last | Local iterator describing the end of the range to broadcast. |
root | The unit (member of team ) to broadcast the data from. |
team | The team to use for the collective operation. |
Definition at line 95 of file Bcast.h.
References dash::broadcast().
Referenced by dash::broadcast().
ValueType dash::broadcast | ( | dash::Shared< ValueType > & | shared | ) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Bcast.h>
Broadcast the value stored in dash::Shared from the unit owning the value to all other units with access to the shared object.
Collective operation.
dash::Shared
instance individually.shared | Instance of dash::Shared from which the value is broadcast to all units in the team that created the shared object. |
Definition at line 124 of file Bcast.h.
References dash::broadcast(), dash::Shared< ElementType >::local(), dash::Shared< ElementType >::owner(), dash::Shared< ElementType >::team(), and dash::ValueType.
void dash::broadcast | ( | Coarray< T > & | coarr, |
const team_unit_t & | root | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Bcast.h>
Broadcasts the value on root
to all other members of this co_array.
This is a wrapper for dash::coarray::cobroadcast.
Collective operation.
coarr | coarray which should be broadcasted |
master | the value of this unit will be broadcastet |
Definition at line 152 of file Bcast.h.
References dash::coarray::cobroadcast().
Referenced by dash::broadcast().
OutputIt dash::copy | ( | InputIt | in_first, |
InputIt | in_last, | ||
OutputIt | out_first | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Copy.h>
Copies the elements in the range, defined by [in_first, in_last), to another range beginning at
out_first
.
In terms of data distribution, source and destination ranges passed to dash::copy
can be local (*ValueType
) or global (GlobIter<ValueType>
).
For a non-blocking variant of dash::copy
, see dash::copy_async
.
Example:
Referenced by dash::summa().
dash::Future<ValueType *> dash::copy_async | ( | InputIt | in_first, |
InputIt | in_last, | ||
OutputIt | out_first | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Copy.h>
Asynchronous variant of dash::copy
.
Copies the elements in the range, defined by [in_first, in_last), to another range beginning at
out_first
.
In terms of data distribution, source and destination ranges passed to dash::copy
can be local (*ValueType
) or global (GlobIter<ValueType>
).
For a blocking variant of dash::copy_async
, see dash::copy
.
Example:
dash::Future
providing the output range end iterator that is created on completion of the asynchronous copy operation. Referenced by dash::summa().
bool dash::equal | ( | GlobIter | first_1, |
GlobIter | last_1, | ||
GlobIter | first_2 | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Equal.h>
Returns true if the range [first1, last1) is equal to the range
[first2, first2 + (last1 - first1)), and false otherwise.
first_1 | Iterator to the initial position in the sequence |
last_1 | Iterator to the final position in the sequence |
Definition at line 51 of file Equal.h.
References dart_allreduce(), DART_OK, DART_OP_BAND, DART_TYPE_BYTE, dash::distance(), dash::GlobIter< ElementType, PatternType, GlobMemType, PointerType, ReferenceType >::local(), dash::local_range(), and dash::myid().
bool dash::equal | ( | GlobIter | first_1, |
GlobIter | last_1, | ||
GlobIter | first_2, | ||
BinaryPredicate | |||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Equal.h>
Returns true if the range [first1, last1) is equal to the range
[first2, first2 + (last1 - first1)) with respect to a specified predicate, and false otherwise.
first_1 | Iterator to the initial position in the sequence |
last_1 | Iterator to the final position in the sequence |
Definition at line 100 of file Equal.h.
References dart_allreduce(), DART_OK, DART_OP_BAND, DART_TYPE_BYTE, dash::distance(), dash::GlobIter< ElementType, PatternType, GlobMemType, PointerType, ReferenceType >::local(), dash::local_range(), and dash::myid().
void dash::fill | ( | GlobIterType | first, |
GlobIterType | last, | ||
const typename GlobIterType::value_type & | value | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Fill.h>
Assigns the given value to the elements in the range [first, last)
Being a collaborative operation, each unit will assign the value to its local elements only.
ElementType | Type of the elements in the sequence |
d
dimensions in the global iterators' pattern and nl
local elements within the global range first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
value | Value which will be assigned to the elements in range [first, last) |
Definition at line 35 of file Fill.h.
References dash::local_range(), and dash::util::UnitLocality::num_domain_threads().
Referenced by dash::halo::HaloMemory< HaloBlock_t >::HaloMemory(), and dash::Coevent::initialize().
GlobIter dash::find | ( | GlobIter | first, |
GlobIter | last, | ||
const ElementType & | value | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Find.h>
Returns an iterator to the first element in the range [first,last) that compares equal to
val
.
If no such element is found, the function returns last
.
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
value | Value which is searched for using operator== |
Definition at line 22 of file Find.h.
References dart_allreduce(), DART_OK, DART_OP_MIN, dash::local_begin(), dash::local_index_range(), and dash::GlobIter< ElementType, PatternType, GlobMemType, PointerType, ReferenceType >::pos().
Referenced by dash::util::LocalityDomain::leader_unit(), and dash::coarray::sync_images().
GlobIter dash::find_if | ( | GlobIter | first, |
GlobIter | last, | ||
UnaryPredicate | predicate | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Find.h>
Returns an iterator to the first element in the range [first,last) that satisfies the predicate
p
.
If no such element is found, the function returns last
.
Global iterators to local range:
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
predicate | Predicate which will be applied to the elements in range [first, last) |
Definition at line 104 of file Find.h.
References dash::distance(), dash::Array< ElementType, IndexType, PatternType, LocalMemSpaceT >::local, dash::local_range(), dash::myid(), and dash::GlobIter< ElementType, PatternType, GlobMemType, PointerType, ReferenceType >::pos().
Referenced by dash::any_of(), dash::EpochSynchronizedAllocator< ElementType, LMemSpace, AllocationPolicy, LocalAlloc >::deallocate(), dash::find_if_not(), dash::GlobLocalMemoryPool< dash::HostSpace >::flush_local(), and dash::EpochSynchronizedAllocator< ElementType, LMemSpace, AllocationPolicy, LocalAlloc >::get_local_allocator().
GlobIter dash::find_if_not | ( | GlobIter | first, |
GlobIter | last, | ||
UnaryPredicate | predicate | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Find.h>
Returns an iterator to the first element in the range [first,last) that does not satisfy the predicate
p
.
If no such element is found, the function returns last
.
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
predicate | Predicate which will be applied to the elements in range [first, last) |
Definition at line 160 of file Find.h.
References dash::find_if().
Referenced by dash::all_of().
void dash::for_each | ( | const GlobInputIt & | first, |
const GlobInputIt & | last, | ||
UnaryFunction | func | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/ForEach.h>
Invoke a function on every element in a range distributed by a pattern.
This function has the same signature as std::for_each
but Being a collaborative operation, each unit will invoke the given function on its local elements only. To support compiler optimization, this const version is provided
GlobIter | Global Iterator to iterate the sequence |
UnaryFunction | Function to invoke for each element in the specified range with signature (void (const ElementType &)). Signature does not need to have (const &) but must be compatible to std::for_each . |
d
dimensions in the global iterators' pattern and nl
local elements within the global range Global iterators to local index range:
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
func | Function to invoke on every index in the range |
Definition at line 32 of file ForEach.h.
References dash::local(), and dash::local_index_range().
Referenced by dash::coarray::sync_images(), and dash::io::hdf5::StoreHDF::write().
void dash::for_each_with_index | ( | const GlobInputIt & | first, |
const GlobInputIt & | last, | ||
UnaryFunctionWithIndex | func | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/ForEach.h>
Invoke a function on every element in a range distributed by a pattern.
Being a collaborative operation, each unit will invoke the given function on its local elements only. The index passed to the function is a global index.
GlobIter | Global Iterator to iterate the sequence |
UnaryFunctionWithIndex | Function to invoke for each element in the specified range with signature void (const ElementType &, index_t) Signature does not need to have (const &) but must be compatible to std::for_each . |
d
dimensions in the global iterators' pattern and nl
local elements within the global range Global iterators to local index range:
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
func | Function to invoke on every index in the range |
Definition at line 80 of file ForEach.h.
References dash::local_index_range().
void dash::generate | ( | GlobInputIt | first, |
GlobInputIt | last, | ||
UnaryFunction | gen | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Generate.h>
Assigns each element in range [first, last) a value generated by the given function object g.
Being a collaborative operation, each unit will invoke the given function on its local elements only.
ElementType | Type of the elements in the sequence invoke, deduced from parameter gen |
UnaryFunction | Unary function with signature ElementType(void) |
d
dimensions in the global iterators' pattern and nl
local elements within the global range Global iterators to local range:
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
gen | Generator function |
Definition at line 32 of file Generate.h.
References dash::local_range().
void dash::generate_with_index | ( | GlobInputIt | first, |
GlobInputIt | last, | ||
UnaryFunction | gen | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Generate.h>
Assigns each element in range [first, last) a value generated by the given function object g.
The index passed to the function is a global index.
Being a collaborative operation, each unit will invoke the given function on its local elements only.
ElementType | Type of the elements in the sequence invoke, deduced from parameter gen |
UnaryFunction | Unary function with signature ElementType(index_t) |
d
dimensions in the global iterators' pattern and nl
local elements within the global range Global iterators to local index range:
first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
gen | Generator function |
Definition at line 71 of file Generate.h.
References dash::local_index_range().
std::enable_if< !GlobInputIter::has_view::value, LocalIndexRange<typename GlobInputIter::pattern_type::index_type>>::type dash::local_index_range | ( | const GlobInputIter & | first, |
const GlobInputIter & | last | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/LocalRange.h>
Resolves the local index range between global iterators.
Example:
Total range | 0 1 2 3 4 5 6 7 8 9 |
---|---|
Global iterators | first = 4; last = 7; |
0 1 2 3 [4 5 6 7] 8 9] | |
Local elements | (local index:value) 0:2 1:3 2:6 3:7 |
Result | (local indices) 2 3 |
ElementType | Type of the elements in the sequence |
PatternType | Type of the global iterators' pattern implementation |
d
dimensions in the global iterators' pattern first | Iterator to the initial position in the global sequence |
last | Iterator to the final position in the global sequence |
Definition at line 101 of file LocalRange.h.
Referenced by dash::find(), dash::for_each(), dash::for_each_with_index(), dash::generate_with_index(), dash::local_range(), and dash::min_element().
LocalRange<const typename GlobIterType::value_type> dash::local_range | ( | const GlobIterType & | first, |
const GlobIterType & | last | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/LocalRange.h>
Resolves the local address range between global iterators.
Total range | a b c d e f g h i j |
---|---|
Global iterators | first = b; last = i; |
| a b [c d e f g h] i j]
Local elements | a b d e
Result | d e
d
dimensions in the global iterators' pattern first | Iterator to the initial position in the global sequence |
last | Iterator to the final position in the global sequence |
Definition at line 295 of file LocalRange.h.
References dash::local_begin(), and dash::local_index_range().
Referenced by dash::equal(), dash::fill(), dash::find_if(), dash::generate(), and dash::reduce().
GlobIter dash::max_element | ( | const GlobIter & | first, |
const GlobIter & | last, | ||
Compare | compare = Compare() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/MinMax.h>
Finds an iterator pointing to the element with the greatest value in the range [first,last).
last
if the range is empty.ElementType | Type of the elements in the sequence |
Compare | Binary comparison function with signature bool (const TypeA &a, const TypeB &b) |
d
dimensions in the global iterators' pattern and nl
local elements within the global range first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
compare | Element comparison function, defaults to std::less |
Definition at line 332 of file MinMax.h.
References dash::min_element().
Referenced by dash::LoadBalancePattern< 1, CompBasedMeasure, MemBasedMeasure, Arrangement, IndexType >::ndim(), dash::CSRPattern< 1, Arrangement, IndexType >::ndim(), and dash::DynamicPattern< 1, Arrangement, IndexType >::ndim().
const ElementType* dash::max_element | ( | const ElementType * | first, |
const ElementType * | last, | ||
Compare | compare = Compare() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/MinMax.h>
Finds an iterator pointing to the element with the greatest value in the range [first,last).
Specialization for local range, delegates to std::min_element.
last
if the range is empty.ElementType | Type of the elements in the sequence |
Compare | Binary comparison function with signature bool (const TypeA &a, const TypeB &b) |
d
dimensions in the global iterators' pattern and nl
local elements within the global range first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
compare | Element comparison function, defaults to std::less |
Definition at line 362 of file MinMax.h.
References dash::min_element().
const ElementType* dash::min_element | ( | const ElementType * | l_range_begin, |
const ElementType * | l_range_end, | ||
Compare | compare = std::less<const ElementType &>() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/MinMax.h>
Finds an iterator pointing to the element with the smallest value in the range [first,last).
Specialization for local range, delegates to std::min_element.
last
if the range is empty.ElementType | Type of the elements in the sequence |
Compare | Binary comparison function with signature bool (const TypeA &a, const TypeB &b) |
d
dimensions in the global iterators' pattern and nl
local elements within the global range l_range_begin | Iterator to the initial position in the sequence |
l_range_end | Iterator to the final position in the sequence |
compare | Element comparison function, defaults to std::less |
Definition at line 47 of file MinMax.h.
References dash::min_element(), and dash::util::UnitLocality::num_domain_threads().
Referenced by dash::max_element(), and dash::min_element().
GlobInputIt dash::min_element | ( | const typename std::enable_if< dash::iterator_traits< GlobInputIt >::is_global_iterator::value, GlobInputIt >::type & | first, |
const GlobInputIt & | last, | ||
Compare | compare = Compare() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/MinMax.h>
Finds an iterator pointing to the element with the smallest value in the range [first,last).
last
if the range is empty.ElementType | Type of the elements in the sequence |
Compare | Binary comparison function with signature bool (const TypeA &a, const TypeB &b) |
d
dimensions in the global iterators' pattern and nl
local elements within the global range first | Iterator to the initial position in the sequence |
last | Iterator to the final position in the sequence |
compare | Element comparison function, defaults to std::less |
Definition at line 161 of file MinMax.h.
References dart_allgather(), DART_OK, DART_TYPE_BYTE, dash::local_begin(), dash::local_index_range(), and dash::min_element().
Referenced by dash::min_element().
std::iterator_traits<LocalInputIter>::value_type dash::reduce | ( | LocalInputIter | in_first, |
LocalInputIter | in_last, | ||
InitType | init, | ||
BinaryOperation | binary_op = BinaryOperation() , |
||
bool | non_empty = true , |
||
dash::Team & | team = dash::Team::All() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Reduce.h>
Accumulate values in each process' range [in_first, in_last) using the provided binary reduce function binary_op
, which must be commutative and associative.
The iteration order is not specified and the result is non-deterministic if binary_op
is not commutative and associative.
The result type is determined by the type of the elements in the range and the value of init
is cast to this type.
Collective operation.
in_first | Local iterator describing the beginning of the range to reduce. |
in_last | Local iterator describing the end of the range to accumualte |
init | The initial element to use in the accumulation. |
binary_op | The binary operation to apply to reduce two elements (default: using dash::plus) |
non_empty | Whether all units are guaranteed to provide a non-empty local range (default false ). |
team | The team to use for the collective operation. |
Definition at line 79 of file Reduce.h.
References DART_OP_UNDEFINED, and dash::myid().
Referenced by dash::reduce().
std::iterator_traits<LocalInputIter>::value_type dash::reduce | ( | LocalInputIter | in_first, |
LocalInputIter | in_last, | ||
InitType | init, | ||
bool | non_empty, | ||
dash::Team & | team = dash::Team::All() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Reduce.h>
Accumulate values across the local ranges [in_first,in_last) of each process as the sum of all values in the range.
The iteration order is not specified. The reduction is performed using dash::plus.
The result type is determined by the type of the elements in the range and the value of init
is cast to this type.
MPI_Accumulate
, see dash::transform.in_first | Local pointer describing the beginning of the range to reduce. |
in_last | Local pointer describing the end of the range to accumualte |
init | The initial element to use in the accumulation. |
non_empty | Whether all units are guaranteed to provide a non-empty local range (default false ). |
team | The team to use for the collective operation. |
Definition at line 162 of file Reduce.h.
References dash::reduce().
dash::iterator_traits<GlobInputIt>::value_type dash::reduce | ( | GlobInputIt | in_first, |
GlobInputIt | in_last, | ||
InitType | init, | ||
BinaryOperation | binary_op = BinaryOperation() |
||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Reduce.h>
Accumulate values in the global range [in_first, in_last) using the provided binary reduce function binary_op
, which must be commutative and linear.
The iteration order is not specified and the result is non-deterministic if binary_op
is not commutative and associative.
The result type is determined by the type of the elements in the range and the value of init
is cast to this type.
Collective operation.
in_first | Global iterator describing the beginning of the range to reduce. |
in_last | Global iterator describing the end of the range to accumualte |
init | The initial element to use in the accumulation. |
binary_op | The associative, commutative binary operation to apply. |
MPI_Accumulate
, see dash::transform. Definition at line 212 of file Reduce.h.
References dash::local_range(), and dash::reduce().
void dash::sort | ( | GlobRandomIt | begin, |
GlobRandomIt | end | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Sort.h>
Sorts the elements in the range, defined by [begin, end) in ascending order.
The order of equal elements is not guaranteed to be preserved.
Elements are sorted using operator<. Additionally, the elements must be arithmetic, i.e. std::is_arithmetic<T> must be satisfied.
In terms of data distribution, source and destination ranges passed to dash::sort
must be global (GlobIter<ValueType>
).
The operation is collective among the team of the owning dash container.
Example:
void dash::sort | ( | GlobRandomIt | begin, |
GlobRandomIt | end, | ||
SortableHash | hash | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Sort.h>
Sorts the elements in the range, defined by [begin, end) in ascending order.
The order of equal elements is not guaranteed to be preserved.
Elements are sorted by using a user-defined hash function. Resulting values of the hash function are required to be sortable by operator<.
This variant may be appropriate if the underlying container does not hold arithmetic values (e.g. structs).
In terms of data distribution, source and destination ranges passed to dash::sort
must be global (GlobIter<ValueType>
).
The operation is collective among the team of the owning dash container.
Example:
OutputIt dash::transform | ( | InputIt | in_first, |
InputIt | in_last, | ||
OutputIt | out_first, | ||
UnaryOperation | unary_op | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Transform.h>
Apply a given function to elements in a range and store the result in another range, beginning at out_first
.
Corresponding to MPI_Accumulate
, the unary operation is executed atomically on single elements.
Precondition: All elements in the input range are contained in a single block so that
g_out_last == g_out_first + (l_in_last - l_in_first)
Semantics:
unary_op(in_first[0]), unary_op(in_first[1]), ..., unary_op(in_first[n])
Referenced by dash::LoadBalancePattern< 1, CompBasedMeasure, MemBasedMeasure, Arrangement, IndexType >::ndim(), and dash::UnitClockFreqMeasure::unit_weights().
GlobOutputIt dash::transform | ( | InputIt1 | in_a_first, |
InputIt1 | in_a_last, | ||
GlobInputIt | in_b_first, | ||
GlobOutputIt | out_first, | ||
BinaryOperation | binary_op | ||
) |
#include </tmp/tmporruphar/dash/include/dash/algorithm/Transform.h>
Apply a given function to pairs of elements from two ranges and store the result in another range, beginning at out_first
.
Corresponding to MPI_Accumulate
, the binary operation is executed atomically on single elements.
Precondition: All elements in the input range are contained in a single block so that
g_out_last == g_out_first + (l_in_last - l_in_first)
Semantics:
binary_op(in_a[0], in_b[0]), binary_op(in_a[1], in_b[1]), ..., binary_op(in_a[n], in_b[n])
Example:
InputIt | Iterator on first (local) input range |
GlobInputIt | Iterator on second (global) input range |
GlobOutputIt | Iterator on global result range |
BinaryOperation | Reduce operation type |
in_a_first | Iterator on begin of first local range |
in_a_last | Iterator after last element of local range |
in_b_first | Iterator on begin of second local range |
out_first | Iterator on first element of global output range |
binary_op | Reduce operation |