execution

#include <hpx/traits/is_execution_policy.hpp>

namespace hpx
namespace parallel
namespace execution
template <typename T>
struct is_async_execution_policy : public execution::detail::is_async_execution_policy<hpx::util::decay<T>::type>
#include <is_execution_policy.hpp>

Extension: Detect whether given execution policy makes algorithms asynchronous

  1. The type is_async_execution_policy can be used to detect asynchronous execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
  2. If T is the type of a standard or implementation-defined execution policy, is_async_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
  3. The behavior of a program that adds specializations for is_async_execution_policy is undefined.

template <typename T>
struct is_execution_policy : public execution::detail::is_execution_policy<hpx::util::decay<T>::type>
#include <is_execution_policy.hpp>

  1. The type is_execution_policy can be used to detect execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
  2. If T is the type of a standard or implementation-defined execution policy, is_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
  3. The behavior of a program that adds specializations for is_execution_policy is undefined.

template <typename T>
struct is_parallel_execution_policy : public execution::detail::is_parallel_execution_policy<hpx::util::decay<T>::type>
#include <is_execution_policy.hpp>

Extension: Detect whether given execution policy enables parallelization

  1. The type is_parallel_execution_policy can be used to detect parallel execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
  2. If T is the type of a standard or implementation-defined execution policy, is_parallel_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
  3. The behavior of a program that adds specializations for is_parallel_execution_policy is undefined.

template <typename T>
struct is_sequenced_execution_policy : public execution::detail::is_sequenced_execution_policy<hpx::util::decay<T>::type>
#include <is_execution_policy.hpp>

Extension: Detect whether given execution policy does not enable parallelization

  1. The type is_sequenced_execution_policy can be used to detect non-parallel execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
  2. If T is the type of a standard or implementation-defined execution policy, is_sequenced_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
  3. The behavior of a program that adds specializations for is_sequenced_execution_policy is undefined.

#include <hpx/traits/is_executor_parameters.hpp>

template <typename Executor>
template<>
struct extract_executor_parameters<Executor, typename hpx::util::always_void<typename Executor::executor_parameters_type>::type>

Public Types

template<>
using type = typename Executor::executor_parameters_type
template <typename Parameters>
template<>
struct extract_has_variable_chunk_size<Parameters, typename hpx::util::always_void<typename Parameters::has_variable_chunk_size>::type>

Public Types

template<>
using type = typename Parameters::has_variable_chunk_size
namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::is_executor_parameters_t = typedef typename is_executor_parameters<T>::type
template <typename Executor, typename Enable = void>
struct extract_executor_parameters

Public Types

template<>
using type = sequential_executor_parameters
template <typename Executor>
template<>
struct extract_executor_parameters<Executor, typename hpx::util::always_void<typename Executor::executor_parameters_type>::type>

Public Types

template<>
using type = typename Executor::executor_parameters_type
template <typename Parameters, typename Enable = void>
struct extract_has_variable_chunk_size

Public Types

template<>
using type = std::false_type
template <typename Parameters>
template<>
struct extract_has_variable_chunk_size<Parameters, typename hpx::util::always_void<typename Parameters::has_variable_chunk_size>::type>

Public Types

template<>
using type = typename Parameters::has_variable_chunk_size
namespace traits

Typedefs

using hpx::traits::is_executor_parameters_t = typedef typename is_executor_parameters<T>::type

#include <hpx/traits/executor_traits.hpp>

namespace hpx
namespace parallel
namespace execution
template <typename Executor>
struct executor_context

Public Types

template<>
using type = typename std::decay::type
template <typename Executor>
struct executor_execution_category

Public Types

template<>
using type = hpx::util::detected_or_t<unsequenced_execution_tag, execution_category, Executor>

Private Types

template<>
using execution_category = typename T::execution_category
template <typename Executor>
struct executor_index

Public Types

template<>
using type = hpx::util::detected_or_t<typename executor_shape<Executor>::type, index_type, Executor>

Private Types

template<>
using index_type = typename T::index_type
template <typename Executor>
struct executor_parameters_type

Public Types

template<>
using type = hpx::util::detected_or_t<parallel::execution::static_chunk_size, parameters_type, Executor>

Private Types

template<>
using parameters_type = typename T::parameters_type
template <typename Executor>
struct executor_shape

Public Types

template<>
using type = hpx::util::detected_or_t<std::size_t, shape_type, Executor>

Private Types

template<>
using shape_type = typename T::shape_type
namespace traits

Typedefs

using hpx::traits::executor_context_t = typedef typename executor_context<Executor>::type
using hpx::traits::executor_execution_category_t = typedef typename executor_execution_category<Executor>::type
using hpx::traits::executor_shape_t = typedef typename executor_shape<Executor>::type
using hpx::traits::executor_index_t = typedef typename executor_index<Executor>::type
using hpx::traits::executor_parameters_type_t = typedef typename executor_parameters_type<Executor>::type

