19 std::ostream & operator<<(std::ostream & os,
const test_t & test)
21 std::ostringstream ss;
22 ss <<
"test_t(a:" << test.a <<
" b:" << test.b <<
")";
23 return operator<<(os, ss.str());
26 int main(
int argc,
char * argv[])
32 cout <<
"Unit " <<
dash::myid() <<
" PID: " << getpid()
37 for (
auto i = 0; i < arr.
size(); i++ ) {
44 cout <<
"dash::min_element on dash::Array<int>" << endl;
48 auto it = arr.
begin();
49 while (it != arr.
end()) {
53 ss <<
"Min: " << (int)(*min) << endl;
60 for (
auto & el : arr2.
local) {
61 el = {rand() % 100, 23.3};
66 cout <<
"dash::min_element on dash::Array<test_t>" << endl;
82 cout <<
"Min. test_t: " << ((
test_t)*min).a
global_unit_t myid()
Shortcut to query the global unit ID of the calling unit.
iterator end() noexcept
Global pointer to the end of the array.
void finalize()
Finalize the DASH library and the underlying runtime system.
const ElementType * 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).
constexpr size_type size() const noexcept
The size of the array.
void barrier() const
Establish a barrier for all units operating on the array, publishing all changes to all units...
see https://en.cppreference.com/w/cpp/feature_test for recommended feature tests
void init(int *argc, char ***argv)
Initialize the DASH library and the underlying runtime system.
iterator begin() noexcept
Global pointer to the beginning of the array.
local_type local
Local proxy object, allows use in range-based for loops.