Skip to content

Commit

Permalink
Moving most of APIs from hpx::parallel::execution to hpx::execution::…
Browse files Browse the repository at this point in the history
…experimental
  • Loading branch information
hkaiser committed Nov 8, 2024
1 parent 342d373 commit dc4175c
Show file tree
Hide file tree
Showing 91 changed files with 1,674 additions and 1,530 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ With ``executor_parameter_traits``, clients access all types of executor
parameters uniformly, e.g.::

std::size_t chunk_size =
hpx::execution::get_chunk_size(my_parameter, my_executor,
hpx::execution::experimental::get_chunk_size(my_parameter, my_executor,
num_cores, num_tasks);

This call synchronously retrieves the size of a single chunk of loop iterations
Expand Down
3 changes: 2 additions & 1 deletion docs/sphinx/releases.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
..
Copyright (C) 2018-2023 STE||AR Group
Copyright (C) 2018-2024 STE||AR Group
SPDX-License-Identifier: BSL-1.0
Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -17,6 +17,7 @@ List of releases
.. toctree::
:maxdepth: 1

releases/whats_new_1_11_0
releases/whats_new_1_10_0
releases/whats_new_1_9_1
releases/whats_new_1_9_0
Expand Down
31 changes: 31 additions & 0 deletions docs/sphinx/releases/whats_new_1_11_0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
..
Copyright (C) 2007-2024 Hartmut Kaiser
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)

.. _hpx_1_11_0:

============================
|hpx| V1.11.0 (TBA)
============================

General changes
===============

Breaking changes
================

- We have moved most of the APIs that were defined in the namespace
``hpx::parallel::execution`` to the namespace ``hpx::execution::experimental``.
It was not possible to add compatibility facilities that will allow to continue
using the old APIs, applications will have to be changed in order to
continue functioning correctly.

Closed issues
=============

Closed pull requests
====================

4 changes: 2 additions & 2 deletions examples/async_io/async_io_action.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2013 Hartmut Kaiser
// Copyright (c) 2007-2024 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -42,7 +42,7 @@ namespace detail {
std::make_shared<hpx::promise<int>>();

// Get a reference to one of the IO specific HPX io_service objects ...
hpx::parallel::execution::io_pool_executor executor;
hpx::execution::experimental::io_pool_executor executor;

// ... and schedule the handler to run on one of its OS-threads.
hpx::post(executor, &do_async_io, string_to_write, p);
Expand Down
4 changes: 2 additions & 2 deletions examples/async_io/async_io_simple.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2013 Hartmut Kaiser
// Copyright (c) 2007-2024 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -34,7 +34,7 @@ int async_io(char const* string_to_write)

{
// Get a reference to one of the IO specific HPX io_service objects ...
hpx::parallel::execution::io_pool_executor executor;
hpx::execution::experimental::io_pool_executor executor;

// ... and schedule the handler to run on one of its OS-threads.
hpx::async(executor, &do_async_io, string_to_write, std::ref(result))
Expand Down
5 changes: 3 additions & 2 deletions examples/qt/qt.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2014 Thomas Heller
// Copyright (c) 2012-2024 Thomas Heller
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -59,7 +59,8 @@ int hpx_main(int argc, char* argv[])
{
{
// Get a reference to one of the main thread
hpx::parallel::execution::main_pool_executor scheduler;
hpx::execution::experimental::main_pool_executor scheduler;

// run an async function on the main thread to start the Qt application
hpx::future<void> qt_application =
hpx::async(scheduler, qt_main, argc, argv);
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart/simple_future_continuation.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2017 Hartmut Kaiser
// Copyright (c) 2007-2024 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -58,7 +58,7 @@ int hpx_main()

// executing continuation cont2 on UI (main) thread
{
hpx::parallel::execution::main_pool_executor exec;
hpx::execution::experimental::main_pool_executor exec;
hpx::future<int> t = hpx::async(&func1);
hpx::future<int> t2 = t.then(exec, &cont2);
t2.get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2023 Hartmut Kaiser
// Copyright (c) 2007-2024 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -114,9 +114,10 @@ namespace hpx::parallel::detail {

using buffer_type = typename set_operations_buffer<Iter3>::type;

std::size_t cores = execution::processing_units_count(
policy.parameters(), policy.executor(), hpx::chrono::null_duration,
(std::min)(len1, len2));
std::size_t cores =
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, (std::min)(len1, len2));

std::size_t const step = (len1 + cores - 1) / cores;

Expand Down
17 changes: 10 additions & 7 deletions libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,22 +369,25 @@ namespace hpx::parallel {
};

std::size_t const cores =
execution::processing_units_count(policy.parameters(),
policy.executor(), hpx::chrono::null_duration, n);
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, n);

// Take a standard chunk size (amount of work / cores), and only
// take a quarter of that. If our chunk size is too large a LOT
// of the work will be done sequentially due to the level
// barrier of heap parallelism. 1/4 of the standard chunk size
// is an estimate to lower the average number of levels done
// sequentially
std::size_t chunk_size = execution::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, n);
std::size_t chunk_size =
hpx::execution::experimental::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, n);
chunk_size /= 4;