#include <hpx/traits/is_timed_executor.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::is_timed_executor_t = typedef typename is_timed_executor<T>::type

#include <hpx/traits/is_executor.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::is_one_way_executor_t = typedef typename is_one_way_executor<T>::type
using hpx::parallel::execution::is_never_blocking_one_way_executor_t = typedef typename is_never_blocking_one_way_executor<T>::type
using hpx::parallel::execution::is_bulk_one_way_executor_t = typedef typename is_bulk_one_way_executor<T>::type
using hpx::parallel::execution::is_two_way_executor_t = typedef typename is_two_way_executor<T>::type
using hpx::parallel::execution::is_bulk_two_way_executor_t = typedef typename is_bulk_two_way_executor<T>::type
namespace traits

Typedefs

using hpx::traits::is_one_way_executor_t = typedef typename is_one_way_executor<T>::type
using hpx::traits::is_never_blocking_one_way_executor_t = typedef typename is_never_blocking_one_way_executor<T>::type
using hpx::traits::is_bulk_one_way_executor_t = typedef typename is_bulk_one_way_executor<T>::type
using hpx::traits::is_two_way_executor_t = typedef typename is_two_way_executor<T>::type
using hpx::traits::is_bulk_two_way_executor_t = typedef typename is_bulk_two_way_executor<T>::type
using hpx::traits::is_executor_any_t = typedef typename is_executor_any<T>::type

#include <hpx/parallel/execution_policy_fwd.hpp>

namespace hpx
namespace parallel
namespace execution
template <typename Executor, typename Parameters>
struct parallel_policy_shim : public hpx::parallel::execution::parallel_policy
#include <execution_policy.hpp>

The class parallel_policy_shim is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized.

template <typename Executor, typename Parameters>
struct parallel_task_policy_shim : public hpx::parallel::execution::parallel_task_policy
#include <execution_policy.hpp>

Extension: The class parallel_task_policy_shim is an execution policy type used as a unique type to disambiguate parallel algorithm overloading based on combining a underlying parallel_task_policy and an executor and indicate that a parallel algorithm’s execution may be parallelized.

template <typename Executor, typename Parameters>
struct sequenced_policy_shim : public hpx::parallel::execution::sequenced_policy
#include <execution_policy.hpp>

The class sequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and require that a parallel algorithm’s execution may not be parallelized.

template <typename Executor, typename Parameters>
struct sequenced_task_policy_shim : public hpx::parallel::execution::sequenced_task_policy
#include <execution_policy.hpp>

Extension: The class sequenced_task_policy_shim is an execution policy type used as a unique type to disambiguate parallel algorithm overloading based on combining a underlying sequenced_task_policy and an executor and indicate that a parallel algorithm’s execution may not be parallelized (has to run sequentially).

The algorithm returns a future representing the result of the corresponding algorithm when invoked with the sequenced_policy.

#include <hpx/parallel/executors.hpp>

#include <hpx/parallel/execution.hpp>

#include <hpx/parallel/execution_policy.hpp>

namespace hpx
namespace parallel
namespace execution

Variables

task_policy_tag HPX_CONSTEXPR_OR_CONST hpx::parallel::execution::task

Default sequential execution policy object.

HPX_STATIC_CONSTEXPR sequenced_policy hpx::parallel::execution::seq

Default sequential execution policy object.

HPX_STATIC_CONSTEXPR parallel_policy hpx::parallel::execution::par

Default parallel execution policy object.

HPX_STATIC_CONSTEXPR parallel_unsequenced_policy hpx::parallel::execution::par_unseq

Default vector execution policy object.

struct parallel_policy
#include <execution_policy.hpp>

The class parallel_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized.

Subclassed by hpx::parallel::execution::parallel_policy_shim< Executor, Parameters >

Public Types

typedef parallel_executor executor_type

The type of the executor associated with this execution policy.

typedef execution::extract_executor_parameters<executor_type>::type executor_parameters_type

The type of the associated executor parameters object which is associated with this execution policy

typedef parallel_execution_tag execution_category

The category of the execution agents created by this execution policy.

Public Functions

parallel_task_policy operator()(task_policy_tag) const

Create a new parallel_policy referencing a chunk size.

Return
The new parallel_policy
Parameters
  • tag: [in] Specify that the corresponding asynchronous execution policy should be used

template <typename Executor>
rebind_executor<parallel_policy, Executor, executor_parameters_type>::type on(Executor &&exec) const

Create a new parallel_policy referencing an executor and a chunk size.

Return
The new parallel_policy
Parameters
  • exec: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with

template <typename... Parameters, typename ParametersType = typename executor_parameters_join<Parameters...>::type>
rebind_executor<parallel_policy, executor_type, ParametersType>::type with(Parameters&&... params) const

Create a new parallel_policy from the given execution parameters

Note
Requires: is_executor_parameters<Parameters>::value is true
Return
The new parallel_policy
Template Parameters
  • Parameters: The type of the executor parameters to associate with this execution policy.
Parameters
  • params: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.

executor_type &executor()

