Skip to content

Commit

Permalink
Cleaning up collective operations
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Nov 25, 2023
1 parent d165ef8 commit 24163bb
Show file tree
Hide file tree
Showing 88 changed files with 4,392 additions and 3,217 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ jobs:
-T test \
--no-compress-output \
--output-on-failure \
--tests-regex tests.unit.modules.segmented_algorithms
--tests-regex tests.unit.modules.segmented_algorithms \
- run:
<<: *convert_xml
- run:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux_release_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ jobs:
--output-on-failure \
--tests-regex tests.examples \
--exclude-regex tests.examples.transpose.transpose_block_numa \
--exclude-regex tests.examples.quickstart.hello_world_1 \
--exclude-regex tests.examples.quickstart.distributed.tcp.custom_serialization
3 changes: 3 additions & 0 deletions examples/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ endif()

# TODO: These examples currently fail. Disabled until they are fixed.
set(disabled_tests error_handling fibonacci_await non_atomic_rma zerocopy_rdma)
if(HPX_WITH_STATIC_LINKING)
set(disabled_tests ${disabled_tests} hello_world_1)
endif()

set(1d_wave_equation_FLAGS COMPONENT_DEPENDENCIES iostreams)
set(allow_unknown_options_FLAGS COMPONENT_DEPENDENCIES iostreams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ namespace hpx::parallel::util {
decltype(auto) adapt_thread_priority(
ExPolicy&& policy, hpx::threads::thread_priority new_priority)
{
// clang-format off
constexpr bool supports_priority =
hpx::functional::is_tag_invocable_v<
hpx::execution::experimental::with_priority_t,
std::decay_t<ExPolicy>, hpx::threads::thread_priority>;
// clang-format on

if constexpr (supports_priority)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ set(tests
is_partitioned_range
is_partitioned_projection_range
is_sorted_range
is_sorted_range2
is_sorted_range3
is_sorted_range_exception
is_sorted_until_range
is_sorted_until_range_exception
lexicographical_compare_range
make_heap_range
max_element_range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,145 +44,11 @@ void sorted_test1()
test_sorted1_seq();
}

////////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_sorted2()
{
using namespace hpx::execution;
test_sorted2(seq, IteratorTag());
test_sorted2(par, IteratorTag());
test_sorted2(par_unseq, IteratorTag());

test_sorted2_async(seq(task), IteratorTag());
test_sorted2_async(par(task), IteratorTag());

test_sorted2_seq(IteratorTag());
}

void sorted_test2()
{
test_sorted2<std::random_access_iterator_tag>();
test_sorted2<std::forward_iterator_tag>();

using namespace hpx::execution;

test_sorted2(seq);
test_sorted2(par);
test_sorted2(par_unseq);

test_sorted2_async(seq(task));
test_sorted2_async(par(task));

test_sorted2_seq();
}

////////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_sorted3()
{
using namespace hpx::execution;
test_sorted3(seq, IteratorTag());
test_sorted3(par, IteratorTag());
test_sorted3(par_unseq, IteratorTag());

test_sorted3_async(seq(task), IteratorTag());
test_sorted3_async(par(task), IteratorTag());

test_sorted3_seq(IteratorTag());
}

void sorted_test3()
{
test_sorted3<std::random_access_iterator_tag>();
test_sorted3<std::forward_iterator_tag>();

using namespace hpx::execution;

test_sorted3(seq);
test_sorted3(par);
test_sorted3(par_unseq);

test_sorted3_async(seq(task));
test_sorted3_async(par(task));

test_sorted3_seq();
}

////////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_sorted_exception()
{
using namespace hpx::execution;
//If the execution policy object is of type vector_execution_policy,
// std::terminate shall be called. Therefore we do not test exceptions
// with a vector execution policy
test_sorted_exception(seq, IteratorTag());
test_sorted_exception(par, IteratorTag());

test_sorted_exception_async(seq(task), IteratorTag());
test_sorted_exception_async(par(task), IteratorTag());

test_sorted_exception_seq(IteratorTag());
}

void sorted_exception_test()
{
test_sorted_exception<std::random_access_iterator_tag>();
test_sorted_exception<std::forward_iterator_tag>();

using namespace hpx::execution;

test_sorted_exception(seq);
test_sorted_exception(par);

test_sorted_exception_async(seq(task));
test_sorted_exception_async(par(task));

test_sorted_exception_seq();
}

////////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_sorted_bad_alloc()
{
using namespace hpx::execution;

// If the execution policy object is of type vector_execution_policy,
// std::terminate shall be called. therefore we do not test exceptions
// with a vector execution policy
test_sorted_bad_alloc(par, IteratorTag());
test_sorted_bad_alloc(seq, IteratorTag());

test_sorted_bad_alloc_async(seq(task), IteratorTag());
test_sorted_bad_alloc_async(par(task), IteratorTag());

test_sorted_bad_alloc_seq(IteratorTag());
}

void sorted_bad_alloc_test()
{
test_sorted_bad_alloc<std::random_access_iterator_tag>();
test_sorted_bad_alloc<std::forward_iterator_tag>();

using namespace hpx::execution;

test_sorted_bad_alloc(par);
test_sorted_bad_alloc(seq);

test_sorted_bad_alloc_async(seq(task));
test_sorted_bad_alloc_async(par(task));

test_sorted_bad_alloc_seq();
}

////////////////////////////////////////////////////////////////////////////////
int hpx_main()
{
sorted_test1();
sorted_test2();
sorted_test3();
sorted_exception_test();
sorted_bad_alloc_test();

return hpx::local::finalize();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) 2015 Daniel Bourgeois
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/init.hpp>

#include <iostream>
#include <string>
#include <vector>

#include "is_sorted_range_tests2.hpp"

////////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_sorted2()
{
using namespace hpx::execution;
test_sorted2(seq, IteratorTag());
test_sorted2(par, IteratorTag());
test_sorted2(par_unseq, IteratorTag());

test_sorted2_async(seq(task), IteratorTag());
test_sorted2_async(par(task), IteratorTag());

test_sorted2_seq(IteratorTag());
}

void sorted_test2()
{
test_sorted2<std::random_access_iterator_tag>();
test_sorted2<std::forward_iterator_tag>();

using namespace hpx::execution;

test_sorted2(seq);
test_sorted2(par);
test_sorted2(par_unseq);

test_sorted2_async(seq(task));
test_sorted2_async(par(task));

test_sorted2_seq();
}

////////////////////////////////////////////////////////////////////////////////
int hpx_main()
{
sorted_test2();

return hpx::local::finalize();
}

int main(int argc, char* argv[])
{
using namespace hpx::program_options;
options_description desc_commandline(
"Usage: " HPX_APPLICATION_STRING " [options]");

std::vector<std::string> const cfg = {"hpx.os_threads=all"};

hpx::local::init_params init_args;
init_args.desc_cmdline = desc_commandline;
init_args.cfg = cfg;

HPX_TEST_EQ_MSG(hpx::local::init(hpx_main, argc, argv, init_args), 0,
"HPX main exited with non-zero status");

return hpx::util::report_errors();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) 2015 Daniel Bourgeois
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/init.hpp>

#include <iostream>
#include <string>
#include <vector>

#include "is_sorted_range_tests3.hpp"

////////////////////////////////////////////////////////////////////////////////
template <typename IteratorTag>
void test_sorted3()
{
using namespace hpx::execution;
test_sorted3(seq, IteratorTag());
test_sorted3(par, IteratorTag());
test_sorted3(par_unseq, IteratorTag());

test_sorted3_async(seq(task), IteratorTag());
test_sorted3_async(par(task), IteratorTag());

test_sorted3_seq(IteratorTag());
}

void sorted_test3()
{
test_sorted3<std::random_access_iterator_tag>();
test_sorted3<std::forward_iterator_tag>();

using namespace hpx::execution;

test_sorted3(seq);
test_sorted3(par);
test_sorted3(par_unseq);

test_sorted3_async(seq(task));
test_sorted3_async(par(task));

test_sorted3_seq();
}

////////////////////////////////////////////////////////////////////////////////
int hpx_main()
{
sorted_test3();

return hpx::local::finalize();
}

int main(int argc, char* argv[])
{
using namespace hpx::program_options;
options_description desc_commandline(
"Usage: " HPX_APPLICATION_STRING " [options]");

std::vector<std::string> const cfg = {"hpx.os_threads=all"};

hpx::local::init_params init_args;
init_args.desc_cmdline = desc_commandline;
init_args.cfg = cfg;

HPX_TEST_EQ_MSG(hpx::local::init(hpx_main, argc, argv, init_args), 0,
"HPX main exited with non-zero status");

return hpx::util::report_errors();
}
Loading

0 comments on commit 24163bb

Please sign in to comment.