Skip to content

Commit

Permalink
Accommodate for CircleCI reduce available number of cores to two
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Dec 2, 2024
1 parent f711e41 commit 003d584
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 4 additions & 2 deletions libs/core/concurrency/tests/unit/contiguous_index_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<hpx::future<void>> fs;
std::vector<std::vector<std::uint32_t>> popped_indices(num_threads);
fs.reserve(num_threads);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<hpx::future<void>> fs;
std::vector<std::vector<std::uint32_t>> popped_indices(num_threads);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int main(int argc, char* argv[])
// clang-format off
cmdline.add_options()
("test-runs"
, value<std::uint64_t>()->default_value(1000)
, value<std::uint64_t>()->default_value(100)
, "number of times to repeat the test (0 == infinite)")

("verbose"
Expand All @@ -174,7 +174,7 @@ int main(int argc, char* argv[])
, "depth of the tree structure")

("delay-iterations"
, value<std::uint64_t>()->default_value(1000)
, value<std::uint64_t>()->default_value(100)
, "number of iterations in the delay loop");
// clang-format on

Expand Down

0 comments on commit 003d584

Please sign in to comment.