Return the associated executor object.

executor_type const &executor() const

Return the associated executor object.

executor_parameters_type &parameters()

Return the associated executor parameters object.

executor_parameters_type const &parameters() const

Return the associated executor parameters object.

Private Functions

template <typename Archive>
void serialize(Archive &ar, const unsigned int version)

Private Members

executor_type exec_
executor_parameters_type params_

Friends

friend hpx::parallel::execution::hpx::serialization::access
template <typename Executor_, typename Parameters_>
struct rebind
#include <execution_policy.hpp>

Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy

Public Types

typedef parallel_policy_shim<Executor_, Parameters_> type

The type of the rebound execution policy.

struct parallel_task_policy
#include <execution_policy.hpp>

Extension: The class parallel_task_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized.

The algorithm returns a future representing the result of the corresponding algorithm when invoked with the parallel_policy.

Subclassed by hpx::parallel::execution::parallel_task_policy_shim< Executor, Parameters >

Public Types

typedef parallel_executor executor_type

The type of the executor associated with this execution policy.

typedef execution::extract_executor_parameters<executor_type>::type executor_parameters_type

The type of the associated executor parameters object which is associated with this execution policy

typedef parallel_execution_tag execution_category

The category of the execution agents created by this execution policy.

Public Functions

parallel_task_policy operator()(task_policy_tag) const

Create a new parallel_task_policy from itself

Return
The new parallel_task_policy
Parameters
  • tag: [in] Specify that the corresponding asynchronous execution policy should be used

template <typename Executor>
rebind_executor<parallel_task_policy, Executor, executor_parameters_type>::type on(Executor &&exec) const

Create a new parallel_task_policy from given executor

Note
Requires: is_executor<Executor>::value is true
Return
The new parallel_task_policy
Template Parameters
  • Executor: The type of the executor to associate with this execution policy.
Parameters
  • exec: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.

template <typename... Parameters, typename ParametersType = typename executor_parameters_join<Parameters...>::type>
rebind_executor<parallel_task_policy, executor_type, ParametersType>::type with(Parameters&&... params) const

Create a new parallel_policy_shim from the given execution parameters

Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
Return
The new parallel_policy_shim
Template Parameters
  • Parameters: The type of the executor parameters to associate with this execution policy.
Parameters
  • params: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.

executor_type &executor()

Return the associated executor object.

executor_type const &executor() const

Return the associated executor object.

executor_parameters_type &parameters()

Return the associated executor parameters object.

executor_parameters_type const &parameters() const

Return the associated executor parameters object.

Private Functions

template <typename Archive>
void serialize(Archive &ar, const unsigned int version)

Private Members

executor_type exec_
executor_parameters_type params_

Friends

friend hpx::parallel::execution::hpx::serialization::access
template <typename Executor_, typename Parameters_>
struct rebind
#include <execution_policy.hpp>

Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy

Public Types

typedef parallel_task_policy_shim<Executor_, Parameters_> type

The type of the rebound execution policy.

struct parallel_unsequenced_policy
#include <execution_policy.hpp>

The class parallel_unsequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be vectorized.

Public Types

typedef parallel_executor executor_type

The type of the executor associated with this execution policy.

typedef execution::extract_executor_parameters<executor_type>::type executor_parameters_type

The type of the associated executor parameters object which is associated with this execution policy

typedef parallel_execution_tag execution_category

The category of the execution agents created by this execution policy.

Public Functions

parallel_unsequenced_policy operator()(task_policy_tag) const

Create a new parallel_unsequenced_policy from itself

Return
The new parallel_unsequenced_policy
Parameters
  • tag: [in] Specify that the corresponding asynchronous execution policy should be used

executor_type &executor()

Return the associated executor object.

executor_type const &executor() const

Return the associated executor object.

executor_parameters_type &parameters()

Return the associated executor parameters object.

executor_parameters_type const &parameters() const

Return the associated executor parameters object.

Private Functions

template <typename Archive>
void serialize(Archive &ar, const unsigned int version)

Private Members

executor_type exec_
executor_parameters_type params_

Friends

friend hpx::parallel::execution::hpx::serialization::access
struct sequenced_policy
#include <execution_policy.hpp>

The class sequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and require that a parallel algorithm’s execution may not be parallelized.

Subclassed by hpx::parallel::execution::sequenced_policy_shim< Executor, Parameters >

Public Types

typedef sequenced_executor executor_type

The type of the executor associated with this execution policy.

typedef execution::extract_executor_parameters<executor_type>::type executor_parameters_type

The type of the associated executor parameters object which is associated with this execution policy

typedef sequenced_execution_tag execution_category

The category of the execution agents created by this execution policy.

Public Functions

sequenced_task_policy operator()(task_policy_tag) const

Create a new sequenced_task_policy.

Return
The new sequenced_task_policy
Parameters
  • tag: [in] Specify that the corresponding asynchronous execution policy should be used

template <typename Executor>
rebind_executor<sequenced_policy, Executor, executor_parameters_type>::type on(Executor &&exec) const