std::size_t max_chunks = execution::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores, n);
std::size_t max_chunks =
hpx::execution::experimental::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores, n);

util::detail::adjust_chunk_size_and_max_chunks(
cores, n, chunk_size, max_chunks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,15 @@ namespace hpx::parallel {
{
// figure out the chunk size to use
std::size_t const cores =
execution::processing_units_count(policy.parameters(),
policy.executor(), hpx::chrono::null_duration, nelem);
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, nelem);

// number of elements to sort
std::size_t chunk_size = execution::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, nelem);
std::size_t chunk_size =
hpx::execution::experimental::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, nelem);

hpx::future<Iter> left = execution::async_execute(
policy.executor(), sort_thread_helper(), policy, first,
Expand Down
29 changes: 15 additions & 14 deletions libs/core/algorithms/include/hpx/parallel/algorithms/partition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,19 +670,19 @@ namespace hpx::parallel {
}
else
{
std::size_t const cores =
execution::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, size);
std::size_t const cores = hpx::execution::experimental::
processing_units_count(policy.parameters(),
policy.executor(), hpx::chrono::null_duration,
size);

std::size_t chunk_size = execution::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, size);
std::size_t chunk_size =
hpx::execution::experimental::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, size);

std::size_t max_chunks =
execution::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores,
size);
std::size_t max_chunks = hpx::execution::experimental::
maximal_number_of_chunks(policy.parameters(),
policy.executor(), cores, size);

util::detail::adjust_chunk_size_and_max_chunks(
cores, size, chunk_size, max_chunks);
Expand Down Expand Up @@ -1341,9 +1341,10 @@ namespace hpx::parallel {
if (first == last)
return first;

std::size_t const cores = execution::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, std::distance(first, last));
std::size_t const cores =
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, std::distance(first, last));

// TODO: Find better block size.
constexpr std::size_t block_size =
Expand Down
20 changes: 11 additions & 9 deletions libs/core/algorithms/include/hpx/parallel/algorithms/rotate.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2023 Hartmut Kaiser
// Copyright (c) 2007-2024 Hartmut Kaiser
// Copyright (c) 2021-2022 Chuanqiu He
//
// SPDX-License-Identifier: BSL-1.0
Expand Down Expand Up @@ -225,9 +225,9 @@ namespace hpx::parallel {

// get number of cores currently used
std::size_t const cores =
parallel::execution::processing_units_count(policy.parameters(),
policy.executor(), hpx::chrono::null_duration,
size_left + size_right);
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, size_left + size_right);

// get currently used first core
std::size_t first_core =
Expand Down Expand Up @@ -257,11 +257,13 @@ namespace hpx::parallel {
auto p = policy(hpx::execution::task);

auto left_policy =
execution::with_processing_units_count(p, cores_left);
auto right_policy = execution::with_processing_units_count(
hpx::execution::experimental::with_first_core(
p, cores == 1 ? first_core : first_core + cores_left),
cores_right);
hpx::execution::experimental::with_processing_units_count(
p, cores_left);
auto right_policy =
hpx::execution::experimental::with_processing_units_count(
hpx::execution::experimental::with_first_core(
p, cores == 1 ? first_core : first_core + cores_left),
cores_right);

detail::reverse<FwdIter> r;

Expand Down
21 changes: 12 additions & 9 deletions libs/core/algorithms/include/hpx/parallel/algorithms/sort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,18 @@ namespace hpx::parallel {

// figure out the chunk size to use
std::size_t const cores =
execution::processing_units_count(policy.parameters(),
policy.executor(), hpx::chrono::null_duration, count);

std::size_t max_chunks = execution::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores, count);

std::size_t chunk_size = execution::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, count);
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, count);

std::size_t max_chunks =
hpx::execution::experimental::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores, count);

std::size_t chunk_size =
hpx::execution::experimental::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, count);

util::detail::adjust_chunk_size_and_max_chunks(
cores, count, max_chunks, chunk_size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,18 @@ namespace hpx::parallel {

// figure out the chunk size to use
std::size_t cores =
execution::processing_units_count(policy.parameters(),
policy.executor(), hpx::chrono::null_duration, count);

std::size_t max_chunks = execution::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores, count);

std::size_t chunk_size = execution::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, count);
hpx::execution::experimental::processing_units_count(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, count);

std::size_t max_chunks =
hpx::execution::experimental::maximal_number_of_chunks(
policy.parameters(), policy.executor(), cores, count);

std::size_t chunk_size =
hpx::execution::experimental::get_chunk_size(
policy.parameters(), policy.executor(),
hpx::chrono::null_duration, cores, count);

util::detail::adjust_chunk_size_and_max_chunks(
cores, count, max_chunks, chunk_size);
Expand Down
Loading

0 comments on commit dc4175c

Please sign in to comment.