From 0c0b0c2fc0450834f363c56fc99a18205b8a73a9 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 25 Nov 2024 10:25:39 -0600 Subject: [PATCH] Accommodate for CircleCI reduce available number of cores to two --- .circleci/config.yml | 3 ++- .../compute_local/tests/regressions/parallel_fill_4132.cpp | 2 +- libs/core/concurrency/tests/unit/contiguous_index_queue.cpp | 6 ++++-- .../concurrency/tests/unit/non_contiguous_index_queue.cpp | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a16f9e14a814..b55732074951 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -249,7 +249,8 @@ jobs: -DCMAKE_EXPORT_COMPILE_COMMANDS=On \ -DHPX_WITH_DOCUMENTATION=On \ -DHPX_WITH_DOCUMENTATION_OUTPUT_FORMATS="${DOCUMENTATION_OUTPUT_FORMATS}" \ - -DHPX_WITH_TESTS_COMMAND_LINE=--hpx:queuing=local-workrequesting-fifo + -DHPX_WITH_TESTS_COMMAND_LINE=--hpx:queuing=local-workrequesting-fifo \ + -DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 - persist_to_workspace: root: /hpx paths: diff --git a/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp b/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp index 215d1332201d..69eb1ddd74cf 100644 --- a/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp +++ b/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp @@ -17,7 +17,7 @@ int hpx_main() { std::size_t const max_targets = - (std::min)(hpx::get_num_worker_threads(), std::size_t(10)); + (std::min)(2 * hpx::get_num_worker_threads(), std::size_t(10)); ; auto targets = hpx::compute::host::get_local_targets(); diff --git a/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp b/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp index 3bda97b432e5..5e44a4a44937 100644 --- a/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp +++ b/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp @@ -143,9 +143,11 @@ void test_concurrent(pop_mode m) std::uint32_t last = 732100; hpx::concurrency::detail::contiguous_index_queue<> q{first, last}; - std::size_t const num_threads = hpx::get_num_worker_threads(); + std::size_t const num_threads = 2 * hpx::get_num_worker_threads(); + // This test should be run on at least two worker threads. - HPX_TEST_LTE(std::size_t(2), num_threads); + HPX_TEST_LTE(std::size_t(4), num_threads); + std::vector> fs; std::vector> popped_indices(num_threads); fs.reserve(num_threads); diff --git a/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp b/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp index 0f3280bca64e..0566c5516129 100644 --- a/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp +++ b/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp @@ -153,10 +153,10 @@ void test_concurrent(pop_mode m) std::uint32_t step = 7; hpx::concurrency::detail::non_contiguous_index_queue<> q{first, last, step}; - std::size_t const num_threads = hpx::get_num_worker_threads(); + std::size_t const num_threads = 2 * hpx::get_num_worker_threads(); // This test should be run on at least two worker threads. - HPX_TEST_LTE(std::size_t(2), num_threads); + HPX_TEST_LTE(std::size_t(4), num_threads); std::vector> fs; std::vector> popped_indices(num_threads);