Create a new sequenced_policy from the given executor

Note
Requires: is_executor<Executor>::value is true
Return
The new sequenced_policy
Template Parameters
  • Executor: The type of the executor to associate with this execution policy.
Parameters
  • exec: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.

template <typename... Parameters, typename ParametersType = typename executor_parameters_join<Parameters...>::type>
rebind_executor<sequenced_policy, executor_type, ParametersType>::type with(Parameters&&... params) const

Create a new sequenced_policy from the given execution parameters

Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
Return
The new sequenced_policy
Template Parameters
  • Parameters: The type of the executor parameters to associate with this execution policy.
Parameters
  • params: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.

executor_type &executor()

Return the associated executor object. Return the associated executor object.

executor_type const &executor() const

Return the associated executor object.

executor_parameters_type &parameters()

Return the associated executor parameters object.

executor_parameters_type const &parameters() const

Return the associated executor parameters object.

Private Functions

template <typename Archive>
void serialize(Archive &ar, const unsigned int version)

Private Members

executor_type exec_
executor_parameters_type params_

Friends

friend hpx::parallel::execution::hpx::serialization::access
template <typename Executor_, typename Parameters_>
struct rebind
#include <execution_policy.hpp>

Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy

Public Types

typedef sequenced_policy_shim<Executor_, Parameters_> type

The type of the rebound execution policy.

struct sequenced_task_policy
#include <execution_policy.hpp>

Extension: The class sequenced_task_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may not be parallelized (has to run sequentially).

The algorithm returns a future representing the result of the corresponding algorithm when invoked with the sequenced_policy.

Subclassed by hpx::parallel::execution::sequenced_task_policy_shim< Executor, Parameters >

Public Types

typedef sequenced_executor executor_type

The type of the executor associated with this execution policy.

typedef execution::extract_executor_parameters<executor_type>::type executor_parameters_type

The type of the associated executor parameters object which is associated with this execution policy

typedef sequenced_execution_tag execution_category

The category of the execution agents created by this execution policy.

Public Functions

sequenced_task_policy operator()(task_policy_tag) const

Create a new sequenced_task_policy from itself

Return
The new sequenced_task_policy
Parameters
  • tag: [in] Specify that the corresponding asynchronous execution policy should be used

template <typename Executor>
rebind_executor<sequenced_task_policy, Executor, executor_parameters_type>::type on(Executor &&exec) const

Create a new sequenced_task_policy from the given executor

Note
Requires: is_executor<Executor>::value is true
Return
The new sequenced_task_policy
Template Parameters
  • Executor: The type of the executor to associate with this execution policy.
Parameters
  • exec: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.

template <typename... Parameters, typename ParametersType = typename executor_parameters_join<Parameters...>::type>
rebind_executor<sequenced_task_policy, executor_type, ParametersType>::type with(Parameters&&... params) const

Create a new sequenced_task_policy from the given execution parameters

Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
Return
The new sequenced_task_policy
Template Parameters
  • Parameters: The type of the executor parameters to associate with this execution policy.
Parameters
  • params: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.

executor_type &executor()

Return the associated executor object.

executor_type const &executor() const

Return the associated executor object.

executor_parameters_type &parameters()

Return the associated executor parameters object.

executor_parameters_type const &parameters() const

Return the associated executor parameters object.

Private Functions

template <typename Archive>
void serialize(Archive &ar, const unsigned int version)

Private Members

executor_type exec_
executor_parameters_type params_

Friends

friend hpx::parallel::execution::hpx::serialization::access
template <typename Executor_, typename Parameters_>
struct rebind
#include <execution_policy.hpp>

Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy

Public Types

typedef sequenced_task_policy_shim<Executor_, Parameters_> type

The type of the rebound execution policy.

#include <hpx/parallel/executor_parameters.hpp>

#include <hpx/parallel/exception_list.hpp>

#include <hpx/parallel/executors/execution_information_fwd.hpp>

#include <hpx/parallel/executors/execution_parameters_fwd.hpp>

#include <hpx/parallel/executors/default_executor.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::default_executor = typedef threads::executors::default_executor

Refers to the currently used base-executor.

#include <hpx/parallel/executors/service_executors.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::service_executor = typedef threads::executors::service_executor

A service_executor exposes one of the predefined HPX thread pools through an executor interface.

Note
All tasks executed by one of these executors will run on one of the OS-threads dedicated for the given thread pool. The tasks will not run as HPX-threads.

using hpx::parallel::execution::io_pool_executor = typedef threads::executors::io_pool_executor

A io_pool_executor exposes the predefined HPX IO thread pool through an executor interface.

Note
All tasks executed by one of these executors will run on one of the OS-threads dedicated for the IO thread pool. The tasks will not run as HPX-threads.

using hpx::parallel::execution::parcel_pool_executor = typedef threads::executors::parcel_pool_executor

A io_pool_executor exposes the predefined HPX parcel thread pool through an executor interface.

Note
All tasks executed by one of these executors will run on one of the OS-threads dedicated for the parcel thread pool. The tasks will not run as HPX-threads.

using hpx::parallel::execution::timer_pool_executor = typedef threads::executors::timer_pool_executor

A io_pool_executor exposes the predefined HPX timer thread pool through an executor interface.

Note
All tasks executed by one of these executors will run on one of the OS-threads dedicated for the timer thread pool. The tasks will not run as HPX-threads.

using hpx::parallel::execution::main_pool_executor = typedef threads::executors::main_pool_executor

A io_pool_executor exposes the predefined HPX main thread pool through an executor interface.

Note
All tasks executed by one of these executors will run on one of the OS-threads dedicated for the main thread pool. The tasks will not run as HPX-threads.

#include <hpx/parallel/executors/distribution_policy_executor.hpp>

namespace hpx
namespace parallel
namespace execution

Functions

template <typename DistPolicy>
distribution_policy_executor<typename hpx::util::decay<DistPolicy>::type> make_distribution_policy_executor(DistPolicy &&policy)

Create a new distribution_policy_executor from the given distribution_policy.

Parameters
  • policy: The distribution_policy to create an executor from

template <typename DistPolicy>
class distribution_policy_executor
#include <distribution_policy_executor.hpp>

A distribution_policy_executor creates groups of parallel execution agents which execute in threads implicitly created by the executor and placed on any of the associated localities.

Template Parameters
  • DistPolicy: The distribution policy type for which an executor should be created. The expression hpx::traits::is_distribution_policy<DistPolicy>::value must evaluate to true.

Public Functions

template <typename DistPolicy_, typename Enable = typename std::enable_if< !std::is_same<distribution_policy_executor, typename hpx::util::decay<DistPolicy_>::type>::value>::type>
distribution_policy_executor(DistPolicy_ &&policy)

Create a new distribution_policy executor from the given distribution policy

Parameters
  • policy: The distribution_policy to create an executor from

Private Members

DistPolicy policy_

#include <hpx/parallel/executors/dynamic_chunk_size.hpp>

namespace hpx
namespace parallel
namespace execution
struct dynamic_chunk_size
#include <dynamic_chunk_size.hpp>

Loop iterations are divided into pieces of size chunk_size and then dynamically scheduled among the threads; when a thread finishes one chunk, it is dynamically assigned another If chunk_size is not specified, the default chunk size is 1.

Note
This executor parameters type is equivalent to OpenMP’s DYNAMIC scheduling directive.

Public Functions

dynamic_chunk_size(std::size_t chunk_size = 1)

Construct a dynamic_chunk_size executor parameters object

Parameters
  • chunk_size: [in] The optional chunk size to use as the number of loop iterations to schedule together. The default chunk size is 1.

#include <hpx/parallel/executors/execution.hpp>

#include <hpx/parallel/executors/timed_execution_fwd.hpp>

#include <hpx/parallel/executors/auto_chunk_size.hpp>

namespace hpx
namespace parallel
namespace execution
struct auto_chunk_size
#include <auto_chunk_size.hpp>

Loop iterations are divided into pieces and then assigned to threads. The number of loop iterations combined is determined based on measurements of how long the execution of 1% of the overall number of iterations takes. This executor parameters type makes sure that as many loop iterations are combined as necessary to run for the amount of time specified.

Public Functions

auto_chunk_size()

Construct an auto_chunk_size executor parameters object

Note
Default constructed auto_chunk_size executor parameter types will use 80 microseconds as the minimal time for which any of the scheduled chunks should run.

auto_chunk_size(hpx::util::steady_duration const &rel_time)

Construct an auto_chunk_size executor parameters object

Parameters
  • rel_time: [in] The time duration to use as the minimum to decide how many loop iterations should be combined.

#include <hpx/parallel/executors/thread_timed_execution.hpp>

namespace hpx
namespace threads

Functions

template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value>::type post_at(Executor &&exec, hpx::util::steady_time_point const &abs_time, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value>::type post_after(Executor &&exec, hpx::util::steady_duration const &rel_time, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, hpx::future<typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>>::type async_execute_at(Executor &&exec, hpx::util::steady_time_point const &abs_time, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, hpx::future<typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>>::type async_execute_after(Executor &&exec, hpx::util::steady_duration const &rel_time, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>::type sync_execute_at(Executor &&exec, hpx::util::steady_time_point const &abs_time, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>::type sync_execute_after(Executor &&exec, hpx::util::steady_duration const &rel_time, F &&f, Ts&&... ts)

#include <hpx/parallel/executors/execution_parameters.hpp>

namespace hpx
namespace parallel
namespace execution

Functions

template <typename... Params>
executor_parameters_join<Params...>::type join_executor_parameters(Params&&... params)
template <typename Param>
Param &&join_executor_parameters(Param &&param)
template <typename... Params>
struct executor_parameters_join

Public Types

template<>
using type = detail::executor_parameters<typename hpx::util::decay<Params>::type...>
template <typename Param>
template<>
struct executor_parameters_join<Param>

Public Types

template<>
using type = Param

#include <hpx/parallel/executors/thread_pool_attached_executors.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::local_priority_queue_attached_executor = typedef threads::executors::local_priority_queue_attached_executor

#include <hpx/parallel/executors/thread_pool_os_executors.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::local_priority_queue_os_executor = typedef threads::executors::local_priority_queue_os_executor

Creates a new local_priority_queue_executor

Parameters
  • max_punits: [in] The maximum number of processing units to associate with the newly created executor.
  • min_punits: [in] The minimum number of processing units to associate with the newly created executor (default: 1).

#include <hpx/parallel/executors/guided_chunk_size.hpp>

namespace hpx
namespace parallel
namespace execution
struct guided_chunk_size
#include <guided_chunk_size.hpp>

Iterations are dynamically assigned to threads in blocks as threads request them until no blocks remain to be assigned. Similar to dynamic_chunk_size except that the block size decreases each time a number of loop iterations is given to a thread. The size of the initial block is proportional to number_of_iterations / number_of_cores. Subsequent blocks are proportional to number_of_iterations_remaining / number_of_cores. The optional chunk size parameter defines the minimum block size. The default chunk size is 1.

Note
This executor parameters type is equivalent to OpenMP’s GUIDED scheduling directive.

Public Functions

guided_chunk_size(std::size_t min_chunk_size = 1)

Construct a guided_chunk_size executor parameters object

Parameters
  • min_chunk_size: [in] The optional minimal chunk size to use as the minimal number of loop iterations to schedule together. The default minimal chunk size is 1.

#include <hpx/parallel/executors/this_thread_executors.hpp>

#include <hpx/parallel/executors/fused_bulk_execute.hpp>

#include <hpx/parallel/executors/thread_pool_executors.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::local_priority_queue_executor = typedef threads::executors::local_priority_queue_executor

Creates a new local_priority_queue_executor

Parameters
  • max_punits: [in] The maximum number of processing units to associate with the newly created executor.
  • min_punits: [in] The minimum number of processing units to associate with the newly created executor (default: 1).

#include <hpx/parallel/executors/timed_executors.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::sequenced_timed_executor = typedef timed_executor<execution::sequenced_executor>
using hpx::parallel::execution::parallel_timed_executor = typedef timed_executor<execution::parallel_executor>
template <typename BaseExecutor>
struct timed_executor

Public Types

typedef std::decay<BaseExecutor>::type base_executor_type
typedef hpx::traits::executor_execution_category<base_executor_type>::type execution_category
typedef hpx::traits::executor_parameters_type<base_executor_type>::type parameters_type

Public Functions

timed_executor(hpx::util::steady_time_point const &abs_time)
timed_executor(hpx::util::steady_duration const &rel_time)
template <typename Executor>
timed_executor(Executor &&exec, hpx::util::steady_time_point const &abs_time)
template <typename Executor>
timed_executor(Executor &&exec, hpx::util::steady_duration const &rel_time)
template <typename F, typename... Ts>
hpx::util::detail::invoke_deferred_result<F, Ts...>::type sync_execute(F &&f, Ts&&... ts)
template <typename F, typename... Ts>
hpx::future<typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type> async_execute(F &&f, Ts&&... ts)
template <typename F, typename... Ts>
void post(F &&f, Ts&&... ts)

Public Members

BaseExecutor exec_
std::chrono::steady_clock::time_point execute_at_

#include <hpx/parallel/executors/rebind_executor.hpp>

namespace hpx
namespace parallel
namespace execution
template <typename ExecutionPolicy, typename Executor, typename Parameters>
struct rebind_executor
#include <rebind_executor.hpp>

Rebind the type of executor used by an execution policy. The execution category of Executor shall not be weaker than that of ExecutionPolicy.

Public Types

typedef ExecutionPolicy::template rebind<executor_type, parameters_type>::type type

The type of the rebound execution policy.

#include <hpx/parallel/executors/parallel_executor_aggregated.hpp>

template <>
template<>
struct parallel_policy_executor_aggregated<hpx::launch>

Public Types

template<>
using execution_category = parallel_execution_tag

Associate the parallel_execution_tag executor tag type as a default with this executor.

template<>
using executor_parameters_type = static_chunk_size

Associate the static_chunk_size executor parameters type as a default with this executor.

Public Functions

hpx::parallel::execution::parallel_policy_executor_aggregated::parallel_policy_executor_aggregated(hpx::launch l = hpx::launch::async_policy{}, std::size_t spread = 4, std::size_t tasks = std::size_t(-1))

Create a new parallel executor.

template <typename F, typename S, typename... Ts>
std::vector<hpx::future<void>> bulk_async_execute(F &&f, S const &shape, Ts&&... ts) const
namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::parallel_executor_aggregated = typedef parallel_policy_executor_aggregated<hpx::launch::async_policy>
template <typename Policy = hpx::launch::async_policy>
struct parallel_policy_executor_aggregated
#include <parallel_executor_aggregated.hpp>

A parallel_executor_aggregated creates groups of parallel execution agents that execute in threads implicitly created by the executor. This executor prefers continuing with the creating thread first before executing newly created threads.

This executor conforms to the concepts of a TwoWayExecutor, and a BulkTwoWayExecutor

Public Types

template<>
using execution_category = parallel_execution_tag

Associate the parallel_execution_tag executor tag type as a default with this executor.

template<>
using executor_parameters_type = static_chunk_size

Associate the static_chunk_size executor parameters type as a default with this executor.

Public Functions

parallel_policy_executor_aggregated(std::size_t spread = 4, std::size_t tasks = std::size_t(-1))

Create a new parallel executor.

template <typename F, typename S, typename... Ts>
std::vector<hpx::future<void>> bulk_async_execute(F &&f, S const &shape, Ts&&... ts) const
template <>
template<>
struct parallel_policy_executor_aggregated<hpx::launch>

Public Types

template<>
using execution_category = parallel_execution_tag

Associate the parallel_execution_tag executor tag type as a default with this executor.

template<>
using executor_parameters_type = static_chunk_size

Associate the static_chunk_size executor parameters type as a default with this executor.

Public Functions

hpx::parallel::execution::parallel_policy_executor_aggregated::parallel_policy_executor_aggregated(hpx::launch l = hpx::launch::async_policy{}, std::size_t spread = 4, std::size_t tasks = std::size_t(-1))

Create a new parallel executor.

template <typename F, typename S, typename... Ts>
std::vector<hpx::future<void>> bulk_async_execute(F &&f, S const &shape, Ts&&... ts) const

#include <hpx/parallel/executors/thread_execution.hpp>

namespace hpx
namespace threads

Functions

template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, hpx::lcos::future<typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>>::type async_execute(Executor &&exec, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>::type sync_execute(Executor &&exec, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename Future, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, hpx::lcos::future<typename hpx::util::detail::invoke_deferred_result<F, Future, Ts...>::type>>::type then_execute(Executor &&exec, F &&f, Future &&predecessor, Ts&&... ts)
template <typename Executor, typename F, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value>::type post(Executor &&exec, F &&f, Ts&&... ts)
template <typename Executor, typename F, typename Hint, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value && std::is_same<typename hpx::util::decay<Hint>::type, hpx::threads::thread_schedule_hint>::value>::type post(Executor &&exec, F &&f, Hint &&hint, const char *annotation, Ts&&... ts)
template <typename Executor, typename F, typename Shape, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, std::vector<hpx::lcos::future<typename parallel::execution::detail::bulk_function_result<F, Shape, Ts...>::type>>>::type bulk_async_execute(Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
template <typename Executor, typename F, typename Shape, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, typename parallel::execution::detail::bulk_execute_result<F, Shape, Ts...>::type>::type bulk_sync_execute(Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
template <typename Executor, typename F, typename Shape, typename Future, typename... Ts>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, hpx::future<typename parallel::execution::detail::bulk_then_execute_result<F, Shape, Future, Ts...>::type>>::type bulk_then_execute(Executor &&exec, F &&f, Shape const &shape, Future &&predecessor, Ts&&... ts)

#include <hpx/parallel/executors/thread_pool_executor.hpp>

namespace hpx
namespace parallel
namespace execution
struct thread_pool_executor
#include <thread_pool_executor.hpp>

A thread_pool_executor creates groups of parallel execution agents which execute in threads implicitly created by the executor. This executor prefers continuing with the creating thread first before executing newly created threads.

This executor conforms to the concepts of a TwoWayExecutor, and a BulkTwoWayExecutor

Public Types

typedef parallel_execution_tag execution_category

Associate the parallel_execution_tag executor tag type as a default with this executor.

typedef static_chunk_size executor_parameters_type

Associate the static_chunk_size executor parameters type as a default with this executor.

Public Functions

thread_pool_executor(threads::thread_pool_base *pool)

Create a new parallel executor.

Private Members

threads::thread_pool_base *pool_

#include <hpx/parallel/executors/parallel_executor.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::parallel_executor = typedef parallel_policy_executor<hpx::launch>
template <typename Policy>
struct parallel_policy_executor
#include <parallel_executor.hpp>

A parallel_executor creates groups of parallel execution agents which execute in threads implicitly created by the executor. This executor prefers continuing with the creating thread first before executing newly created threads.

This executor conforms to the concepts of a TwoWayExecutor, and a BulkTwoWayExecutor

Public Types

typedef parallel_execution_tag execution_category

Associate the parallel_execution_tag executor tag type as a default with this executor.

typedef static_chunk_size executor_parameters_type

Associate the static_chunk_size executor parameters type as a default with this executor.

Public Functions

parallel_policy_executor(Policy l = detail::get_default_policy<Policy>::call(), std::size_t spread = 4, std::size_t tasks = std::size_t(-1))

Create a new parallel executor.

#include <hpx/parallel/executors/persistent_auto_chunk_size.hpp>

namespace hpx
namespace parallel
namespace execution
struct persistent_auto_chunk_size
#include <persistent_auto_chunk_size.hpp>

Loop iterations are divided into pieces and then assigned to threads. The number of loop iterations combined is determined based on measurements of how long the execution of 1% of the overall number of iterations takes. This executor parameters type makes sure that as many loop iterations are combined as necessary to run for the amount of time specified.

Public Functions

persistent_auto_chunk_size()

Construct an persistent_auto_chunk_size executor parameters object

Note
Default constructed persistent_auto_chunk_size executor parameter types will use 0 microseconds as the execution time for each chunk and 80 microseconds as the minimal time for which any of the scheduled chunks should run.

persistent_auto_chunk_size(hpx::util::steady_duration const &time_cs)

Construct an persistent_auto_chunk_size executor parameters object

Parameters
  • time_cs: The execution time for each chunk.

persistent_auto_chunk_size(hpx::util::steady_duration const &time_cs, hpx::util::steady_duration const &rel_time)

Construct an persistent_auto_chunk_size executor parameters object

Parameters
  • rel_time: [in] The time duration to use as the minimum to decide how many loop iterations should be combined.
  • time_cs: The execution time for each chunk.

#include <hpx/parallel/executors/pool_executor.hpp>

namespace hpx
namespace parallel
namespace execution

Typedefs

using hpx::parallel::execution::pool_executor = typedef threads::executors::pool_executor

#include <hpx/parallel/executors/post_policy_dispatch.hpp>

#include <hpx/parallel/executors/sequenced_executor.hpp>

namespace hpx
namespace parallel
namespace execution
struct sequenced_executor
#include <sequenced_executor.hpp>

A sequential_executor creates groups of sequential execution agents which execute in the calling thread. The sequential order is given by the lexicographical order of indices in the index space.

#include <hpx/parallel/executors/thread_execution_information.hpp>

namespace hpx
namespace threads

Functions

template <typename Executor, typename Parameters>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, std::size_t>::type processing_units_count(Executor &&exec, Parameters&)
template <typename Executor>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, bool>::type has_pending_closures(Executor &&exec)
template <typename Executor>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value, threads::mask_cref_type>::type get_pu_mask(Executor &&exec, threads::topology &topo, std::size_t thread_num)
template <typename Executor, typename Mode>
std::enable_if<hpx::traits::is_threads_executor<Executor>::value>::type set_scheduler_mode(Executor &&exec, Mode mode)

#include <hpx/parallel/executors/execution_fwd.hpp>

namespace hpx
namespace parallel
namespace execution
struct parallel_execution_tag
#include <execution_fwd.hpp>

Function invocations executed by a group of parallel execution agents execute in unordered fashion. Any such invocations executing in the same thread are indeterminately sequenced with respect to each other.

Note
parallel_execution_tag is weaker than sequenced_execution_tag.

struct sequenced_execution_tag
#include <execution_fwd.hpp>

Function invocations executed by a group of sequential execution agents execute in sequential order.

struct unsequenced_execution_tag
#include <execution_fwd.hpp>

Function invocations executed by a group of vector execution agents are permitted to execute in unordered fashion when executed in different threads, and un-sequenced with respect to one another when executed in the same thread.

Note
unsequenced_execution_tag is weaker than parallel_execution_tag.

#include <hpx/parallel/executors/static_chunk_size.hpp>

namespace hpx
namespace parallel
namespace execution
struct static_chunk_size
#include <static_chunk_size.hpp>

Loop iterations are divided into pieces of size chunk_size and then assigned to threads. If chunk_size is not specified, the iterations are evenly (if possible) divided contiguously among the threads.

Note
This executor parameters type is equivalent to OpenMP’s STATIC scheduling directive.

Public Functions

static_chunk_size()

Construct a static_chunk_size executor parameters object

Note
By default the number of loop iterations is determined from the number of available cores and the overall number of loop iterations to schedule.

static_chunk_size(std::size_t chunk_size)

Construct a static_chunk_size executor parameters object

Parameters
  • chunk_size: [in] The optional chunk size to use as the number of loop iterations to run on a single thread.

#include <hpx/parallel/executors/execution_information.hpp>

namespace hpx
namespace threads

Functions

threads::mask_cref_type get_pu_mask(threads::topology &topo, std::size_t thread_num)

#include <hpx/parallel/executors/timed_execution.hpp>

#include <hpx/parallel/traits/vector_pack_count_bits.hpp>

namespace hpx
namespace parallel
namespace traits

Functions

HPX_HOST_DEVICE std::size_t hpx::parallel::traits::count_bits(bool value)

#include <hpx/parallel/traits/vector_pack_load_store.hpp>

#include <hpx/parallel/traits/vector_pack_type.hpp>

#include <hpx/parallel/traits/vector_pack_alignment_size.hpp>

#include <hpx/parallel/datapar/execution_policy_fwd.hpp>

#include <hpx/parallel/datapar/execution_policy.hpp>