API reference¶
Main HPX library reference¶
-
template<typename
Action
>
structasync_result
¶ - #include <colocating_distribution_policy.hpp>
- Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
>
structasync_result
¶ - #include <default_distribution_policy.hpp>
- Note
- This function is part of the invocation policy implemented by this class
-
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.
-
-
class
barrier
¶ - #include <barrier.hpp>
The barrier is an implementation performing a barrier over a number of participating threads. The different threads don’t have to be on the same locality. This barrier can be invoked in a distributed application.
For a local only barrier
- See
- hpx::lcos::local::barrier.
Public Functions
-
barrier
(std::string const &base_name)¶ Creates a barrier, rank is locality id, size is number of localities
A barrier
base_name is created. It expects that hpx::get_num_localities() participate and the local rank is hpx::get_locality_id().- Parameters
base_name
: The name of the barrier
-
barrier
(std::string const &base_name, std::size_t num)¶ Creates a barrier with a given size, rank is locality id
A barrier
base_name is created. It expects that num participate and the local rank is hpx::get_locality_id().- Parameters
base_name
: The name of the barriernum
: The number of participating threads
-
barrier
(std::string const &base_name, std::size_t num, std::size_t rank)¶ Creates a barrier with a given size and rank
A barrier
base_name is created. It expects that num participate and the local rank is rank.- Parameters
base_name
: The name of the barriernum
: The number of participating threadsrank
: The rank of the calling site for this invocation
-
barrier
(std::string const &base_name, std::vector<std::size_t> const &ranks, std::size_t rank)¶ Creates a barrier with a vector of ranks
A barrier
base_name is created. It expects that ranks.size() and the local rank is rank (must be contained in ranks).- Parameters
base_name
: The name of the barrierranks
: Gives a list of participating ranks (this could be derived from a list of locality idsrank
: The rank of the calling site for this invocation
-
void
wait
()¶ Wait until each participant entered the barrier. Must be called by all participants
- Return
- This function returns once all participants have entered the barrier (have called wait).
Public Static Functions
-
static void
synchronize
()¶ Perform a global synchronization using the default global barrier The barrier is created once at startup and can be reused throughout the lifetime of an HPX application.
- Note
- This function currently does not support dynamic connection and disconnection of localities.
-
struct
binpacking_distribution_policy
¶ - #include <binpacking_distribution_policy.hpp>
This class specifies the parameters for a binpacking distribution policy to use for creating a given number of items on a given set of localities. The binpacking policy will distribute the new objects in a way such that each of the localities will equalize the number of overall objects of this type based on a given criteria (by default this criteria is the overall number of objects of this type).
Public Functions
-
binpacking_distribution_policy
()¶ Default-construct a new instance of a binpacking_distribution_policy. This policy will represent one locality (the local locality).
-
binpacking_distribution_policy
operator()
(std::vector<id_type> const &locs, char const *perf_counter_name = default_binpacking_counter_name) const¶ Create a new default_distribution policy representing the given set of localities.
- Parameters
locs
: [in] The list of localities the new instance should representperf_counter_name
: [in] The name of the performance counter which should be used as the distribution criteria (by default the overall number of existing instances of the given component type will be used).
-
binpacking_distribution_policy
operator()
(std::vector<id_type> &&locs, char const *perf_counter_name = default_binpacking_counter_name) const¶ Create a new default_distribution policy representing the given set of localities.
- Parameters
locs
: [in] The list of localities the new instance should representperf_counter_name
: [in] The name of the performance counter which should be used as the distribution criteria (by default the overall number of existing instances of the given component type will be used).
-
binpacking_distribution_policy
operator()
(id_type const &loc, char const *perf_counter_name = default_binpacking_counter_name) const¶ Create a new default_distribution policy representing the given locality
- Parameters
loc
: [in] The locality the new instance should representperf_counter_name
: [in] The name of the performance counter which should be used as the distribution criteria (by default the overall number of existing instances of the given component type will be used).
-
template<typename
Component
, typename ...Ts
>
hpx::future<hpx::id_type>create
(Ts&&... vs) const¶ Create one object on one of the localities associated by this policy instance
- Return
- A future holding the global address which represents the newly created object
- Parameters
vs
: [in] The arguments which will be forwarded to the constructor of the new object.
-
template<typename
Component
, typename ...Ts
>
hpx::future<std::vector<bulk_locality_result>>bulk_create
(std::size_t count, Ts&&... vs) const¶ Create multiple objects on the localities associated by this policy instance
- Return
- A future holding the list of global addresses which represent the newly created objects
- Parameters
count
: [in] The number of objects to createvs
: [in] The arguments which will be forwarded to the constructors of the new objects.
-
std::string const &
get_counter_name
() const¶ Returns the name of the performance counter associated with this policy instance.
-
std::size_t
get_num_localities
() const¶ Returns the number of associated localities for this distribution policy
- Note
- This function is part of the creation policy implemented by this class
-
-
class
checkpoint
¶ - #include <checkpoint.hpp>
Checkpoint Object
Checkpoint is the container object which is produced by save_checkpoint and is consumed by a restore_checkpoint. A checkpoint may be moved into the save_checkpoint object to write the byte stream to the pre-created checkpoint object.
Public Types
-
using
const_iterator
= std::vector::const_iterator¶
Public Functions
-
checkpoint
()¶
-
checkpoint
(checkpoint const &c)¶
-
checkpoint
(checkpoint &&c)¶
-
~checkpoint
()¶
-
checkpoint
(std::vector<char> const &vec)¶
-
checkpoint
(std::vector<char> &&vec)¶
-
checkpoint &
operator=
(checkpoint const &c)¶
-
checkpoint &
operator=
(checkpoint &&c)¶
-
bool
operator==
(checkpoint const &c) const¶
-
bool
operator!=
(checkpoint const &c) const¶
-
const_iterator
begin
() const¶
-
const_iterator
end
() const¶
-
size_t
size
() const¶
Private Functions
Private Members
-
std::vector<char>
data
¶
Friends
-
friend
hpx::util::checkpoint::hpx::serialization::access
-
std::ostream &
operator<<
(std::ostream &ost, checkpoint const &ckp)¶ Operator<< Overload
This overload is the main way to write data from a checkpoint to an object such as a file. Inside the function, the size of the checkpoint will be written to the stream before the checkpoint’s data. The operator>> overload uses this to read the correct number of bytes. Be mindful of this additional write and read when you use different facilities to write out or read in data to a checkpoint!
- Parameters
ost
: Output stream to write to.ckp
: Checkpoint to copy from.
- Return
- Operator<< returns the ostream object.
-
std::istream &
operator>>
(std::istream &ist, checkpoint &ckp)¶ Operator>> Overload
This overload is the main way to read in data from an object such as a file to a checkpoint. It is important to note that inside the function, the first variable to be read is the size of the checkpoint. This size variable is written to the stream before the checkpoint’s data in the operator<< overload. Be mindful of this additional read and write when you use different facilities to read in or write out data from a checkpoint!
- Parameters
ist
: Input stream to write from.ckp
: Checkpoint to write to.
- Return
- Operator>> returns the ostream object.
-
template<typename
T
, typename ...Ts
>
voidrestore_checkpoint
(checkpoint const &c, T &t, Ts&... ts)¶ Resurrect
Restore_checkpoint takes a checkpoint object as a first argument and the containers which will be filled from the byte stream (in the same order as they were placed in save_checkpoint).
- Return
- Restore_checkpoint returns void.
- Template Parameters
T
: A container to restore.Ts
: Other containers to restore. Containers must be in the same order that they were inserted into the checkpoint.
- Parameters
c
: The checkpoint to restore.t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
-
using
-
struct
colocating_distribution_policy
¶ - #include <colocating_distribution_policy.hpp>
This class specifies the parameters for a distribution policy to use for creating a given number of items on the locality where a given object is currently placed.
Public Functions
-
colocating_distribution_policy
()¶ Default-construct a new instance of a colocating_distribution_policy. This policy will represent the local locality.
-
colocating_distribution_policy
operator()
(id_type const &id) const¶ Create a new colocating_distribution_policy representing the locality where the given object os current located
- Parameters
id
: [in] The global address of the object with which the new instances should be colocated on
-
template<typename
Client
, typenameStub
>
colocating_distribution_policyoperator()
(client_base<Client, Stub> const &client) const¶ Create a new colocating_distribution_policy representing the locality where the given object os current located
- Parameters
client
: [in] The client side representation of the object with which the new instances should be colocated on
-
template<typename
Component
, typename ...Ts
>
hpx::future<hpx::id_type>create
(Ts&&... vs) const¶ Create one object on the locality of the object this distribution policy instance is associated with
- Note
- This function is part of the placement policy implemented by this class
- Return
- A future holding the global address which represents the newly created object
- Parameters
vs
: [in] The arguments which will be forwarded to the constructor of the new object.
-
template<typename
Component
, typename ...Ts
>
hpx::future<std::vector<bulk_locality_result>>bulk_create
(std::size_t count, Ts&&... vs) const¶ Create multiple objects colocated with the object represented by this policy instance
- Note
- This function is part of the placement policy implemented by this class
- Return
- A future holding the list of global addresses which represent the newly created objects
- Parameters
count
: [in] The number of objects to createvs
: [in] The arguments which will be forwarded to the constructors of the new objects.
-
template<typename
Action
, typename ...Ts
>
async_result<Action>::typeasync
(launch policy, Ts&&... vs) const¶
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
async_result<Action>::typeasync_cb
(launch policy, Callback &&cb, Ts&&... vs) const¶ - Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameContinuation
, typename ...Ts
>
boolapply
(Continuation &&c, threads::thread_priority priority, Ts&&... vs) const¶ - Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typename ...Ts
>
boolapply
(threads::thread_priority priority, Ts&&... vs) const¶
-
template<typename
Action
, typenameContinuation
, typenameCallback
, typename ...Ts
>
boolapply_cb
(Continuation &&c, threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶ - Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
boolapply_cb
(threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶
-
std::size_t
get_num_localities
() const¶ Returns the number of associated localities for this distribution policy
- Note
- This function is part of the creation policy implemented by this class
-
-
class
core
¶ - #include <partitioner.hpp>
Public Functions
-
core
(std::size_t id = invalid_core_id, numa_domain *domain = nullptr)¶
-
std::size_t
id
() const¶
Private Static Attributes
-
const std::size_t
invalid_core_id
= std::size_t(-1)¶
Friends
-
friend
hpx::resource::core::pu
-
friend
hpx::resource::core::numa_domain
-
-
struct
default_distribution_policy
¶ - #include <default_distribution_policy.hpp>
This class specifies the parameters for a simple distribution policy to use for creating (and evenly distributing) a given number of items on a given set of localities.
Public Functions
-
default_distribution_policy
()¶ Default-construct a new instance of a default_distribution_policy. This policy will represent one locality (the local locality).
-
default_distribution_policy
operator()
(std::vector<id_type> const &locs) const¶ Create a new default_distribution policy representing the given set of localities.
- Parameters
locs
: [in] The list of localities the new instance should represent
-
default_distribution_policy
operator()
(std::vector<id_type> &&locs) const¶ Create a new default_distribution policy representing the given set of localities.
- Parameters
locs
: [in] The list of localities the new instance should represent
-
default_distribution_policy
operator()
(id_type const &loc) const¶ Create a new default_distribution policy representing the given locality
- Parameters
loc
: [in] The locality the new instance should represent
-
template<typename
Component
, typename ...Ts
>
hpx::future<hpx::id_type>create
(Ts&&... vs) const¶ Create one object on one of the localities associated by this policy instance
- Note
- This function is part of the placement policy implemented by this class
- Return
- A future holding the global address which represents the newly created object
- Parameters
vs
: [in] The arguments which will be forwarded to the constructor of the new object.
-
template<typename
Component
, typename ...Ts
>
hpx::future<std::vector<bulk_locality_result>>bulk_create
(std::size_t count, Ts&&... vs) const¶ Create multiple objects on the localities associated by this policy instance
- Note
- This function is part of the placement policy implemented by this class
- Return
- A future holding the list of global addresses which represent the newly created objects
- Parameters
count
: [in] The number of objects to createvs
: [in] The arguments which will be forwarded to the constructors of the new objects.
-
template<typename
Action
, typename ...Ts
>
async_result<Action>::typeasync
(launch policy, Ts&&... vs) const¶
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
async_result<Action>::typeasync_cb
(launch policy, Callback &&cb, Ts&&... vs) const¶ - Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameContinuation
, typename ...Ts
>
boolapply
(Continuation &&c, threads::thread_priority priority, Ts&&... vs) const¶ - Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typename ...Ts
>
boolapply
(threads::thread_priority priority, Ts&&... vs) const¶
-
template<typename
Action
, typenameContinuation
, typenameCallback
, typename ...Ts
>
boolapply_cb
(Continuation &&c, threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶ - Note
- This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
boolapply_cb
(threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶
-
std::size_t
get_num_localities
() const¶ Returns the number of associated localities for this distribution policy
- Note
- This function is part of the creation policy implemented by this class
-
-
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.
-
class
error_code
: public error_code¶ - #include <error_code.hpp>
A hpx::error_code represents an arbitrary error condition.
The class hpx::error_code describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces.
- Note
- Class hpx::error_code is an adjunct to error reporting by exception
Public Functions
-
error_code
(throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
nothing
:
-
error_code
(error e, throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
nothing
:
-
error_code
(error e, char const *func, char const *file, long line, throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.func
: The name of the function where the error was raised.file
: The file name of the code where the error was raised.line
: The line number of the code line where the error was raised.mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
nothing
:
-
error_code
(error e, char const *msg, throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.msg
: The parametermsg
holds the error message the new exception should encapsulate.mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
std::bad_alloc
: (if allocation of a copy of the passed string fails).
-
error_code
(error e, char const *msg, char const *func, char const *file, long line, throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.msg
: The parametermsg
holds the error message the new exception should encapsulate.func
: The name of the function where the error was raised.file
: The file name of the code where the error was raised.line
: The line number of the code line where the error was raised.mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
std::bad_alloc
: (if allocation of a copy of the passed string fails).
-
error_code
(error e, std::string const &msg, throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.msg
: The parametermsg
holds the error message the new exception should encapsulate.mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
std::bad_alloc
: (if allocation of a copy of the passed string fails).
-
error_code
(error e, std::string const &msg, char const *func, char const *file, long line, throwmode mode = plain)¶ Construct an object of type error_code.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.msg
: The parametermsg
holds the error message the new exception should encapsulate.func
: The name of the function where the error was raised.file
: The file name of the code where the error was raised.line
: The line number of the code line where the error was raised.mode
: The parametermode
specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
- Exceptions
std::bad_alloc
: (if allocation of a copy of the passed string fails).
-
std::string
get_message
() const¶ Return a reference to the error message stored in the hpx::error_code.
- Exceptions
nothing
:
-
void
clear
()¶ Clear this error_code object. The postconditions of invoking this method are.
- value() == hpx::success and category() == hpx::get_hpx_category()
-
error_code
(error_code const &rhs)¶ Copy constructor for error_code
- Note
- This function maintains the error category of the left hand side if the right hand side is a success code.
-
error_code &
operator=
(error_code const &rhs)¶ Assignment operator for error_code
- Note
- This function maintains the error category of the left hand side if the right hand side is a success code.
Private Functions
-
error_code
(std::exception_ptr const &e)¶
Private Members
-
std::exception_ptr
exception_
¶
-
class
exception
: public system_error¶ - #include <exception.hpp>
A hpx::exception is the main exception type used by HPX to report errors.
The hpx::exception type is the main exception type used by HPX to report errors. Any exceptions thrown by functions in the HPX library are either of this type or of a type derived from it. This implies that it is always safe to use this type only in catch statements guarding HPX library calls.
Subclassed by hpx::exception_list, hpx::parallel::v2::task_canceled_exception
Public Functions
-
exception
(error e = success)¶ Construct a hpx::exception from a hpx::error.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.
-
exception
(boost::system::system_error const &e)¶ Construct a hpx::exception from a boost::system_error.
-
exception
(boost::system::error_code const &e)¶ Construct a hpx::exception from a boost::system::error_code (this is new for Boost V1.69). This constructor is required to compensate for the changes introduced as a resolution to LWG3162 (https://cplusplus.github.io/LWG/issue3162).
-
exception
(error e, char const *msg, throwmode mode = plain)¶ Construct a hpx::exception from a hpx::error and an error message.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.msg
: The parametermsg
holds the error message the new exception should encapsulate.mode
: The parametermode
specifies whether the returned hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
-
exception
(error e, std::string const &msg, throwmode mode = plain)¶ Construct a hpx::exception from a hpx::error and an error message.
- Parameters
e
: The parametere
holds the hpx::error code the new exception should encapsulate.msg
: The parametermsg
holds the error message the new exception should encapsulate.mode
: The parametermode
specifies whether the returned hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
-
~exception
()¶ Destruct a hpx::exception
- Exceptions
nothing
:
-
error
get_error
() const¶ The function get_error() returns the hpx::error code stored in the referenced instance of a hpx::exception. It returns the hpx::error code this exception instance was constructed from.
- Exceptions
nothing
:
-
error_code
get_error_code
(throwmode mode = plain) const¶ The function get_error_code() returns a hpx::error_code which represents the same error condition as this hpx::exception instance.
- Parameters
mode
: The parametermode
specifies whether the returned hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).
-
-
class
exception_list
: public hpx::exception¶ - #include <exception_list.hpp>
The class exception_list is a container of exception_ptr objects parallel algorithms may use to communicate uncaught exceptions encountered during parallel execution to the caller of the algorithm
The type exception_list::const_iterator fulfills the requirements of a forward iterator.
Public Types
-
typedef exception_list_type::const_iterator
iterator
¶ bidirectional iterator
Public Functions
-
std::size_t
size
() const¶ The number of exception_ptr objects contained within the exception_list.
- Note
- Complexity: Constant time.
-
exception_list_type::const_iterator
begin
() const¶ An iterator referring to the first exception_ptr object contained within the exception_list.
-
exception_list_type::const_iterator
end
() const¶ An iterator which is the past-the-end value for the exception_list.
Private Types
-
typedef std::list<std::exception_ptr>
exception_list_type
¶
-
typedef exception_list_type::const_iterator
-
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.
-
struct
invoke
¶ - #include <invoke.hpp>
Public Functions
-
template<typename F, typename... Ts>HPX_HOST_DEVICE util::invoke_result<F, Ts...>::type hpx::util::functional::invoke::operator()(F && f, Ts &&... vs) const
-
-
template<typename
R
>
structinvoke_r
¶ - #include <invoke.hpp>
Public Functions
-
template<typename F, typename... Ts>HPX_HOST_DEVICE R hpx::util::functional::invoke_r::operator()(F && f, Ts &&... vs) const
-
-
template<typename
T
>
structis_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
- 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.
- 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>.
- The behavior of a program that adds specializations for is_async_execution_policy is undefined.
-
template<typename
T
>
structis_execution_policy
: public execution::detail::is_execution_policy<hpx::util::decay<T>::type>¶ - #include <is_execution_policy.hpp>
- 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.
- 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>.
- The behavior of a program that adds specializations for is_execution_policy is undefined.
-
template<typename
T
>
structis_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
- 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.
- 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>.
- The behavior of a program that adds specializations for is_parallel_execution_policy is undefined.
-
template<typename
T
>
structis_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
- 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.
- 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>.
- The behavior of a program that adds specializations for is_sequenced_execution_policy is undefined.
-
struct
launch
: public detail::policy_holder<>¶ - #include <launch_policy.hpp>
Launch policies for hpx::async etc.
Public Functions
-
launch
()¶ Default constructor. This creates a launch policy representing all possible launch modes
Public Static Attributes
-
const detail::fork_policy
fork
¶ Predefined launch policy representing asynchronous execution.The new thread is executed in a preferred way
-
const detail::sync_policy
sync
¶ Predefined launch policy representing synchronous execution.
-
const detail::deferred_policy
deferred
¶ Predefined launch policy representing deferred execution.
-
const detail::apply_policy
apply
¶ Predefined launch policy representing fire and forget execution.
-
const detail::select_policy_generator
select
¶ Predefined launch policy representing delayed policy selection.
-
-
class
numa_domain
¶ - #include <partitioner.hpp>
Private Static Attributes
-
const std::size_t
invalid_numa_domain_id
= std::size_t(-1)¶
Friends
-
friend
hpx::resource::numa_domain::pu
-
friend
hpx::resource::numa_domain::core
-
const std::size_t
-
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
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>::typeon
(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
, typenameParametersType
= typename executor_parameters_join<Parameters...>::type>
rebind_executor<parallel_policy, executor_type, ParametersType>::typewith
(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
Friends
-
friend
hpx::parallel::execution::parallel_policy::hpx::serialization::access
-
typedef parallel_executor
-
template<typename
Policy
>
structparallel_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.
-
typedef parallel_execution_tag
-
template<typename
Executor
, typenameParameters
>
structparallel_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.
Public Types
-
typedef Executor
executor_type
¶ The type of the executor associated with this execution policy.
-
typedef Parameters
executor_parameters_type
¶ The type of the associated executor parameters object which is associated with this execution policy
-
typedef hpx::traits::executor_execution_category<executor_type>::type
execution_category
¶ The category of the execution agents created by this execution policy.
Public Functions
-
parallel_task_policy_shim<Executor, Parameters>
operator()
(task_policy_tag 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_shim, Executor_, executor_parameters_type>::typeon
(Executor_ &&exec) const¶ Create a new parallel_policy from the given executor
- Note
- Requires: is_executor<Executor>::value is true
- Return
- The new parallel_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_
, typenameParametersType
= typename executor_parameters_join<Parameters_...>::type>
rebind_executor<parallel_policy_shim, executor_type, ParametersType>::typewith
(Parameters_&&... params) const¶ Create a new parallel_policy_shim from the given execution parameters
- Note
- Requires: is_executor_parameters<Parameters>::value is true
- 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 &
executor
()¶ Return the associated executor object.
-
Executor const &
executor
() const¶ Return the associated executor object.
-
Parameters &
parameters
()¶ Return the associated executor parameters object.
-
Parameters const &
parameters
() const¶ Return the associated executor parameters object.
-
typedef Executor
-
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>::typeon
(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
, typenameParametersType
= typename executor_parameters_join<Parameters...>::type>
rebind_executor<parallel_task_policy, executor_type, ParametersType>::typewith
(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
Friends
-
friend
hpx::parallel::execution::parallel_task_policy::hpx::serialization::access
-
typedef parallel_executor
-
template<typename
Executor
, typenameParameters
>
structparallel_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.
Public Types
-
typedef Executor
executor_type
¶ The type of the executor associated with this execution policy.
-
typedef Parameters
executor_parameters_type
¶ The type of the associated executor parameters object which is associated with this execution policy
-
typedef hpx::traits::executor_execution_category<executor_type>::type
execution_category
¶ The category of the execution agents created by this execution policy.
Public Functions
-
parallel_task_policy_shim
operator()
(task_policy_tag tag) const¶ Create a new parallel_task_policy_shim 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<parallel_task_policy_shim, Executor_, executor_parameters_type>::typeon
(Executor_ &&exec) const¶ Create a new parallel_task_policy from the 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_
, typenameParametersType
= typename executor_parameters_join<Parameters_...>::type>
rebind_executor<parallel_task_policy_shim, executor_type, ParametersType>::typewith
(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 &
executor
()¶ Return the associated executor object.
-
Executor const &
executor
() const¶ Return the associated executor object.
-
Parameters &
parameters
()¶ Return the associated executor parameters object.
-
Parameters const &
parameters
() const¶ Return the associated executor parameters object.
-
typedef Executor
-
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
Friends
-
friend
hpx::parallel::execution::parallel_unsequenced_policy::hpx::serialization::access
-
typedef parallel_executor
-
class
partitioner
¶ - #include <partitioner.hpp>
Public Functions
-
partitioner
(util::function_nonser<int(boost::program_options::variables_map &vm)> const &f, boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default, )¶
-
partitioner
(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶
-
partitioner
(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, std::vector<std::string> const &cfg, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶
-
partitioner
(int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)¶
-
partitioner
(int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)¶
-
partitioner
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)¶
-
partitioner
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)¶
-
partitioner
(std::nullptr_t f, int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default)¶
-
partitioner
(std::nullptr_t f, int argc, char **argv, std::vector<std::string> const &cfg, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default)¶
-
partitioner
(std::nullptr_t f, boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)¶
-
void
create_thread_pool
(std::string const &name, scheduling_policy sched = scheduling_policy::unspecified, hpx::threads::policies::scheduler_mode = hpx::threads::policies::scheduler_mode::default_mode)¶
-
void
create_thread_pool
(std::string const &name, scheduler_function scheduler_creation)¶
-
void
set_default_pool_name
(std::string const &name)¶
-
const std::string &
get_default_pool_name
() const¶
-
void
add_resource
(hpx::resource::pu const &p, std::string const &pool_name, std::size_t num_threads = 1)¶
-
void
add_resource
(hpx::resource::pu const &p, std::string const &pool_name, bool exclusive, std::size_t num_threads = 1)¶
-
void
add_resource
(std::vector<hpx::resource::pu> const &pv, std::string const &pool_name, bool exclusive = true)¶
-
void
add_resource
(hpx::resource::core const &c, std::string const &pool_name, bool exclusive = true)¶
-
void
add_resource
(std::vector<hpx::resource::core> &cv, std::string const &pool_name, bool exclusive = true)¶
-
void
add_resource
(hpx::resource::numa_domain const &nd, std::string const &pool_name, bool exclusive = true)¶
-
void
add_resource
(std::vector<hpx::resource::numa_domain> const &ndv, std::string const &pool_name, bool exclusive = true)¶
-
std::vector<numa_domain> const &
numa_domains
() const¶
-
std::size_t
get_number_requested_threads
()¶
Private Members
-
detail::partitioner &
partitioner_
¶
-
-
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.
-
-
class
pu
¶ - #include <partitioner.hpp>
Public Functions
-
pu
(std::size_t id = invalid_pu_id, core *core = nullptr, std::size_t thread_occupancy = 0)¶
-
std::size_t
id
() const¶
Private Members
-
std::size_t
id_
¶
-
std::size_t
thread_occupancy_
¶
-
std::size_t
thread_occupancy_count_
¶
Private Static Attributes
-
const std::size_t
invalid_pu_id
= std::size_t(-1)¶
Friends
-
friend
hpx::resource::pu::core
-
friend
hpx::resource::pu::numa_domain
-
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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.
-
typedef parallel_task_policy_shim<Executor_, Parameters_>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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.
-
typedef sequenced_policy_shim<Executor_, Parameters_>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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
-
template<>
typedef sequenced_task_policy_shim<Executor_, Parameters_>type
¶ The type of the rebound execution policy.
-
template<>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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
-
template<>
typedef parallel_task_policy_shim<Executor_, Parameters_>type
¶ The type of the rebound execution policy.
-
template<>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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
-
template<>
typedef parallel_policy_shim<Executor_, Parameters_>type
¶ The type of the rebound execution policy.
-
template<>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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.
-
typedef parallel_policy_shim<Executor_, Parameters_>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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.
-
typedef sequenced_task_policy_shim<Executor_, Parameters_>
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #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
-
template<>
typedef sequenced_policy_shim<Executor_, Parameters_>type
¶ The type of the rebound execution policy.
-
template<>
-
struct
sequenced_execution_tag
¶ - #include <execution_fwd.hpp>
Function invocations executed by a group of sequential execution agents execute in sequential order.
-
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.
-
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>::typeon
(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
, typenameParametersType
= typename executor_parameters_join<Parameters...>::type>
rebind_executor<sequenced_policy, executor_type, ParametersType>::typewith
(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
Friends
-
friend
hpx::parallel::execution::sequenced_policy::hpx::serialization::access
-
typedef sequenced_executor
-
template<typename
Executor
, typenameParameters
>
structsequenced_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.
Public Types
-
typedef Executor
executor_type
¶ The type of the executor associated with this execution policy.
-
typedef Parameters
executor_parameters_type
¶ The type of the associated executor parameters object which is associated with this execution policy
-
typedef hpx::traits::executor_execution_category<executor_type>::type
execution_category
¶ The category of the execution agents created by this execution policy.
Public Functions
-
sequenced_task_policy_shim<Executor, Parameters>
operator()
(task_policy_tag tag) const¶ Create a new sequenced_task_policy.
- Return
- The new sequenced_task_policy_shim
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
template<typename
Executor_
>
rebind_executor<sequenced_policy_shim, Executor_, executor_parameters_type>::typeon
(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_
, typenameParametersType
= typename executor_parameters_join<Parameters_...>::type>
rebind_executor<sequenced_policy_shim, executor_type, ParametersType>::typewith
(Parameters_&&... params) const¶ Create a new sequenced_policy_shim from the given execution parameters
- Note
- Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
- The new sequenced_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 &
executor
()¶ Return the associated executor object.
-
Executor const &
executor
() const¶ Return the associated executor object.
-
Parameters &
parameters
()¶ Return the associated executor parameters object.
-
Parameters const &
parameters
() const¶ Return the associated executor parameters object.
-
typedef Executor
-
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>::typeon
(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
, typenameParametersType
= typename executor_parameters_join<Parameters...>::type>
rebind_executor<sequenced_task_policy, executor_type, ParametersType>::typewith
(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
Friends
-
friend
hpx::parallel::execution::sequenced_task_policy::hpx::serialization::access
-
typedef sequenced_executor
-
template<typename
Executor
, typenameParameters
>
structsequenced_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.
Public Types
-
typedef Executor
executor_type
¶ The type of the executor associated with this execution policy.
-
typedef Parameters
executor_parameters_type
¶ The type of the associated executor parameters object which is associated with this execution policy
-
typedef hpx::traits::executor_execution_category<executor_type>::type
execution_category
¶ The category of the execution agents created by this execution policy.
Public Functions
-
sequenced_task_policy_shim const &
operator()
(task_policy_tag 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_shim, Executor_, executor_parameters_type>::typeon
(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_
, typenameParametersType
= typename executor_parameters_join<Parameters_...>::type>
rebind_executor<sequenced_task_policy_shim, executor_type, ParametersType>::typewith
(Parameters_&&... params) const¶ Create a new sequenced_task_policy_shim 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_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 &
executor
()¶ Return the associated executor object.
-
Executor const &
executor
() const¶ Return the associated executor object.
-
Parameters &
parameters
()¶ Return the associated executor parameters object.
-
Parameters const &
parameters
() const¶ Return the associated executor parameters object.
-
typedef Executor
-
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.
-
template<typename
ExPolicy
= parallel::execution::parallel_policy>
classtask_block
¶ - #include <task_block.hpp>
The class task_block defines an interface for forking and joining parallel tasks. The define_task_block and define_task_block_restore_thread function templates create an object of type task_block and pass a reference to that object to a user-provided callable object.
An object of class task_block cannot be constructed, destroyed, copied, or moved except by the implementation of the task region library. Taking the address of a task_block object via operator& or addressof is ill formed. The result of obtaining its address by any other means is unspecified.
is active if it was created by the nearest enclosing task block, where “task block” refers to an invocation of define_task_block or define_task_block_restore_thread and “nearest
enclosing” means the most recent invocation that has not yet completed. Code designated for execution in another thread by means other than the facilities in this section (e.g., using thread or async) are not enclosed in the task region and a
task_block passed to (or captured by) such code is not active within that code. Performing any operation on a task_block that is not active results in undefined behavior.The task_block that is active before a specific call to the run member function is not active within the asynchronous function that invoked run. (The invoked function should not, therefore, capture the task_block from the surrounding block.)
Example: define_task_block([&](auto& tr) { tr.run([&] { tr.run([] { f(); }); // Error: tr is not active define_task_block([&](auto& tr) { // Nested task block tr.run(f); // OK: inner tr is active /// ... }); }); /// ... });
- Template Parameters
ExPolicy
: The execution policy an instance of a task_block was created with. This defaults to parallel_policy.
Public Types
-
typedef ExPolicy
execution_policy
¶ Refers to the type of the execution policy used to create the task_block.
Public Functions
-
execution_policy const &
get_execution_policy
() const¶ Return the execution policy instance used to create this task_block
-
template<typename
F
, typename ...Ts
>
voidrun
(F &&f, Ts&&... ts)¶ Causes the expression f() to be invoked asynchronously. The invocation of f is permitted to run on an unspecified thread in an unordered fashion relative to the sequence of operations following the call to run(f) (the continuation), or indeterminately sequenced within the same thread as the continuation.
The call to run synchronizes with the invocation of f. The completion of f() synchronizes with the next invocation of wait on the same task_block or completion of the nearest enclosing task block (i.e., the define_task_block or define_task_block_restore_thread that created this task block).
Requires: F shall be MoveConstructible. The expression, (void)f(), shall be well-formed.
Precondition: this shall be the active task_block.
Postconditions: A call to run may return on a different thread than that on which it was called.
- Note
- The call to run is sequenced before the continuation as if run returns on the same thread. The invocation of the user-supplied callable object f may be immediate or may be delayed until compute resources are available. run might or might not return before invocation of f completes.
- Exceptions
This
: function may throw task_canceled_exception, as described in Exception Handling.
-
template<typename
Executor
, typenameF
, typename ...Ts
>
voidrun
(Executor &exec, F &&f, Ts&&... ts)¶ Causes the expression f() to be invoked asynchronously using the given executor. The invocation of f is permitted to run on an unspecified thread associated with the given executor and in an unordered fashion relative to the sequence of operations following the call to run(exec, f) (the continuation), or indeterminately sequenced within the same thread as the continuation.
The call to run synchronizes with the invocation of f. The completion of f() synchronizes with the next invocation of wait on the same task_block or completion of the nearest enclosing task block (i.e., the define_task_block or define_task_block_restore_thread that created this task block).
Requires: Executor shall be a type modeling the Executor concept. F shall be MoveConstructible. The expression, (void)f(), shall be well-formed.
Precondition: this shall be the active task_block.
Postconditions: A call to run may return on a different thread than that on which it was called.
- Note
- The call to run is sequenced before the continuation as if run returns on the same thread. The invocation of the user-supplied callable object f may be immediate or may be delayed until compute resources are available. run might or might not return before invocation of f completes.
- Exceptions
This
: function may throw task_canceled_exception, as described in Exception Handling.
-
void
wait
()¶ Blocks until the tasks spawned using this task_block have finished.
Precondition: this shall be the active task_block.
Postcondition: All tasks spawned by the nearest enclosing task region have finished. A call to wait may return on a different thread than that on which it was called.
Example: define_task_block([&](auto& tr) { tr.run([&]{ process(a, w, x); }); // Process a[w] through a[x] if (y < x) tr.wait(); // Wait if overlap between [w, x) and [y, z) process(a, y, z); // Process a[y] through a[z] });
- Note
- The call to wait is sequenced before the continuation as if wait returns on the same thread.
- Exceptions
This
: function may throw task_canceled_exception, as described in Exception Handling.
-
ExPolicy &
policy
()¶ Returns a reference to the execution policy used to construct this object.
Precondition: this shall be the active task_block.
-
ExPolicy const &
policy
() const¶ Returns a reference to the execution policy used to construct this object.
Precondition: this shall be the active task_block.
-
class
task_canceled_exception
: public hpx::exception¶ - #include <task_block.hpp>
The class task_canceled_exception defines the type of objects thrown by task_block::run or task_block::wait if they detect that an exception is pending within the current parallel region.
Public Functions
-
task_canceled_exception
()¶
-
-
struct
thread_interrupted
: public exception¶ - #include <exception.hpp>
A hpx::thread_interrupted is the exception type used by HPX to interrupt a running HPX thread.
The hpx::thread_interrupted type is the exception type used by HPX to interrupt a running thread.
A running thread can be interrupted by invoking the interrupt() member function of the corresponding hpx::thread object. When the interrupted thread next executes one of the specified interruption points (or if it is currently blocked whilst executing one) with interruption enabled, then a hpx::thread_interrupted exception will be thrown in the interrupted thread. If not caught, this will cause the execution of the interrupted thread to terminate. As with any other exception, the stack will be unwound, and destructors for objects of automatic storage duration will be executed.
If a thread wishes to avoid being interrupted, it can create an instance of hpx::this_thread::disable_interruption. Objects of this class disable interruption for the thread that created them on construction, and restore the interruption state to whatever it was before on destruction.
void f() { // interruption enabled here { hpx::this_thread::disable_interruption di; // interruption disabled { hpx::this_thread::disable_interruption di2; // interruption still disabled } // di2 destroyed, interruption state restored // interruption still disabled } // di destroyed, interruption state restored // interruption now enabled }
The effects of an instance of hpx::this_thread::disable_interruption can be temporarily reversed by constructing an instance of hpx::this_thread::restore_interruption, passing in the hpx::this_thread::disable_interruption object in question. This will restore the interruption state to what it was when the hpx::this_thread::disable_interruption object was constructed, and then disable interruption again when the hpx::this_thread::restore_interruption object is destroyed.
void g() { // interruption enabled here { hpx::this_thread::disable_interruption di; // interruption disabled { hpx::this_thread::restore_interruption ri(di); // interruption now enabled } // ri destroyed, interruption disable again } // di destroyed, interruption state restored // interruption now enabled }
At any point, the interruption state for the current thread can be queried by calling hpx::this_thread::interruption_enabled().
-
class
thread_pool_base
: public manage_executor¶ - #include <thread_pool_base.hpp>
The base class used to manage a pool of OS threads.
Public Functions
-
virtual hpx::future<void>
resume
() = 0¶ Resumes the thread pool. When the all OS threads on the thread pool have been resumed the returned future will be ready.
- Note
- Can only be called from an HPX thread. Use resume_cb or resume_direct to suspend the pool from outside HPX.
- Return
- A
future<void>
which is ready when the thread pool has been resumed. - Exceptions
hpx::exception
: if called from outside the HPX runtime.
-
virtual void
resume_cb
(std::function<void(void)> callback, error_code &ec = throws, ) = 0¶ Resumes the thread pool. Takes a callback as a parameter which will be called when all OS threads on the thread pool have been resumed.
- Parameters
callback
: [in] called when the thread pool has been resumed.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
virtual void
resume_direct
(error_code &ec = throws) = 0¶ Resumes the thread pool. Blocks until all OS threads on the thread pool have been resumed.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
virtual hpx::future<void>
suspend
() = 0¶ Suspends the thread pool. When the all OS threads on the thread pool have been suspended the returned future will be ready.
- Note
- Can only be called from an HPX thread. Use suspend_cb or suspend_direct to suspend the pool from outside HPX. A thread pool cannot be suspended from an HPX thread running on the pool itself.
- Return
- A
future<void>
which is ready when the thread pool has been suspended. - Exceptions
hpx::exception
: if called from outside the HPX runtime.
-
virtual void
suspend_cb
(std::function<void(void)> callback, error_code &ec = throws, ) = 0¶ Suspends the thread pool. Takes a callback as a parameter which will be called when all OS threads on the thread pool have been suspended.
- Note
- A thread pool cannot be suspended from an HPX thread running on the pool itself.
- Parameters
callback
: [in] called when the thread pool has been suspended.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
- Exceptions
hpx::exception
: if called from an HPX thread which is running on the pool itself.
-
virtual void
suspend_direct
(error_code &ec = throws) = 0¶ Suspends the thread pool. Blocks until all OS threads on the thread pool have been suspended.
- Note
- A thread pool cannot be suspended from an HPX thread running on the pool itself.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
- Exceptions
hpx::exception
: if called from an HPX thread which is running on the pool itself.
-
virtual hpx::future<void>
suspend_processing_unit
(std::size_t virt_core) = 0¶ Suspends the given processing unit. When the processing unit has been suspended the returned future will be ready.
- Note
- Can only be called from an HPX thread. Use suspend_processing_unit_cb or to suspend the processing unit from outside HPX. Requires that the pool has threads::policies::enable_elasticity set.
- Return
- A
future<void>
which is ready when the given processing unit has been suspended. - Parameters
virt_core
: [in] The processing unit on the the pool to be suspended. The processing units are indexed starting from 0.
- Exceptions
hpx::exception
: if called from outside the HPX runtime.
-
virtual void
suspend_processing_unit_cb
(std::function<void(void)> callback, std::size_t virt_core, error_code &ec = throws, ) = 0¶ Suspends the given processing unit. Takes a callback as a parameter which will be called when the processing unit has been suspended.
- Note
- Requires that the pool has threads::policies::enable_elasticity set.
- Parameters
callback
: [in] Callback which is called when the processing unit has been suspended.virt_core
: [in] The processing unit to suspend.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
virtual hpx::future<void>
resume_processing_unit
(std::size_t virt_core) = 0¶ Resumes the given processing unit. When the processing unit has been resumed the returned future will be ready.
- Note
- Can only be called from an HPX thread. Use resume_processing_unit_cb or to resume the processing unit from outside HPX. Requires that the pool has threads::policies::enable_elasticity set.
- Return
- A
future<void>
which is ready when the given processing unit has been resumed. - Parameters
virt_core
: [in] The processing unit on the the pool to be resumed. The processing units are indexed starting from 0.
-
virtual void
resume_processing_unit_cb
(std::function<void(void)> callback, std::size_t virt_core, error_code &ec = throws, ) = 0¶ Resumes the given processing unit. Takes a callback as a parameter which will be called when the processing unit has been resumed.
- Note
- Requires that the pool has threads::policies::enable_elasticity set.
- Parameters
callback
: [in] Callback which is called when the processing unit has been suspended.virt_core
: [in] The processing unit to resume.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
virtual hpx::future<void>
-
struct
thread_schedule_hint
¶ - #include <thread_enums.hpp>
Public Functions
-
thread_schedule_hint
()¶
-
thread_schedule_hint
(std::int16_t thread_hint)¶
-
thread_schedule_hint
(thread_schedule_hint_mode mode, std::int16_t hint)¶
-
-
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.
-
struct
unwrap
¶ - #include <unwrap.hpp>
A helper function object for functionally invoking
hpx::util::unwrap
. For more information please refer to its documentation.
-
struct
unwrap_all
¶ - #include <unwrap.hpp>
A helper function object for functionally invoking
hpx::util::unwrap_all
. For more information please refer to its documentation.
-
template<std::size_t
Depth
>
structunwrap_n
¶ - #include <unwrap.hpp>
A helper function object for functionally invoking
hpx::util::unwrap_n
. For more information please refer to its documentation.
-
template<typename
Sequence
>
structwhen_any_result
¶ - #include <when_any.hpp>
Result type for when_any, contains a sequence of futures and an index pointing to a ready future.
Public Members
-
std::size_t
index
¶ The index of a future which has become ready.
-
Sequence
futures
¶ The sequence of futures as passed to hpx::when_any.
-
std::size_t
-
template<typename
Sequence
>
structwhen_some_result
¶ - #include <when_some.hpp>
Result type for when_some, contains a sequence of futures and indices pointing to ready futures.
Public Members
-
std::vector<std::size_t>
indices
¶ List of indices of futures which became ready.
-
Sequence
futures
¶ The sequence of futures as passed to hpx::when_some.
-
std::vector<std::size_t>
-
namespace
applier
¶ The namespace applier contains all definitions needed for the class hpx::applier::applier and its related functionality. This namespace is part of the HPX core module.
-
namespace
hpx
¶ Unnamed Group
-
error_code
make_error_code
(error e, throwmode mode = plain)¶ Returns a new error_code constructed from the given parameters.
-
error_code
make_error_code
(error e, char const *func, char const *file, long line, throwmode mode = plain)¶
-
error_code
make_error_code
(error e, char const *msg, throwmode mode = plain)¶ Returns error_code(e, msg, mode).
-
error_code
make_error_code
(error e, char const *msg, char const *func, char const *file, long line, throwmode mode = plain)¶
-
error_code
make_error_code
(error e, std::string const &msg, throwmode mode = plain)¶ Returns error_code(e, msg, mode).
-
error_code
make_error_code
(error e, std::string const &msg, char const *func, char const *file, long line, throwmode mode = plain)¶
-
error_code
make_error_code
(std::exception_ptr const &e)¶
Typedefs
-
typedef util::function_nonser<void(boost::system::error_code const&, parcelset::parcel const&)>
parcel_write_handler_type
¶ The type of a function which can be registered as a parcel write handler using the function hpx::set_parcel_write_handler.
- Note
- A parcel write handler is a function which is called by the parcel layer whenever a parcel has been sent by the underlying networking library and if no explicit parcel handler function was specified for the parcel.
Enums
-
enum
error
¶ Possible error conditions.
This enumeration lists all possible error conditions which can be reported from any of the API functions.
Values:
-
success
= 0¶ The operation was successful.
-
no_success
= 1¶ The operation did failed, but not in an unexpected manner.
-
not_implemented
= 2¶ The operation is not implemented.
-
out_of_memory
= 3¶ The operation caused an out of memory condition.
-
bad_action_code
= 4¶
-
bad_component_type
= 5¶ The specified component type is not known or otherwise invalid.
-
network_error
= 6¶ A generic network error occurred.
-
version_too_new
= 7¶ The version of the network representation for this object is too new.
-
version_too_old
= 8¶ The version of the network representation for this object is too old.
-
version_unknown
= 9¶ The version of the network representation for this object is unknown.
-
unknown_component_address
= 10¶
-
duplicate_component_address
= 11¶ The given global id has already been registered.
-
invalid_status
= 12¶ The operation was executed in an invalid status.
-
bad_parameter
= 13¶ One of the supplied parameters is invalid.
-
internal_server_error
= 14¶
-
bad_request
= 16¶
-
repeated_request
= 17¶
-
lock_error
= 18¶
-
duplicate_console
= 19¶ There is more than one console locality.
-
no_registered_console
= 20¶ There is no registered console locality available.
-
startup_timed_out
= 21¶
-
uninitialized_value
= 22¶
-
bad_response_type
= 23¶
-
deadlock
= 24¶
-
assertion_failure
= 25¶
-
null_thread_id
= 26¶ Attempt to invoke a API function from a non-HPX thread.
-
invalid_data
= 27¶
-
yield_aborted
= 28¶ The yield operation was aborted.
-
dynamic_link_failure
= 29¶
-
commandline_option_error
= 30¶ One of the options given on the command line is erroneous.
-
serialization_error
= 31¶ There was an error during serialization of this object.
-
unhandled_exception
= 32¶ An unhandled exception has been caught.
-
kernel_error
= 33¶ The OS kernel reported an error.
-
broken_task
= 34¶ The task associated with this future object is not available anymore.
-
task_moved
= 35¶ The task associated with this future object has been moved.
-
task_already_started
= 36¶ The task associated with this future object has already been started.
-
future_already_retrieved
= 37¶ The future object has already been retrieved.
-
promise_already_satisfied
= 38¶ The value for this future object has already been set.
-
future_does_not_support_cancellation
= 39¶ The future object does not support cancellation.
-
future_can_not_be_cancelled
= 40¶ The future can’t be canceled at this time.
-
no_state
= 41¶ The future object has no valid shared state.
-
broken_promise
= 42¶ The promise has been deleted.
-
thread_resource_error
= 43¶
-
future_cancelled
= 44¶
-
thread_cancelled
= 45¶
-
thread_not_interruptable
= 46¶
-
duplicate_component_id
= 47¶ The component type has already been registered.
-
unknown_error
= 48¶ An unknown error occurred.
-
bad_plugin_type
= 49¶ The specified plugin type is not known or otherwise invalid.
-
filesystem_error
= 50¶ The specified file does not exist or other filesystem related error.
-
bad_function_call
= 51¶ equivalent of std::bad_function_call
-
task_canceled_exception
= 52¶
-
task_block_not_active
= 53¶ task_region is not active
-
out_of_range
= 54¶ Equivalent to std::out_of_range.
-
length_error
= 55¶ Equivalent to std::length_error.
-
migration_needs_retry
= 56¶ migration failed because of global race, retry
-
-
enum
throwmode
¶ Encode error category for new error_code.
Values:
-
plain
= 0¶
-
rethrow
= 1¶
-
-
enum
runtime_mode
¶ A HPX runtime can be executed in two different modes: console mode and worker mode.
Values:
-
runtime_mode_invalid
= -1¶
-
runtime_mode_console
= 0¶ The runtime is the console locality.
-
runtime_mode_worker
= 1¶ The runtime is a worker locality.
-
runtime_mode_connect
= 2¶ The runtime is a worker locality connecting late
-
runtime_mode_default
= 3¶ The runtime mode will be determined based on the command line arguments
-
runtime_mode_last
¶
-
Functions
-
int
init
(util::function_nonser<int(boost::program_options::variables_map &vm)> const &f, boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> const &cfg, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is the main entry point for any HPX application. This function (or one of its overloads below) should be called from the users
main()
function. It will set up the HPX runtime environment and schedule the function given byf
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied
f
. - Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(int (*f)(boost::program_options::variables_map &vm), boost::program_options::options_description const &desc_cmdline, int argc, char **argv, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is the main entry point for any HPX application. This function (or one of its overloads below) should be called from the users
main()
function. It will set up the HPX runtime environment and schedule the function given byf
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied
f
. - Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> const &cfg, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(int argc, char **argv, std::vector<std::string> const &cfg, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, hpx::runtime_mode mode)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- If the parameter
mode
is runtime_mode_default, the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> const &cfg, hpx::runtime_mode mode)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- If the parameter
mode
is runtime_mode_default, the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(std::string const &app_name, int argc = 0, char **argv = nullptr, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
app_name
: [in] The name of the application.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(int argc = 0, char **argv = nullptr, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. If not command line arguments are passed, console mode is assumed. - Note
- If no command line arguments are passed the HPX runtime system will not support any of the default command line options as described in the section ‘HPX Command Line Options’.
- Parameters
argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(std::vector<std::string> const &cfg, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings).
- Return
- The function returns the value, which has been returned from
hpx_main
(or 0 when executed in worker mode). - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. If not command line arguments are passed, console mode is assumed. - Note
- If no command line arguments are passed the HPX runtime system will not support any of the default command line options as described in the section ‘HPX Command Line Options’.
- Parameters
cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(int (*f)(boost::program_options::variables_map &vm), std::string const &app_name, int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will schedule the function given by
f
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied function
f
. - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.app_name
: [in] The name of the application.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(int (*f)(boost::program_options::variables_map &vm), int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will schedule the function given by
f
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied function
f
. - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(util::function_nonser<int(int, char **)> const &f, std::string const &app_name, int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will schedule the function given by
f
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied function
f
. - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.app_name
: [in] The name of the application.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will schedule the function given by
f
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied function
f
. - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
init
(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, std::vector<std::string> const &cfg, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main entry point for launching the HPX runtime system.
This is a simplified main entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will schedule the function given by
f
as a HPX thread. This overload will not callhpx_main
.- Return
- The function returns the value, which has been returned from the user supplied function
f
. - Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(util::function_nonser<int(boost::program_options::variables_map &vm)> const &f, boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> const &cfg, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is the main, non-blocking entry point for any HPX application. This function (or one of its overloads below) should be called from the users
main()
function. It will set up the HPX runtime environment and schedule the function given byf
as a HPX thread. It will return immediately after that. Usehpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(int (*f)(boost::program_options::variables_map &vm), boost::program_options::options_description const &desc_cmdline, int argc, char **argv, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is the main, non-blocking entry point for any HPX application. This function (or one of its overloads below) should be called from the users
main()
function. It will set up the HPX runtime environment and schedule the function given byf
as a HPX thread. It will return immediately after that. Usehpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> const &cfg, startup_function_type startup = startup_function_type(), shutdown_function_type shutdown = shutdown_function_type(), hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is not given (defaulted), the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)startup
: [in] A function to be executed inside a HPX thread beforef
is called. If this parameter is not given no function will be executed.shutdown
: [in] A function to be executed inside an HPX thread while hpx::finalize is executed. If this parameter is not given no function will be executed.mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(int argc, char **argv, std::vector<std::string> const &cfg, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is runtime_mode_default, the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, hpx::runtime_mode mode)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is runtime_mode_default, the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(boost::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> const &cfg, hpx::runtime_mode mode)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.In console mode it will execute the user supplied function
hpx_main
, in worker mode it will execute an emptyhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- If the parameter
mode
is runtime_mode_default, the created runtime system instance will be executed in console or worker mode depending on the command line arguments passed inargc
/argv
. Otherwise it will be executed as specified by the parametermode
. - Parameters
desc_cmdline
: [in] This parameter may hold the description of additional command line arguments understood by the application. These options will be prepended to the default command line options understood by hpx::init (see description below).argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(std::string const &app_name, int argc = 0, char **argv = nullptr, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
app_name
: [in] The name of the application.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(int argc = 0, char **argv = nullptr, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. If not command line arguments are passed, console mode is assumed. - Note
- If no command line arguments are passed the HPX runtime system will not support any of the default command line options as described in the section ‘HPX Command Line Options’.
- Parameters
argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(std::vector<std::string> const &cfg, hpx::runtime_mode mode = hpx::runtime_mode_default)¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. If not command line arguments are passed, console mode is assumed. - Note
- If no command line arguments are passed the HPX runtime system will not support any of the default command line options as described in the section ‘HPX Command Line Options’.
- Parameters
cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(int (*f)(boost::program_options::variables_map &vm), std::string const &app_name, int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will schedule the function given byf
as a HPX thread. It will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application.app_name
: [in] The name of the application.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(util::function_nonser<int(int, char **)> const &f, std::string const &app_name, int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will schedule the function given byf
as a HPX thread. It will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.app_name
: [in] The name of the application.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(int (*f)(boost::program_options::variables_map &vm), int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will schedule the function given byf
as a HPX thread. It will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will schedule the function given byf
as a HPX thread. It will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
bool
start
(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, std::vector<std::string> const &cfg, hpx::runtime_mode mode = hpx::runtime_mode_default, )¶ Main non-blocking entry point for launching the HPX runtime system.
This is a simplified main, non-blocking entry point, which can be used to set up the runtime for an HPX application (the runtime system will be set up in console mode or worker mode depending on the command line settings). It will return immediately after that. Use
hpx::wait
andhpx::stop
to synchronize with the runtime system’s execution. This overload will schedule the function given byf
as a HPX thread. It will not callhpx_main
.- Return
- The function returns true if command line processing succeeded and the runtime system was started successfully. It will return false otherwise.
- Note
- The created runtime system instance will be executed in console or worker mode depending on the command line arguments passed in
argc
/argv
. - Parameters
f
: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. Iff
isnullptr
the HPX runtime environment will be started without invokingf
.argc
: [in] The number of command line arguments passed inargv
. This is usually the unchanged value as passed by the operating system (tomain()
).argv
: [in] The command line arguments for this application, usually that is the value as passed by the operating system (tomain()
).cfg
: A list of configuration settings which will be added to the system configuration before the runtime instance is run. Each of the entries in this list must have the format of a fully defined key/value pair from an ini-file (for instance ‘hpx.component.enabled=1’)mode
: [in] The mode the created runtime environment should be initialized in. There has to be exactly one locality in each HPX application which is executed in console mode (hpx::runtime_mode_console), all other localities have to be run in worker mode (hpx::runtime_mode_worker). Normally this is set up automatically, but sometimes it is necessary to explicitly specify the mode.
-
int
finalize
(double shutdown_timeout, double localwait = -1.0, error_code &ec = throws)¶ Main function to gracefully terminate the HPX runtime system.
The function hpx::finalize is the main way to (gracefully) exit any HPX application. It should be called from one locality only (usually the console) and it will notify all connected localities to finish execution. Only after all other localities have exited this function will return, allowing to exit the console locality as well.
During the execution of this function the runtime system will invoke all registered shutdown functions (see hpx::init) on all localities.
The default value (
-1.0
) will try to find a globally set timeout value (can be set as the configuration parameterhpx.shutdown_timeout
), and if that is not set or-1.0
as well, it will disable any timeout, each connected locality will wait for all existing HPX-threads to terminate.- Parameters
shutdown_timeout
: This parameter allows to specify a timeout (in microseconds), specifying how long any of the connected localities should wait for pending tasks to be executed. After this timeout, all suspended HPX-threads will be aborted. Note, that this function will not abort any running HPX-threads. In any case the shutdown will not proceed as long as there is at least one pending/running HPX-thread.
The default value (
-1.0
) will try to find a globally set wait time value (can be set as the configuration parameter “hpx.finalize_wait_time”), and if this is not set or-1.0
as well, it will disable any addition local wait time before proceeding.- Parameters
localwait
: This parameter allows to specify a local wait time (in microseconds) before the connected localities will be notified and the overall shutdown process starts.
This function will block and wait for all connected localities to exit before returning to the caller. It should be the last HPX-function called by any application.
- Return
- This function will always return zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
Using this function is an alternative to hpx::disconnect, these functions do not need to be called both.
-
int
finalize
(error_code &ec = throws)¶ Main function to gracefully terminate the HPX runtime system.
The function hpx::finalize is the main way to (gracefully) exit any HPX application. It should be called from one locality only (usually the console) and it will notify all connected localities to finish execution. Only after all other localities have exited this function will return, allowing to exit the console locality as well.
During the execution of this function the runtime system will invoke all registered shutdown functions (see hpx::init) on all localities.
This function will block and wait for all connected localities to exit before returning to the caller. It should be the last HPX-function called by any application.
- Return
- This function will always return zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
Using this function is an alternative to hpx::disconnect, these functions do not need to be called both.
-
HPX_NORETURN void hpx::terminate()
Terminate any application non-gracefully.
The function hpx::terminate is the non-graceful way to exit any application immediately. It can be called from any locality and will terminate all localities currently used by the application.
- Note
- This function will cause HPX to call
std::terminate()
on all localities associated with this application. If the function is called not from an HPX thread it will fail and return an error using the argument ec.
-
int
disconnect
(double shutdown_timeout, double localwait = -1.0, error_code &ec = throws)¶ Disconnect this locality from the application.
The function hpx::disconnect can be used to disconnect a locality from a running HPX application.
During the execution of this function the runtime system will invoke all registered shutdown functions (see hpx::init) on this locality.
The default value (
-1.0
) will try to find a globally set timeout value (can be set as the configuration parameter “hpx.shutdown_timeout”), and if that is not set or-1.0
as well, it will disable any timeout, each connected locality will wait for all existing HPX-threads to terminate.- Parameters
shutdown_timeout
: This parameter allows to specify a timeout (in microseconds), specifying how long this locality should wait for pending tasks to be executed. After this timeout, all suspended HPX-threads will be aborted. Note, that this function will not abort any running HPX-threads. In any case the shutdown will not proceed as long as there is at least one pending/running HPX-thread.
The default value (
-1.0
) will try to find a globally set wait time value (can be set as the configuration parameterhpx.finalize_wait_time
), and if this is not set or-1.0
as well, it will disable any addition local wait time before proceeding.- Parameters
localwait
: This parameter allows to specify a local wait time (in microseconds) before the connected localities will be notified and the overall shutdown process starts.
This function will block and wait for this locality to finish executing before returning to the caller. It should be the last HPX-function called by any locality being disconnected.
- Return
- This function will always return zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
int
disconnect
(error_code &ec = throws)¶ Disconnect this locality from the application.
The function hpx::disconnect can be used to disconnect a locality from a running HPX application.
During the execution of this function the runtime system will invoke all registered shutdown functions (see hpx::init) on this locality.
This function will block and wait for this locality to finish executing before returning to the caller. It should be the last HPX-function called by any locality being disconnected.
- Return
- This function will always return zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
int
stop
(error_code &ec = throws)¶ Stop the runtime system.
This function will block and wait for this locality to finish executing before returning to the caller. It should be the last HPX-function called on every locality. This function should be used only if the runtime system was started using
hpx::start
.- Return
- The function returns the value, which has been returned from the user supplied main HPX function (usually
hpx_main
).
-
int
suspend
(error_code &ec = throws)¶ Suspend the runtime system.
The function hpx::suspend is used to suspend the HPX runtime system. It can only be used when running HPX on a single locality. It will block waiting for all thread pools to be empty. This function only be called when the runtime is running, or already suspended in which case this function will do nothing.
- Return
- This function will always return zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
int
resume
(error_code &ec = throws)¶ Resume the HPX runtime system.
The function hpx::resume is used to resume the HPX runtime system. It can only be used when running HPX on a single locality. It will block waiting for all thread pools to be resumed. This function only be called when the runtime suspended, or already running in which case this function will do nothing.
- Return
- This function will always return zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
boost::system::error_category const &
get_hpx_category
()¶ Returns generic HPX error category used for new errors.
-
boost::system::error_category const &
get_hpx_rethrow_category
()¶ Returns generic HPX error category used for errors re-thrown after the exception has been de-serialized.
-
error_code
make_success_code
(throwmode mode = plain)¶ Returns error_code(hpx::success, “success”, mode).
-
std::string
diagnostic_information
(exception_info const &xi)¶ Extract the diagnostic information embedded in the given exception and return a string holding a formatted message.
The function hpx::diagnostic_information can be used to extract all diagnostic information stored in the given exception instance as a formatted string. This simplifies debug output as it composes the diagnostics into one, easy to use function call. This includes the name of the source file and line number, the sequence number of the OS-thread and the HPX-thread id, the locality id and the stack backtrace of the point where the original exception was thrown.
- Return
- The formatted string holding all of the available diagnostic information stored in the given exception instance.
- See
- hpx::get_error_locality_id(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for all diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if any of the required allocation operations fail)
-
std::string
get_error_what
(exception_info const &xi)¶ Return the error message of the thrown exception.
The function hpx::get_error_what can be used to extract the diagnostic information element representing the error message as stored in the given exception instance.
- Return
- The error message stored in the exception If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error() hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::uint32_t
get_error_locality_id
(hpx::exception_info const &xi)¶ Return the locality id where the exception was thrown.
The function hpx::get_error_locality_id can be used to extract the diagnostic information element representing the locality id as stored in the given exception instance.
- Return
- The locality id of the locality where the exception was thrown. If the exception instance does not hold this information, the function will return hpx::naming::invalid_locality_id.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
nothing
:
-
error
get_error
(hpx::exception const &e)¶ Return the locality id where the exception was thrown.
The function hpx::get_error can be used to extract the diagnostic information element representing the error value code as stored in the given exception instance.
- Return
- The error value code of the locality where the exception was thrown. If the exception instance does not hold this information, the function will return hpx::naming::invalid_locality_id.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
e
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception, hpx::error_code, or std::exception_ptr.
- Exceptions
nothing
:
-
error
get_error
(hpx::error_code const &e)¶ Return the locality id where the exception was thrown.
The function hpx::get_error can be used to extract the diagnostic information element representing the error value code as stored in the given exception instance.
- Return
- The error value code of the locality where the exception was thrown. If the exception instance does not hold this information, the function will return hpx::naming::invalid_locality_id.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
e
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception, hpx::error_code, or std::exception_ptr.
- Exceptions
nothing
:
-
std::string
get_error_host_name
(hpx::exception_info const &xi)¶ Return the hostname of the locality where the exception was thrown.
The function hpx::get_error_host_name can be used to extract the diagnostic information element representing the host name as stored in the given exception instance.
- Return
- The hostname of the locality where the exception was thrown. If the exception instance does not hold this information, the function will return and empty string.
- See
- hpx::diagnostic_information() hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error() hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::int64_t
get_error_process_id
(hpx::exception_info const &xi)¶ Return the (operating system) process id of the locality where the exception was thrown.
The function hpx::get_error_process_id can be used to extract the diagnostic information element representing the process id as stored in the given exception instance.
- Return
- The process id of the OS-process which threw the exception If the exception instance does not hold this information, the function will return 0.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
nothing
:
-
std::string
get_error_env
(hpx::exception_info const &xi)¶ Return the environment of the OS-process at the point the exception was thrown.
The function hpx::get_error_env can be used to extract the diagnostic information element representing the environment of the OS-process collected at the point the exception was thrown.
- Return
- The environment from the point the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::string
get_error_function_name
(hpx::exception_info const &xi)¶ Return the function name from which the exception was thrown.
The function hpx::get_error_function_name can be used to extract the diagnostic information element representing the name of the function as stored in the given exception instance.
- Return
- The name of the function from which the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id() hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::string
get_error_backtrace
(hpx::exception_info const &xi)¶ Return the stack backtrace from the point the exception was thrown.
The function hpx::get_error_backtrace can be used to extract the diagnostic information element representing the stack backtrace collected at the point the exception was thrown.
- Return
- The stack back trace from the point the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::string
get_error_file_name
(hpx::exception_info const &xi)¶ Return the (source code) file name of the function from which the exception was thrown.
The function hpx::get_error_file_name can be used to extract the diagnostic information element representing the name of the source file as stored in the given exception instance.
- Return
- The name of the source file of the function from which the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
long
get_error_line_number
(hpx::exception_info const &xi)¶ Return the line number in the (source code) file of the function from which the exception was thrown.
The function hpx::get_error_line_number can be used to extract the diagnostic information element representing the line number as stored in the given exception instance.
- Return
- The line number of the place where the exception was thrown. If the exception instance does not hold this information, the function will return -1.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name() hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
nothing
:
-
std::size_t
get_error_os_thread
(hpx::exception_info const &xi)¶ Return the sequence number of the OS-thread used to execute HPX-threads from which the exception was thrown.
The function hpx::get_error_os_thread can be used to extract the diagnostic information element representing the sequence number of the OS-thread as stored in the given exception instance.
- Return
- The sequence number of the OS-thread used to execute the HPX-thread from which the exception was thrown. If the exception instance does not hold this information, the function will return std::size(-1).
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_thread_id(), hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
nothing
:
-
std::size_t
get_error_thread_id
(hpx::exception_info const &xi)¶ Return the unique thread id of the HPX-thread from which the exception was thrown.
The function hpx::get_error_thread_id can be used to extract the diagnostic information element representing the HPX-thread id as stored in the given exception instance.
- Return
- The unique thread id of the HPX-thread from which the exception was thrown. If the exception instance does not hold this information, the function will return std::size_t(0).
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread() hpx::get_error_thread_description(), hpx::get_error(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error_what(), hpx::get_error_config(), hpx::get_error_state()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
nothing
:
-
std::string
get_error_thread_description
(hpx::exception_info const &xi)¶ Return any additionally available thread description of the HPX-thread from which the exception was thrown.
The function hpx::get_error_thread_description can be used to extract the diagnostic information element representing the additional thread description as stored in the given exception instance.
- Return
- Any additionally available thread description of the HPX-thread from which the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error(), hpx::get_error_state(), hpx::get_error_what(), hpx::get_error_config()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::string
get_error_config
(hpx::exception_info const &xi)¶ Return the HPX configuration information point from which the exception was thrown.
The function hpx::get_error_config can be used to extract the HPX configuration information element representing the full HPX configuration information as stored in the given exception instance.
- Return
- Any additionally available HPX configuration information the point from which the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error(), hpx::get_error_state() hpx::get_error_what(), hpx::get_error_thread_description()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
std::string
get_error_state
(hpx::exception_info const &xi)¶ Return the HPX runtime state information at which the exception was thrown.
The function hpx::get_error_state can be used to extract the HPX runtime state information element representing the state the runtime system is currently in as stored in the given exception instance.
- Return
- The point runtime state at the point at which the exception was thrown. If the exception instance does not hold this information, the function will return an empty string.
- See
- hpx::diagnostic_information(), hpx::get_error_host_name(), hpx::get_error_process_id(), hpx::get_error_function_name(), hpx::get_error_file_name(), hpx::get_error_line_number(), hpx::get_error_os_thread(), hpx::get_error_thread_id(), hpx::get_error_backtrace(), hpx::get_error_env(), hpx::get_error(), hpx::get_error_what(), hpx::get_error_thread_description()
- Parameters
xi
: The parametere
will be inspected for the requested diagnostic information elements which have been stored at the point where the exception was thrown. This parameter can be one of the following types: hpx::exception_info, hpx::error_code, std::exception, or std::exception_ptr.
- Exceptions
std::bad_alloc
: (if one of the required allocations fails)
-
bool
register_thread
(runtime *rt, char const *name, error_code &ec = throws)¶ Register the current kernel thread with HPX, this should be done once for each external OS-thread intended to invoke HPX functionality. Calling this function more than once will silently fail.
-
void
unregister_thread
(runtime *rt)¶ Unregister the thread from HPX, this should be done once in the end before the external thread exists.
-
naming::gid_type const &
get_locality
()¶ The function get_locality returns a reference to the locality prefix.
-
std::size_t
get_runtime_instance_number
()¶ The function get_runtime_instance_number returns a unique number associated with the runtime instance the current thread is running in.
-
bool
register_on_exit
(util::function_nonser<void()> const&)¶ Register a function to be called during system shutdown.
-
bool
is_starting
()¶ Test whether the runtime system is currently being started.
This function returns whether the runtime system is currently being started or not, e.g. whether the current state of the runtime system is hpx::state_startup
- Note
- This function needs to be executed on a HPX-thread. It will return false otherwise.
-
bool
tolerate_node_faults
()¶ Test if HPX runs in fault-tolerant mode.
This function returns whether the runtime system is running in fault-tolerant mode
-
bool
is_running
()¶ Test whether the runtime system is currently running.
This function returns whether the runtime system is currently running or not, e.g. whether the current state of the runtime system is hpx::state_running
- Note
- This function needs to be executed on a HPX-thread. It will return false otherwise.
-
bool
is_stopped
()¶ Test whether the runtime system is currently stopped.
This function returns whether the runtime system is currently stopped or not, e.g. whether the current state of the runtime system is hpx::state_stopped
- Note
- This function needs to be executed on a HPX-thread. It will return false otherwise.
-
bool
is_stopped_or_shutting_down
()¶ Test whether the runtime system is currently being shut down.
This function returns whether the runtime system is currently being shut down or not, e.g. whether the current state of the runtime system is hpx::state_stopped or hpx::state_shutdown
- Note
- This function needs to be executed on a HPX-thread. It will return false otherwise.
-
std::size_t
get_num_worker_threads
()¶ Return the number of worker OS- threads used to execute HPX threads.
This function returns the number of OS-threads used to execute HPX threads. If the function is called while no HPX runtime system is active, it will return zero.
-
std::uint64_t
get_system_uptime
()¶ Return the system uptime measure on the thread executing this call.
This function returns the system uptime measured in nanoseconds for the thread executing this call. If the function is called while no HPX runtime system is active, it will return zero.
-
void
start_active_counters
(error_code &ec = throws)¶ Start all active performance counters, optionally naming the section of code.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- The active counters are those which have been specified on the command line while executing the application (see command line option –hpx:print-counter)
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
reset_active_counters
(error_code &ec = throws)¶ Resets all active performance counters.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- The active counters are those which have been specified on the command line while executing the application (see command line option –hpx:print-counter)
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
reinit_active_counters
(bool reset = true, error_code &ec = throws)¶ Re-initialize all active performance counters.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- The active counters are those which have been specified on the command line while executing the application (see command line option –hpx:print-counter)
- Parameters
reset
: [in] Reset the current values before re-initializing counters (default: true)ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
stop_active_counters
(error_code &ec = throws)¶ Stop all active performance counters.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- The active counters are those which have been specified on the command line while executing the application (see command line option –hpx:print-counter)
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
evaluate_active_counters
(bool reset = false, char const *description = nullptr, error_code &ec = throws)¶ Evaluate and output all active performance counters, optionally naming the point in code marked by this function.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- The output generated by this function is redirected to the destination specified by the corresponding command line options (see –hpx:print-counter-destination).
- Note
- The active counters are those which have been specified on the command line while executing the application (see command line option –hpx:print-counter)
- Parameters
reset
: [in] this is an optional flag allowing to reset the counter value after it has been evaluated.description
: [in] this is an optional value naming the point in the code marked by the call to this function.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
serialization::binary_filter *
create_binary_filter
(char const *binary_filter_type, bool compress, serialization::binary_filter *next_filter = nullptr, error_code &ec = throws)¶ Create an instance of a binary filter plugin.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
binary_filter_type
: [in] The type of the binary filter to createcompress
: [in] The created filter should support compressionnext_filter
: [in] Use this as the filter to dispatch the invocation into.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::vector<Client>
find_all_from_basename
(std::string base_name, std::size_t num_ids)¶ Return all registered ids from all localities from the given base name.
This function locates all ids which were registered with the given base name. It returns a list of futures representing those ids.
Return all registered clients from all localities from the given base name.
- Return
- A list of futures representing the ids which were registered using the given base name.
- Note
- The futures will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.num_ids
: [in] The number of registered ids to expect.
This function locates all ids which were registered with the given base name. It returns a list of futures representing those ids.
- Return
- A list of futures representing the ids which were registered using the given base name.
- Note
- The futures embedded in the returned client objects will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.num_ids
: [in] The number of registered ids to expect.
-
std::vector<Client>
find_from_basename
(std::string base_name, std::vector<std::size_t> const &ids)¶ Return registered ids from the given base name and sequence numbers.
This function locates the ids which were registered with the given base name and the given sequence numbers. It returns a list of futures representing those ids.
Return registered clients from the given base name and sequence numbers.
- Return
- A list of futures representing the ids which were registered using the given base name and sequence numbers.
- Note
- The futures will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.ids
: [in] The sequence numbers of the registered ids.
This function locates the ids which were registered with the given base name and the given sequence numbers. It returns a list of futures representing those ids.
- Return
- A list of futures representing the ids which were registered using the given base name and sequence numbers.
- Note
- The futures embedded in the returned client objects will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.ids
: [in] The sequence numbers of the registered ids.
-
Client
find_from_basename
(std::string base_name, std::size_t sequence_nr = ~0U)¶ Return registered id from the given base name and sequence number.
This function locates the id which was registered with the given base name and the given sequence number. It returns a future representing those id.
This function locates the id which was registered with the given base name and the given sequence number. It returns a future representing those id.
- Return
- A representing the id which was registered using the given base name and sequence numbers.
- Note
- The future will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in] The sequence number of the registered id.
- Return
- A representing the id which was registered using the given base name and sequence numbers.
- Note
- The future embedded in the returned client object will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in] The sequence number of the registered id.
-
hpx::future<bool>
register_with_basename
(std::string base_name, hpx::id_type id, std::size_t sequence_nr = ~0U)¶ Register the given id using the given base name.
The function registers the given ids using the provided base name.
- Return
- A future representing the result of the registration operation itself.
- Note
- The operation will fail if the given sequence number is not unique.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.id
: [in] The id to register using the given base name.sequence_nr
: [in, optional] The sequential number to use for the registration of the id. This number has to be unique system wide for each registration using the same base name. The default is the current locality identifier. Also, the sequence numbers have to be consecutive starting from zero.
-
hpx::future<bool>
register_with_basename
(std::string base_name, hpx::future<hpx::id_type> f, std::size_t sequence_nr = ~0U)¶ Register the id wrapped in the given future using the given base name.
The function registers the object the given future refers to using the provided base name.
- Return
- A future representing the result of the registration operation itself.
- Note
- The operation will fail if the given sequence number is not unique.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.f
: [in] The future which should be registered using the given base name.sequence_nr
: [in, optional] The sequential number to use for the registration of the id. This number has to be unique system wide for each registration using the same base name. The default is the current locality identifier. Also, the sequence numbers have to be consecutive starting from zero.
-
template<typename
Client
, typenameStub
>
hpx::future<bool>register_with_basename
(std::string base_name, components::client_base<Client, Stub> &client, std::size_t sequence_nr = ~0U)¶ Register the id wrapped in the given client using the given base name.
The function registers the object the given client refers to using the provided base name.
- Return
- A future representing the result of the registration operation itself.
- Note
- The operation will fail if the given sequence number is not unique.
- Template Parameters
Client
: The client type to register
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.client
: [in] The client which should be registered using the given base name.sequence_nr
: [in, optional] The sequential number to use for the registration of the id. This number has to be unique system wide for each registration using the same base name. The default is the current locality identifier. Also, the sequence numbers have to be consecutive starting from zero.
-
Client
unregister_with_basename
(std::string base_name, std::size_t sequence_nr = ~0U)¶ Unregister the given id using the given base name.
The function unregisters the given ids using the provided base name.
Unregister the given base name.
- Return
- A future representing the result of the un-registration operation itself.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in, optional] The sequential number to use for the un-registration. This number has to be the same as has been used with register_with_basename before.
The function unregisters the given ids using the provided base name.
- Return
- A future representing the result of the un-registration operation itself.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in, optional] The sequential number to use for the un-registration. This number has to be the same as has been used with register_with_basename before.
-
naming::id_type
find_here
(error_code &ec = throws)¶ Return the global id representing this locality.
The function find_here() can be used to retrieve the global id usable to refer to the current locality.
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global id representing the locality this function has been called on.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return hpx::naming::invalid_id otherwise.
- See
- hpx::find_all_localities(), hpx::find_locality()
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
naming::id_type
find_root_locality
(error_code &ec = throws)¶ Return the global id representing the root locality.
The function find_root_locality() can be used to retrieve the global id usable to refer to the root locality. The root locality is the locality where the main AGAS service is hosted.
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global id representing the root locality for this application.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return hpx::naming::invalid_id otherwise.
- See
- hpx::find_all_localities(), hpx::find_locality()
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::vector<naming::id_type>
find_all_localities
(error_code &ec = throws)¶ Return the list of global ids representing all localities available to this application.
The function find_all_localities() can be used to retrieve the global ids of all localities currently available to this application.
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global ids representing the localities currently available to this application.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return an empty vector otherwise.
- See
- hpx::find_here(), hpx::find_locality()
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::vector<naming::id_type>
find_all_localities
(components::component_type type, error_code &ec = throws)¶ Return the list of global ids representing all localities available to this application which support the given component type.
The function find_all_localities() can be used to retrieve the global ids of all localities currently available to this application which support the creation of instances of the given component type.
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global ids representing the localities currently available to this application which support the creation of instances of the given component type. If no localities supporting the given component type are currently available, this function will return an empty vector.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return an empty vector otherwise.
- See
- hpx::find_here(), hpx::find_locality()
- Parameters
type
: [in] The type of the components for which the function should return the available localities.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::vector<naming::id_type>
find_remote_localities
(error_code &ec = throws)¶ Return the list of locality ids of remote localities supporting the given component type. By default this function will return the list of all remote localities (all but the current locality).
The function find_remote_localities() can be used to retrieve the global ids of all remote localities currently available to this application (i.e. all localities except the current one).
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global ids representing the remote localities currently available to this application.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return an empty vector otherwise.
- See
- hpx::find_here(), hpx::find_locality()
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::vector<naming::id_type>
find_remote_localities
(components::component_type type, error_code &ec = throws)¶ Return the list of locality ids of remote localities supporting the given component type. By default this function will return the list of all remote localities (all but the current locality).
The function find_remote_localities() can be used to retrieve the global ids of all remote localities currently available to this application (i.e. all localities except the current one) which support the creation of instances of the given component type.
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global ids representing the remote localities currently available to this application.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return an empty vector otherwise.
- See
- hpx::find_here(), hpx::find_locality()
- Parameters
type
: [in] The type of the components for which the function should return the available remote localities.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
naming::id_type
find_locality
(components::component_type type, error_code &ec = throws)¶ Return the global id representing an arbitrary locality which supports the given component type.
The function find_locality() can be used to retrieve the global id of an arbitrary locality currently available to this application which supports the creation of instances of the given component type.
- Note
- Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).
- Return
- The global id representing an arbitrary locality currently available to this application which supports the creation of instances of the given component type. If no locality supporting the given component type is currently available, this function will return hpx::naming::invalid_id.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return hpx::naming::invalid_id otherwise.
- See
- hpx::find_here(), hpx::find_all_localities()
- Parameters
type
: [in] The type of the components for which the function should return any available locality.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
naming::id_type
get_colocation_id
(launch::sync_policy, naming::id_type const &id, error_code &ec = throws)¶ Return the id of the locality where the object referenced by the given id is currently located on.
The function hpx::get_colocation_id() returns the id of the locality where the given object is currently located.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- See
- hpx::get_colocation_id()
- Parameters
id
: [in] The id of the object to locate.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
lcos::future<naming::id_type>
get_colocation_id
(naming::id_type const &id)¶ Asynchronously return the id of the locality where the object referenced by the given id is currently located on.
- See
- hpx::get_colocation_id(launch::sync_policy)
- Parameters
id
: [in] The id of the object to locate.
Returns a future referring to the pointer to the underlying memory of a component.
The function hpx::get_ptr can be used to extract a future referring to the pointer to the underlying memory of a given component.
- Return
- This function returns a future representing the pointer to the underlying memory for the component instance with the given id.
- Note
- This function will successfully return the requested result only if the given component is currently located on the calling locality. Otherwise the function will raise an error.
- Note
- The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Parameters
id
: [in] The global id of the component for which the pointer to the underlying memory should be retrieved.
- Template Parameters
The
: only template parameter has to be the type of the server side component.
Returns a future referring to the pointer to the underlying memory of a component.
The function hpx::get_ptr can be used to extract a future referring to the pointer to the underlying memory of a given component.
- Return
- This function returns a future representing the pointer to the underlying memory for the component instance with the given id.
- Note
- This function will successfully return the requested result only if the given component is currently located on the calling locality. Otherwise the function will raise an error.
- Note
- The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Parameters
c
: [in] A client side representation of the component for which the pointer to the underlying memory should be retrieved.
Returns the pointer to the underlying memory of a component.
The function hpx::get_ptr_sync can be used to extract the pointer to the underlying memory of a given component.
- Return
- This function returns the pointer to the underlying memory for the component instance with the given id.
- Note
- This function will successfully return the requested result only if the given component is currently located on the requesting locality. Otherwise the function will raise and error.
- Note
- The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
p
: [in] The parameter p represents a placeholder type to turn make the call synchronous.id
: [in] The global id of the component for which the pointer to the underlying memory should be retrieved.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
- Template Parameters
The
: only template parameter has to be the type of the server side component.
Returns the pointer to the underlying memory of a component.
The function hpx::get_ptr_sync can be used to extract the pointer to the underlying memory of a given component.
- Return
- This function returns the pointer to the underlying memory for the component instance with the given id.
- Note
- This function will successfully return the requested result only if the given component is currently located on the requesting locality. Otherwise the function will raise and error.
- Note
- The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
p
: [in] The parameter p represents a placeholder type to turn make the call synchronous.c
: [in] A client side representation of the component for which the pointer to the underlying memory should be retrieved.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::uint32_t
get_locality_id
(error_code &ec = throws)¶ Return the number of the locality this function is being called from.
This function returns the id of the current locality.
- Note
- The returned value is zero based and its maximum value is smaller than the overall number of localities the current application is running on (as returned by get_num_localities()).
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::string
get_locality_name
()¶ Return the name of the locality this function is called on.
This function returns the name for the locality on which this function is called.
- Return
- This function returns the name for the locality on which the function is called. The name is retrieved from the underlying networking layer and may be different for different parcelports.
- See
- future<std::string> get_locality_name(naming::id_type const& id)
-
future<std::string>
get_locality_name
(naming::id_type const &id)¶ Return the name of the referenced locality.
This function returns a future referring to the name for the locality of the given id.
- Return
- This function returns the name for the locality of the given id. The name is retrieved from the underlying networking layer and may be different for different parcel ports.
- See
- std::string get_locality_name()
- Parameters
id
: [in] The global id of the locality for which the name should be retrieved
-
std::uint32_t
get_initial_num_localities
()¶ Return the number of localities which were registered at startup for the running application.
The function get_initial_num_localities returns the number of localities which were connected to the console at application startup.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- See
- hpx::find_all_localities, hpx::get_num_localities
-
lcos::future<std::uint32_t>
get_num_localities
()¶ Asynchronously return the number of localities which are currently registered for the running application.
The function get_num_localities asynchronously returns the number of localities currently connected to the console. The returned future represents the actual result.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return 0 otherwise.
- See
- hpx::find_all_localities, hpx::get_num_localities
-
std::uint32_t
get_num_localities
(launch::sync_policy, error_code &ec = throws)¶ Return the number of localities which are currently registered for the running application.
The function get_num_localities returns the number of localities currently connected to the console.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return 0 otherwise.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- See
- hpx::find_all_localities, hpx::get_num_localities
- Parameters
ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
lcos::future<std::uint32_t>
get_num_localities
(components::component_type t)¶ Asynchronously return the number of localities which are currently registered for the running application.
The function get_num_localities asynchronously returns the number of localities currently connected to the console which support the creation of the given component type. The returned future represents the actual result.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return 0 otherwise.
- See
- hpx::find_all_localities, hpx::get_num_localities
- Parameters
t
: The component type for which the number of connected localities should be retrieved.
-
std::uint32_t
get_num_localities
(launch::sync_policy, components::component_type t, error_code &ec = throws)¶ Synchronously return the number of localities which are currently registered for the running application.
The function get_num_localities returns the number of localities currently connected to the console which support the creation of the given component type. The returned future represents the actual result.
- Note
- This function will return meaningful results only if called from an HPX-thread. It will return 0 otherwise.
- See
- hpx::find_all_localities, hpx::get_num_localities
- Parameters
t
: The component type for which the number of connected localities should be retrieved.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::size_t
get_os_thread_count
()¶ Return the number of OS-threads running in the runtime instance the current HPX-thread is associated with.
-
std::size_t
get_os_thread_count
(threads::executor const &exec)¶ Return the number of worker OS- threads used by the given executor to execute HPX threads.
This function returns the number of cores used to execute HPX threads for the given executor. If the function is called while no HPX runtime system is active, it will return zero. If the executor is not valid, this function will fall back to retrieving the number of OS threads used by HPX.
- Parameters
exec
: [in] The executor to be used.
-
std::string
get_thread_name
()¶ Return the name of the calling thread.
This function returns the name of the calling thread. This name uniquely identifies the thread in the context of HPX. If the function is called while no HPX runtime system is active, the result will be “<unknown>”.
-
std::size_t
get_worker_thread_num
()¶ Return the number of the current OS-thread running in the runtime instance the current HPX-thread is executed with.
This function returns the zero based index of the OS-thread which executes the current HPX-thread.
- Note
- The returned value is zero based and its maximum value is smaller than the overall number of OS-threads executed (as returned by get_os_thread_count().
- Note
- This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).
-
std::size_t
get_worker_thread_num
(error_code &ec)¶ Return the number of the current OS-thread running in the runtime instance the current HPX-thread is executed with.
This function returns the zero based index of the OS-thread which executes the current HPX-thread.
- Note
- The returned value is zero based and its maximum value is smaller than the overall number of OS-threads executed (as returned by get_os_thread_count(). It will return -1 if the current thread is not a known thread or if the runtime is not in running state.
- Note
- This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).
- Parameters
ec
: [in,out] this represents the error status on exit.
-
void
report_error
(std::size_t num_thread, std::exception_ptr const &e)¶ The function report_error reports the given exception to the console.
-
void
report_error
(std::exception_ptr const &e)¶ The function report_error reports the given exception to the console.
-
char const *
get_runtime_mode_name
(runtime_mode state)¶ Get the readable string representing the name of the given runtime_mode constant.
-
runtime_mode
get_runtime_mode_from_name
(std::string const &mode)¶ Get the internal representation (runtime_mode constant) from the readable string representing the name.
-
parcel_write_handler_type
set_parcel_write_handler
(parcel_write_handler_type const &f)¶ Set the default parcel write handler which is invoked once a parcel has been sent if no explicit write handler was specified.
- Return
- The function returns the parcel write handler which was installed before this function was called.
- Note
- If no parcel handler function is registered by the user the system will call a default parcel handler function which is not performing any actions. However, this default function will terminate the application in case of any errors detected during preparing or sending the parcel.
- Parameters
f
: The new parcel write handler to use from this point on
-
void
register_pre_shutdown_function
(shutdown_function_type f)¶ Add a function to be executed by a HPX thread during hpx::finalize() but guaranteed before any shutdown function is executed (system-wide)
Any of the functions registered with register_pre_shutdown_function are guaranteed to be executed by an HPX thread during the execution of hpx::finalize() before any of the registered shutdown functions are executed (see: hpx::register_shutdown_function()).
- Note
- If this function is called while the pre-shutdown functions are being executed, or after that point, it will raise a invalid_status exception.
- See
- hpx::register_shutdown_function()
- Parameters
f
: [in] The function to be registered to run by an HPX thread as a pre-shutdown function.
-
void
register_shutdown_function
(shutdown_function_type f)¶ Add a function to be executed by a HPX thread during hpx::finalize() but guaranteed after any pre-shutdown function is executed (system-wide)
Any of the functions registered with register_shutdown_function are guaranteed to be executed by an HPX thread during the execution of hpx::finalize() after any of the registered pre-shutdown functions are executed (see: hpx::register_pre_shutdown_function()).
- Note
- If this function is called while the shutdown functions are being executed, or after that point, it will raise a invalid_status exception.
- See
- hpx::register_pre_shutdown_function()
- Parameters
f
: [in] The function to be registered to run by an HPX thread as a shutdown function.
-
void
register_pre_startup_function
(startup_function_type f)¶ Add a function to be executed by a HPX thread before hpx_main but guaranteed before any startup function is executed (system-wide).
Any of the functions registered with register_pre_startup_function are guaranteed to be executed by an HPX thread before any of the registered startup functions are executed (see hpx::register_startup_function()).
This function is one of the few API functions which can be called before the runtime system has been fully initialized. It will automatically stage the provided startup function to the runtime system during its initialization (if necessary).
- Note
- If this function is called while the pre-startup functions are being executed or after that point, it will raise a invalid_status exception.
- Parameters
f
: [in] The function to be registered to run by an HPX thread as a pre-startup function.
-
void
register_startup_function
(startup_function_type f)¶ Add a function to be executed by a HPX thread before hpx_main but guaranteed after any pre-startup function is executed (system-wide).
Any of the functions registered with register_startup_function are guaranteed to be executed by an HPX thread after any of the registered pre-startup functions are executed (see: hpx::register_pre_startup_function()), but before hpx_main is being called.
This function is one of the few API functions which can be called before the runtime system has been fully initialized. It will automatically stage the provided startup function to the runtime system during its initialization (if necessary).
- Note
- If this function is called while the startup functions are being executed or after that point, it will raise a invalid_status exception.
- Parameters
f
: [in] The function to be registered to run by an HPX thread as a startup function.
-
void
trigger_lco_event
(naming::id_type const &id, naming::address &&addr, bool move_credits = true)¶ Trigger the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should be triggered.addr
: [in] This represents the addr of the LCO which should be triggered.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
trigger_lco_event
(naming::id_type const &id, bool move_credits = true)¶ Trigger the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should be triggered.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
trigger_lco_event
(naming::id_type const &id, naming::address &&addr, naming::id_type const &cont, bool move_credits = true)¶ Trigger the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should be triggered.addr
: [in] This represents the addr of the LCO which should be triggered.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
trigger_lco_event
(naming::id_type const &id, naming::id_type const &cont, bool move_credits = true)¶ Trigger the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should be triggered.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename
Result
>
voidset_lco_value
(naming::id_type const &id, naming::address &&addr, Result &&t, bool move_credits = true)¶ Set the result value for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the given value.addr
: [in] This represents the addr of the LCO which should be triggered.t
: [in] This is the value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename
Result
>
std::enable_if<!std::is_same<typename util::decay<Result>::type, naming::address>::value>::typeset_lco_value
(naming::id_type const &id, Result &&t, bool move_credits = true)¶ Set the result value for the (managed) LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the given value.t
: [in] This is the value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename
Result
>
std::enable_if<!std::is_same<typename util::decay<Result>::type, naming::address>::value>::typeset_lco_value_unmanaged
(naming::id_type const &id, Result &&t, bool move_credits = true)¶ Set the result value for the (unmanaged) LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the given value.t
: [in] This is the value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename
Result
>
voidset_lco_value
(naming::id_type const &id, naming::address &&addr, Result &&t, naming::id_type const &cont, bool move_credits = true)¶ Set the result value for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the given value.addr
: [in] This represents the addr of the LCO which should be triggered.t
: [in] This is the value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename
Result
>
std::enable_if<!std::is_same<typename util::decay<Result>::type, naming::address>::value>::typeset_lco_value
(naming::id_type const &id, Result &&t, naming::id_type const &cont, bool move_credits = true)¶ Set the result value for the (managed) LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the given value.t
: [in] This is the value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename
Result
>
std::enable_if<!std::is_same<typename util::decay<Result>::type, naming::address>::value>::typeset_lco_value_unmanaged
(naming::id_type const &id, Result &&t, naming::id_type const &cont, bool move_credits = true)¶ Set the result value for the (unmanaged) LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the given value.t
: [in] This is the value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, naming::address &&addr, std::exception_ptr const &e, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.addr
: [in] This represents the addr of the LCO which should be triggered.e
: [in] This is the error value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, naming::address &&addr, std::exception_ptr &&e, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.addr
: [in] This represents the addr of the LCO which should be triggered.e
: [in] This is the error value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, std::exception_ptr const &e, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.e
: [in] This is the error value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, std::exception_ptr &&e, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.e
: [in] This is the error value which should be sent to the LCO.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, naming::address &&addr, std::exception_ptr const &e, naming::id_type const &cont, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.addr
: [in] This represents the addr of the LCO which should be triggered.e
: [in] This is the error value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, naming::address &&addr, std::exception_ptr &&e, naming::id_type const &cont, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.addr
: [in] This represents the addr of the LCO which should be triggered.e
: [in] This is the error value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, std::exception_ptr const &e, naming::id_type const &cont, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.e
: [in] This is the error value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
void
set_lco_error
(naming::id_type const &id, std::exception_ptr &&e, naming::id_type const &cont, bool move_credits = true)¶ Set the error state for the LCO referenced by the given id.
- Parameters
id
: [in] This represents the id of the LCO which should receive the error value.e
: [in] This is the error value which should be sent to the LCO.cont
: [in] This represents the LCO to trigger after completion.move_credits
: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.
-
template<typename Component, typename ... Ts><unspecified> hpx::new_(id_type const & locality, Ts &&... vs)
Create one or more new instances of the given Component type on the specified locality.
This function creates one or more new instances of the given Component type on the specified locality and returns a future object for the global address which can be used to reference the new component instance.
- Note
- This function requires to specify an explicit template argument which will define what type of component(s) to create, for instance:
hpx::future<hpx::id_type> f = hpx::new_<some_component>(hpx::find_here(), ...); hpx::id_type id = f.get();
- Return
- The function returns different types depending on its use:
- If the explicit template argument Component represents a component type (
traits::is_component<Component>::value
evaluates to true), the function will return an hpx::future object instance which can be used to retrieve the global address of the newly created component. - If the explicit template argument Component represents a client side object (
traits::is_client<Component>::value
evaluates to true), the function will return a new instance of that type which can be used to refer to the newly created component instance.
- If the explicit template argument Component represents a component type (
- Parameters
locality
: [in] The global address of the locality where the new instance should be created on.vs
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the constructor of the created component instance.
-
template<typename Component, typename ... Ts><unspecified> hpx::local_new(Ts &&... vs)
Create one new instance of the given Component type on the current locality.
This function creates one new instance of the given Component type on the current locality and returns a future object for the global address which can be used to reference the new component instance.
- Note
- This function requires to specify an explicit template argument which will define what type of component(s) to create, for instance:
hpx::future<hpx::id_type> f = hpx::local_new<some_component>(...); hpx::id_type id = f.get();
- Return
- The function returns different types depending on its use:
- If the explicit template argument Component represents a component type (
traits::is_component<Component>::value
evaluates to true), the function will return an hpx::future object instance which can be used to retrieve the global address of the newly created component. If the first argument ishpx::launch::sync
the function will directly return anhpx::id_type
. - If the explicit template argument Component represents a client side object (
traits::is_client<Component>::value
evaluates to true), the function will return a new instance of that type which can be used to refer to the newly created component instance.
- If the explicit template argument Component represents a component type (
- Note
- The difference of this funtion to hpx::new_ is that it can be used in cases where the supplied arguments are non-copyable and non-movable. All operations are guaranteed to be local only.
- Parameters
vs
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the constructor of the created component instance.
-
template<typename Component, typename ... Ts><unspecified> hpx::new_(id_type const & locality, std::size_t count, Ts &&... vs)
Create multiple new instances of the given Component type on the specified locality.
This function creates multiple new instances of the given Component type on the specified locality and returns a future object for the global address which can be used to reference the new component instance.
- Note
- This function requires to specify an explicit template argument which will define what type of component(s) to create, for instance:
hpx::future<std::vector<hpx::id_type> > f = hpx::new_<some_component[]>(hpx::find_here(), 10, ...); hpx::id_type id = f.get();
- Return
- The function returns different types depending on its use:
- If the explicit template argument Component represents an array of a component type (i.e. Component[], where
traits::is_component<Component>::value
evaluates to true), the function will return an hpx::future object instance which holds a std::vector<hpx::id_type>, where each of the items in this vector is a global address of one of the newly created components. - If the explicit template argument Component represents an array of a client side object type (i.e. Component[], where
traits::is_client<Component>::value
evaluates to true), the function will return an hpx::future object instance which holds a std::vector<hpx::id_type>, where each of the items in this vector is a client side instance of the given type, each representing one of the newly created components.
- If the explicit template argument Component represents an array of a component type (i.e. Component[], where
- Parameters
locality
: [in] The global address of the locality where the new instance should be created on.count
: [in] The number of component instances to createvs
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the constructor of the created component instance.
-
template<typename Component, typename DistPolicy, typename ... Ts><unspecified> hpx::new_(DistPolicy const & policy, Ts &&... vs)
Create one or more new instances of the given Component type based on the given distribution policy.
This function creates one or more new instances of the given Component type on the localities defined by the given distribution policy and returns a future object for global address which can be used to reference the new component instance(s).
- Note
- This function requires to specify an explicit template argument which will define what type of component(s) to create, for instance:
hpx::future<hpx::id_type> f = hpx::new_<some_component>(hpx::default_layout, ...); hpx::id_type id = f.get();
- Return
- The function returns different types depending on its use:
- If the explicit template argument Component represents a component type (
traits::is_component<Component>::value
evaluates to true), the function will return an hpx::future object instance which can be used to retrieve the global address of the newly created component. - If the explicit template argument Component represents a client side object (
traits::is_client<Component>::value
evaluates to true), the function will return a new instance of that type which can be used to refer to the newly created component instance.
- If the explicit template argument Component represents a component type (
- Parameters
policy
: [in] The distribution policy used to decide where to place the newly created.vs
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the constructor of the created component instance.
-
template<typename Component, typename DistPolicy, typename ... Ts><unspecified> hpx::new_(DistPolicy const & policy, std::size_t count, Ts &&... vs)
Create multiple new instances of the given Component type on the localities as defined by the given distribution policy.
This function creates multiple new instances of the given Component type on the localities defined by the given distribution policy and returns a future object for the global address which can be used to reference the new component instance.
- Note
- This function requires to specify an explicit template argument which will define what type of component(s) to create, for instance:
hpx::future<std::vector<hpx::id_type> > f = hpx::new_<some_component[]>(hpx::default_layout, 10, ...); hpx::id_type id = f.get();
- Return
- The function returns different types depending on its use:
- If the explicit template argument Component represents an array of a component type (i.e. Component[], where
traits::is_component<Component>::value
evaluates to true), the function will return an hpx::future object instance which holds a std::vector<hpx::id_type>, where each of the items in this vector is a global address of one of the newly created components. - If the explicit template argument Component represents an array of a client side object type (i.e. Component[], where
traits::is_client<Component>::value
evaluates to true), the function will return an hpx::future object instance which holds a std::vector<hpx::id_type>, where each of the items in this vector is a client side instance of the given type, each representing one of the newly created components.
- If the explicit template argument Component represents an array of a component type (i.e. Component[], where
- Parameters
policy
: [in] The distribution policy used to decide where to place the newly created.count
: [in] The number of component instances to createvs
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the constructor of the created component instance.
-
template<typename ...
Ts
>
tuple<future<Ts>...>split_future
(future<tuple<Ts...>> &&f)¶ The function split_future is an operator allowing to split a given future of a sequence of values (any tuple, std::pair, or std::array) into an equivalent container of futures where each future represents one of the values from the original future. In some sense this function provides the inverse operation of when_all.
- Return
- Returns an equivalent container (same container type as passed as the argument) of futures, where each future refers to the corresponding value in the input parameter. All of the returned futures become ready once the input future has become ready. If the input future is exceptional, all output futures will be exceptional as well.
- Note
- The following cases are special: here the returned futures are directly representing the futures which were passed to the function.
tuple<future<void> > split_future(future<tuple<> > && f); array<future<void>, 1> split_future(future<array<T, 0> > && f);
- Parameters
f
: [in] A future holding an arbitrary sequence of values stored in a tuple-like container. This facility supports hpx::util::tuple<>, std::pair<T1, T2>, and std::array<T, N>
-
template<typename
T
>
std::vector<future<T>>split_future
(future<std::vector<T>> &&f, std::size_t size)¶ The function split_future is an operator allowing to split a given future of a sequence of values (any std::vector) into a std::vector of futures where each future represents one of the values from the original std::vector. In some sense this function provides the inverse operation of when_all.
- Return
- Returns a std::vector of futures, where each future refers to the corresponding value in the input parameter. All of the returned futures become ready once the input future has become ready. If the input future is exceptional, all output futures will be exceptional as well.
- Parameters
f
: [in] A future holding an arbitrary sequence of values stored in a std::vector.size
: [in] The number of elements the vector will hold once the input future has become ready
-
template<typename
InputIter
>
voidwait_all
(InputIter first, InputIter last)¶ The function wait_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing.
- Note
- The function wait_all returns after all futures have become ready. All input futures are still valid after wait_all returns.
- Parameters
first
: The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_all should wait.last
: The iterator pointing to the last element of a sequence of future or shared_future objects for which wait_all should wait.
-
template<typename
R
>
voidwait_all
(std::vector<future<R>> &&futures)¶ The function wait_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing.
- Note
- The function wait_all returns after all futures have become ready. All input futures are still valid after wait_all returns.
- Parameters
futures
: A vector or array holding an arbitrary amount of future or shared_future objects for which wait_all should wait.
-
template<typename
R
, std::size_tN
>
voidwait_all
(std::array<future<R>, N> &&futures)¶ The function wait_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing.
- Note
- The function wait_all returns after all futures have become ready. All input futures are still valid after wait_all returns.
- Parameters
futures
: A vector or array holding an arbitrary amount of future or shared_future objects for which wait_all should wait.
-
template<typename ...
T
>
voidwait_all
(T&&... futures)¶ The function wait_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing.
- Note
- The function wait_all returns after all futures have become ready. All input futures are still valid after wait_all returns.
- Parameters
futures
: An arbitrary number of future or shared_future objects, possibly holding different types for which wait_all should wait.
-
template<typename
InputIter
>
InputIterwait_all_n
(InputIter begin, std::size_t count)¶ The function wait_all_n is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing.
- Return
- The function wait_all_n will return an iterator referring to the first element in the input sequence after the last processed element.
- Note
- The function wait_all_n returns after all futures have become ready. All input futures are still valid after wait_all_n returns.
- Parameters
begin
: The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_all_n should wait.count
: The number of elements in the sequence starting at first.
-
template<typename
InputIter
, typenameContainer
= vector<future<typename std::iterator_traits<InputIter>::value_type>>>
future<Container>when_all
(InputIter first, InputIter last)¶ The function when_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after they finished executing.
- Return
- Returns a future holding the same list of futures as has been passed to when_all.
- future<Container<future<R>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Note
- Calling this version of when_all where first == last, returns a future with an empty container that is immediately ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_all will not throw an exception, but the futures held in the output collection may.
- Parameters
first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_all should wait.last
: [in] The iterator pointing to the last element of a sequence of future or shared_future objects for which when_all should wait.
-
template<typename
Range
>
future<Range>when_all
(Range &&values)¶ The function when_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after they finished executing.
- Return
- Returns a future holding the same list of futures as has been passed to when_all.
- future<Container<future<R>>>: If the input cardinality is unknown at compile time and the futures are all of the same type.
- Note
- Calling this version of when_all where the input container is empty, returns a future with an empty container that is immediately ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_all will not throw an exception, but the futures held in the output collection may.
- Parameters
values
: [in] A range holding an arbitrary amount of future or shared_future objects for which when_all should wait.
-
template<typename ...
T
>
future<tuple<future<T>...>>when_all
(T&&... futures)¶ The function when_all is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after they finished executing.
- Return
- Returns a future holding the same list of futures as has been passed to when_all.
- future<tuple<future<T0>, future<T1>, future<T2>…>>: If inputs are fixed in number and are of heterogeneous types. The inputs can be any arbitrary number of future objects.
- future<tuple<>> if when_all is called with zero arguments. The returned future will be initially ready.
- Note
- Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_all will not throw an exception, but the futures held in the output collection may.
- Parameters
futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which when_all should wait.
-
template<typename
InputIter
, typenameContainer
= vector<future<typename std::iterator_traits<InputIter>::value_type>>>
future<Container>when_all_n
(InputIter begin, std::size_t count)¶ The function when_all_n is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after they finished executing.
- Return
- Returns a future holding the same list of futures as has been passed to when_all_n.
- future<Container<future<R>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output vector will be the same as given by the input iterator.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
begin
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_all_n should wait.count
: [in] The number of elements in the sequence starting at first.
- Exceptions
This
: function will throw errors which are encountered while setting up the requested operation only. Errors encountered while executing the operations delivering the results to be stored in the futures are reported through the futures themselves.
-
template<typename
InputIter
>
voidwait_any
(InputIter first, InputIter last, error_code &ec = throws)¶ The function wait_any is a non-deterministic choice operator. It OR-composes all future objects given and returns after one future of that list finishes execution.
- Note
- The function wait_any returns after at least one future has become ready. All input futures are still valid after wait_any returns.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_any should wait.last
: [in] The iterator pointing to the last element of a sequence of future or shared_future objects for which wait_any should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
R
>
voidwait_any
(std::vector<future<R>> &futures, error_code &ec = throws)¶ The function wait_any is a non-deterministic choice operator. It OR-composes all future objects given and returns after one future of that list finishes execution.
- Note
- The function wait_any returns after at least one future has become ready. All input futures are still valid after wait_any returns.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
futures
: [in] A vector holding an arbitrary amount of future or shared_future objects for which wait_any should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename R, std:;size_t N>void hpx::wait_any(std::array< future< R >, N > & futures, error_code & ec = throws)
The function wait_any is a non-deterministic choice operator. It OR-composes all future objects given and returns after one future of that list finishes execution.
- Note
- The function wait_any returns after at least one future has become ready. All input futures are still valid after wait_any returns.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
futures
: [in] Amn array holding an arbitrary amount of future or shared_future objects for which wait_any should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename ...
T
>
voidwait_any
(error_code &ec, T&&... futures)¶ The function wait_any is a non-deterministic choice operator. It OR-composes all future objects given and returns after one future of that list finishes execution.
- Note
- The function wait_any returns after at least one future has become ready. All input futures are still valid after wait_any returns.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which wait_any should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename ...
T
>
voidwait_any
(T&&... futures)¶ The function wait_any is a non-deterministic choice operator. It OR-composes all future objects given and returns after one future of that list finishes execution.
- Note
- The function wait_any returns after at least one future has become ready. All input futures are still valid after wait_any returns.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which wait_any should wait.
-
template<typename
InputIter
>
InputIterwait_any_n
(InputIter first, std::size_t count, error_code &ec = throws)¶ The function wait_any_n is a non-deterministic choice operator. It OR-composes all future objects given and returns after one future of that list finishes execution.
- Note
- The function wait_any_n returns after at least one future has become ready. All input futures are still valid after wait_any_n returns.
- Return
- The function wait_all_n will return an iterator referring to the first element in the input sequence after the last processed element.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_any_n should wait.count
: [in] The number of elements in the sequence starting at first.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
InputIter
, typenameContainer
= vector<future<typename std::iterator_traits<InputIter>::value_type>>>
future<when_any_result<Container>>when_any
(InputIter first, InputIter last)¶ The function when_any is a non-deterministic choice operator. It OR-composes all future objects given and returns a new future object representing the same list of futures after one future of that list finishes execution.
- Return
- Returns a when_any_result holding the same list of futures as has been passed to when_any and an index pointing to a ready future.
- future<when_any_result<Container<future<R>>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Parameters
first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_any should wait.last
: [in] The iterator pointing to the last element of a sequence of future or shared_future objects for which when_any should wait.
-
template<typename
Range
>
future<when_any_result<Range>>when_any
(Range &values)¶ The function when_any is a non-deterministic choice operator. It OR-composes all future objects given and returns a new future object representing the same list of futures after one future of that list finishes execution.
- Return
- Returns a when_any_result holding the same list of futures as has been passed to when_any and an index pointing to a ready future.
- future<when_any_result<Container<future<R>>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Parameters
values
: [in] A range holding an arbitrary amount of futures or shared_future objects for which when_any should wait.
-
template<typename ...
T
>
future<when_any_result<tuple<future<T>...>>>when_any
(T&&... futures)¶ The function when_any is a non-deterministic choice operator. It OR-composes all future objects given and returns a new future object representing the same list of futures after one future of that list finishes execution.
- Return
- Returns a when_any_result holding the same list of futures as has been passed to when_any and an index pointing to a ready future..
- future<when_any_result<tuple<future<T0>, future<T1>…>>>: If inputs are fixed in number and are of heterogeneous types. The inputs can be any arbitrary number of future objects.
- future<when_any_result<tuple<>>> if when_any is called with zero arguments. The returned future will be initially ready.
- Parameters
futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which when_any should wait.
-
template<typename
InputIter
, typenameContainer
= vector<future<typename std::iterator_traits<InputIter>::value_type>>>
future<when_any_result<Container>>when_any_n
(InputIter first, std::size_t count)¶ The function when_any_n is a non-deterministic choice operator. It OR-composes all future objects given and returns a new future object representing the same list of futures after one future of that list finishes execution.
- Return
- Returns a when_any_result holding the same list of futures as has been passed to when_any and an index pointing to a ready future.
- future<when_any_result<Container<future<R>>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Note
- None of the futures in the input sequence are invalidated.
- Parameters
first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_any_n should wait.count
: [in] The number of elements in the sequence starting at first.
-
template<typename
InputIter
>
future<vector<future<typename std::iterator_traits<InputIter>::value_type>>>wait_some
(std::size_t n, Iterator first, Iterator last, error_code &ec = throws)¶ The function wait_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The future returned by the function wait_some becomes ready when at least n argument futures have become ready.
- Return
- Returns a future holding the same list of futures as has been passed to wait_some.
- future<vector<future<R>>>: If the input cardinality is unknown at compile time and the futures are all of the same type.
- Note
- Calling this version of wait_some where first == last, returns a future with an empty vector that is immediately ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by wait_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_all should wait.last
: [in] The iterator pointing to the last element of a sequence of future or shared_future objects for which when_all should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
R
>
voidwait_some
(std::size_t n, std::vector<future<R>> &&futures, error_code &ec = throws)¶ The function wait_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The function wait_all returns after n futures have become ready. All input futures are still valid after wait_all returns.
- Note
- Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by wait_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.futures
: [in] A vector holding an arbitrary amount of future or shared_future objects for which wait_some should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
R
, std::size_tN
>
voidwait_some
(std::size_t n, std::array<future<R>, N> &&futures, error_code &ec = throws)¶ The function wait_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The function wait_all returns after n futures have become ready. All input futures are still valid after wait_all returns.
- Note
- Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by wait_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.futures
: [in] An array holding an arbitrary amount of future or shared_future objects for which wait_some should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename ...
T
>
voidwait_some
(std::size_t n, T&&... futures, error_code &ec = throws)¶ The function wait_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The function wait_all returns after n futures have become ready. All input futures are still valid after wait_all returns.
- Note
- Calling this version of wait_some where first == last, returns a future with an empty vector that is immediately ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by wait_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which wait_some should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
InputIter
>
InputIterwait_some_n
(std::size_t n, Iterator first, std::size_t count, error_code &ec = throws)¶ The function wait_some_n is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The function wait_all returns after n futures have become ready. All input futures are still valid after wait_all returns.
- Return
- This function returns an Iterator referring to the first element after the last processed input element.
- Note
- Calling this version of wait_some_n where count == 0, returns a future with the same elements as the arguments that is immediately ready. Possibly none of the futures in that vector are ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by wait_some_n will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_all should wait.count
: [in] The number of elements in the sequence starting at first.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
InputIter
, typenameContainer
= vector<future<typename std::iterator_traits<InputIter>::value_type>>>
future<when_some_result<Container>>when_some
(std::size_t n, Iterator first, Iterator last, error_code &ec = throws)¶ The function when_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The future returned by the function when_some becomes ready when at least n argument futures have become ready.
- Return
- Returns a when_some_result holding the same list of futures as has been passed to when_some and indices pointing to ready futures.
- future<when_some_result<Container<future<R>>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Note
- Calling this version of when_some where first == last, returns a future with an empty container that is immediately ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_all should wait.last
: [in] The iterator pointing to the last element of a sequence of future or shared_future objects for which when_all should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
Range
>
future<when_some_result<Range>>when_some
(std::size_t n, Range &&futures, error_code &ec = throws)¶ The function when_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The future returned by the function when_some becomes ready when at least n argument futures have become ready.
- Return
- Returns a when_some_result holding the same list of futures as has been passed to when_some and indices pointing to ready futures.
- future<when_some_result<Container<future<R>>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Note
- Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.futures
: [in] A container holding an arbitrary amount of future or shared_future objects for which when_some should wait.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename ...
T
>
future<when_some_result<tuple<future<T>...>>>when_some
(std::size_t n, error_code &ec, T&&... futures)¶ The function when_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The future returned by the function when_some becomes ready when at least n argument futures have become ready.
- Return
- Returns a when_some_result holding the same list of futures as has been passed to when_some and an index pointing to a ready future..
- future<when_some_result<tuple<future<T0>, future<T1>…>>>: If inputs are fixed in number and are of heterogeneous types. The inputs can be any arbitrary number of future objects.
- future<when_some_result<tuple<>>> if when_some is called with zero arguments. The returned future will be initially ready.
- Note
- Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which when_some should wait.
-
template<typename ...
T
>
future<when_some_result<tuple<future<T>...>>>when_some
(std::size_t n, T&&... futures)¶ The function when_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The future returned by the function when_some becomes ready when at least n argument futures have become ready.
- Return
- Returns a when_some_result holding the same list of futures as has been passed to when_some and an index pointing to a ready future..
- future<when_some_result<tuple<future<T0>, future<T1>…>>>: If inputs are fixed in number and are of heterogeneous types. The inputs can be any arbitrary number of future objects.
- future<when_some_result<tuple<>>> if when_some is called with zero arguments. The returned future will be initially ready.
- Note
- Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_some will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.futures
: [in] An arbitrary number of future or shared_future objects, possibly holding different types for which when_some should wait.
-
template<typename
InputIter
, typenameContainer
= vector<future<typename std::iterator_traits<InputIter>::value_type>>>
future<when_some_result<Container>>when_some_n
(std::size_t n, Iterator first, std::size_t count, error_code &ec = throws)¶ The function when_some_n is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.
- Note
- The future returned by the function when_some_n becomes ready when at least n argument futures have become ready.
- Return
- Returns a when_some_result holding the same list of futures as has been passed to when_some and indices pointing to ready futures.
- future<when_some_result<Container<future<R>>>>: If the input cardinality is unknown at compile time and the futures are all of the same type. The order of the futures in the output container will be the same as given by the input iterator.
- Note
- Calling this version of when_some_n where count == 0, returns a future with the same elements as the arguments that is immediately ready. Possibly none of the futures in that container are ready. Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by when_some_n will not throw an exception, but the futures held in the output collection may.
- Parameters
n
: [in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.first
: [in] The iterator pointing to the first element of a sequence of future or shared_future objects for which when_all should wait.count
: [in] The number of elements in the sequence starting at first.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
template<typename
F
, typenameFuture
>
voidwait_each
(F &&f, std::vector<Future> &&futures)¶ The function wait_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns after they finished executing. Additionally, the supplied function is called for each of the passed futures as soon as the future has become ready. wait_each returns after all futures have been become ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.futures
: A vector holding an arbitrary amount of future or shared_future objects for which wait_each should wait.
-
template<typename
F
, typenameIterator
>
voidwait_each
(F &&f, Iterator begin, Iterator end)¶ The function wait_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns after they finished executing. Additionally, the supplied function is called for each of the passed futures as soon as the future has become ready. wait_each returns after all futures have been become ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.begin
: The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_each should wait.end
: The iterator pointing to the last element of a sequence of future or shared_future objects for which wait_each should wait.
-
template<typename
F
, typename ...T
>
voidwait_each
(F &&f, T&&... futures)¶ The function wait_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns after they finished executing. Additionally, the supplied function is called for each of the passed futures as soon as the future has become ready. wait_each returns after all futures have been become ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.futures
: An arbitrary number of future or shared_future objects, possibly holding different types for which wait_each should wait.
-
template<typename
F
, typenameIterator
>
voidwait_each_n
(F &&f, Iterator begin, std::size_t count)¶ The function wait_each is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing. Additionally, the supplied function is called for each of the passed futures as soon as the future has become ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.begin
: The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_each_n should wait.count
: The number of elements in the sequence starting at first.
-
template<typename
F
, typenameFuture
>
future<void>when_each
(F &&f, std::vector<Future> &&futures)¶ The function when_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns a new future object representing the event of all those futures having finished executing. It also calls the supplied callback for each of the futures which becomes ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Return
- Returns a future representing the event of all input futures being ready.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.futures
: A vector holding an arbitrary amount of future or shared_future objects for which wait_each should wait.
-
template<typename
F
, typenameIterator
>
future<Iterator>when_each
(F &&f, Iterator begin, Iterator end)¶ The function when_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns a new future object representing the event of all those futures having finished executing. It also calls the supplied callback for each of the futures which becomes ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Return
- Returns a future representing the event of all input futures being ready.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.begin
: The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_each should wait.end
: The iterator pointing to the last element of a sequence of future or shared_future objects for which wait_each should wait.
-
template<typename
F
, typename ...Ts
>
future<void>when_each
(F &&f, Ts&&... futures)¶ The function when_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns a new future object representing the event of all those futures having finished executing. It also calls the supplied callback for each of the futures which becomes ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Return
- Returns a future representing the event of all input futures being ready.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.futures
: An arbitrary number of future or shared_future objects, possibly holding different types for which wait_each should wait.
-
template<typename
F
, typenameIterator
>
future<Iterator>when_each_n
(F &&f, Iterator begin, std::size_t count)¶ The function when_each is an operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns a new future object representing the event of all those futures having finished executing. It also calls the supplied callback for each of the futures which becomes ready.
- Note
- This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Return
- Returns a future holding the iterator pointing to the first element after the last one.
- Parameters
f
: The function which will be called for each of the input futures once the future has become ready.begin
: The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_each_n should wait.count
: The number of elements in the sequence starting at first.
Variables
-
error_code
throws
¶ Predefined error_code object used as “throw on error” tag.
The predefined hpx::error_code object hpx::throws is supplied for use as a “throw on error” tag.
Functions that specify an argument in the form ‘error_code& ec=throws’ (with appropriate namespace qualifiers), have the following error handling semantics:
If &ec != &throws and an error occurred: ec.value() returns the implementation specific error number for the particular error that occurred and ec.category() returns the error_category for ec.value().
If &ec != &throws and an error did not occur, ec.clear().
If an error occurs and &ec == &throws, the function throws an exception of type hpx::exception or of a type derived from it. The exception’s get_errorcode() member function returns a reference to an hpx::error_code object with the behavior as specified above.
-
error_code
-
namespace
actions
¶
-
namespace
applier
¶
-
namespace
components
¶ Functions
-
template<typename
Component
>
future<naming::id_type>migrate_from_storage
(naming::id_type const &to_resurrect, naming::id_type const &target = naming::invalid_id)¶ Migrate the component with the given id from the specified target storage (resurrect the object)
The function migrate_from_storage<Component> will migrate the component referenced by to_resurrect from the storage facility specified where the object is currently stored on. It returns a future referring to the migrated component instance. The component instance is resurrected on the locality specified by target_locality.
- Return
- A future representing the global id of the migrated component instance. This should be the same as to_resurrect.
- Parameters
to_resurrect
: [in] The global id of the component to migrate.target
: [in] The optional locality to resurrect the object on. By default the object is resurrected on the locality it was located on last.
- Template Parameters
The
: only template argument specifies the component type of the component to migrate from the given storage facility.
-
template<typename
Component
>
future<naming::id_type>migrate_to_storage
(naming::id_type const &to_migrate, naming::id_type const &target_storage)¶ Migrate the component with the given id to the specified target storage
The function migrate_to_storage<Component> will migrate the component referenced by to_migrate to the storage facility specified with target_storage. It returns a future referring to the migrated component instance.
- Return
- A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The global id of the component to migrate.target_storage
: [in] The id of the storage facility to migrate this object to.
- Template Parameters
The
: only template argument specifies the component type of the component to migrate to the given storage facility.
-
template<typename
Derived
, typenameStub
>
Derivedmigrate_to_storage
(client_base<Derived, Stub> const &to_migrate, hpx::components::component_storage const &target_storage)¶ Migrate the given component to the specified target storage
The function migrate_to_storage will migrate the component referenced by to_migrate to the storage facility specified with target_storage. It returns a future referring to the migrated component instance.
- Return
- A client side representation of representing of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.target_storage
: [in] The id of the storage facility to migrate this object to.
-
template<typename
Component
>
future<naming::id_type>copy
(naming::id_type const &to_copy)¶ Copy given component to the specified target locality.
The function copy<Component> will create a copy of the component referenced by to_copy on the locality specified with target_locality. It returns a future referring to the newly created component instance.
- Return
- A future representing the global id of the newly (copied) component instance.
- Note
- The new component instance is created on the locality of the component instance which is to be copied.
- Parameters
to_copy
: [in] The global id of the component to copy
- Template Parameters
The
: only template argument specifies the component type to create.
-
template<typename
Component
>
future<naming::id_type>copy
(naming::id_type const &to_copy, naming::id_type const &target_locality)¶ Copy given component to the specified target locality.
The function copy<Component> will create a copy of the component referenced by to_copy on the locality specified with target_locality. It returns a future referring to the newly created component instance.
- Return
- A future representing the global id of the newly (copied) component instance.
- Parameters
to_copy
: [in] The global id of the component to copytarget_locality
: [in ] The locality where the copy should be created.
- Template Parameters
The
: only template argument specifies the component type to create.
-
template<typename
Derived
, typenameStub
>
Derivedcopy
(client_base<Derived, Stub> const &to_copy, naming::id_type const &target_locality = naming::invalid_id)¶ Copy given component to the specified target locality.
The function copy will create a copy of the component referenced by the client side object to_copy on the locality specified with target_locality. It returns a new client side object future referring to the newly created component instance.
- Return
- A future representing the global id of the newly (copied) component instance.
- Note
- If the second argument is omitted (or is invalid_id) the new component instance is created on the locality of the component instance which is to be copied.
- Parameters
to_copy
: [in] The client side object representing the component to copytarget_locality
: [in, optional] The locality where the copy should be created (default is same locality as source).
- Template Parameters
The
: only template argument specifies the component type to create.
-
template<typename
Component
, typenameDistPolicy
>
future<naming::id_type>migrate
(naming::id_type const &to_migrate, DistPolicy const &policy)¶ Migrate the given component to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
- A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.policy
: [in] A distribution policy which will be used to determine the locality to migrate this object to.
- Template Parameters
Component
: Specifies the component type of the component to migrate.DistPolicy
: Specifies the distribution policy to use to determine the destination locality.
-
template<typename
Derived
, typenameStub
, typenameDistPolicy
>
Derivedmigrate
(client_base<Derived, Stub> const &to_migrate, DistPolicy const &policy)¶ Migrate the given component to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
- A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.policy
: [in] A distribution policy which will be used to determine the locality to migrate this object to.
- Template Parameters
Derived
: Specifies the component type of the component to migrate.DistPolicy
: Specifies the distribution policy to use to determine the destination locality.
-
template<typename
Component
>
future<naming::id_type>migrate
(naming::id_type const &to_migrate, naming::id_type const &target_locality)¶ Migrate the component with the given id to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
- A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The global id of the component to migrate.target_locality
: [in] The locality where the component should be migrated to.
- Template Parameters
Component
: Specifies the component type of the component to migrate.
-
template<typename
Derived
, typenameStub
>
Derivedmigrate
(client_base<Derived, Stub> const &to_migrate, naming::id_type const &target_locality)¶ Migrate the given component to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
- A client side representation of representing of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.target_locality
: [in] The id of the locality to migrate this object to.
- Template Parameters
Derived
: Specifies the component type of the component to migrate.
Variables
-
char const *const
default_binpacking_counter_name
= "/runtime{locality/total}/count/component@"¶
-
binpacking_distribution_policy const
binpacked
¶ A predefined instance of the binpacking distribution_policy. It will represent the local locality and will place all items to create here.
-
colocating_distribution_policy const
colocated
¶ A predefined instance of the co-locating distribution_policy. It will represent the local locality and will place all items to create here.
-
default_distribution_policy const
default_layout
= {}¶ A predefined instance of the default distribution_policy. It will represent the local locality and will place all items to create here.
-
template<typename
-
namespace
lcos
¶ Functions
-
template<typename Action, typename ArgN, ...>hpx::future<std::vector<decltype(Action(hpx::id_type, ArgN, ...))> > hpx::lcos::broadcast(std::vector< hpx::id_type > const & ids, ArgN argN, ...)
Perform a distributed broadcast operation.
The function hpx::lcos::broadcast performs a distributed broadcast operation resulting in action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The given action is invoked asynchronously on all given identifiers, and the arguments ArgN are passed along to those invocations.
- Return
- This function returns a future representing the result of the overall reduction operation.
- Note
- If decltype(Action(…)) is void, then the result of this function is future<void>.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.argN
: [in] Any number of arbitrary arguments (passed by const reference) which will be forwarded to the action invocation.
-
template<typename Action, typename ArgN, ...>void hpx::lcos::broadcast_apply(std::vector< hpx::id_type > const & ids, ArgN argN, ...)
Perform an asynchronous (fire&forget) distributed broadcast operation.
The function hpx::lcos::broadcast_apply performs an asynchronous (fire&forget) distributed broadcast operation resulting in action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The given action is invoked asynchronously on all given identifiers, and the arguments ArgN are passed along to those invocations.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.argN
: [in] Any number of arbitrary arguments (passed by const reference) which will be forwarded to the action invocation.
-
template<typename Action, typename ArgN, ...>hpx::future<std::vector<decltype(Action(hpx::id_type, ArgN, ..., std::size_t))> > hpx::lcos::broadcast_with_index(std::vector< hpx::id_type > const & ids, ArgN argN, ...)
Perform a distributed broadcast operation.
The function hpx::lcos::broadcast_with_index performs a distributed broadcast operation resulting in action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The given action is invoked asynchronously on all given identifiers, and the arguments ArgN are passed along to those invocations.
The function passes the index of the global identifier in the given list of identifiers as the last argument to the action.
- Return
- This function returns a future representing the result of the overall reduction operation.
- Note
- If decltype(Action(…)) is void, then the result of this function is future<void>.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.argN
: [in] Any number of arbitrary arguments (passed by const reference) which will be forwarded to the action invocation.
-
template<typename Action, typename ArgN, ...>void hpx::lcos::broadcast_apply_with_index(std::vector< hpx::id_type > const & ids, ArgN argN, ...)
Perform an asynchronous (fire&forget) distributed broadcast operation.
The function hpx::lcos::broadcast_apply_with_index performs an asynchronous (fire&forget) distributed broadcast operation resulting in action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The given action is invoked asynchronously on all given identifiers, and the arguments ArgN are passed along to those invocations.
The function passes the index of the global identifier in the given list of identifiers as the last argument to the action.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.argN
: [in] Any number of arbitrary arguments (passed by const reference) which will be forwarded to the action invocation.
-
template<typename Action, typename FoldOp, typename Init, typename ArgN, ...>hpx::future<decltype(Action(hpx::id_type, ArgN, ...))> hpx::lcos::fold(std::vector< hpx::id_type > const & ids, FoldOp && fold_op, Init && init, ArgN argN, ...)
Perform a distributed fold operation.
The function hpx::lcos::fold performs a distributed folding operation over results returned from action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
- Note
- The type of the initial value must be convertible to the result type returned from the invoked action.
- Return
- This function returns a future representing the result of the overall folding operation.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.fold_op
: [in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the folding operation performed on its arguments.init
: [in] The initial value to be used for the folding operationargN
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the action invocation.
-
template<typename Action, typename FoldOp, typename Init, typename ArgN, ...>hpx::future<decltype(Action(hpx::id_type, ArgN, ..., std::size_t))> hpx::lcos::fold_with_index(std::vector< hpx::id_type > const & ids, FoldOp && fold_op, Init && init, ArgN argN, ...)
Perform a distributed folding operation.
The function hpx::lcos::fold_with_index performs a distributed folding operation over results returned from action invocations on a given set of global identifiers. The action can be either plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The function passes the index of the global identifier in the given list of identifiers as the last argument to the action.
- Note
- The type of the initial value must be convertible to the result type returned from the invoked action.
- Return
- This function returns a future representing the result of the overall folding operation.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.fold_op
: [in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the folding operation performed on its arguments.init
: [in] The initial value to be used for the folding operationargN
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the action invocation.
-
template<typename Action, typename FoldOp, typename Init, typename ArgN, ...>hpx::future<decltype(Action(hpx::id_type, ArgN, ...))> hpx::lcos::inverse_fold(std::vector< hpx::id_type > const & ids, FoldOp && fold_op, Init && init, ArgN argN, ...)
Perform a distributed inverse folding operation.
The function hpx::lcos::inverse_fold performs an inverse distributed folding operation over results returned from action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
- Note
- The type of the initial value must be convertible to the result type returned from the invoked action.
- Return
- This function returns a future representing the result of the overall folding operation.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.fold_op
: [in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the folding operation performed on its arguments.init
: [in] The initial value to be used for the folding operationargN
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the action invocation.
-
template<typename Action, typename FoldOp, typename Init, typename ArgN, ...>hpx::future<decltype(Action(hpx::id_type, ArgN, ..., std::size_t))> hpx::lcos::inverse_fold_with_index(std::vector< hpx::id_type > const & ids, FoldOp && fold_op, Init && init, ArgN argN, ...)
Perform a distributed inverse folding operation.
The function hpx::lcos::inverse_fold_with_index performs an inverse distributed folding operation over results returned from action invocations on a given set of global identifiers. The action can be either plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The function passes the index of the global identifier in the given list of identifiers as the last argument to the action.
- Note
- The type of the initial value must be convertible to the result type returned from the invoked action.
- Return
- This function returns a future representing the result of the overall folding operation.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.fold_op
: [in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the folding operation performed on its arguments.init
: [in] The initial value to be used for the folding operationargN
: [in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the action invocation.
-
template<typename
T
>
hpx::future<std::vector<T>>gather_here
(char const *basename, hpx::future<T> result, std::size_t num_sites = std::size_t(-1), std::size_t generation = std::size_t(-1), std::size_t this_site = std::size_t(-1))¶ Gather a set of values from different call sites
This function receives a set of values from all call sites operating on the given base name.
- Note
- Each gather operation has to be accompanied with a unique usage of the HPX_REGISTER_GATHER macro to define the necessary internal facilities used by gather_here and gather_there
- Return
- This function returns a future holding a vector with all gathered values. It will become ready once the gather operation has been completed.
- Parameters
basename
: The base name identifying the gather operationresult
: A future referring to the value to transmit to the central gather point from this call site.num_sites
: The number of participating sites (default: all localities).generation
: The generational counter identifying the sequence number of the gather operation performed on the given base name. This is optional and needs to be supplied only if the gather operation on the given base name has to be performed more than once.this_site
: The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
-
template<typename
T
>
hpx::future<void>gather_there
(char const *basename, hpx::future<T> result, std::size_t generation = std::size_t(-1), std::size_t root_site = 0, std::size_t this_site = std::size_t(-1))¶ Gather a given value at the given call site
This function transmits the value given by result to a central gather site (where the corresponding gather_here is executed)
- Note
- Each gather operation has to be accompanied with a unique usage of the HPX_REGISTER_GATHER macro to define the necessary internal facilities used by gather_here and gather_there
- Return
- This function returns a future which will become ready once the gather operation has been completed.
- Parameters
basename
: The base name identifying the gather operationresult
: A future referring to the value to transmit to the central gather point from this call site.generation
: The generational counter identifying the sequence number of the gather operation performed on the given base name. This is optional and needs to be supplied only if the gather operation on the given base name has to be performed more than once.root_site
: The sequence number of the central gather point (usually the locality id). This value is optional and defaults to 0.this_site
: The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
-
template<typename
T
>
hpx::future<std::vector<typename std::decay<T>::type>>gather_here
(char const *basename, T &&result, std::size_t num_sites = std::size_t(-1), std::size_t generation = std::size_t(-1), std::size_t this_site = std::size_t(-1))¶ Gather a set of values from different call sites
This function receives a set of values from all call sites operating on the given base name.
- Note
- Each gather operation has to be accompanied with a unique usage of the HPX_REGISTER_GATHER macro to define the necessary internal facilities used by gather_here and gather_there
- Return
- This function returns a future holding a vector with all gathered values. It will become ready once the gather operation has been completed.
- Parameters
basename
: The base name identifying the gather operationresult
: The value to transmit to the central gather point from this call site.num_sites
: The number of participating sites (default: all localities).generation
: The generational counter identifying the sequence number of the gather operation performed on the given base name. This is optional and needs to be supplied only if the gather operation on the given base name has to be performed more than once.this_site
: The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
-
template<typename
T
>
hpx::future<void>gather_there
(char const *basename, T &&result, std::size_t generation = std::size_t(-1), std::size_t root_site = 0, std::size_t this_site = std::size_t(-1))¶ Gather a given value at the given call site
This function transmits the value given by result to a central gather site (where the corresponding gather_here is executed)
- Note
- Each gather operation has to be accompanied with a unique usage of the HPX_REGISTER_GATHER macro to define the necessary internal facilities used by gather_here and gather_there
- Return
- This function returns a future which will become ready once the gather operation has been completed.
- Parameters
basename
: The base name identifying the gather operationresult
: The value to transmit to the central gather point from this call site.generation
: The generational counter identifying the sequence number of the gather operation performed on the given base name. This is optional and needs to be supplied only if the gather operation on the given base name has to be performed more than once.root_site
: The sequence number of the central gather point (usually the locality id). This value is optional and defaults to 0.this_site
: The sequence number of this invocation (usually the locality id). This value is optional and defaults to whatever hpx::get_locality_id() returns.
-
template<typename Action, typename ReduceOp, typename ArgN, ...>hpx::future<decltype(Action(hpx::id_type, ArgN, ...))> hpx::lcos::reduce(std::vector< hpx::id_type > const & ids, ReduceOp && reduce_op, ArgN argN, ...)
Perform a distributed reduction operation.
The function hpx::lcos::reduce performs a distributed reduction operation over results returned from action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
- Return
- This function returns a future representing the result of the overall reduction operation.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.reduce_op
: [in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the reduction operation performed on its arguments.argN
: [in] Any number of arbitrary arguments (passed by by const reference) which will be forwarded to the action invocation.
-
template<typename Action, typename ReduceOp, typename ArgN, ...>hpx::future<decltype(Action(hpx::id_type, ArgN, ..., std::size_t))> hpx::lcos::reduce_with_index(std::vector< hpx::id_type > const & ids, ReduceOp && reduce_op, ArgN argN, ...)
Perform a distributed reduction operation.
The function hpx::lcos::reduce_with_index performs a distributed reduction operation over results returned from action invocations on a given set of global identifiers. The action can be either plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.
The function passes the index of the global identifier in the given list of identifiers as the last argument to the action.
- Return
- This function returns a future representing the result of the overall reduction operation.
- Parameters
ids
: [in] A list of global identifiers identifying the target objects for which the given action will be invoked.reduce_op
: [in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the reduction operation performed on its arguments.argN
: [in] Any number of arbitrary arguments (passed by by const reference) which will be forwarded to the action invocation.
-
-
namespace
naming
¶ Functions
-
id_type
unmanaged
(id_type const &id)¶ The helper function hpx::unmanaged can be used to generate a global identifier which does not participate in the automatic garbage collection.
- Return
- This function returns a new global id referencing the same object as the parameter id. The only difference is that the returned global identifier does not participate in the automatic garbage collection.
- Note
- This function allows to apply certain optimizations to the process of memory management in HPX. It however requires the user to take full responsibility for keeping the referenced objects alive long enough.
- Parameters
id
: [in] The id to generated the unmanaged global id from This parameter can be itself a managed or a unmanaged global id.
-
id_type
-
namespace
parallel
¶
-
namespace
execution
¶ Typedefs
-
using
service_executor
= 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
io_pool_executor
= 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
parcel_pool_executor
= 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
timer_pool_executor
= 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
main_pool_executor
= 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.
-
using
local_priority_queue_executor
= 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).
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.
-
using
-
namespace [anonymous]¶
-
namespace [anonymous]¶
-
namespace
v1
¶ Functions
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeadjacent_difference
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest)¶ Assigns each value in the range given by result its corresponding element in the range [first, last] and the one preceding it except *result, which is assigned *first
The difference operations in the parallel
adjacent_difference invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly (last - first) - 1 application of the binary operator and (last - first) assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the input range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the output range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the range the algorithm will be applied to.dest
: Refers to the beginning of the sequence of elements the results will be assigned to.
The difference operations in the parallel adjacent_difference invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
This overload of
adjacent_find is available if the user decides to provide their algorithm their own binary predicate op.- Return
- The adjacent_difference algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The adjacent_find algorithm returns an iterator to the last element in the output range.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameOp
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeadjacent_difference
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, Op &&op)¶ Assigns each value in the range given by result its corresponding element in the range [first, last] and the one preceding it except *result, which is assigned *first
The difference operations in the parallel
adjacent_difference invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly (last - first) - 1 application of the binary operator and (last - first) assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the input range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the output range (deduced). This iterator type must meet the requirements of an forward iterator.Op
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of adjacent_difference requires Op to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the range the algorithm will be applied to.dest
: Refers to the beginning of the sequence of elements the results will be assigned to.op
: The binary operator which returns the difference of elements. The signature should be equivalent to the following:bool op(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 must be such that objects of type FwdIter1 can be dereferenced and then implicitly converted to the dereferenced type of dest.
The difference operations in the parallel adjacent_difference invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The adjacent_difference algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The adjacent_find algorithm returns an iterator to the last element in the output range.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
= detail::equal_to>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter>::type>::typeadjacent_find
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&op = Pred())¶ Searches the range [first, last) for two consecutive identical elements. This version uses the given binary predicate op
The comparison operations in the parallel
adjacent_find invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly the smaller of (result - first) + 1 and (last - first) - 1 application of the predicate where result is the value returned
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of adjacent_find requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the range the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1 .
The comparison operations in the parallel adjacent_find invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
This overload of
adjacent_find is available if the user decides to provide their algorithm their own binary predicate op.- Return
- The adjacent_find algorithm returns a hpx::future<InIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns InIter otherwise. The adjacent_find algorithm returns an iterator to the first of the identical elements. If no such elements are found, last is returned.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typenone_of
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f, Proj &&proj = Proj())¶ Checks if unary predicate f returns true for no elements in the range [first, last).
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last - first applications of the predicate f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of none_of requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The none_of algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The none_of algorithm returns true if the unary predicate f returns true for no elements in the range, false otherwise. It returns true if the range is empty.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typeany_of
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f, Proj &&proj = Proj())¶ Checks if unary predicate f returns true for at least one element in the range [first, last).
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last - first applications of the predicate f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of any_of requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The any_of algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The any_of algorithm returns true if the unary predicate f returns true for at least one element in the range, false otherwise. It returns false if the range is empty.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typeall_of
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f, Proj &&proj = Proj())¶ Checks if unary predicate f returns true for all elements in the range [first, last).
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last - first applications of the predicate f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of all_of requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The all_of algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The all_of algorithm returns true if the unary predicate f returns true for all elements in the range, false otherwise. It returns true if the range is empty.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typecopy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest)¶ Copies the elements in the range, defined by [first, last), to another range beginning at dest.
The assignments in the parallel
copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameSize
, typenameFwdIter2
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typecopy_n
(ExPolicy &&policy, FwdIter1 first, Size count, FwdIter2 dest)¶ Copies the elements in the range [first, first + count), starting from first and proceeding to first + count - 1., to another range beginning at dest.
The assignments in the parallel
copy_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, if count > 0, no assignments otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Size
: The type of the argument specifying the number of elements to apply f to.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel copy_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The copy_n algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typecopy_if
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, F &&f, Proj &&proj = Proj())¶ Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the predicate f returns true. The order of the elements that are not removed is preserved.
The assignments in the parallel
copy_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The copy_if algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIterB
, typenameFwdIterE
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename std::iterator_traits<FwdIterB>::difference_type>::typecount
(ExPolicy &&policy, FwdIterB first, FwdIterE last, T const &value, Proj &&proj = Proj())¶ Returns the number of elements in the range [first, last) satisfying a specific criteria. This version counts the elements that are equal to the given value.
The comparisons in the parallel
count algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first comparisons.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the comparisons.FwdIterB
: The type of the source begin iterator used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIterE
: The type of the source end iterator used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to search for (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.value
: The value to search for.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
- Note
- The comparisons in the parallel count algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The count algorithm returns a hpx::future<difference_type> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by std::iterator_traits<FwdIterB>::difference_type. The count algorithm returns the number of elements satisfying the given criteria.
-
template<typename
ExPolicy
, typenameFwdIterB
, typenameFwdIterE
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename std::iterator_traits<FwdIterB>::difference_type>::typecount_if
(ExPolicy &&policy, FwdIterB first, FwdIterE last, F &&f, Proj &&proj = Proj())¶ Returns the number of elements in the range [first, last) satisfying a specific criteria. This version counts elements for which predicate f returns true.
- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Note
- The assignments in the parallel count_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
- Note
- The assignments in the parallel count_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The count_if algorithm returns hpx::future<difference_type> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by std::iterator_traits<FwdIterB>::difference_type. The count algorithm returns the number of elements satisfying the given criteria.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the comparisons.FwdIterB
: The type of the source begin iterator used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIterE
: The type of the source end iterator used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of count_if requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIterB can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
-
template<typename
ExPolicy
, typenameFwdIter
>
util::detail::algorithm_result<ExPolicy>::typedestroy
(ExPolicy &&policy, FwdIter first, FwdIter last)¶ Destroys objects of type typename iterator_traits<ForwardIt>::value_type in the range [first, last).
The operations in the parallel
destroy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first operations.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The operations in the parallel destroy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The destroy algorithm returns a hpx::future<void>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
>
util::detail::algorithm_result<ExPolicy, FwdIter>::typedestroy_n
(ExPolicy &&policy, FwdIter first, Size count)¶ Destroys objects of type typename iterator_traits<ForwardIt>::value_type in the range [first, first + count).
The operations in the parallel
destroy_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count operations, if count > 0, no assignments otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Size
: The type of the argument specifying the number of elements to apply this algorithm to.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.
The operations in the parallel destroy_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The destroy_n algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The destroy_n algorithm returns the iterator to the element in the source range, one past the last element constructed.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, bool>::type>::typeequal
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, Pred &&op = Pred())¶ Returns true if the range [first1, last1) is equal to the range [first2, last2), and false otherwise.
The comparison operations in the parallel
equal algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most min(last1 - first1, last2 - first2) applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of equal requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively
The comparison operations in the parallel equal algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The two ranges are considered equal if, for every iterator i in the range [first1,last1), *i equals *(first2 + (i - first1)). This overload of equal uses operator== to determine if two elements are equal.
- Return
- The equal algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The equal algorithm returns true if the elements in the two ranges are equal, otherwise it returns false. If the length of the range [first1, last1) does not equal the length of the range [first2, last2), it returns false.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, bool>::type>::typeequal
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, Pred &&op = Pred())¶ Returns true if the range [first1, last1) is equal to the range starting at first2, and false otherwise.
The comparison operations in the parallel
equal algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last1 - first1 applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of equal requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively
The comparison operations in the parallel equal algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The two ranges are considered equal if, for every iterator i in the range [first1,last1), *i equals *(first2 + (i - first1)). This overload of equal uses operator== to determine if two elements are equal.
- Return
- The equal algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The equal algorithm returns true if the elements in the two ranges are equal, otherwise it returns false.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT
, typenameOp
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeexclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, T init, Op &&op)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(binary_op, init, *first, …, *(first + (i - result) - 1)).
The reduce operations in the parallel
exclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be used as initial (and intermediate) values (deduced).Op
: The type of the binary function object used for the reduction operation.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.init
: The initial value for the generalized sum.op
: Specifies the function (or function object) which will be invoked for each of the values of the input sequence. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Ret must be such that an object of a type as given by the input sequence can be implicitly converted to any of those types.
The reduce operations in the parallel exclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
exclusive_scan and inclusive_scan is that inclusive_scan includes the ith input element in the ith sum. If op is not mathematically associative, the behavior of inclusive_scan may be non-deterministic.- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The exclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aN) is defined as:
- a1 when N is 1
- op(GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aK), GENERALIZED_NONCOMMUTATIVE_SUM(op, aM, …, aN)) where 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeexclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, T init)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(+, init, *first, …, *(first + (i - result) - 1))
The reduce operations in the parallel
exclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate std::plus<T>.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be used as initial (and intermediate) values (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.init
: The initial value for the generalized sum.
The reduce operations in the parallel exclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
exclusive_scan and inclusive_scan is that inclusive_scan includes the ith input element in the ith sum.- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The exclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(+, a1, …, aN) is defined as:
- a1 when N is 1
- GENERALIZED_NONCOMMUTATIVE_SUM(+, a1, …, aK)
- GENERALIZED_NONCOMMUTATIVE_SUM(+, aM, …, aN) where 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameT
>
util::detail::algorithm_result<ExPolicy>::typefill
(ExPolicy &&policy, FwdIter first, FwdIter last, T value)¶ Assigns the given value to the elements in the range [first, last).
The comparisons in the parallel
fill algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be assigned (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.value
: The value to be assigned.
The comparisons in the parallel fill algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The fill algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by void.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
, typenameT
>
util::detail::algorithm_result<ExPolicy, FwdIter>::typefill_n
(ExPolicy &&policy, FwdIter first, Size count, T value)¶ Assigns the given value value to the first count elements in the range beginning at first if count > 0. Does nothing otherwise.
The comparisons in the parallel
fill_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, for count > 0.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an output iterator.Size
: The type of the argument specifying the number of elements to apply f to.T
: The type of the value to be assigned (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.value
: The value to be assigned.
The comparisons in the parallel fill_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The fill_n algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by void.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameT
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter>::type>::typefind
(ExPolicy &&policy, FwdIter first, FwdIter last, T const &val)¶ Returns the first element in the range [first, last) that is equal to value
The comparison operations in the parallel
find algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last - first applications of the operator==().
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to find (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.val
: the value to compare the elements to
The comparison operations in the parallel find algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The find algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find algorithm returns the first element in the range [first,last) that is equal to val. If no such element in the range of [first,last) is equal to val, then the algorithm returns last.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter>::type>::typefind_if
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f)¶ Returns the first element in the range [first, last) for which predicate f returns true
The comparison operations in the parallel
find_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.f
: The unary predicate which returns true for the required element. The signature of the predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type.
The comparison operations in the parallel find_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The find_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_if algorithm returns the first element in the range [first,last) that satisfies the predicate f. If no such element exists that satisfies the predicate f, the algorithm returns last.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter>::type>::typefind_if_not
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f)¶ Returns the first element in the range [first, last) for which predicate f returns false
The comparison operations in the parallel
find_if_not algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.f
: The unary predicate which returns false for the required element. The signature of the predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type.
The comparison operations in the parallel find_if_not algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The find_if_not algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_if_not algorithm returns the first element in the range [first, last) that does not satisfy the predicate f. If no such element exists that does not satisfy the predicate f, the algorithm returns last.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to, typenameProj
= util::projection_identity>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter1>::type>::typefind_end
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, Pred &&op = Pred(), Proj &&proj = Proj())¶ Returns the last subsequence of elements [first2, last2) found in the range [first, last) using the given predicate f to compare elements.
The comparison operations in the parallel
find_end algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most S*(N-S+1) comparisons where S = distance(first2, last2) and N = distance(first1, last1).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of type dereferenced FwdIter1 and dereferenced FwdIter2.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements the algorithm will be searching for.last2
: Refers to the end of the sequence of elements of the algorithm will be searching for.op
: The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively.proj
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter1 and dereferenced FwdIter2 as a projection operation before the function f is invoked.
The comparison operations in the parallel find_end algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
This overload of
find_end is available if the user decides to provide the algorithm their own predicate f.- Return
- The find_end algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The find_end algorithm returns an iterator to the beginning of the last subsequence [first2, last2) in range [first, last). If the length of the subsequence [first2, last2) is greater than the length of the range [first1, last1), last1 is returned. Additionally if the size of the subsequence is empty or no subsequence is found, last1 is also returned.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter1>::type>::typefind_first_of
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 s_first, FwdIter2 s_last, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Searches the range [first, last) for any elements in the range [s_first, s_last). Uses binary predicate p to compare elements
The comparison operations in the parallel
find_first_of algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most (S*N) comparisons where S = distance(s_first, s_last) and N = distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of equal requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj1
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of type dereferenced FwdIter1.Proj2
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of type dereferenced FwdIter2.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.s_first
: Refers to the beginning of the sequence of elements the algorithm will be searching for.s_last
: Refers to the end of the sequence of elements of the algorithm will be searching for.op
: The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively.proj1
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter1 as a projection operation before the function op is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter2 as a projection operation before the function op is invoked.
The comparison operations in the parallel find_first_of algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The find_first_of algorithm returns a hpx::future<FwdIter1> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter1 otherwise. The find_first_of algorithm returns an iterator to the first element in the range [first, last) that is equal to an element from the range [s_first, s_last). If the length of the subsequence [s_first, s_last) is greater than the length of the range [first, last), last is returned. Additionally if the size of the subsequence is empty or no subsequence is found, last is also returned. This overload of find_end is available if the user decides to provide the algorithm their own predicate f.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typefor_each_n
(ExPolicy &&policy, FwdIter first, Size count, F &&f, Proj &&proj = Proj())¶ Applies f to the result of dereferencing every iterator in the range [first, first + count), starting from first and proceeding to first + count - 1.
If
f returns a result, the result is ignored.- Note
- Complexity: Applies f exactly count times.
If the type of first satisfies the requirements of a mutable iterator, f may apply non-constant functions through the dereferenced iterator.
Unlike its sequential form, the parallel overload of for_each does not return a copy of its Function parameter, since parallelization may not permit efficient state accumulation.
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Size
: The type of the argument specifying the number of elements to apply f to.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of for_each requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:<ignored> pred(const Type &a);
The signature does not need to have const&. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate f is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The for_each_n algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. It returns first + count for non-negative values of count and first for negative values.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typefor_each
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f, Proj &&proj = Proj())¶ Applies f to the result of dereferencing every iterator in the range [first, last).
If
f returns a result, the result is ignored.- Note
- Complexity: Applies f exactly last - first times.
If the type of first satisfies the requirements of a mutable iterator, f may apply non-constant functions through the dereferenced iterator.
Unlike its sequential form, the parallel overload of for_each does not return a copy of its Function parameter, since parallelization may not permit efficient state accumulation.
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of for_each requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:<ignored> pred(const Type &a);
The signature does not need to have const&. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate f is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The for_each algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
>
util::detail::algorithm_result<ExPolicy, FwdIter>::typegenerate
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f)¶ Assign each element in range [first, last) a value generated by the given function object f
The assignments in the parallel
generate algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly distance(first, last) invocations of f and assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: generator function that will be called. signature of function should be equivalent to the following:Ret fun();
The type
Ret must be such that an object of type FwdIter can be dereferenced and assigned a value of type Ret.
The assignments in the parallel generate algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
, typenameF
>
util::detail::algorithm_result<ExPolicy, FwdIter>::typegenerate_n
(ExPolicy &&policy, FwdIter first, Size count, F &&f)¶ Assigns each element in range [first, first+count) a value generated by the given function object g.
The assignments in the parallel
generate_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly count invocations of f and assignments, for count > 0.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements in the sequence the algorithm will be applied to.f
: Refers to the generator function object that will be called. The signature of the function should be equivalent toRet fun();
The type
Ret must be such that an object of type OutputIt can be dereferenced and assigned a value of type Ret.
The assignments in the parallel generate_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameRandIter
, typenameComp
= detail::less, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typeis_heap
(ExPolicy &&policy, RandIter first, RandIter last, Comp &&comp = Comp(), Proj &&proj = Proj())¶ Returns whether the range is max heap. That is, true if the range is max heap, false otherwise. The function uses the given comparison function object comp (defaults to using operator<()).
comp has to induce a strict weak ordering on the values.
- Note
- Complexity: Performs at most N applications of the comparison comp, at most 2 * N applications of the projection proj, where N = last - first.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.RandIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a random access iterator.Comp
: The type of the function/function object to use (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_heap algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The is_heap algorithm returns whether the range is max heap. That is, true if the range is max heap, false otherwise.
-
template<typename
ExPolicy
, typenameRandIter
, typenameComp
= detail::less, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, RandIter>::typeis_heap_until
(ExPolicy &&policy, RandIter first, RandIter last, Comp &&comp = Comp(), Proj &&proj = Proj())¶ Returns the upper bound of the largest range beginning at first which is a max heap. That is, the last iterator it for which range [first, it) is a max heap. The function uses the given comparison function object comp (defaults to using operator<()).
comp has to induce a strict weak ordering on the values.
- Note
- Complexity: Performs at most N applications of the comparison comp, at most 2 * N applications of the projection proj, where N = last - first.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.RandIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a random access iterator.Comp
: The type of the function/function object to use (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_heap_until algorithm returns a hpx::future<RandIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns RandIter otherwise. The is_heap_until algorithm returns the upper bound of the largest range beginning at first which is a max heap. That is, the last iterator it for which range [first, it) is a max heap.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, bool>::type>::typeincludes
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, Pred &&op = Pred())¶ Returns true if every element from the sorted range [first2, last2) is found within the sorted range [first1, last1). Also returns true if [first2, last2) is empty. The version expects both ranges to be sorted with the user supplied binary predicate f.
The comparison operations in the parallel
includes algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- At most 2*(N1+N2-1) comparisons, where N1 = std::distance(first1, last1) and N2 = std::distance(first2, last2).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of includes requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as includes. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively
The comparison operations in the parallel includes algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The includes algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The includes algorithm returns true every element from the sorted range [first2, last2) is found within the sorted range [first1, last1). Also returns true if [first2, last2) is empty.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameOp
, typenameT
>
util::detail::algorithm_result<ExPolicy, FwdIter2>::typeinclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, Op &&op, T init)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(op, init, *first, …, *(first + (i - result))).
The reduce operations in the parallel
inclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be used as initial (and intermediate) values (deduced).Op
: The type of the binary function object used for the reduction operation.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.init
: The initial value for the generalized sum.op
: Specifies the function (or function object) which will be invoked for each of the values of the input sequence. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Ret must be such that an object of a type as given by the input sequence can be implicitly converted to any of those types.
The reduce operations in the parallel inclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
exclusive_scan and inclusive_scan is that inclusive_scan includes the ith input element in the ith sum. If op is not mathematically associative, the behavior of inclusive_scan may be non-deterministic.- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The inclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aN) is defined as:
- a1 when N is 1
- op(GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aK), GENERALIZED_NONCOMMUTATIVE_SUM(op, aM, …, aN)) where 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameOp
>
util::detail::algorithm_result<ExPolicy, FwdIter2>::typeinclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, Op &&op)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(op, *first, …, *(first + (i - result))).
The reduce operations in the parallel
inclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Op
: The type of the binary function object used for the reduction operation.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.op
: Specifies the function (or function object) which will be invoked for each of the values of the input sequence. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Ret must be such that an object of a type as given by the input sequence can be implicitly converted to any of those types.
The reduce operations in the parallel inclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
exclusive_scan and inclusive_scan is that inclusive_scan includes the ith input element in the ith sum.- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The inclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(+, a1, …, aN) is defined as:
- a1 when N is 1
- GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aK)
- GENERALIZED_NONCOMMUTATIVE_SUM(+, aM, …, aN) where 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeinclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest)¶ Assigns through each iterator i in [result, result + (last - first)) the value of gENERALIZED_NONCOMMUTATIVE_SUM(+, *first, …, *(first + (i - result))).
The reduce operations in the parallel
inclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The reduce operations in the parallel inclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
exclusive_scan and inclusive_scan is that inclusive_scan includes the ith input element in the ith sum.- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The inclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(+, a1, …, aN) is defined as:
- a1 when N is 1
- GENERALIZED_NONCOMMUTATIVE_SUM(+, a1, …, aK)
- GENERALIZED_NONCOMMUTATIVE_SUM(+, aM, …, aN) where 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, bool>::type>::typeis_partitioned
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&pred)¶ Determines if the range [first, last) is partitioned.
The predicate operations in the parallel
is_partitioned algorithm invoked with an execution policy object of type sequenced_policy executes in sequential order in the calling thread.- Note
- Complexity: at most (N) predicate evaluations where N = distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the This iterator type must meet the requirements of a forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of that the algorithm will be applied to.last
: Refers to the end of the sequence of elements of that the algorithm will be applied to.pred
: Refers to the binary predicate which returns true if the first argument should be treated as less than the second argument. The signature of the function should be equivalent tobool pred(const Type &a, const Type &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type must be such that objects of types FwdIter can be dereferenced and then implicitly converted to Type.
The comparison operations in the parallel is_partitioned algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_partitioned algorithm returns a hpx::future<bool> if the execution policy is of type task_execution_policy and returns bool otherwise. The is_partitioned algorithm returns true if each element in the sequence for which pred returns true precedes those for which pred returns false. Otherwise is_partitioned returns false. If the range [first, last) contains less than two elements, the function is always true.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, bool>::type>::typeis_sorted
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&pred = Pred())¶ Determines if the range [first, last) is sorted. Uses pred to compare elements.
The comparison operations in the parallel
is_sorted algorithm invoked with an execution policy object of type sequenced_policy executes in sequential order in the calling thread.- Note
- Complexity: at most (N+S-1) comparisons where N = distance(first, last). S = number of partitions
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the This iterator type must meet the requirements of a forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of is_sorted requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of that the algorithm will be applied to.last
: Refers to the end of the sequence of elements of that the algorithm will be applied to.pred
: Refers to the binary predicate which returns true if the first argument should be treated as less than the second argument. The signature of the function should be equivalent tobool pred(const Type &a, const Type &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type must be such that objects of types FwdIter can be dereferenced and then implicitly converted to Type.
The comparison operations in the parallel is_sorted algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_sorted algorithm returns a hpx::future<bool> if the execution policy is of type task_execution_policy and returns bool otherwise. The is_sorted algorithm returns a bool if each element in the sequence [first, last) satisfies the predicate passed. If the range [first, last) contains less than two elements, the function always returns true.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter>::type>::typeis_sorted_until
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&pred = Pred())¶ Returns the first element in the range [first, last) that is not sorted. Uses a predicate to compare elements or the less than operator.
The comparison operations in the parallel
is_sorted_until algorithm invoked with an execution policy object of type sequenced_policy executes in sequential order in the calling thread.- Note
- Complexity: at most (N+S-1) comparisons where N = distance(first, last). S = number of partitions
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the This iterator type must meet the requirements of a forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of is_sorted_until requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of that the algorithm will be applied to.last
: Refers to the end of the sequence of elements of that the algorithm will be applied to.pred
: Refers to the binary predicate which returns true if the first argument should be treated as less than the second argument. The signature of the function should be equivalent tobool pred(const Type &a, const Type &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type must be such that objects of types FwdIter can be dereferenced and then implicitly converted to Type.
The comparison operations in the parallel is_sorted_until algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_sorted_until algorithm returns a hpx::future<FwdIter> if the execution policy is of type task_execution_policy and returns FwdIter otherwise. The is_sorted_until algorithm returns the first unsorted element. If the sequence has less than two elements or the sequence is sorted, last is returned.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, bool>::type>::typelexicographical_compare
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, Pred &&pred = Pred())¶ Checks if the first range [first1, last1) is lexicographically less than the second range [first2, last2). uses a provided predicate to compare elements.
The comparison operations in the parallel
lexicographical_compare algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most 2 * min(N1, N2) applications of the comparison operation, where N1 = std::distance(first1, last) and N2 = std::distance(first2, last2).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of lexicographical_compare requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.pred
: Refers to the comparison function that the first and second ranges will be applied to
The comparison operations in the parallel lexicographical_compare algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- Lexicographical comparison is an operation with the following properties
- Two ranges are compared element by element
- The first mismatching element defines which range is lexicographically less or greater than the other
- If one range is a prefix of another, the shorter range is lexicographically less than the other
- If two ranges have equivalent elements and are of the same length, then the ranges are lexicographically equal
- An empty range is lexicographically less than any non-empty range
- Two empty ranges are lexicographically equal
- Return
- The lexicographically_compare algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The lexicographically_compare algorithm returns true if the first range is lexicographically less, otherwise it returns false. range [first2, last2), it returns false.
-
template<typename
ExPolicy
, typenameRandIter1
, typenameRandIter2
, typenameRandIter3
, typenameComp
= detail::less, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in1(RandIter1), tag::in2(RandIter2), tag::out(RandIter3)>>::typemerge
(ExPolicy &&policy, RandIter1 first1, RandIter1 last1, RandIter2 first2, RandIter2 last2, RandIter3 dest, Comp &&comp = Comp(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Merges two sorted ranges [first1, last1) and [first2, last2) into one sorted range beginning at dest. The order of equivalent elements in the each of original two ranges is preserved. For equivalent elements in the original two ranges, the elements from the first range precede the elements from the second range. The destination range cannot overlap with either of the input ranges.
The assignments in the parallel
merge algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs O(std::distance(first1, last1) + std::distance(first2, last2)) applications of the comparison comp and the each projection.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.RandIter1
: The type of the source iterators used (deduced) representing the first sorted range. This iterator type must meet the requirements of an random access iterator.RandIter2
: The type of the source iterators used (deduced) representing the second sorted range. This iterator type must meet the requirements of an random access iterator.RandIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an random access iterator.Comp
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of merge requires Comp to meet the requirements of CopyConstructible. This defaults to std::less<>Proj1
: The type of an optional projection function to be used for elements of the first range. This defaults to util::projection_identityProj2
: The type of an optional projection function to be used for elements of the second range. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the first range of elements the algorithm will be applied to.last1
: Refers to the end of the first range of elements the algorithm will be applied to.first2
: Refers to the beginning of the second range of elements the algorithm will be applied to.last2
: Refers to the end of the second range of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.comp
: comp is a callable object which returns true if the first argument is less than the second, and false otherwise. The signature of this comparison should be equivalent to:bool comp(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types RandIter1 and RandIter2 can be dereferenced and then implicitly converted to both Type1 and Type2proj1
: Specifies the function (or function object) which will be invoked for each of the elements of the first range as a projection operation before the actual comparison comp is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of the second range as a projection operation before the actual comparison comp is invoked.
The assignments in the parallel merge algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The merge algorithm returns a hpx::future<tagged_tuple<tag::in1(RandIter1), tag::in2(RandIter2), tag::out(RandIter3)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_tuple<tag::in1(RandIter1), tag::in2(RandIter2), tag::out(RandIter3)> otherwise. The merge algorithm returns the tuple of the source iterator last1, the source iterator last2, the destination iterator to the end of the dest range.
-
template<typename
ExPolicy
, typenameRandIter
, typenameComp
= detail::less, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, RandIter>::typeinplace_merge
(ExPolicy &&policy, RandIter first, RandIter middle, RandIter last, Comp &&comp = Comp(), Proj &&proj = Proj())¶ Merges two consecutive sorted ranges [first, middle) and [middle, last) into one sorted range [first, last). The order of equivalent elements in the each of original two ranges is preserved. For equivalent elements in the original two ranges, the elements from the first range precede the elements from the second range.
The assignments in the parallel
inplace_merge algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs O(std::distance(first, last)) applications of the comparison comp and the each projection.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.RandIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an random access iterator.Comp
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of inplace_merge requires Comp to meet the requirements of CopyConstructible. This defaults to std::less<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the first sorted range the algorithm will be applied to.middle
: Refers to the end of the first sorted range and the beginning of the second sorted range the algorithm will be applied to.last
: Refers to the end of the second sorted range the algorithm will be applied to.comp
: comp is a callable object which returns true if the first argument is less than the second, and false otherwise. The signature of this comparison should be equivalent to:bool comp(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types RandIter can be dereferenced and then implicitly converted to both Type1 and Type2proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel inplace_merge algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The inplace_merge algorithm returns a hpx::future<RandIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns RandIter otherwise. The inplace_merge algorithm returns the source iterator last
-
template<typename
ExPolicy
, typenameFwdIter
, typenameProj
= util::projection_identity, typenameF
= detail::less>
util::detail::algorithm_result<ExPolicy, FwdIter>::typemin_element
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f = F(), Proj &&proj = Proj())¶ Finds the smallest element in the range [first, last) using the given comparison function f.
The comparisons in the parallel
min_element algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly max(N-1, 0) comparisons, where N = std::distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of min_element requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: The binary predicate which returns true if the the left argument is less than the right element. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The comparisons in the parallel min_element algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The min_element algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The min_element algorithm returns the iterator to the smallest element in the range [first, last). If several elements in the range are equivalent to the smallest element, returns the iterator to the first such element. Returns last if the range is empty.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameProj
= util::projection_identity, typenameF
= detail::less>
util::detail::algorithm_result<ExPolicy, FwdIter>::typemax_element
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f = F(), Proj &&proj = Proj())¶ Finds the greatest element in the range [first, last) using the given comparison function f.
The comparisons in the parallel
max_element algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly max(N-1, 0) comparisons, where N = std::distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of max_element requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: The binary predicate which returns true if the This argument is optional and defaults to std::less. the left argument is less than the right element. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The comparisons in the parallel max_element algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The max_element algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The max_element algorithm returns the iterator to the smallest element in the range [first, last). If several elements in the range are equivalent to the smallest element, returns the iterator to the first such element. Returns last if the range is empty.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameProj
= util::projection_identity, typenameF
= detail::less>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::min(FwdIter), tag::max(FwdIter)>>::typeminmax_element
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f = F(), Proj &&proj = Proj())¶ Finds the greatest element in the range [first, last) using the given comparison function f.
The comparisons in the parallel
minmax_element algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most max(floor(3/2*(N-1)), 0) applications of the predicate, where N = std::distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of minmax_element requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: The binary predicate which returns true if the the left argument is less than the right element. This argument is optional and defaults to std::less. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The comparisons in the parallel minmax_element algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The minmax_element algorithm returns a hpx::future<tagged_pair<tag::min(FwdIter), tag::max(FwdIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::min(FwdIter), tag::max(FwdIter)> otherwise. The minmax_element algorithm returns a pair consisting of an iterator to the smallest element as the first element and an iterator to the greatest element as the second. Returns std::make_pair(first, first) if the range is empty. If several elements are equivalent to the smallest element, the iterator to the first such element is returned. If several elements are equivalent to the largest element, the iterator to the last such element is returned.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, std::pair<FwdIter1, FwdIter2>>::type>::typemismatch
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, Pred &&op = Pred())¶ Returns true if the range [first1, last1) is mismatch to the range [first2, last2), and false otherwise.
The comparison operations in the parallel
mismatch algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most min(last1 - first1, last2 - first2) applications of the predicate f. If FwdIter1 and FwdIter2 meet the requirements of RandomAccessIterator and (last1 - first1) != (last2 - first2) then no applications of the predicate f are made.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of mismatch requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as mismatch. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively
The comparison operations in the parallel mismatch algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The two ranges are considered mismatch if, for every iterator i in the range [first1,last1), *i mismatchs *(first2 + (i - first1)). This overload of mismatch uses operator== to determine if two elements are mismatch.
- Return
- The mismatch algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The mismatch algorithm returns true if the elements in the two ranges are mismatch, otherwise it returns false. If the length of the range [first1, last1) does not mismatch the length of the range [first2, last2), it returns false.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, std::pair<FwdIter1, FwdIter2>>::type>::typemismatch
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, Pred &&op = Pred())¶ Returns std::pair with iterators to the first two non-equivalent elements.
The comparison operations in the parallel
mismatch algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most last1 - first1 applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of mismatch requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as mismatch. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively
The comparison operations in the parallel mismatch algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The mismatch algorithm returns a hpx::future<std::pair<FwdIter1, FwdIter2> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns std::pair<FwdIter1, FwdIter2> otherwise. The mismatch algorithm returns the first mismatching pair of elements from two ranges: one defined by [first1, last1) and another defined by [first2, last2).
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typemove
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest)¶ Moves the elements in the range [first, last), to another range beginning at dest. After this operation the elements in the moved-from range will still contain valid values of the appropriate type, but not necessarily the same values as before the move.
The move assignments in the parallel
move algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first move assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the move assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The move assignments in the parallel move algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The move algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The move algorithm returns the pair of the input iterator last and the output iterator to the element in the destination range, one past the last element moved.
-
template<typename
ExPolicy
, typenameBidirIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, BidirIter>::typestable_partition
(ExPolicy &&policy, BidirIter first, BidirIter last, F &&f, Proj &&proj = Proj())¶ Permutes the elements in the range [first, last) such that there exists an iterator i such that for every iterator j in the range [first, i) INVOKE(f, INVOKE (proj, *j)) != false, and for every iterator k in the range [i, last), INVOKE(f, INVOKE (proj, *k)) == false
The invocations of
f in the parallel stable_partition algorithm invoked with an execution policy object of type sequenced_policy executes in sequential order in the calling thread.- Note
- Complexity: At most (last - first) * log(last - first) swaps, but only linear number of swaps if there is enough extra memory. Exactly last - first applications of the predicate and projection.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.BidirIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Unary predicate which returns true if the element should be ordered before other elements. Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool fun(const Type &a);
The signature does not need to have const&. The type
Type must be such that an object of type BidirIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel stable_partition algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The stable_partition algorithm returns an iterator i such that for every iterator j in the range [first, i), f(*j) != false INVOKE(f, INVOKE(proj, *j)) != false, and for every iterator k in the range [i, last), f(*k) == false INVOKE(f, INVOKE (proj, *k)) == false. The relative order of the elements in both groups is preserved. If the execution policy is of type parallel_task_policy the algorithm returns a future<> referring to this iterator.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typepartition
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&pred, Proj &&proj = Proj())¶ Reorders the elements in the range [first, last) in such a way that all elements for which the predicate pred returns true precede the elements for which the predicate pred returns false. Relative order of the elements is not preserved.
The assignments in the parallel
partition algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most 2 * (last - first) swaps. Exactly last - first applications of the predicate and projection.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of partition requires Pred to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is an unary predicate for partitioning the source iterators. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel partition algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The partition algorithm returns a hpx::future<FwdIter> if the execution policy is of type parallel_task_policy and returns FwdIter otherwise. The partition algorithm returns the iterator to the first element of the second group.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenamePred
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in(FwdIter1), tag::out1(FwdIter2), tag::out2(FwdIter3)>>::typepartition_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest_true, FwdIter3 dest_false, Pred &&pred, Proj &&proj = Proj())¶ Copies the elements in the range, defined by [first, last), to two different ranges depending on the value returned by the predicate pred. The elements, that satisfy the predicate pred, are copied to the range beginning at dest_true. The rest of the elements are copied to the range beginning at dest_false. The order of the elements is preserved.
The assignments in the parallel
partition_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range for the elements that satisfy the predicate pred (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range for the elements that don’t satisfy the predicate pred (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of partition_copy requires Pred to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest_true
: Refers to the beginning of the destination range for the elements that satisfy the predicate pred.dest_false
: Refers to the beginning of the destination range for the elements that don’t satisfy the predicate pred.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is an unary predicate for partitioning the source iterators. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel partition_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The partition_copy algorithm returns a hpx::future<tagged_tuple<tag::in(InIter), tag::out1(OutIter1), tag::out2(OutIter2)> > if the execution policy is of type parallel_task_policy and returns tagged_tuple<tag::in(InIter), tag::out1(OutIter1), tag::out2(OutIter2)> otherwise. The partition_copy algorithm returns the tuple of the source iterator last, the destination iterator to the end of the dest_true range, and the destination iterator to the end of the dest_false range.
-
template<typename
ExPolicy
, typenameFwdIterB
, typenameFwdIterE
, typenameT
, typenameF
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, T>::type>::typereduce
(ExPolicy &&policy, FwdIterB first, FwdIterE last, T init, F &&f)¶ Returns GENERALIZED_SUM(f, init, *first, …, *(first + (last - first) - 1)).
The reduce operations in the parallel
reduce algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIterB
: The type of the source begin iterator used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIterE
: The type of the source end iterator used (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.T
: The type of the value to be used as initial (and intermediate) values (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&. The types
Type1 Ret must be such that an object of type FwdIterB can be dereferenced and then implicitly converted to any of those types.init
: The initial value for the generalized sum.
The reduce operations in the parallel copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
reduce and accumulate is that the behavior of reduce may be non-deterministic for non-associative or non-commutative binary predicate.- Return
- The reduce algorithm returns a hpx::future<T> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns T otherwise. The reduce algorithm returns the result of the generalized sum over the elements given by the input range [first, last).
- Note
- GENERALIZED_SUM(op, a1, …, aN) is defined as follows:
- a1 when N is 1
- op(GENERALIZED_SUM(op, b1, …, bK), GENERALIZED_SUM(op, bM, …, bN)), where:
- b1, …, bN may be any permutation of a1, …, aN and
- 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIterB
, typenameFwdIterE
, typenameT
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, T>::type>::typereduce
(ExPolicy &&policy, FwdIterB first, FwdIterE last, T init)¶ Returns GENERALIZED_SUM(+, init, *first, …, *(first + (last - first) - 1)).
The reduce operations in the parallel
reduce algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the operator+().
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIterB
: The type of the source begin iterator used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIterE
: The type of the source end iterator used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be used as initial (and intermediate) values (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.init
: The initial value for the generalized sum.
The reduce operations in the parallel copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
reduce and accumulate is that the behavior of reduce may be non-deterministic for non-associative or non-commutative binary predicate.- Return
- The reduce algorithm returns a hpx::future<T> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns T otherwise. The reduce algorithm returns the result of the generalized sum (applying operator+()) over the elements given by the input range [first, last).
- Note
- GENERALIZED_SUM(+, a1, …, aN) is defined as follows:
- a1 when N is 1
- op(GENERALIZED_SUM(+, b1, …, bK), GENERALIZED_SUM(+, bM, …, bN)), where:
- b1, …, bN may be any permutation of a1, …, aN and
- 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIterB
, typenameFwdIterE
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, typename std::iterator_traits<FwdIterB>::value_type>::type>::typereduce
(ExPolicy &&policy, FwdIterB first, FwdIterE last)¶ Returns GENERALIZED_SUM(+, T(), *first, …, *(first + (last - first) - 1)).
The reduce operations in the parallel
reduce algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the operator+().
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIterB
: The type of the source begin iterator used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIterE
: The type of the source end iterator used (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The reduce operations in the parallel copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
reduce and accumulate is that the behavior of reduce may be non-deterministic for non-associative or non-commutative binary predicate.- Return
- The reduce algorithm returns a hpx::future<T> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns T otherwise (where T is the value_type of FwdIterB). The reduce algorithm returns the result of the generalized sum (applying operator+()) over the elements given by the input range [first, last).
- Note
- The type of the initial value (and the result type) T is determined from the value_type of the used FwdIterB.
- Note
- GENERALIZED_SUM(+, a1, …, aN) is defined as follows:
- a1 when N is 1
- op(GENERALIZED_SUM(+, b1, …, bK), GENERALIZED_SUM(+, bM, …, bN)), where:
- b1, …, bN may be any permutation of a1, …, aN and
- 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameRanIter
, typenameRanIter2
, typenameFwdIter1
, typenameFwdIter2
, typenameCompare
= std::equal_to<typename std::iterator_traits<RanIter>::value_type>, typenameFunc
= std::plus<typename std::iterator_traits<RanIter2>::value_type>>
util::detail::algorithm_result<ExPolicy, std::pair<FwdIter1, FwdIter2>>::typereduce_by_key
(ExPolicy &&policy, RanIter key_first, RanIter key_last, RanIter2 values_first, FwdIter1 keys_output, FwdIter2 values_output, Compare &&comp = Compare(), Func &&func = Func())¶ Reduce by Key performs an inclusive scan reduction operation on elements supplied in key/value pairs. The algorithm produces a single output value for each set of equal consecutive keys in [key_first, key_last). the value being the GENERALIZED_NONCOMMUTATIVE_SUM(op, init, *first, …, *(first + (i - result))). for the run of consecutive matching keys. The number of keys supplied must match the number of values.
comp has to induce a strict weak ordering on the values.
- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.RanIter
: The type of the key iterators used (deduced). This iterator type must meet the requirements of a random access iterator.RanIter2
: The type of the value iterators used (deduced). This iterator type must meet the requirements of a random access iterator.FwdIter1
: The type of the iterator representing the destination key range (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination value range (deduced). This iterator type must meet the requirements of an forward iterator.Compare
: The type of the optional function/function object to use to compare keys (deduced). Assumed to be std::equal_to otherwise.Func
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.key_first
: Refers to the beginning of the sequence of key elements the algorithm will be applied to.key_last
: Refers to the end of the sequence of key elements the algorithm will be applied to.values_first
: Refers to the beginning of the sequence of value elements the algorithm will be applied to.keys_output
: Refers to the start output location for the keys produced by the algorithm.values_output
: Refers to the start output location for the values produced by the algorithm.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.func
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&. The types
Type1 Ret must be such that an object of type FwdIter can be dereferenced and then implicitly converted to any of those types.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The reduce_by_key algorithm returns a hpx::future<pair<Iter1,Iter2>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns pair<Iter1,Iter2> otherwise.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typeremove_if
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&pred, Proj &&proj = Proj())¶ Removes all elements satisfying specific criteria from the range [first, last) and returns a past-the-end iterator for the new end of the range. This version removes all elements for which predicate pred returns true.
The assignments in the parallel
remove_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate pred and the projection proj.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of remove_if requires Pred to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The remove_if algorithm returns the iterator to the new end of the range.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typeremove
(ExPolicy &&policy, FwdIter first, FwdIter last, T const &value, Proj &&proj = Proj())¶ Removes all elements satisfying specific criteria from the range [first, last) and returns a past-the-end iterator for the new end of the range. This version removes all elements that are equal to value.
The assignments in the parallel
remove algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the operator==() and the projection proj.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to remove (deduced). This value type must meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.value
: Specifies the value of elements to remove.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The remove algorithm returns the iterator to the new end of the range.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typeremove_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, T const &val, Proj &&proj = Proj())¶ Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the comparison operator returns false when compare to val. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(proj, *it) == value
The assignments in the parallel
remove_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type that the result of dereferencing FwdIter1 is compared to.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.val
: Value to be removed.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove_copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typeremove_copy_if
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, F &&f, Proj &&proj = Proj())¶ Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the predicate f returns false. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(pred, INVOKE(proj, *it)) != false.
The assignments in the parallel
remove_copy_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements to be removed. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove_copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove_copy_if algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameT1
, typenameT2
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typereplace
(ExPolicy &&policy, FwdIter first, FwdIter last, T1 const &old_value, T2 const &new_value, Proj &&proj = Proj())¶ Replaces all elements satisfying specific criteria with new_value in the range [first, last).
Effects: Substitutes elements referred by the iterator it in the range [first, last) with new_value, when the following corresponding conditions hold: INVOKE(proj, *it) == old_value
The assignments in the parallel
replace algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.T1
: The type of the old value to replace (deduced).T2
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.old_value
: Refers to the old value of the elements to replace.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise. It returns last.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameF
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typereplace_if
(ExPolicy &&policy, FwdIter first, FwdIter last, F &&f, T const &new_value, Proj &&proj = Proj())¶ Replaces all elements satisfying specific criteria (for which predicate f returns true) with new_value in the range [first, last).
Effects: Substitutes elements referred by the iterator it in the range [first, last) with new_value, when the following corresponding conditions hold: INVOKE(f, INVOKE(proj, *it)) != false
The assignments in the parallel
replace_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible. (deduced).T
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements which need to replaced. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT1
, typenameT2
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typereplace_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, T1 const &old_value, T2 const &new_value, Proj &&proj = Proj())¶ Copies the all elements from the range [first, last) to another range beginning at dest replacing all elements satisfying a specific criteria with new_value.
Effects: Assigns to every iterator it in the range [result, result + (last - first)) either new_value or *(first + (it - result)) depending on whether the following corresponding condition holds: INVOKE(proj, *(first + (i - result))) == old_value
The assignments in the parallel
replace_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.T1
: The type of the old value to replace (deduced).T2
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.old_value
: Refers to the old value of the elements to replace.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameF
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typereplace_copy_if
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, F &&f, T const &new_value, Proj &&proj = Proj())¶ Copies the all elements from the range [first, last) to another range beginning at dest replacing all elements satisfying a specific criteria with new_value.
Effects: Assigns to every iterator it in the range [result, result + (last - first)) either new_value or *(first + (it - result)) depending on whether the following corresponding condition holds: INVOKE(f, INVOKE(proj, *(first + (i - result)))) != false
The assignments in the parallel
replace_copy_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible. (deduced).T
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements which need to replaced. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace_copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_copy_if algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The replace_copy_if algorithm returns the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameBidirIter
>
util::detail::algorithm_result<ExPolicy, BidirIter>::typereverse
(ExPolicy &&policy, BidirIter first, BidirIter last)¶ Reverses the order of the elements in the range [first, last). Behaves as if applying std::iter_swap to every pair of iterators first+i, (last-i) - 1 for each non-negative i < (last-first)/2.
The assignments in the parallel
reverse algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Linear in the distance between first and last.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.BidirIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an bidirectional iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The assignments in the parallel reverse algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The reverse algorithm returns a hpx::future<BidirIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns BidirIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameBidirIter
, typenameFwdIter
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(BidirIter), tag::out(FwdIter)>>::typereverse_copy
(ExPolicy &&policy, BidirIter first, BidirIter last, FwdIter dest_first)¶ Copies the elements from the range [first, last) to another range beginning at dest_first in such a way that the elements in the new range are in reverse order. Behaves as if by executing the assignment *(dest_first + (last - first) - 1 - i) = *(first + i) once for each non-negative i < (last - first) If the source and destination ranges (that is, [first, last) and [dest_first, dest_first+(last-first)) respectively) overlap, the behavior is undefined.
The assignments in the parallel
reverse_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.BidirIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an bidirectional iterator.FwdIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest_first
: Refers to the begin of the destination range.
The assignments in the parallel reverse_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The reverse_copy algorithm returns a hpx::future<tagged_pair<tag::in(BidirIter), tag::out(FwdIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(BidirIter), tag::out(FwdIter)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::begin(FwdIter), tag::end(FwdIter)>>::typerotate
(ExPolicy &&policy, FwdIter first, FwdIter new_first, FwdIter last)¶ Performs a left rotation on a range of elements. Specifically, rotate swaps the elements in the range [first, last) in such a way that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element.
The assignments in the parallel
rotate algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Linear in the distance between first and last.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.new_first
: Refers to the element that should appear at the beginning of the rotated range.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The assignments in the parallel rotate algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The type of dereferenced FwdIter must meet the requirements of MoveAssignable and MoveConstructible.
- Return
- The rotate algorithm returns a hpx::future<tagged_pair<tag::begin(FwdIter), tag::end(FwdIter)> > if the execution policy is of type parallel_task_policy and returns tagged_pair<tag::begin(FwdIter), tag::end(FwdIter)> otherwise. The rotate algorithm returns the iterator equal to pair(first + (last - new_first), last).
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typerotate_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 new_first, FwdIter1 last, FwdIter2 dest_first)¶ Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element.
The assignments in the parallel
rotate_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an bidirectional iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.new_first
: Refers to the element that should appear at the beginning of the rotated range.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest_first
: Refers to the begin of the destination range.
The assignments in the parallel rotate_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The rotate_copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The rotate_copy algorithm returns the output iterator to the element past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameFwdIter2
, typenamePred
= detail::equal_to, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typesearch
(ExPolicy &&policy, FwdIter first, FwdIter last, FwdIter2 s_first, FwdIter2 s_last, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Searches the range [first, last) for any elements in the range [s_first, s_last). Uses a provided predicate to compare elements.
The comparison operations in the parallel
search algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most (S*N) comparisons where S = distance(s_first, s_last) and N = distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an input iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of adjacent_find requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj1
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of type dereferenced FwdIter.Proj2
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of type dereferenced FwdIter2.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.s_first
: Refers to the beginning of the sequence of elements the algorithm will be searching for.s_last
: Refers to the end of the sequence of elements of the algorithm will be searching for.op
: Refers to the binary predicate which returns true if the elements should be treated as equal. the signature of the function should be equivalent tobool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectivelyproj1
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter1 as a projection operation before the actual predicate is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter2 as a projection operation before the actual predicate is invoked.
The comparison operations in the parallel search algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The search algorithm returns a hpx::future<FwdIter> if the execution policy is of type task_execution_policy and returns FwdIter otherwise. The search algorithm returns an iterator to the beginning of the first subsequence [s_first, s_last) in range [first, last). If the length of the subsequence [s_first, s_last) is greater than the length of the range [first, last), last is returned. Additionally if the size of the subsequence is empty first is returned. If no subsequence is found, last is returned.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameFwdIter2
, typenamePred
= detail::equal_to, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typesearch_n
(ExPolicy &&policy, FwdIter first, std::size_t count, FwdIter2 s_first, FwdIter2 s_last, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Searches the range [first, last) for any elements in the range [s_first, s_last). Uses a provided predicate to compare elements.
The comparison operations in the parallel
search_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most (S*N) comparisons where S = distance(s_first, s_last) and N = count.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used for the first range (deduced). This iterator type must meet the requirements of an input iterator.FwdIter2
: The type of the source iterators used for the second range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of adjacent_find requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.count
: Refers to the range of elements of the first range the algorithm will be applied to.s_first
: Refers to the beginning of the sequence of elements the algorithm will be searching for.s_last
: Refers to the end of the sequence of elements of the algorithm will be searching for.op
: Refers to the binary predicate which returns true if the elements should be treated as equal. the signature of the function should be equivalent tobool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectivelyproj1
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter1 as a projection operation before the actual predicate is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced FwdIter2 as a projection operation before the actual predicate is invoked.
The comparison operations in the parallel search_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The search_n algorithm returns a hpx::future<FwdIter> if the execution policy is of type task_execution_policy and returns FwdIter otherwise. The search_n algorithm returns an iterator to the beginning of the last subsequence [s_first, s_last) in range [first, first+count). If the length of the subsequence [s_first, s_last) is greater than the length of the range [first, first+count), first is returned. Additionally if the size of the subsequence is empty or no subsequence is found, first is also returned.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter3>::type>::typeset_difference
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, FwdIter3 dest, Pred &&op = Pred())¶ Constructs a sorted range beginning at dest consisting of all elements present in the range [first1, last1) and not present in the range [first2, last2). This algorithm expects both input ranges to be sorted with the given binary predicate f.
Equivalent elements are treated individually, that is, if some element is found
m times in [first1, last1) and n times in [first2, last2), it will be copied to dest exactly std::max(m-n, 0) times. The resulting range cannot overlap with either of the input ranges.- Note
- Complexity: At most 2*(N1 + N2 - 1) comparisons, where N1 is the length of the first sequence and N2 is the length of the second sequence.
The resulting range cannot overlap with either of the input ranges.
The application of function objects in parallel algorithm invoked with a sequential execution policy object execute in sequential order in the calling thread (
sequenced_policy) or in a single new thread spawned from the current thread (for sequenced_task_policy).- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter1
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of set_difference requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.dest
: Refers to the beginning of the destination range.op
: The binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type InIter can be dereferenced and then implicitly converted to Type1
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The set_difference algorithm returns a hpx::future<FwdIter3> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter3 otherwise. The set_difference algorithm returns the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter3>::type>::typeset_intersection
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, FwdIter3 dest, Pred &&op = Pred())¶ Constructs a sorted range beginning at dest consisting of all elements present in both sorted ranges [first1, last1) and [first2, last2). This algorithm expects both input ranges to be sorted with the given binary predicate f.
If some element is found
m times in [first1, last1) and n times in [first2, last2), the first std::min(m, n) elements will be copied from the first range to the destination range. The order of equivalent elements is preserved. The resulting range cannot overlap with either of the input ranges.- Note
- Complexity: At most 2*(N1 + N2 - 1) comparisons, where N1 is the length of the first sequence and N2 is the length of the second sequence.
The resulting range cannot overlap with either of the input ranges.
The application of function objects in parallel algorithm invoked with a sequential execution policy object execute in sequential order in the calling thread (
sequenced_policy) or in a single new thread spawned from the current thread (for sequenced_task_policy).- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter1
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of set_intersection requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.dest
: Refers to the beginning of the destination range.op
: The binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type InIter can be dereferenced and then implicitly converted to Type1
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The set_intersection algorithm returns a hpx::future<FwdIter3> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter3 otherwise. The set_intersection algorithm returns the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter3>::type>::typeset_symmetric_difference
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, FwdIter3 dest, Pred &&op = Pred())¶ Constructs a sorted range beginning at dest consisting of all elements present in either of the sorted ranges [first1, last1) and [first2, last2), but not in both of them are copied to the range beginning at dest. The resulting range is also sorted. This algorithm expects both input ranges to be sorted with the given binary predicate f.
If some element is found
m times in [first1, last1) and n times in [first2, last2), it will be copied to dest exactly std::abs(m-n) times. If m>n, then the last m-n of those elements are copied from [first1,last1), otherwise the last n-m elements are copied from [first2,last2). The resulting range cannot overlap with either of the input ranges.- Note
- Complexity: At most 2*(N1 + N2 - 1) comparisons, where N1 is the length of the first sequence and N2 is the length of the second sequence.
The resulting range cannot overlap with either of the input ranges.
The application of function objects in parallel algorithm invoked with a sequential execution policy object execute in sequential order in the calling thread (
sequenced_policy) or in a single new thread spawned from the current thread (for sequenced_task_policy).- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter1
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of set_symmetric_difference requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.dest
: Refers to the beginning of the destination range.op
: The binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type InIter can be dereferenced and then implicitly converted to Type1
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The set_symmetric_difference algorithm returns a hpx::future<FwdIter3> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter3 otherwise. The set_symmetric_difference algorithm returns the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenamePred
= detail::less>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter3>::type>::typeset_union
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, FwdIter3 dest, Pred &&op = Pred())¶ Constructs a sorted range beginning at dest consisting of all elements present in one or both sorted ranges [first1, last1) and [first2, last2). This algorithm expects both input ranges to be sorted with the given binary predicate f.
If some element is found
m times in [first1, last1) and n times in [first2, last2), then all m elements will be copied from [first1, last1) to dest, preserving order, and then exactly std::max(n-m, 0) elements will be copied from [first2, last2) to dest, also preserving order.- Note
- Complexity: At most 2*(N1 + N2 - 1) comparisons, where N1 is the length of the first sequence and N2 is the length of the second sequence.
The resulting range cannot overlap with either of the input ranges.
The application of function objects in parallel algorithm invoked with a sequential execution policy object execute in sequential order in the calling thread (
sequenced_policy) or in a single new thread spawned from the current thread (for sequenced_task_policy).- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.FwdIter1
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators used (deduced) representing the first sequence. This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.Op
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of set_union requires Pred to meet the requirements of CopyConstructible. This defaults to std::less<>
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the sequence of elements of the first range the algorithm will be applied to.last1
: Refers to the end of the sequence of elements of the first range the algorithm will be applied to.first2
: Refers to the beginning of the sequence of elements of the second range the algorithm will be applied to.last2
: Refers to the end of the sequence of elements of the second range the algorithm will be applied to.dest
: Refers to the beginning of the destination range.op
: The binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type InIter can be dereferenced and then implicitly converted to Type1
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The set_union algorithm returns a hpx::future<FwdIter3> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter3 otherwise. The set_union algorithm returns the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRandomIt
, typenameProj
= util::projection_identity, typenameCompare
= detail::less>
util::detail::algorithm_result<ExPolicy, RandomIt>::typesort
(ExPolicy &&policy, RandomIt first, RandomIt last, Compare &&comp = Compare(), Proj &&proj = Proj())¶ Sorts the elements in the range [first, last) in ascending order. The order of equal elements is not guaranteed to be preserved. The function uses the given comparison function object comp (defaults to using operator<()).
A sequence is sorted with respect to a comparator
comp and a projection proj if for every iterator i pointing to the sequence and every non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence, and INVOKE(comp, INVOKE(proj, *(i + n)), INVOKE(proj, *i)) == false.- Note
- Complexity: O(Nlog(N)), where N = std::distance(first, last) comparisons.
comp has to induce a strict weak ordering on the values.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.Iter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a random access iterator.Comp
: The type of the function/function object to use (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.proj
: Specifies the function (or function object) which will be invoked for each pair of elements as a projection operation before the actual predicate comp is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The sort algorithm returns a hpx::future<RandomIt> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns RandomIt otherwise. The algorithm returns an iterator pointing to the first element after the last element in the input sequence.
-
template<typename
ExPolicy
, typenameKeyIter
, typenameValueIter
, typenameCompare
= detail::less>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in1(KeyIter), tag::in2(ValueIter)>>::typesort_by_key
(ExPolicy &&policy, KeyIter key_first, KeyIter key_last, ValueIter value_first, Compare &&comp = Compare())¶ Sorts one range of data using keys supplied in another range. The key elements in the range [key_first, key_last) are sorted in ascending order with the corresponding elements in the value range moved to follow the sorted order. The algorithm is not stable, the order of equal elements is not guaranteed to be preserved. The function uses the given comparison function object comp (defaults to using operator<()).
A sequence is sorted with respect to a comparator
comp and a projection proj if for every iterator i pointing to the sequence and every non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence, and INVOKE(comp, INVOKE(proj, *(i + n)), INVOKE(proj, *i)) == false.- Note
- Complexity: O(Nlog(N)), where N = std::distance(first, last) comparisons.
comp has to induce a strict weak ordering on the values.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.KeyIter
: The type of the key iterators used (deduced). This iterator type must meet the requirements of a random access iterator.ValueIter
: The type of the value iterators used (deduced). This iterator type must meet the requirements of a random access iterator.Comp
: The type of the function/function object to use (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.key_first
: Refers to the beginning of the sequence of key elements the algorithm will be applied to.key_last
: Refers to the end of the sequence of key elements the algorithm will be applied to.value_first
: Refers to the beginning of the sequence of value elements the algorithm will be applied to, the range of elements must match [key_first, key_last)comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The sort_by-key algorithm returns a hpx::future<tagged_pair<tag::in1(KeyIter>, tag::in2(ValueIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns otherwise. The algorithm returns a pair holding an iterator pointing to the first element after the last element in the input key sequence and an iterator pointing to the first element after the last element in the input value sequence.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeswap_ranges
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2)¶ Exchanges elements between range [first1, last1) and another range starting at first2.
The swap operations in the parallel
swap_ranges algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Linear in the distance between first1 and last1
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the swap operations.FwdIter1
: The type of the first range of iterators to swap (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the second range of iterators to swap (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the first sequence of elements the algorithm will be applied to.last1
: Refers to the end of the first sequence of elements the algorithm will be applied to.first2
: Refers to the beginning of the second sequence of elements the algorithm will be applied to.
The swap operations in the parallel swap_ranges algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The swap_ranges algorithm returns a hpx::future<FwdIter2> if the execution policy is of type parallel_task_policy and returns FwdIter2 otherwise. The swap_ranges algorithm returns iterator to the element past the last element exchanged in the range beginning with first2.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typetransform
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, F &&f, Proj &&proj = Proj())¶ Applies the given function f to the range [first, last) and stores the result in another range, beginning at dest.
The invocations of
f in the parallel transform algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly last - first applications of f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type &a);
The signature does not need to have const&. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type. The type Ret must be such that an object of type FwdIter2 can be dereferenced and assigned a value of type Ret.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel transform algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The transform algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The transform algorithm returns a tuple holding an iterator referring to the first element after the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenameF
, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in1(FwdIter1), tag::in2(FwdIter2), tag::out(FwdIter3)>>::typetransform
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter3 dest, F &&f, Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Applies the given function f to pairs of elements from two ranges: one defined by [first1, last1) and the other beginning at first2, and stores the result in another range, beginning at dest.
The invocations of
f in the parallel transform algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly last - first applications of f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.FwdIter1
: The type of the source iterators for the first range used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators for the second range used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj1
: The type of an optional projection function to be used for elements of the first sequence. This defaults to util::projection_identityProj2
: The type of an optional projection function to be used for elements of the second sequence. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the first sequence of elements the algorithm will be applied to.last1
: Refers to the end of the first sequence of elements the algorithm will be applied to.first2
: Refers to the beginning of the second sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type2 &b);
The signature does not need to have const&. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively. The type Ret must be such that an object of type FwdIter3 can be dereferenced and assigned a value of type Ret.proj1
: Specifies the function (or function object) which will be invoked for each of the elements of the first sequence as a projection operation before the actual predicate f is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of the second sequence as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel transform algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The transform algorithm returns a hpx::future<tagged_tuple<tag::in1(FwdIter1), tag::in2(FwdIter2), tag::out(FwdIter3)> > if the execution policy is of type parallel_task_policy and returns tagged_tuple<tag::in1(FwdIter1), tag::in2(FwdIter2), tag::out(FwdIter3)> otherwise. The transform algorithm returns a tuple holding an iterator referring to the first element after the first input sequence, an iterator referring to the first element after the second input sequence, and the output iterator referring to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameFwdIter3
, typenameF
, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in1(FwdIter1), tag::in2(FwdIter2), tag::out(FwdIter3)>>::typetransform
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, FwdIter2 last2, FwdIter3 dest, F &&f, Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Applies the given function f to pairs of elements from two ranges: one defined by [first1, last1) and the other beginning at first2, and stores the result in another range, beginning at dest.
The invocations of
f in the parallel transform algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly min(last2-first2, last1-first1) applications of f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.FwdIter1
: The type of the source iterators for the first range used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the source iterators for the second range used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj1
: The type of an optional projection function to be used for elements of the first sequence. This defaults to util::projection_identityProj2
: The type of an optional projection function to be used for elements of the second sequence. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the first sequence of elements the algorithm will be applied to.last1
: Refers to the end of the first sequence of elements the algorithm will be applied to.first2
: Refers to the beginning of the second sequence of elements the algorithm will be applied to.last2
: Refers to the end of the second sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type2 &b);
The signature does not need to have const&. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively. The type Ret must be such that an object of type FwdIter3 can be dereferenced and assigned a value of type Ret.proj1
: Specifies the function (or function object) which will be invoked for each of the elements of the first sequence as a projection operation before the actual predicate f is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of the second sequence as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel transform algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The algorithm will invoke the binary predicate until it reaches the end of the shorter of the two given input sequences
- Return
- The transform algorithm returns a hpx::future<tagged_tuple<tag::in1(FwdIter1), tag::in2(FwdIter2), tag::out(FwdIter3)> > if the execution policy is of type parallel_task_policy and returns tagged_tuple<tag::in1(FwdIter1), tag::in2(FwdIter2), tag::out(FwdIter3)> otherwise. The transform algorithm returns a tuple holding an iterator referring to the first element after the first input sequence, an iterator referring to the first element after the second input sequence, and the output iterator referring to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT
, typenameOp
, typenameConv
>
util::detail::algorithm_result<ExPolicy, FwdIter2>::typetransform_exclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, T init, Op &&op, Conv &&conv)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(binary_op, init, conv(*first), …, conv(*(first + (i - result) - 1))).
The reduce operations in the parallel
transform_exclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicates op and conv.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Conv
: The type of the unary function object used for the conversion operation.T
: The type of the value to be used as initial (and intermediate) values (deduced).Op
: The type of the binary function object used for the reduction operation.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.conv
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is a unary predicate. The signature of this predicate should be equivalent to:R fun(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type. The type R must be such that an object of this type can be implicitly converted to T.init
: The initial value for the generalized sum.op
: Specifies the function (or function object) which will be invoked for each of the values of the input sequence. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Ret must be such that an object of a type as given by the input sequence can be implicitly converted to any of those types.
The reduce operations in the parallel transform_exclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
Neither
conv nor op shall invalidate iterators or subranges, or modify elements in the ranges [first,last) or [result,result + (last - first)).- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The transform_exclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aN) is defined as:
- a1 when N is 1
- op(GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aK), GENERALIZED_NONCOMMUTATIVE_SUM(op, aM, …, aN) where 1 < K+1 = M <= N.
The behavior of transform_exclusive_scan may be non-deterministic for a non-associative predicate.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameOp
, typenameConv
, typenameT
>
util::detail::algorithm_result<ExPolicy, FwdIter2>::typetransform_inclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, Op &&op, Conv &&conv, T init)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(op, init, conv(*first), …, conv(*(first + (i - result)))).
The reduce operations in the parallel
transform_inclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Conv
: The type of the unary function object used for the conversion operation.T
: The type of the value to be used as initial (and intermediate) values (deduced).Op
: The type of the binary function object used for the reduction operation.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.conv
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is a unary predicate. The signature of this predicate should be equivalent to:R fun(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type. The type R must be such that an object of this type can be implicitly converted to T.init
: The initial value for the generalized sum.op
: Specifies the function (or function object) which will be invoked for each of the values of the input sequence. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Ret must be such that an object of a type as given by the input sequence can be implicitly converted to any of those types.
The reduce operations in the parallel transform_inclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
Neither
conv nor op shall invalidate iterators or subranges, or modify elements in the ranges [first,last) or [result,result + (last - first)).- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The transform_inclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aN) is defined as:
- a1 when N is 1
- op(GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aK), GENERALIZED_NONCOMMUTATIVE_SUM(op, aM, …, aN)) where 1 < K+1 = M <= N.
The difference between exclusive_scan and transform_inclusive_scan is that transform_inclusive_scan includes the ith input element in the ith sum. If op is not mathematically associative, the behavior of transform_inclusive_scan may be non-deterministic.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameConv
, typenameOp
>
util::detail::algorithm_result<ExPolicy, FwdIter2>::typetransform_inclusive_scan
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, Op &&op, Conv &&conv)¶ Assigns through each iterator i in [result, result + (last - first)) the value of GENERALIZED_NONCOMMUTATIVE_SUM(op, conv(*first), …, conv(*(first + (i - result)))).
The reduce operations in the parallel
transform_inclusive_scan algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Conv
: The type of the unary function object used for the conversion operation.T
: The type of the value to be used as initial (and intermediate) values (deduced).Op
: The type of the binary function object used for the reduction operation.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.conv
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is a unary predicate. The signature of this predicate should be equivalent to:R fun(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type. The type R must be such that an object of this type can be implicitly converted to T.op
: Specifies the function (or function object) which will be invoked for each of the values of the input sequence. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Ret must be such that an object of a type as given by the input sequence can be implicitly converted to any of those types.
The reduce operations in the parallel transform_inclusive_scan algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
Neither
conv nor op shall invalidate iterators or subranges, or modify elements in the ranges [first,last) or [result,result + (last - first)).- Return
- The copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The transform_inclusive_scan algorithm returns the output iterator to the element in the destination range, one past the last element copied.
- Note
- GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aN) is defined as:
- a1 when N is 1
- op(GENERALIZED_NONCOMMUTATIVE_SUM(op, a1, …, aK), GENERALIZED_NONCOMMUTATIVE_SUM(op, aM, …, aN)) where 1 < K+1 = M <= N.
The difference between exclusive_scan and transform_inclusive_scan is that transform_inclusive_scan includes the ith input element in the ith sum.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameT
, typenameReduce
, typenameConvert
>
util::detail::algorithm_result<ExPolicy, T>::typetransform_reduce
(ExPolicy &&policy, FwdIter first, FwdIter last, T init, Reduce &&red_op, Convert &&conv_op)¶ Returns GENERALIZED_SUM(red_op, init, conv_op(*first), …, conv_op(*(first + (last - first) - 1))).
The reduce operations in the parallel
transform_reduce algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicates red_op and conv_op.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.T
: The type of the value to be used as initial (and intermediate) values (deduced).Reduce
: The type of the binary function object used for the reduction operation.Convert
: The type of the unary function object used to transform the elements of the input sequence before invoking the reduce function.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.conv_op
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is a unary predicate. The signature of this predicate should be equivalent to:R fun(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type. The type R must be such that an object of this type can be implicitly converted to T.init
: The initial value for the generalized sum.red_op
: Specifies the function (or function object) which will be invoked for each of the values returned from the invocation of conv_op. This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1, Type2, and Ret must be such that an object of a type as returned from conv_op can be implicitly converted to any of those types.
The reduce operations in the parallel transform_reduce algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
The difference between
transform_reduce and accumulate is that the behavior of transform_reduce may be non-deterministic for non-associative or non-commutative binary predicate.- Return
- The transform_reduce algorithm returns a hpx::future<T> if the execution policy is of type parallel_task_policy and returns T otherwise. The transform_reduce algorithm returns the result of the generalized sum over the values returned from conv_op when applied to the elements given by the input range [first, last).
- Note
- GENERALIZED_SUM(op, a1, …, aN) is defined as follows:
- a1 when N is 1
- op(GENERALIZED_SUM(op, b1, …, bK), GENERALIZED_SUM(op, bM, …, bN)), where:
- b1, …, bN may be any permutation of a1, …, aN and
- 1 < K+1 = M <= N.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT
>
util::detail::algorithm_result<ExPolicy, T>::typetransform_reduce
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, T init)¶ Returns the result of accumulating init with the inner products of the pairs formed by the elements of two ranges starting at first1 and first2.
The operations in the parallel
transform_reduce algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op2.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the first source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the second source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be used as return) values (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the first sequence of elements the result will be calculated with.last1
: Refers to the end of the first sequence of elements the algorithm will be applied to.first2
: Refers to the beginning of the second sequence of elements the result will be calculated with.init
: The initial value for the sum.
The operations in the parallel transform_reduce algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The transform_reduce algorithm returns a hpx::future<T> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns T otherwise.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenameT
, typenameReduce
, typenameConvert
>
util::detail::algorithm_result<ExPolicy, T>::typetransform_reduce
(ExPolicy &&policy, FwdIter1 first1, FwdIter1 last1, FwdIter2 first2, T init, Reduce &&red_op, Convert &&conv_op)¶ Returns the result of accumulating init with the inner products of the pairs formed by the elements of two ranges starting at first1 and first2.
The operations in the parallel
transform_reduce algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: O(last - first) applications of the predicate op2.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the first source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the second source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be used as return) values (deduced).Reduce
: The type of the binary function object used for the multiplication operation.Convert
: The type of the unary function object used to transform the elements of the input sequence before invoking the reduce function.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first1
: Refers to the beginning of the first sequence of elements the result will be calculated with.last1
: Refers to the end of the first sequence of elements the algorithm will be applied to.first2
: Refers to the beginning of the second sequence of elements the result will be calculated with.init
: The initial value for the sum.red_op
: Specifies the function (or function object) which will be invoked for the initial value and each of the return values of op2. This is a binary predicate. The signature of this predicate should be equivalent to should be equivalent to:Ret fun(const Type1 &a, const Type1 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Ret must be such that it can be implicitly converted to a type of T.conv_op
: Specifies the function (or function object) which will be invoked for each of the input values of the sequence. This is a binary predicate. The signature of this predicate should be equivalent toRet fun(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Ret must be such that it can be implicitly converted to an object for the second argument type of op1.
The operations in the parallel transform_reduce algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The transform_reduce algorithm returns a hpx::future<T> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns T otherwise.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeuninitialized_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest)¶ Copies the elements in the range, defined by [first, last), to an uninitialized memory area beginning at dest. If an exception is thrown during the copy operation, the function has no effects.
The assignments in the parallel
uninitialized_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of a forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel uninitialized_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_copy algorithm returns a hpx::future<FwdIter2>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The uninitialized_copy algorithm returns the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameSize
, typenameFwdIter2
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy, FwdIter2>::type>::typeuninitialized_copy_n
(ExPolicy &&policy, FwdIter1 first, Size count, FwdIter2 dest)¶ Copies the elements in the range [first, first + count), starting from first and proceeding to first + count - 1., to another range beginning at dest. If an exception is thrown during the copy operation, the function has no effects.
The assignments in the parallel
uninitialized_copy_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, if count > 0, no assignments otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an input iterator.Size
: The type of the argument specifying the number of elements to apply f to.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of a forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel uninitialized_copy_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_copy_n algorithm returns a hpx::future<FwdIter2> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The uninitialized_copy_n algorithm returns the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameFwdIter
>
util::detail::algorithm_result<ExPolicy>::typeuninitialized_default_construct
(ExPolicy &&policy, FwdIter first, FwdIter last)¶ Constructs objects of type typename iterator_traits<ForwardIt>::value_type in the uninitialized storage designated by the range [first, last) by default-initialization. If an exception is thrown during the initialization, the function has no effects.
The assignments in the parallel
uninitialized_default_construct algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The assignments in the parallel uninitialized_default_construct algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_default_construct algorithm returns a hpx::future<void>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
>
util::detail::algorithm_result<ExPolicy, FwdIter>::typeuninitialized_default_construct_n
(ExPolicy &&policy, FwdIter first, Size count)¶ Constructs objects of type typename iterator_traits<ForwardIt>::value_type in the uninitialized storage designated by the range [first, first + count) by default-initialization. If an exception is thrown during the initialization, the function has no effects.
The assignments in the parallel
uninitialized_default_construct_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, if count > 0, no assignments otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Size
: The type of the argument specifying the number of elements to apply f to.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.
The assignments in the parallel uninitialized_default_construct_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_default_construct_n algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The uninitialized_default_construct_n algorithm returns the iterator to the element in the source range, one past the last element constructed.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameT
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy>::type>::typeuninitialized_fill
(ExPolicy &&policy, FwdIter first, FwdIter last, T const &value)¶ Copies the given value to an uninitialized memory area, defined by the range [first, last). If an exception is thrown during the initialization, the function has no effects.
The initializations in the parallel
uninitialized_fill algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Linear in the distance between first and last
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.T
: The type of the value to be assigned (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.value
: The value to be assigned.
The initializations in the parallel uninitialized_fill algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_fill algorithm returns a hpx::future<void>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns nothing otherwise.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
, typenameT
>
std::enable_if<execution::is_execution_policy<ExPolicy>::value, typename util::detail::algorithm_result<ExPolicy>::type>::typeuninitialized_fill_n
(ExPolicy &&policy, FwdIter first, Size count, T const &value)¶ Copies the given value value to the first count elements in an uninitialized memory area beginning at first. If an exception is thrown during the initialization, the function has no effects.
The initializations in the parallel
uninitialized_fill_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, if count > 0, no assignments otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of a forward iterator.Size
: The type of the argument specifying the number of elements to apply f to.T
: The type of the value to be assigned (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.value
: The value to be assigned.
The initializations in the parallel uninitialized_fill_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_fill_n algorithm returns a hpx::future<void>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns nothing otherwise.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
>
util::detail::algorithm_result<ExPolicy, FwdIter2>::typeuninitialized_move
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest)¶ Moves the elements in the range, defined by [first, last), to an uninitialized memory area beginning at dest. If an exception is thrown during the initialization, some objects in [first, last) are left in a valid but unspecified state.
The assignments in the parallel
uninitialized_move algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first move operations.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of a forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel uninitialized_move algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_move algorithm returns a hpx::future<FwdIter2>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter2 otherwise. The uninitialized_move algorithm returns the output iterator to the element in the destination range, one past the last element moved.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameSize
, typenameFwdIter2
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typeuninitialized_move_n
(ExPolicy &&policy, FwdIter1 first, Size count, FwdIter2 dest)¶ Moves the elements in the range [first, first + count), starting from first and proceeding to first + count - 1., to another range beginning at dest. If an exception is thrown during the initialization, some objects in [first, first + count) are left in a valid but unspecified state.
The assignments in the parallel
uninitialized_move_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count movements, if count > 0, no move operations otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Size
: The type of the argument specifying the number of elements to apply f to.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of a forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel uninitialized_move_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_move_n algorithm returns a hpx::future<std::pair<FwdIter1, FwdIter2>> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns std::pair<FwdIter1, FwdIter2> otherwise. The uninitialized_move_n algorithm returns the pair of the input iterator to the element past in the source range and an output iterator to the element in the destination range, one past the last element moved.
-
template<typename
ExPolicy
, typenameFwdIter
>
util::detail::algorithm_result<ExPolicy>::typeuninitialized_value_construct
(ExPolicy &&policy, FwdIter first, FwdIter last)¶ Constructs objects of type typename iterator_traits<ForwardIt>::value_type in the uninitialized storage designated by the range [first, last) by default-initialization. If an exception is thrown during the initialization, the function has no effects.
The assignments in the parallel
uninitialized_value_construct algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.
The assignments in the parallel uninitialized_value_construct algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_value_construct algorithm returns a hpx::future<void>, if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename
ExPolicy
, typenameFwdIter
, typenameSize
>
util::detail::algorithm_result<ExPolicy, FwdIter>::typeuninitialized_value_construct_n
(ExPolicy &&policy, FwdIter first, Size count)¶ Constructs objects of type typename iterator_traits<ForwardIt>::value_type in the uninitialized storage designated by the range [first, first + count) by default-initialization. If an exception is thrown during the initialization, the function has no effects.
The assignments in the parallel
uninitialized_value_construct_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, if count > 0, no assignments otherwise.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Size
: The type of the argument specifying the number of elements to apply f to.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.
The assignments in the parallel uninitialized_value_construct_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The uninitialized_value_construct_n algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The uninitialized_value_construct_n algorithm returns the iterator to the element in the source range, one past the last element constructed.
-
template<typename
ExPolicy
, typenameFwdIter
, typenamePred
= detail::equal_to, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, FwdIter>::typeunique
(ExPolicy &&policy, FwdIter first, FwdIter last, Pred &&pred = Pred(), Proj &&proj = Proj())¶ Eliminates all but the first element from every consecutive group of equivalent elements from the range [first, last) and returns a past-the-end iterator for the new logical end of the range.
The assignments in the parallel
unique algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first - 1 applications of the predicate pred and no more than twice as many applications of the projection proj.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of unique requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is an binary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter can be dereferenced and then implicitly converted to both Type1 and Type2proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel unique algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The unique algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The unique algorithm returns the iterator to the new end of the range.
-
template<typename
ExPolicy
, typenameFwdIter1
, typenameFwdIter2
, typenamePred
= detail::equal_to, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)>>::typeunique_copy
(ExPolicy &&policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest, Pred &&pred = Pred(), Proj &&proj = Proj())¶ Copies the elements from the range [first, last), to another range beginning at dest in such a way that there are no consecutive equal elements. Only the first element of each group of equal elements is copied.
The assignments in the parallel
unique_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first - 1 applications of the predicate pred and no more than twice as many applications of the projection proj
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.FwdIter1
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of unique_copy requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is an binary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a, const Type &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel unique_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The unique_copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The unique_copy algorithm returns the pair of the source iterator to last, and the destination iterator to the end of the dest range.
-
template<typename
ExPolicy
, typenameRng
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typenone_of
(ExPolicy &&policy, Rng &&rng, F &&f, Proj &&proj = Proj())¶ Checks if unary predicate f returns true for no elements in the range rng.
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most std::distance(begin(rng), end(rng)) applications of the predicate f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of none_of requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The none_of algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The none_of algorithm returns true if the unary predicate f returns true for no elements in the range, false otherwise. It returns true if the range is empty.
-
template<typename
ExPolicy
, typenameRng
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typeany_of
(ExPolicy &&policy, Rng &&rng, F &&f, Proj &&proj = Proj())¶ Checks if unary predicate f returns true for at least one element in the range rng.
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most std::distance(begin(rng), end(rng)) applications of the predicate f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of none_of requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The any_of algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The any_of algorithm returns true if the unary predicate f returns true for at least one element in the range, false otherwise. It returns false if the range is empty.
-
template<typename
ExPolicy
, typenameRng
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typeall_of
(ExPolicy &&policy, Rng &&rng, F &&f, Proj &&proj = Proj())¶ Checks if unary predicate f returns true for all elements in the range rng.
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most std::distance(begin(rng), end(rng)) applications of the predicate f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of none_of requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The all_of algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The all_of algorithm returns true if the unary predicate f returns true for all elements in the range, false otherwise. It returns true if the range is empty.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_traits<Rng>::iterator_type), tag::out(OutIter)>>::typecopy
(ExPolicy &&policy, Rng &&rng, OutIter dest)¶ Copies the elements in the range rng to another range beginning at dest.
The assignments in the parallel
copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly std::distance(begin(rng), end(rng)) assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.
The assignments in the parallel copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The copy algorithm returns a hpx::future<tagged_pair<tag::in(iterator_t<Rng>), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(iterator_t<Rng>), tag::out(FwdIter2)> otherwise. The copy algorithm returns the pair of the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_traits<Rng>::iterator_type), tag::out(OutIter)>>::typecopy_if
(ExPolicy &&policy, Rng &&rng, OutIter dest, F &&f, Proj &&proj = Proj())¶ Copies the elements in the range rng to another range beginning at dest. Copies only the elements for which the predicate f returns true. The order of the elements that are not removed is preserved.
The assignments in the parallel
copy_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than std::distance(begin(rng), end(rng)) assignments, exactly std::distance(begin(rng), end(rng)) applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The copy_if algorithm returns a hpx::future<tagged_pair<tag::in(iterator_t<Rng>), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(iterator_t<Rng>), tag::out(FwdIter2)> otherwise. The copy_if algorithm returns the pair of the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename std::iterator_traits<typename hpx::traits::range_traits<Rng>::iterator_type>::difference_type>::typecount
(ExPolicy &&policy, Rng &&rng, T const &value, Proj &&proj = Proj())¶ Returns the number of elements in the range [first, last) satisfying a specific criteria. This version counts the elements that are equal to the given value.
The comparisons in the parallel
count algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first comparisons.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the comparisons.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.T
: The type of the value to search for (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.value
: The value to search for.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
- Note
- The comparisons in the parallel count algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The count algorithm returns a hpx::future<difference_type> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by std::iterator_traits<FwdIter>::difference_type. The count algorithm returns the number of elements satisfying the given criteria.
-
template<typename
ExPolicy
, typenameRng
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename std::iterator_traits<typename hpx::traits::range_traits<Rng>::iterator_type>::difference_type>::typecount_if
(ExPolicy &&policy, Rng &&rng, F &&f, Proj &&proj = Proj())¶ Returns the number of elements in the range [first, last) satisfying a specific criteria. This version counts elements for which predicate f returns true.
- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Note
- The assignments in the parallel count_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
- Note
- The assignments in the parallel count_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The count_if algorithm returns hpx::future<difference_type> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by std::iterator_traits<FwdIter>::difference_type. The count algorithm returns the number of elements satisfying the given criteria.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the comparisons.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of count_if requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
-
template<typename
ExPolicy
, typenameRng
, typenameT
>
util::detail::algorithm_result<ExPolicy>::typefill
(ExPolicy &&policy, Rng &&rng, T value)¶ Assigns the given value to the elements in the range [first, last).
The comparisons in the parallel
fill algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.T
: The type of the value to be assigned (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.value
: The value to be assigned.
The comparisons in the parallel fill algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The fill algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by void.
-
template<typename
ExPolicy
, typenameRng
, typenameSize
, typenameT
>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_traits<Rng>::iterator_type>::typefill_n
(ExPolicy &&policy, Rng &rng, Size count, T value)¶ Assigns the given value value to the first count elements in the range beginning at first if count > 0. Does nothing otherwise.
The comparisons in the parallel
fill_n algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly count assignments, for count > 0.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Size
: The type of the argument specifying the number of elements to apply f to.T
: The type of the value to be assigned (deduced).
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.count
: Refers to the number of elements starting at first the algorithm will be applied to.value
: The value to be assigned.
The comparisons in the parallel fill_n algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The fill_n algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns difference_type otherwise (where difference_type is defined by void.
-
template<typename
ExPolicy
, typenameRng
, typenameRng2
, typenamePred
= detail::equal_to, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typefind_end
(ExPolicy &&policy, Rng &&rng, Rng2 &&rng2, Pred &&op = Pred(), Proj &&proj = Proj())¶ Returns the last subsequence of elements rng2 found in the range rng using the given predicate f to compare elements.
The comparison operations in the parallel
find_end algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most S*(N-S+1) comparisons where S = distance(begin(rng2), end(rng2)) and N = distance(begin(rng), end(rng)).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the first source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.Rng2
: The type of the second source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the first sequence of elements the algorithm will be applied to.rng2
: Refers to the second sequence of elements the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types iterator_t<Rng> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.proj
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng> and dereferenced iterator_t<Rng2> as a projection operation before the function op is invoked.
The comparison operations in the parallel find_end algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
This overload of
find_end is available if the user decides to provide the algorithm their own predicate op.- Return
- The find_end algorithm returns a hpx::future<iterator_t<Rng> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns iterator_t<Rng> otherwise. The find_end algorithm returns an iterator to the beginning of the last subsequence rng2 in range rng. If the length of the subsequence rng2 is greater than the length of the range rng, end(rng) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng) is also returned.
-
template<typename
ExPolicy
, typenameRng1
, typenameRng2
, typenamePred
= detail::equal_to, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng1>::type>::typefind_first_of
(ExPolicy &&policy, Rng1 &&rng1, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Searches the range rng1 for any elements in the range rng2. Uses binary predicate p to compare elements
The comparison operations in the parallel
find_first_of algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most (S*N) comparisons where S = distance(begin(rng2), end(rng2)) and N = distance(begin(rng1), end(rng1)).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng1
: The type of the first source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.Rng2
: The type of the second source range (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of replace requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj1
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements in rng1.Proj2
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements in rng2.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng1
: Refers to the first sequence of elements the algorithm will be applied to.rng2
: Refers to the second sequence of elements the algorithm will be applied to.op
: The binary predicate which returns true if the elements should be treated as equal. The signature should be equivalent to the following:bool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types iterator_t<Rng1> and iterator_t<Rng2> can be dereferenced and then implicitly converted to Type1 and Type2 respectively.proj1
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng1> before the function op is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of type dereferenced iterator_t<Rng2> before the function op is invoked.
The comparison operations in the parallel find_first_of algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
This overload of
find_first_of is available if the user decides to provide the algorithm their own predicate op.- Return
- The find_end algorithm returns a hpx::future<iterator_t<Rng1> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns iterator_t<Rng1> otherwise. The find_first_of algorithm returns an iterator to the first element in the range rng1 that is equal to an element from the range rng2. If the length of the subsequence rng2 is greater than the length of the range rng1, end(rng1) is returned. Additionally if the size of the subsequence is empty or no subsequence is found, end(rng1) is also returned.
-
template<typename
ExPolicy
, typenameRng
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typefor_each
(ExPolicy &&policy, Rng &&rng, F &&f, Proj &&proj = Proj())¶ Applies f to the result of dereferencing every iterator in the given range rng.
If
f returns a result, the result is ignored.- Note
- Complexity: Applies f exactly size(rng) times.
If the type of first satisfies the requirements of a mutable iterator, f may apply non-constant functions through the dereferenced iterator.
Unlike its sequential form, the parallel overload of for_each does not return a copy of its Function parameter, since parallelization may not permit efficient state accumulation.
The application of function objects in parallel algorithm invoked with an execution policy object of type
sequenced_policy execute in sequential order in the calling thread.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of for_each requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). The signature of this predicate should be equivalent to:<ignored> pred(const Type &a);
The signature does not need to have const&. The type
Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The for_each algorithm returns a hpx::future<InIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns InIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameRng
, typenameF
>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typegenerate
(ExPolicy &&policy, Rng &&rng, F &&f)¶ Assign each element in range [first, last) a value generated by the given function object f
The assignments in the parallel
generate algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly distance(first, last) invocations of f and assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: generator function that will be called. signature of function should be equivalent to the following:Ret fun();
The type
Ret must be such that an object of type FwdIter can be dereferenced and assigned a value of type Ret.
The assignments in the parallel generate algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameRng
, typenameComp
= detail::less, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, bool>::typeis_heap
(ExPolicy &&policy, Rng &&rng, Comp &&comp = Comp(), Proj &&proj = Proj())¶ Returns whether the range is max heap. That is, true if the range is max heap, false otherwise. The function uses the given comparison function object comp (defaults to using operator<()).
comp has to induce a strict weak ordering on the values.
- Note
- Complexity: Performs at most N applications of the comparison comp, at most 2 * N applications of the projection proj, where N = last - first.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an random access iterator.Comp
: The type of the function/function object to use (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_heap algorithm returns a hpx::future<bool> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns bool otherwise. The is_heap algorithm returns whether the range is max heap. That is, true if the range is max heap, false otherwise.
-
template<typename
ExPolicy
, typenameRng
, typenameComp
= detail::less, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typeis_heap_until
(ExPolicy &&policy, Rng &&rng, Comp &&comp = Comp(), Proj &&proj = Proj())¶ Returns the upper bound of the largest range beginning at first which is a max heap. That is, the last iterator it for which range [first, it) is a max heap. The function uses the given comparison function object comp (defaults to using operator<()).
comp has to induce a strict weak ordering on the values.
- Note
- Complexity: Performs at most N applications of the comparison comp, at most 2 * N applications of the projection proj, where N = last - first.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an random access iterator.Comp
: The type of the function/function object to use (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The is_heap_until algorithm returns a hpx::future<RandIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns RandIter otherwise. The is_heap_until algorithm returns the upper bound of the largest range beginning at first which is a max heap. That is, the last iterator it for which range [first, it) is a max heap.
-
template<typename
ExPolicy
, typenameRng1
, typenameRng2
, typenameRandIter3
, typenameComp
= detail::less, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in1(typename hpx::traits::range_iterator<Rng1>::type), tag::in2(typename hpx::traits::range_iterator<Rng2>::type), tag::out(RandIter3)>>::typemerge
(ExPolicy &&policy, Rng1 &&rng1, Rng2 &&rng2, RandIter3 dest, Comp &&comp = Comp(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Merges two sorted ranges [first1, last1) and [first2, last2) into one sorted range beginning at dest. The order of equivalent elements in the each of original two ranges is preserved. For equivalent elements in the original two ranges, the elements from the first range precede the elements from the second range. The destination range cannot overlap with either of the input ranges.
The assignments in the parallel
merge algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs O(std::distance(first1, last1) + std::distance(first2, last2)) applications of the comparison comp and the each projection.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng1
: The type of the first source range used (deduced). The iterators extracted from this range type must meet the requirements of an random access iterator.Rng2
: The type of the second source range used (deduced). The iterators extracted from this range type must meet the requirements of an random access iterator.RandIter3
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an random access iterator.Comp
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of merge requires Comp to meet the requirements of CopyConstructible. This defaults to std::less<>Proj1
: The type of an optional projection function to be used for elements of the first range. This defaults to util::projection_identityProj2
: The type of an optional projection function to be used for elements of the second range. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng1
: Refers to the first range of elements the algorithm will be applied to.rng2
: Refers to the second range of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.comp
: comp is a callable object which returns true if the first argument is less than the second, and false otherwise. The signature of this comparison should be equivalent to:bool comp(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types RandIter1 and RandIter2 can be dereferenced and then implicitly converted to both Type1 and Type2proj1
: Specifies the function (or function object) which will be invoked for each of the elements of the first range as a projection operation before the actual comparison comp is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of the second range as a projection operation before the actual comparison comp is invoked.
The assignments in the parallel merge algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The merge algorithm returns a hpx::future<tagged_tuple<tag::in1(RandIter1), tag::in2(RandIter2), tag::out(RandIter3)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_tuple<tag::in1(RandIter1), tag::in2(RandIter2), tag::out(RandIter3)> otherwise. The merge algorithm returns the tuple of the source iterator last1, the source iterator last2, the destination iterator to the end of the dest range.
-
template<typename
ExPolicy
, typenameRng
, typenameRandIter
, typenameComp
= detail::less, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, RandIter>::typeinplace_merge
(ExPolicy &&policy, Rng &&rng, RandIter middle, Comp &&comp = Comp(), Proj &&proj = Proj())¶ Merges two consecutive sorted ranges [first, middle) and [middle, last) into one sorted range [first, last). The order of equivalent elements in the each of original two ranges is preserved. For equivalent elements in the original two ranges, the elements from the first range precede the elements from the second range.
The assignments in the parallel
inplace_merge algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs O(std::distance(first, last)) applications of the comparison comp and the each projection.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an random access iterator.RandIter
: The type of the source iterators used (deduced). This iterator type must meet the requirements of an random access iterator.Comp
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of inplace_merge requires Comp to meet the requirements of CopyConstructible. This defaults to std::less<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the range of elements the algorithm will be applied to.middle
: Refers to the end of the first sorted range and the beginning of the second sorted range the algorithm will be applied to.comp
: comp is a callable object which returns true if the first argument is less than the second, and false otherwise. The signature of this comparison should be equivalent to:bool comp(const Type1 &a, const Type2 &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types RandIter can be dereferenced and then implicitly converted to both Type1 and Type2proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel inplace_merge algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The inplace_merge algorithm returns a hpx::future<RandIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns RandIter otherwise. The inplace_merge algorithm returns the source iterator last
-
template<typename
ExPolicy
, typenameRng
, typenameProj
= util::projection_identity, typenameF
= detail::less>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_traits<Rng>::iterator_type>::typemin_element
(ExPolicy &&policy, Rng &&rng, F &&f = F(), Proj &&proj = Proj())¶ Finds the smallest element in the range [first, last) using the given comparison function f.
The comparisons in the parallel
min_element algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly max(N-1, 0) comparisons, where N = std::distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of min_element requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: The binary predicate which returns true if the the left argument is less than the right element. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The comparisons in the parallel min_element algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The min_element algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The min_element algorithm returns the iterator to the smallest element in the range [first, last). If several elements in the range are equivalent to the smallest element, returns the iterator to the first such element. Returns last if the range is empty.
-
template<typename
ExPolicy
, typenameRng
, typenameProj
= util::projection_identity, typenameF
= detail::less>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_traits<Rng>::iterator_type>::typemax_element
(ExPolicy &&policy, Rng &&rng, F &&f = F(), Proj &&proj = Proj())¶ Finds the greatest element in the range [first, last) using the given comparison function f.
The comparisons in the parallel
max_element algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly max(N-1, 0) comparisons, where N = std::distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of max_element requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: The binary predicate which returns true if the This argument is optional and defaults to std::less. the left argument is less than the right element. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The comparisons in the parallel max_element algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The max_element algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The max_element algorithm returns the iterator to the smallest element in the range [first, last). If several elements in the range are equivalent to the smallest element, returns the iterator to the first such element. Returns last if the range is empty.
-
template<typename
ExPolicy
, typenameRng
, typenameProj
= util::projection_identity, typenameF
= detail::less>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::min(typename hpx::traits::range_traits<Rng>::iterator_type), tag::max(typename hpx::traits::range_traits<Rng>::iterator_type)>>::typeminmax_element
(ExPolicy &&policy, Rng &&rng, F &&f = F(), Proj &&proj = Proj())¶ Finds the greatest element in the range [first, last) using the given comparison function f.
The comparisons in the parallel
minmax_element algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: At most max(floor(3/2*(N-1)), 0) applications of the predicate, where N = std::distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of minmax_element requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: The binary predicate which returns true if the the left argument is less than the right element. This argument is optional and defaults to std::less. The signature of the predicate function should be equivalent to the following:bool pred(const Type1 &a, const Type1 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The type
Type1 must be such that objects of type FwdIter can be dereferenced and then implicitly converted to Type1.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The comparisons in the parallel minmax_element algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The minmax_element algorithm returns a hpx::future<tagged_pair<tag::min(FwdIter), tag::max(FwdIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::min(FwdIter), tag::max(FwdIter)> otherwise. The minmax_element algorithm returns a pair consisting of an iterator to the smallest element as the first element and an iterator to the greatest element as the second. Returns std::make_pair(first, first) if the range is empty. If several elements are equivalent to the smallest element, the iterator to the first such element is returned. If several elements are equivalent to the largest element, the iterator to the last such element is returned.
-
template<typename
ExPolicy
, typenameRng
, typenamePred
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typepartition
(ExPolicy &&policy, Rng &&rng, Pred &&pred, Proj &&proj = Proj())¶ Reorders the elements in the range rng in such a way that all elements for which the predicate pred returns true precede the elements for which the predicate pred returns false. Relative order of the elements is not preserved.
The assignments in the parallel
partition algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs at most 2 * N swaps, exactly N applications of the predicate and projection, where N = std::distance(begin(rng), end(rng)).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of partition requires Pred to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by the range rng. This is an unary predicate for partitioning the source iterators. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel partition algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The partition algorithm returns a hpx::future<FwdIter> if the execution policy is of type parallel_task_policy and returns FwdIter otherwise. The partition algorithm returns the iterator to the first element of the second group.
-
template<typename
ExPolicy
, typenameRng
, typenameFwdIter2
, typenameFwdIter3
, typenamePred
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in(typename hpx::traits::range_iterator<Rng>::type), tag::out1(FwdIter2), tag::out2(FwdIter3)>>::typepartition_copy
(ExPolicy &&policy, Rng &&rng, FwdIter2 dest_true, FwdIter3 dest_false, Pred &&pred, Proj &&proj = Proj())¶ Copies the elements in the range rng, to two different ranges depending on the value returned by the predicate pred. The elements, that satisfy the predicate pred, are copied to the range beginning at dest_true. The rest of the elements are copied to the range beginning at dest_false. The order of the elements is preserved.
The assignments in the parallel
partition_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than N assignments, exactly N applications of the predicate pred, where N = std::distance(begin(rng), end(rng)).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range for the elements that satisfy the predicate pred (deduced). This iterator type must meet the requirements of an forward iterator.FwdIter3
: The type of the iterator representing the destination range for the elements that don’t satisfy the predicate pred (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of partition_copy requires Pred to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest_true
: Refers to the beginning of the destination range for the elements that satisfy the predicate pred.dest_false
: Refers to the beginning of the destination range for the elements that don’t satisfy the predicate pred.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by the range rng. This is an unary predicate for partitioning the source iterators. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel partition_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The partition_copy algorithm returns a hpx::future<tagged_tuple<tag::in(InIter), tag::out1(OutIter1), tag::out2(OutIter2)> > if the execution policy is of type parallel_task_policy and returns tagged_tuple<tag::in(InIter), tag::out1(OutIter1), tag::out2(OutIter2)> otherwise. The partition_copy algorithm returns the tuple of the source iterator last, the destination iterator to the end of the dest_true range, and the destination iterator to the end of the dest_false range.
-
template<typename
ExPolicy
, typenameRng
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typeremove
(ExPolicy &&policy, Rng &&rng, T const &value, Proj &&proj = Proj())¶ Removes all elements satisfying specific criteria from the range [first, last) and returns a past-the-end iterator for the new end of the range. This version removes all elements that are equal to value.
The assignments in the parallel
remove algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the operator==() and the projection proj.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.T
: The type of the value to remove (deduced). This value type must meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.value
: Specifies the value of elements to remove.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The remove algorithm returns the iterator to the new end of the range.
-
template<typename
ExPolicy
, typenameRng
, typenamePred
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typeremove_if
(ExPolicy &&policy, Rng &&rng, Pred &&pred, Proj &&proj = Proj())¶ Removes all elements satisfying specific criteria from the range [first, last) and returns a past-the-end iterator for the new end of the range. This version removes all elements for which predicate pred returns true.
The assignments in the parallel
remove_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate pred and the projection proj.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of remove_if requires Pred to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The remove_if algorithm returns the iterator to the new end of the range.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_traits<Rng>::iterator_type), tag::out(OutIter)>>::typeremove_copy
(ExPolicy &&policy, Rng &&rng, OutIter dest, T const &val, Proj &&proj = Proj())¶ Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the comparison operator returns false when compare to val. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(proj, *it) == value
The assignments in the parallel
remove_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.T
: The type that the result of dereferencing InIter is compared to.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.val
: Value to be removed.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove_copy algorithm returns a hpx::future<tagged_pair<tag::in(InIter), tag::out(OutIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(InIter), tag::out(OutIter)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_traits<Rng>::iterator_type), tag::out(OutIter)>>::typeremove_copy_if
(ExPolicy &&policy, Rng &&rng, OutIter dest, F &&f, Proj &&proj = Proj())¶ Copies the elements in the range, defined by [first, last), to another range beginning at dest. Copies only the elements for which the predicate f returns false. The order of the elements that are not removed is preserved.
Effects: Copies all the elements referred to by the iterator it in the range [first,last) for which the following corresponding conditions do not hold: INVOKE(pred, INVOKE(proj, *it)) != false.
The assignments in the parallel
remove_copy_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than last - first assignments, exactly last - first applications of the predicate f.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of copy_if requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements to be removed. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel remove_copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The remove_copy_if algorithm returns a hpx::future<tagged_pair<tag::in(InIter), tag::out(OutIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(InIter), tag::out(OutIter)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameT1
, typenameT2
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_traits<Rng>::iterator_type>::typereplace
(ExPolicy &&policy, Rng &&rng, T1 const &old_value, T2 const &new_value, Proj &&proj = Proj())¶ Replaces all elements satisfying specific criteria with new_value in the range [first, last).
Effects: Substitutes elements referred by the iterator it in the range [first,last) with new_value, when the following corresponding conditions hold: INVOKE(proj, *i) == old_value
- Note
- Complexity: Performs exactly last - first assignments.
The assignments in the parallel
replace algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.T1
: The type of the old value to replace (deduced).T2
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.old_value
: Refers to the old value of the elements to replace.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename
ExPolicy
, typenameRng
, typenameF
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_traits<Rng>::iterator_type>::typereplace_if
(ExPolicy &&policy, Rng &&rng, F &&f, T const &new_value, Proj &&proj = Proj())¶ Replaces all elements satisfying specific criteria (for which predicate f returns true) with new_value in the range [first, last).
Effects: Substitutes elements referred by the iterator it in the range [first, last) with new_value, when the following corresponding conditions hold: INVOKE(f, INVOKE(proj, *it)) != false
- Note
- Complexity: Performs exactly last - first applications of the predicate.
The assignments in the parallel
replace_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible. (deduced).T
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements which need to replaced. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_if algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise. It returns last.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
, typenameT1
, typenameT2
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_traits<Rng>::iterator_type), tag::out(OutIter)>>::typereplace_copy
(ExPolicy &&policy, Rng &&rng, OutIter dest, T1 const &old_value, T2 const &new_value, Proj &&proj = Proj())¶ Copies the all elements from the range [first, last) to another range beginning at dest replacing all elements satisfying a specific criteria with new_value.
Effects: Assigns to every iterator it in the range [result, result + (last - first)) either new_value or *(first + (it - result)) depending on whether the following corresponding condition holds: INVOKE(proj, *(first + (i - result))) == old_value
The assignments in the parallel
replace_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.T1
: The type of the old value to replace (deduced).T2
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.old_value
: Refers to the old value of the elements to replace.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_copy algorithm returns a hpx::future<tagged_pair<tag::in(InIter), tag::out(OutIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(InIter), tag::out(OutIter)> otherwise. The copy algorithm returns the pair of the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
, typenameF
, typenameT
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_traits<Rng>::iterator_type), tag::out(OutIter)>>::typereplace_copy_if
(ExPolicy &&policy, Rng &&rng, OutIter dest, F &&f, T const &new_value, Proj &&proj = Proj())¶ Copies the all elements from the range [first, last) to another range beginning at dest replacing all elements satisfying a specific criteria with new_value.
Effects: Assigns to every iterator it in the range [result, result + (last - first)) either new_value or *(first + (it - result)) depending on whether the following corresponding condition holds: INVOKE(f, INVOKE(proj, *(first + (i - result)))) != false
The assignments in the parallel
replace_copy_if algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first applications of the predicate.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of equal requires F to meet the requirements of CopyConstructible. (deduced).T
: The type of the new values to replace (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate which returns true for the elements which need to replaced. The signature of this predicate should be equivalent to:bool pred(const Type &a);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter can be dereferenced and then implicitly converted to Type.new_value
: Refers to the new value to use as the replacement.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel replace_copy_if algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The replace_copy_if algorithm returns a hpx::future<tagged_pair<tag::in(InIter), tag::out(OutIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(InIter), tag::out(OutIter)> otherwise. The replace_copy_if algorithm returns the input iterator last and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typereverse
(ExPolicy &&policy, Rng &&rng)¶ Reverses the order of the elements in the range [first, last). Behaves as if applying std::iter_swap to every pair of iterators first+i, (last-i) - 1 for each non-negative i < (last-first)/2.
The assignments in the parallel
reverse algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Linear in the distance between first and last.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a bidirectional iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.
The assignments in the parallel reverse algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The reverse algorithm returns a hpx::future<BidirIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns BidirIter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_iterator<Rng>::type), tag::out(OutIter)>>::typereverse_copy
(ExPolicy &&policy, Rng &&rng, OutIter dest_first)¶ Copies the elements from the range [first, last) to another range beginning at dest_first in such a way that the elements in the new range are in reverse order. Behaves as if by executing the assignment *(dest_first + (last - first) - 1 - i) = *(first + i) once for each non-negative i < (last - first) If the source and destination ranges (that is, [first, last) and [dest_first, dest_first+(last-first)) respectively) overlap, the behavior is undefined.
The assignments in the parallel
reverse_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a bidirectional iterator.OutputIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest_first
: Refers to the begin of the destination range.
The assignments in the parallel reverse_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The reverse_copy algorithm returns a hpx::future<tagged_pair<tag::in(BidirIter), tag::out(OutIter)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(BidirIter), tag::out(OutIter)> otherwise. The copy algorithm returns the pair of the input iterator forwarded to the first element after the last in the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::begin(typename hpx::traits::range_iterator<Rng>::type), tag::end(typename hpx::traits::range_iterator<Rng>::type)>>::typerotate
(ExPolicy &&policy, Rng &&rng, typename hpx::traits::range_iterator<Rng>::type middle)¶ Performs a left rotation on a range of elements. Specifically, rotate swaps the elements in the range [first, last) in such a way that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element.
The assignments in the parallel
rotate algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Linear in the distance between first and last.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.
The assignments in the parallel rotate algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The type of dereferenced FwdIter must meet the requirements of MoveAssignable and MoveConstructible.
- Return
- The rotate algorithm returns a hpx::future<tagged_pair<tag::begin(FwdIter), tag::end(FwdIter)> > if the execution policy is of type parallel_task_policy and returns tagged_pair<tag::begin(FwdIter), tag::end(FwdIter)> otherwise. The rotate algorithm returns the iterator equal to pair(first + (last - new_first), last).
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_iterator<Rng>::type), tag::out(OutIter)>>::typerotate_copy
(ExPolicy &&policy, Rng &&rng, typename hpx::traits::range_iterator<Rng>::type middle, OutIter dest_first)¶ Copies the elements from the range [first, last), to another range beginning at dest_first in such a way, that the element new_first becomes the first element of the new range and new_first - 1 becomes the last element.
The assignments in the parallel
rotate_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs exactly last - first assignments.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of a forward iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.middle
: Refers to the element that should appear at the beginning of the rotated range.dest_first
: Refers to the begin of the destination range.
The assignments in the parallel rotate_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The rotate_copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter), tag::out(OutIter)> > if the execution policy is of type parallel_task_policy and returns tagged_pair<tag::in(FwdIter), tag::out(OutIter)> otherwise. The rotate_copy algorithm returns the output iterator to the element past the last element copied.
-
template<typename
ExPolicy
, typenameRng1
, typenameRng2
, typenamePred
= detail::equal_to, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng1>::type>::typesearch
(ExPolicy &&policy, Rng1 &&rng1, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Searches the range [first, last) for any elements in the range [s_first, s_last). Uses a provided predicate to compare elements.
The comparison operations in the parallel
search algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most (S*N) comparisons where S = distance(s_first, s_last) and N = distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng1
: The type of the examine range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Rng2
: The type of the search range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of adjacent_find requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj1
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of Rng1.Proj2
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of Rng2.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng1
: Refers to the sequence of elements the algorithm will be examining.rng2
: Refers to the sequence of elements the algorithm will be searching for.op
: Refers to the binary predicate which returns true if the elements should be treated as equal. the signature of the function should be equivalent tobool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectivelyproj1
: Specifies the function (or function object) which will be invoked for each of the elements of rng1 as a projection operation before the actual predicate is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of rng2 as a projection operation before the actual predicate is invoked.
The comparison operations in the parallel search algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The search algorithm returns a hpx::future<FwdIter> if the execution policy is of type task_execution_policy and returns FwdIter otherwise. The search algorithm returns an iterator to the beginning of the first subsequence [s_first, s_last) in range [first, last). If the length of the subsequence [s_first, s_last) is greater than the length of the range [first, last), last is returned. Additionally if the size of the subsequence is empty first is returned. If no subsequence is found, last is returned.
-
template<typename
ExPolicy
, typenameRng1
, typenameRng2
, typenamePred
= detail::equal_to, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng1>::type>::typesearch_n
(ExPolicy &&policy, Rng1 &&rng1, std::size_t count, Rng2 &&rng2, Pred &&op = Pred(), Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Searches the range [first, last) for any elements in the range [s_first, s_last). Uses a provided predicate to compare elements.
The comparison operations in the parallel
search algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: at most (S*N) comparisons where S = distance(s_first, s_last) and N = distance(first, last).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng1
: The type of the examine range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Rng2
: The type of the search range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Pred
: The type of an optional function/function object to use. Unlike its sequential form, the parallel overload of adjacent_find requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj1
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of Rng1.Proj2
: The type of an optional projection function. This defaults to util::projection_identity and is applied to the elements of Rng2.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng1
: Refers to the sequence of elements the algorithm will be examining.count
: The number of elements to apply the algorithm on.rng2
: Refers to the sequence of elements the algorithm will be searching for.op
: Refers to the binary predicate which returns true if the elements should be treated as equal. the signature of the function should be equivalent tobool pred(const Type1 &a, const Type2 &b);
The signature does not need to have const &, but the function must not modify the objects passed to it. The types
Type1 and Type2 must be such that objects of types FwdIter1 and FwdIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectivelyproj1
: Specifies the function (or function object) which will be invoked for each of the elements of rng1 as a projection operation before the actual predicate is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of rng2 as a projection operation before the actual predicate is invoked.
The comparison operations in the parallel search algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The search algorithm returns a hpx::future<FwdIter> if the execution policy is of type task_execution_policy and returns FwdIter otherwise. The search algorithm returns an iterator to the beginning of the first subsequence [s_first, s_last) in range [first, last). If the length of the subsequence [s_first, s_last) is greater than the length of the range [first, last), last is returned. Additionally if the size of the subsequence is empty first is returned. If no subsequence is found, last is returned.
-
template<typename
ExPolicy
, typenameRng
, typenameProj
= util::projection_identity, typenameCompare
= detail::less>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typesort
(ExPolicy &&policy, Rng &&rng, Compare &&comp = Compare(), Proj &&proj = Proj())¶ Sorts the elements in the range rng in ascending order. The order of equal elements is not guaranteed to be preserved. The function uses the given comparison function object comp (defaults to using operator<()).
A sequence is sorted with respect to a comparator
comp and a projection proj if for every iterator i pointing to the sequence and every non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence, and INVOKE(comp, INVOKE(proj, *(i + n)), INVOKE(proj, *i)) == false.- Note
- Complexity: O(Nlog(N)), where N = std::distance(begin(rng), end(rng)) comparisons.
comp has to induce a strict weak ordering on the values.
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Comp
: The type of the function/function object to use (deduced).Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.comp
: comp is a callable object. The return value of the INVOKE operation applied to an object of type Comp, when contextually converted to bool, yields true if the first argument of the call is less than the second, and false otherwise. It is assumed that comp will not apply any non-constant function through the dereferenced iterator.proj
: Specifies the function (or function object) which will be invoked for each pair of elements as a projection operation before the actual predicate comp is invoked.
The application of function objects in parallel algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.
The application of function objects in parallel algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The sort algorithm returns a hpx::future<Iter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns Iter otherwise. It returns last.
-
template<typename
ExPolicy
, typenameRng
, typenameOutIter
, typenameF
, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_iterator<Rng>::type), tag::out(OutIter)>>::typetransform
(ExPolicy &&policy, Rng &&rng, OutIter dest, F &&f, Proj &&proj = Proj())¶ Applies the given function f to the given range rng and stores the result in another range, beginning at dest.
The invocations of
f in the parallel transform algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly size(rng) applications of f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is an unary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type &a);
The signature does not need to have const&. The type
Type must be such that an object of type InIter can be dereferenced and then implicitly converted to Type. The type Ret must be such that an object of type OutIter can be dereferenced and assigned a value of type Ret.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel transform algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The transform algorithm returns a hpx::future<tagged_pair<tag::in(InIter), tag::out(OutIter)> > if the execution policy is of type parallel_task_policy and returns tagged_pair<tag::in(InIter), tag::out(OutIter)> otherwise. The transform algorithm returns a tuple holding an iterator referring to the first element after the input sequence and the output iterator to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenameInIter2
, typenameOutIter
, typenameF
, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in1(typename hpx::traits::range_iterator<Rng>::type), tag::in2(InIter2), tag::out(OutIter)>>::typetransform
(ExPolicy &&policy, Rng &&rng, InIter2 first2, OutIter dest, F &&f, Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Applies the given function f to pairs of elements from two ranges: one defined by rng and the other beginning at first2, and stores the result in another range, beginning at dest.
The invocations of
f in the parallel transform algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly size(rng) applications of f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.InIter2
: The type of the source iterators for the second range used (deduced). This iterator type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj1
: The type of an optional projection function to be used for elements of the first sequence. This defaults to util::projection_identityProj2
: The type of an optional projection function to be used for elements of the second sequence. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.first2
: Refers to the beginning of the second sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type2 &b);
The signature does not need to have const&. The types
Type1 and Type2 must be such that objects of types InIter1 and InIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively. The type Ret must be such that an object of type OutIter can be dereferenced and assigned a value of type Ret.proj1
: Specifies the function (or function object) which will be invoked for each of the elements of the first sequence as a projection operation before the actual predicate f is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of the second sequence as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel transform algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The transform algorithm returns a hpx::future<tagged_tuple<tag::in1(InIter1), tag::in2(InIter2), tag::out(OutIter)> > if the execution policy is of type parallel_task_policy and returns tagged_tuple<tag::in1(InIter1), tag::in2(InIter2), tag::out(OutIter)> otherwise. The transform algorithm returns a tuple holding an iterator referring to the first element after the first input sequence, an iterator referring to the first element after the second input sequence, and the output iterator referring to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng1
, typenameRng2
, typenameOutIter
, typenameF
, typenameProj1
= util::projection_identity, typenameProj2
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_tuple<tag::in1(typename hpx::traits::range_iterator<Rng1>::type), tag::in2(typename hpx::traits::range_iterator<Rng2>::type), tag::out(OutIter)>>::typetransform
(ExPolicy &&policy, Rng1 &&rng1, Rng2 &&rng2, OutIter dest, F &&f, Proj1 &&proj1 = Proj1(), Proj2 &&proj2 = Proj2())¶ Applies the given function f to pairs of elements from two ranges: one defined by [first1, last1) and the other beginning at first2, and stores the result in another range, beginning at dest.
The invocations of
f in the parallel transform algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Exactly min(last2-first2, last1-first1) applications of f
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the invocations of f.Rng1
: The type of the first source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.Rng2
: The type of the second source range used (deduced). The iterators extracted from this range type must meet the requirements of an input iterator.OutIter
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an output iterator.F
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of transform requires F to meet the requirements of CopyConstructible.Proj1
: The type of an optional projection function to be used for elements of the first sequence. This defaults to util::projection_identityProj2
: The type of an optional projection function to be used for elements of the second sequence. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng1
: Refers to the first sequence of elements the algorithm will be applied to.rng2
: Refers to the second sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.f
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last).This is a binary predicate. The signature of this predicate should be equivalent to:Ret fun(const Type1 &a, const Type2 &b);
The signature does not need to have const&. The types
Type1 and Type2 must be such that objects of types InIter1 and InIter2 can be dereferenced and then implicitly converted to Type1 and Type2 respectively. The type Ret must be such that an object of type OutIter can be dereferenced and assigned a value of type Ret.proj1
: Specifies the function (or function object) which will be invoked for each of the elements of the first sequence as a projection operation before the actual predicate f is invoked.proj2
: Specifies the function (or function object) which will be invoked for each of the elements of the second sequence as a projection operation before the actual predicate f is invoked.
The invocations of f in the parallel transform algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Note
- The algorithm will invoke the binary predicate until it reaches the end of the shorter of the two given input sequences
- Return
- The transform algorithm returns a hpx::future<tagged_tuple<tag::in1(InIter1), tag::in2(InIter2), tag::out(OutIter)> > if the execution policy is of type parallel_task_policy and returns tagged_tuple<tag::in1(InIter1), tag::in2(InIter2), tag::out(OutIter)> otherwise. The transform algorithm returns a tuple holding an iterator referring to the first element r the first input sequence, an iterator referring to the first element after the second input sequence, and the output iterator referring to the element in the destination range, one past the last element copied.
-
template<typename
ExPolicy
, typenameRng
, typenamePred
= detail::equal_to, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, typename hpx::traits::range_iterator<Rng>::type>::typeunique
(ExPolicy &&policy, Rng &&rng, Pred &&pred = Pred(), Proj &&proj = Proj())¶ Eliminates all but the first element from every consecutive group of equivalent elements from the range rng and returns a past-the-end iterator for the new logical end of the range.
The assignments in the parallel
unique algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than N assignments, exactly N - 1 applications of the predicate pred and no more than twice as many applications of the projection proj, where N = std::distance(begin(rng), end(rng)).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of unique requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last). This is an binary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a, const Type &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel unique algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The unique algorithm returns a hpx::future<FwdIter> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns FwdIter otherwise. The unique algorithm returns the iterator to the new end of the range.
-
template<typename
ExPolicy
, typenameRng
, typenameFwdIter2
, typenamePred
= detail::equal_to, typenameProj
= util::projection_identity>
util::detail::algorithm_result<ExPolicy, hpx::util::tagged_pair<tag::in(typename hpx::traits::range_iterator<Rng>::type), tag::out(FwdIter2)>>::typeunique_copy
(ExPolicy &&policy, Rng &&rng, FwdIter2 dest, Pred &&pred = Pred(), Proj &&proj = Proj())¶ Copies the elements from the range rng, to another range beginning at dest in such a way that there are no consecutive equal elements. Only the first element of each group of equal elements is copied.
The assignments in the parallel
unique_copy algorithm invoked with an execution policy object of type sequenced_policy execute in sequential order in the calling thread.- Note
- Complexity: Performs not more than N assignments, exactly N - 1 applications of the predicate pred, where N = std::distance(begin(rng), end(rng)).
- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it executes the assignments.Rng
: The type of the source range used (deduced). The iterators extracted from this range type must meet the requirements of an forward iterator.FwdIter2
: The type of the iterator representing the destination range (deduced). This iterator type must meet the requirements of an forward iterator.Pred
: The type of the function/function object to use (deduced). Unlike its sequential form, the parallel overload of unique_copy requires Pred to meet the requirements of CopyConstructible. This defaults to std::equal_to<>Proj
: The type of an optional projection function. This defaults to util::projection_identity
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.rng
: Refers to the sequence of elements the algorithm will be applied to.dest
: Refers to the beginning of the destination range.pred
: Specifies the function (or function object) which will be invoked for each of the elements in the sequence specified by the range rng. This is an binary predicate which returns true for the required elements. The signature of this predicate should be equivalent to:bool pred(const Type &a, const Type &b);
The signature does not need to have const&, but the function must not modify the objects passed to it. The type
Type must be such that an object of type FwdIter1 can be dereferenced and then implicitly converted to Type.proj
: Specifies the function (or function object) which will be invoked for each of the elements as a projection operation before the actual predicate is invoked.
The assignments in the parallel unique_copy algorithm invoked with an execution policy object of type parallel_policy or parallel_task_policy are permitted to execute in an unordered fashion in unspecified threads, and indeterminately sequenced within each thread.
- Return
- The unique_copy algorithm returns a hpx::future<tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> > if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns tagged_pair<tag::in(FwdIter1), tag::out(FwdIter2)> otherwise. The unique_copy algorithm returns the pair of the source iterator to last, and the destination iterator to the end of the dest range.
-
template<typename
-
namespace
v2
¶ Functions
-
template<typename
ExPolicy
, typenameF
>
util::detail::algorithm_result<ExPolicy>::typedefine_task_block
(ExPolicy &&policy, F &&f)¶ Constructs a task_block, tr, using the given execution policy policy,and invokes the expression f(tr) on the user-provided object, f.
Postcondition: All tasks spawned from
f have finished execution. A call to define_task_block may return on a different thread than that on which it was called.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the task block may be parallelized.F
: The type of the user defined function to invoke inside the define_task_block (deduced). F shall be MoveConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.f
: The user defined function to invoke inside the task block. Given an lvalue tr of type task_block, the expression, (void)f(tr), shall be well-formed.
- Note
- It is expected (but not mandated) that f will (directly or indirectly) call tr.run(callable_object).
- Exceptions
An
: exception_list, as specified in Exception Handling.
-
template<typename
F
>
voiddefine_task_block
(F &&f)¶ Constructs a task_block, tr, and invokes the expression f(tr) on the user-provided object, f. This version uses parallel_policy for task scheduling.
Postcondition: All tasks spawned from
f have finished execution. A call to define_task_block may return on a different thread than that on which it was called.- Template Parameters
F
: The type of the user defined function to invoke inside the define_task_block (deduced). F shall be MoveConstructible.
- Parameters
f
: The user defined function to invoke inside the task block. Given an lvalue tr of type task_block, the expression, (void)f(tr), shall be well-formed.
- Note
- It is expected (but not mandated) that f will (directly or indirectly) call tr.run(callable_object).
- Exceptions
An
: exception_list, as specified in Exception Handling.
-
template<typename
ExPolicy
, typenameF
>
util::detail::algorithm_result<ExPolicy>::typedefine_task_block_restore_thread
(ExPolicy &&policy, F &&f)¶ Constructs a task_block, tr, and invokes the expression f(tr) on the user-provided object, f.
Postcondition: All tasks spawned from
f have finished execution. A call to define_task_block_restore_thread always returns on the same thread as that on which it was called.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the task block may be parallelized.F
: The type of the user defined function to invoke inside the define_task_block (deduced). F shall be MoveConstructible.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.f
: The user defined function to invoke inside the define_task_block. Given an lvalue tr of type task_block, the expression, (void)f(tr), shall be well-formed.
- Exceptions
An
: exception_list, as specified in Exception Handling.
- Note
- It is expected (but not mandated) that f will (directly or indirectly) call tr.run(callable_object).
-
template<typename
F
>
voiddefine_task_block_restore_thread
(F &&f)¶ Constructs a task_block, tr, and invokes the expression f(tr) on the user-provided object, f. This version uses parallel_policy for task scheduling.
Postcondition: All tasks spawned from
f have finished execution. A call to define_task_block_restore_thread always returns on the same thread as that on which it was called.- Template Parameters
F
: The type of the user defined function to invoke inside the define_task_block (deduced). F shall be MoveConstructible.
- Parameters
f
: The user defined function to invoke inside the define_task_block. Given an lvalue tr of type task_block, the expression, (void)f(tr), shall be well-formed.
- Exceptions
An
: exception_list, as specified in Exception Handling.
- Note
- It is expected (but not mandated) that f will (directly or indirectly) call tr.run(callable_object).
-
template<typename
ExPolicy
, typenameI
, typename ...Args
>
util::detail::algorithm_result<ExPolicy>::typefor_loop
(ExPolicy &&policy, typename std::decay<I>::type first, I last, Args&&... args)¶ The for_loop implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
- Return
- The for_loop algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename
I
, typename ...Args
>
voidfor_loop
(typename std::decay<I>::type first, I last, Args&&... args)¶ The for_loop implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
The execution of for_loop without specifying an execution policy is equivalent to specifying parallel::execution::seq as the execution policy.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
-
template<typename ExPolicy, typename I, typename S, typename... Args, &&std::is_integral< S >::value>util::detail::algorithm_result<ExPolicy>::type hpx::parallel::v2::for_loop_strided(ExPolicy && policy, typename std::decay< I >::type first, I last, S stride, Args &&... args)
The for_loop_strided implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.S
: The type of the stride variable. This should be an integral type.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.stride
: Refers to the stride of the iteration steps. This shall have non-zero value and shall be negative only if I has integral type or meets the requirements of a bidirectional iterator.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
- Return
- The for_loop_strided algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename I, typename S, typename... Args, &&std::is_integral< S >::value>void hpx::parallel::v2::for_loop_strided(typename std::decay< I >::type first, I last, S stride, Args &&... args)
The for_loop_strided implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
The execution of for_loop without specifying an execution policy is equivalent to specifying parallel::execution::seq as the execution policy.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.S
: The type of the stride variable. This should be an integral type.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.last
: Refers to the end of the sequence of elements the algorithm will be applied to.stride
: Refers to the stride of the iteration steps. This shall have non-zero value and shall be negative only if I has integral type or meets the requirements of a bidirectional iterator.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
-
template<typename ExPolicy, typename I, typename Size, typename... Args, &&std::is_integral< Size >::value>util::detail::algorithm_result<ExPolicy>::type hpx::parallel::v2::for_loop_n(ExPolicy && policy, I first, Size size, Args &&... args)
The for_loop_n implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.Size
: The type of a non-negative integral value specifying the number of items to iterate over.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.size
: Refers to the number of items the algorithm will be applied to.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
- Return
- The for_loop_n algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename I, typename Size, typename... Args, &&std::is_integral< Size >::value>void hpx::parallel::v2::for_loop_n(I first, Size size, Args &&... args)
The for_loop implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
The execution of for_loop without specifying an execution policy is equivalent to specifying parallel::execution::seq as the execution policy.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.Size
: The type of a non-negative integral value specifying the number of items to iterate over.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.size
: Refers to the number of items the algorithm will be applied to.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
-
template<typename ExPolicy, typename I, typename Size, typename S, typename... Args, &&std::is_integral< Size >::value &&std::is_integral< S >::value>util::detail::algorithm_result<ExPolicy>::type hpx::parallel::v2::for_loop_n_strided(ExPolicy && policy, I first, Size size, S stride, Args &&... args)
The for_loop_n_strided implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
ExPolicy
: The type of the execution policy to use (deduced). It describes the manner in which the execution of the algorithm may be parallelized and the manner in which it applies user-provided function objects.I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.Size
: The type of a non-negative integral value specifying the number of items to iterate over.S
: The type of the stride variable. This should be an integral type.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
policy
: The execution policy to use for the scheduling of the iterations.first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.size
: Refers to the number of items the algorithm will be applied to.stride
: Refers to the stride of the iteration steps. This shall have non-zero value and shall be negative only if I has integral type or meets the requirements of a bidirectional iterator.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
- Return
- The for_loop_n_strided algorithm returns a hpx::future<void> if the execution policy is of type sequenced_task_policy or parallel_task_policy and returns void otherwise.
-
template<typename I, typename Size, typename S, typename... Args, &&std::is_integral< Size >::value &&std::is_integral< S >::value>void hpx::parallel::v2::for_loop_n_strided(I first, Size size, S stride, Args &&... args)
The for_loop_n_strided implements loop functionality over a range specified by integral or iterator bounds. For the iterator case, these algorithms resemble for_each from the Parallelism TS, but leave to the programmer when and if to dereference the iterator.
The execution of for_loop without specifying an execution policy is equivalent to specifying parallel::execution::seq as the execution policy.
Requires:
I shall be an integral type or meet the requirements of an input iterator type. The args parameter pack shall have at least one element, comprising objects returned by invocations of reduction and/or induction function templates followed by exactly one element invocable element-access function, f. f shall meet the requirements of MoveConstructible.- Template Parameters
I
: The type of the iteration variable. This could be an (forward) iterator type or an integral type.Size
: The type of a non-negative integral value specifying the number of items to iterate over.S
: The type of the stride variable. This should be an integral type.Args
: A parameter pack, it’s last element is a function object to be invoked for each iteration, the others have to be either conforming to the induction or reduction concept.
- Parameters
first
: Refers to the beginning of the sequence of elements the algorithm will be applied to.size
: Refers to the number of items the algorithm will be applied to.stride
: Refers to the stride of the iteration steps. This shall have non-zero value and shall be negative only if I has integral type or meets the requirements of a bidirectional iterator.args
: The last element of this parameter pack is the function (object) to invoke, while the remaining elements of the parameter pack are instances of either induction or reduction objects. The function (or function object) which will be invoked for each of the elements in the sequence specified by [first, last) should expose a signature equivalent to:<ignored> pred(I const& a, ...);
The signature does not need to have const&. It will receive the current value of the iteration variable and one argument for each of the induction or reduction objects passed to the algorithms, representing their current values.
Effects: Applies f to each element in the input sequence, with additional arguments corresponding to the reductions and inductions in the args parameter pack. The length of the input sequence is last - first.
The first element in the input sequence is specified by first. Each subsequent element is generated by incrementing the previous element.
Along with an element from the input sequence, for each member of the
args parameter pack excluding f, an additional argument is passed to each application of f as follows:- Note
- As described in the C++ standard, arithmetic on non-random-access iterators is performed using advance and distance.
- Note
- The order of the elements of the input sequence is important for determining ordinal position of an application of f, even though the applications themselves may be unordered.
If the pack member is an object returned by a call to a reduction function listed in section, then the additional argument is a reference to a view of that reduction object. If the pack member is an object returned by a call to induction, then the additional argument is the induction value for that induction object corresponding to the position of the application of f in the input sequence.
Complexity: Applies f exactly once for each element of the input sequence.
Remarks: If f returns a result, the result is ignored.
-
template<typename
T
>
detail::induction_stride_helper<T>induction
(T &&value, std::size_t stride)¶ The function template returns an induction object of unspecified type having a value type and encapsulating an initial value value of that type and, optionally, a stride.
For each element in the input range, a looping algorithm over input sequence S computes an induction value from an induction variable and ordinal position p within S by the formula i + p * stride if a stride was specified or i + p otherwise. This induction value is passed to the element access function.
If the value argument to induction is a non-const lvalue, then that lvalue becomes the live-out object for the returned induction object. For each induction object that has a live-out object, the looping algorithm assigns the value of i + n * stride to the live-out object upon return, where n is the number of elements in the input range.
- Return
- This returns an induction object with value type T, initial value value, and (if specified) stride stride. If T is an lvalue of non-const type, value is used as the live-out object for the induction object; otherwise there is no live-out object.
- Template Parameters
T
: The value type to be used by the induction object.
- Parameters
value
: [in] The initial value to use for the induction objectstride
: [in] The (optional) stride to use for the induction object (default: 1)
-
template<typename
T
, typenameOp
>
detail::reduction_helper<T, typename std::decay<Op>::type>reduction
(T &var, T const &identity, Op &&combiner)¶ The function template returns a reduction object of unspecified type having a value type and encapsulating an identity value for the reduction, a combiner function object, and a live-out object from which the initial value is obtained and into which the final value is stored.
A parallel algorithm uses reduction objects by allocating an unspecified number of instances, called views, of the reduction’s value type. Each view is initialized with the reduction object’s identity value, except that the live-out object (which was initialized by the caller) comprises one of the views. The algorithm passes a reference to a view to each application of an element-access function, ensuring that no two concurrently-executing invocations share the same view. A view can be shared between two applications that do not execute concurrently, but initialization is performed only once per view.
Modifications to the view by the application of element access functions accumulate as partial results. At some point before the algorithm returns, the partial results are combined, two at a time, using the reduction object’s combiner operation until a single value remains, which is then assigned back to the live-out object.
T shall meet the requirements of CopyConstructible and MoveAssignable. The expression var = combiner(var, var) shall be well formed.
- Template Parameters
T
: The value type to be used by the induction object.Op
: The type of the binary function (object) used to perform the reduction operation.
- Parameters
var
: [in,out] The life-out value to use for the reduction object. This will hold the reduced value after the algorithm is finished executing.identity
: [in] The identity value to use for the reduction operation.combiner
: [in] The binary function (object) used to perform a pairwise reduction on the elements.
- Note
- In order to produce useful results, modifications to the view should be limited to commutative operations closely related to the combiner operation. For example if the combiner is plus<T>, incrementing the view would be consistent with the combiner but doubling it or assigning to it would not.
- Return
- This returns a reduction object of unspecified type having a value type of T. When the return value is used by an algorithm, the reference to var is used as the live-out object, new views are initialized to a copy of identity, and views are combined by invoking the copy of combiner, passing it the two views to be combined.
-
template<typename
-
namespace
performance_counters
¶ Functions
-
counter_status
install_counter_type
(std::string const &name, hpx::util::function_nonser<std::int64_t(bool)> const &counter_value, std::string const &helptext = "", std::string const &uom = "", error_code &ec = throws, )¶ Install a new generic performance counter type in a way, which will uninstall it automatically during shutdown.
The function install_counter_type will register a new generic counter type based on the provided function. The counter type will be automatically unregistered during system shutdown. Any consumer querying any instance of this this counter type will cause the provided function to be called and the returned value to be exposed as the counter value.
The counter type is registered such that there can be one counter instance per locality. The expected naming scheme for the counter instances is:
'/objectname{locality#<*>/total}/countername'
where ‘<*>’ is a zero based integer identifying the locality the counter is created on.- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Return
- If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).
- Note
- The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.
- Parameters
name
: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.counter_value
: [in] The function to call whenever the counter value is requested by a consumer.helptext
: [in, optional] A longer descriptive text shown to the user to explain the nature of the counters created from this type.uom
: [in] The unit of measure for the new performance counter type.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
counter_status
install_counter_type
(std::string const &name, hpx::util::function_nonser<std::vector<std::int64_t>(bool)> const &counter_value, std::string const &helptext = "", std::string const &uom = "", error_code &ec = throws, )¶ Install a new generic performance counter type returning an array of values in a way, that will uninstall it automatically during shutdown.
The function install_counter_type will register a new generic counter type that returns an array of values based on the provided function. The counter type will be automatically unregistered during system shutdown. Any consumer querying any instance of this this counter type will cause the provided function to be called and the returned array value to be exposed as the counter value.
The counter type is registered such that there can be one counter instance per locality. The expected naming scheme for the counter instances is:
'/objectname{locality#<*>/total}/countername'
where ‘<*>’ is a zero based integer identifying the locality the counter is created on.- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Return
- If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).
- Note
- The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.
- Parameters
name
: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.counter_value
: [in] The function to call whenever the counter value (array of values) is requested by a consumer.helptext
: [in, optional] A longer descriptive text shown to the user to explain the nature of the counters created from this type.uom
: [in] The unit of measure for the new performance counter type.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
install_counter_type
(std::string const &name, counter_type type, error_code &ec = throws)¶ Install a new performance counter type in a way, which will uninstall it automatically during shutdown.
The function install_counter_type will register a new counter type based on the provided counter_type_info. The counter type will be automatically unregistered during system shutdown.
- Return
- If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).
- Note
- The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
name
: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.type
: [in] The type of the counters of this counter_type.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
counter_status
install_counter_type
(std::string const &name, counter_type type, std::string const &helptext, std::string const &uom = "", std::uint32_t version = HPX_PERFORMANCE_COUNTER_V1, error_code &ec = throws)¶ Install a new performance counter type in a way, which will uninstall it automatically during shutdown.
The function install_counter_type will register a new counter type based on the provided counter_type_info. The counter type will be automatically unregistered during system shutdown.
- Return
- If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).
- Note
- The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
name
: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.type
: [in] The type of the counters of this counter_type.helptext
: [in] A longer descriptive text shown to the user to explain the nature of the counters created from this type.uom
: [in] The unit of measure for the new performance counter type.version
: [in] The version of the counter type. This is currently expected to be set to HPX_PERFORMANCE_COUNTER_V1.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
counter_status
install_counter_type
(std::string const &name, counter_type type, std::string const &helptext, create_counter_func const &create_counter, discover_counters_func const &discover_counters, std::uint32_t version = HPX_PERFORMANCE_COUNTER_V1, std::string const &uom = "", error_code &ec = throws)¶ Install a new generic performance counter type in a way, which will uninstall it automatically during shutdown.
The function install_counter_type will register a new generic counter type based on the provided counter_type_info. The counter type will be automatically unregistered during system shutdown.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Return
- If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).
- Note
- The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.
- Parameters
name
: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.type
: [in] The type of the counters of this counter_type.helptext
: [in] A longer descriptive text shown to the user to explain the nature of the counters created from this type.version
: [in] The version of the counter type. This is currently expected to be set to HPX_PERFORMANCE_COUNTER_V1.create_counter
: [in] The function which will be called to create a new instance of this counter type.discover_counters
: [in] The function will be called to discover counter instances which can be created.uom
: [in] The unit of measure of the counter type (default: “”)ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
counter_status
-
namespace
resource
¶ Typedefs
Enums
-
enum
partitioner_mode
¶ This enumeration describes the modes available when creating a resource partitioner.
Values:
-
mode_default
= 0¶ Default mode.
-
mode_allow_oversubscription
= 1¶ Allow processing units to be oversubscribed, i.e. multiple worker threads to share a single processing unit.
-
mode_allow_dynamic_pools
= 2¶ Allow worker threads to be added and removed from thread pools.
-
-
enum
scheduling_policy
¶ This enumeration lists the available scheduling policies (or schedulers) when creating thread pools.
Values:
-
user_defined
= -2¶
-
unspecified
= -1¶
-
local
= 0¶
-
local_priority_fifo
= 1¶
-
local_priority_lifo
= 2¶
-
static_
= 3¶
-
static_priority
= 4¶
-
abp_priority_fifo
= 5¶
-
abp_priority_lifo
= 6¶
-
-
enum
-
namespace
this_thread
¶ Functions
-
threads::thread_state_ex_enum
suspend
(threads::thread_state_enum state, threads::thread_id_type const &id, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to the thread state passed as the parameter.
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
suspend
(threads::thread_state_enum state = threads::pending, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to the thread state passed as the parameter.
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
suspend
(util::steady_time_point const &abs_time, threads::thread_id_type const &id, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to suspended and schedules a wakeup for this threads at the given time.
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
suspend
(util::steady_time_point const &abs_time, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to suspended and schedules a wakeup for this threads at the given time.
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
suspend
(util::steady_duration const &rel_time, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to suspended and schedules a wakeup for this threads after the given duration.
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
suspend
(util::steady_duration const &rel_time, threads::thread_id_type const &id, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to suspended and schedules a wakeup for this threads after the given duration.
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
suspend
(std::uint64_t ms, util::thread_description const &description = util::thread_description("this_thread::suspend"), error_code &ec = throws)¶ The function suspend will return control to the thread manager (suspends the current thread). It sets the new state of this thread to suspended and schedules a wakeup for this threads after the given time (specified in milliseconds).
- Note
- Must be called from within a HPX-thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::executors::current_executor
get_executor
(error_code &ec = throws)¶ Returns a reference to the executor which was used to create the current thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_pool_base *
get_pool
(error_code &ec = throws)¶ Returns a pointer to the pool that was used to run the current thread
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_state_ex_enum
-
namespace
threads
¶ Enums
-
enum
thread_state_enum
¶ The thread_state_enum enumerator encodes the current state of a thread instance
Values:
-
unknown
= 0¶
-
active
= 1¶ thread is currently active (running, has resources)
-
pending
= 2¶ thread is pending (ready to run, but no hardware resource available)
-
suspended
= 3¶ thread has been suspended (waiting for synchronization event, but still known and under control of the thread-manager)
-
depleted
= 4¶ thread has been depleted (deeply suspended, it is not known to the thread-manager)
-
terminated
= 5¶ thread has been stopped an may be garbage collected
-
staged
= 6¶ this is not a real thread state, but allows to reference staged task descriptions, which eventually will be converted into thread objects
-
pending_do_not_schedule
= 7¶
-
pending_boost
= 8¶
-
-
enum
thread_priority
¶ This enumeration lists all possible thread-priorities for HPX threads.
Values:
-
thread_priority_unknown
= -1¶
-
thread_priority_default
= 0¶ Will assign the priority of the task to the default (normal) priority.
-
thread_priority_low
= 1¶ Task goes onto a special low priority queue and will not be executed until all high/normal priority tasks are done, even if they are added after the low priority task.
-
thread_priority_normal
= 2¶ Task will be executed when it is taken from the normal priority queue, this is usually a first in-first-out ordering of tasks (depending on scheduler choice). This is the default priority.
-
thread_priority_high_recursive
= 3¶ The task is a high priority task and any child tasks spawned by this task will be made high priority as well - unless they are specifically flagged as non default priority.
-
thread_priority_boost
= 4¶ Same as thread_priority_high except that the thread will fall back to thread_priority_normal if resumed after being suspended.
-
thread_priority_high
= 5¶ Task goes onto a special high priority queue and will be executed before normal/low priority tasks are taken (some schedulers modify the behavior slightly and the documentation for those should be consulted).
-
-
enum
thread_state_ex_enum
¶ The thread_state_ex_enum enumerator encodes the reason why a thread is being restarted
Values:
-
wait_unknown
= 0¶
-
wait_signaled
= 1¶ The thread has been signaled.
-
wait_timeout
= 2¶ The thread has been reactivated after a timeout.
-
wait_terminate
= 3¶ The thread needs to be terminated.
-
wait_abort
= 4¶ The thread needs to be aborted.
-
-
enum
thread_stacksize
¶ A thread_stacksize references any of the possible stack-sizes for HPX threads.
Values:
-
thread_stacksize_unknown
= -1¶
-
thread_stacksize_small
= 1¶ use small stack size
-
thread_stacksize_medium
= 2¶ use medium sized stack size
-
thread_stacksize_large
= 3¶ use large stack size
-
thread_stacksize_huge
= 4¶ use very large stack size
-
thread_stacksize_current
= 5¶ use size of current thread’s stack
-
thread_stacksize_default
= thread_stacksize_small¶ use default stack size
-
thread_stacksize_minimal
= thread_stacksize_small¶ use minimally stack size
-
thread_stacksize_maximal
= thread_stacksize_huge¶ use maximally stack size
-
Functions
-
char const *
get_thread_state_name
(thread_state_enum state)¶ Get the readable string representing the name of the given thread_state constant.
-
char const *
get_thread_priority_name
(thread_priority priority)¶ Get the readable string representing the name of the given thread_priority constant.
-
char const *
get_thread_state_ex_name
(thread_state_ex_enum state)¶ Get the readable string representing the name of the given thread_state_ex_enum constant.
-
char const *
get_thread_state_name
(thread_state state)¶ Get the readable string representing the name of the given thread_state constant.
-
char const *
get_stack_size_name
(std::ptrdiff_t size)¶ Get the readable string representing the given stack size constant.
-
thread_self &
get_self
()¶ The function get_self returns a reference to the (OS thread specific) self reference to the current HPX thread.
-
thread_self *
get_self_ptr
()¶ The function get_self_ptr returns a pointer to the (OS thread specific) self reference to the current HPX thread.
-
thread_self_impl_type *
get_ctx_ptr
()¶ The function get_ctx_ptr returns a pointer to the internal data associated with each coroutine.
-
thread_self *
get_self_ptr_checked
(error_code &ec = throws)¶ The function get_self_ptr_checked returns a pointer to the (OS thread specific) self reference to the current HPX thread.
-
thread_id_type
get_self_id
()¶ The function get_self_id returns the HPX thread id of the current thread (or zero if the current thread is not a HPX thread).
-
thread_id_type
get_parent_id
()¶ The function get_parent_id returns the HPX thread id of the current thread’s parent (or zero if the current thread is not a HPX thread).
- Note
- This function will return a meaningful value only if the code was compiled with HPX_HAVE_THREAD_PARENT_REFERENCE being defined.
-
std::size_t
get_parent_phase
()¶ The function get_parent_phase returns the HPX phase of the current thread’s parent (or zero if the current thread is not a HPX thread).
- Note
- This function will return a meaningful value only if the code was compiled with HPX_HAVE_THREAD_PARENT_REFERENCE being defined.
-
std::size_t
get_self_stacksize
()¶ The function get_self_stacksize returns the stack size of the current thread (or zero if the current thread is not a HPX thread).
-
std::uint32_t
get_parent_locality_id
()¶ The function get_parent_locality_id returns the id of the locality of the current thread’s parent (or zero if the current thread is not a HPX thread).
- Note
- This function will return a meaningful value only if the code was compiled with HPX_HAVE_THREAD_PARENT_REFERENCE being defined.
-
std::uint64_t
get_self_component_id
()¶ The function get_self_component_id returns the lva of the component the current thread is acting on
- Note
- This function will return a meaningful value only if the code was compiled with HPX_HAVE_THREAD_TARGET_ADDRESS being defined.
-
std::int64_t
get_thread_count
(thread_state_enum state = unknown)¶ The function get_thread_count returns the number of currently known threads.
- Note
- If state == unknown this function will not only return the number of currently existing threads, but will add the number of registered task descriptions (which have not been converted into threads yet).
- Parameters
state
: [in] This specifies the thread-state for which the number of threads should be retrieved.
-
std::int64_t
get_thread_count
(thread_priority priority, thread_state_enum state = unknown)¶ The function get_thread_count returns the number of currently known threads.
- Note
- If state == unknown this function will not only return the number of currently existing threads, but will add the number of registered task descriptions (which have not been converted into threads yet).
- Parameters
priority
: [in] This specifies the thread-priority for which the number of threads should be retrieved.state
: [in] This specifies the thread-state for which the number of threads should be retrieved.
-
bool
enumerate_threads
(util::function_nonser<bool(thread_id_type)> const &f, thread_state_enum state = unknown, )¶ The function enumerate_threads will invoke the given function f for each thread with a matching thread state.
- Parameters
f
: [in] The function which should be called for each matching thread. Returning ‘false’ from this function will stop the enumeration process.state
: [in] This specifies the thread-state for which the threads should be enumerated.
-
thread_state
set_thread_state
(thread_id_type const &id, thread_state_enum state = pending, thread_state_ex_enum stateex = wait_signaled, thread_priority priority = thread_priority_normal, bool retry_on_active = true, hpx::error_code &ec = throws)¶ Set the thread state of the thread referenced by the thread_id id.
- Note
- If the thread referenced by the parameter id is in thread_state::active state this function schedules a new thread which will set the state of the thread as soon as its not active anymore. The function returns thread_state::active in this case.
- Return
- This function returns the previous state of the thread referenced by the id parameter. It will return one of the values as defined by the thread_state enumeration. If the thread is not known to the thread-manager the return value will be thread_state::unknown.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread the state should be modified for.state
: [in] The new state to be set for the thread referenced by the id parameter.stateex
: [in] The new extended state to be set for the thread referenced by the id parameter.priority
:ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
thread_id_type
set_thread_state
(thread_id_type const &id, util::steady_time_point const &abs_time, std::atomic<bool> *started, thread_state_enum state = pending, thread_state_ex_enum stateex = wait_timeout, thread_priority priority = thread_priority_normal, bool retry_on_active = true, error_code &ec = throws)¶ Set the thread state of the thread referenced by the thread_id id.
Set a timer to set the state of the given thread to the given new value after it expired (at the given time)
- Return
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread the state should be modified for.abs_time
: [in] Absolute point in time for the new thread to be runstarted
: [in,out] A helper variable allowing to track the state of the timer helper threadstate
: [in] The new state to be set for the thread referenced by the id parameter.stateex
: [in] The new extended state to be set for the thread referenced by the id parameter.priority
:ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
thread_id_type
set_thread_state
(thread_id_type const &id, util::steady_time_point const &abs_time, thread_state_enum state = pending, thread_state_ex_enum stateex = wait_timeout, thread_priority priority = thread_priority_normal, bool retry_on_active = true, error_code& = throws)¶
-
thread_id_type
set_thread_state
(thread_id_type const &id, util::steady_duration const &rel_time, thread_state_enum state = pending, thread_state_ex_enum stateex = wait_timeout, thread_priority priority = thread_priority_normal, bool retry_on_active = true, error_code &ec = throws)¶ Set the thread state of the thread referenced by the thread_id id.
Set a timer to set the state of the given thread to the given new value after it expired (after the given duration)
- Return
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread the state should be modified for.rel_time
: [in] Time duration after which the new thread should be runstate
: [in] The new state to be set for the thread referenced by the id parameter.stateex
: [in] The new extended state to be set for the thread referenced by the id parameter.priority
:ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
util::thread_description
get_thread_description
(thread_id_type const &id, error_code &ec = throws)¶ The function get_thread_description is part of the thread related API allows to query the description of one of the threads known to the thread-manager.
- Return
- This function returns the description of the thread referenced by the id parameter. If the thread is not known to the thread-manager the return value will be the string “<unknown>”.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread being queried.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
util::thread_description
set_thread_description
(thread_id_type const &id, util::thread_description const &desc = util::thread_description(), error_code &ec = throws)¶
-
util::thread_description
get_thread_lco_description
(thread_id_type const &id, error_code &ec = throws)¶
-
util::thread_description
set_thread_lco_description
(thread_id_type const &id, util::thread_description const &desc = util::thread_description(), error_code &ec = throws)¶
-
thread_state
get_thread_state
(thread_id_type const &id, error_code &ec = throws)¶ The function get_thread_backtrace is part of the thread related API allows to query the currently stored thread back trace (which is captured during thread suspension).
- Return
- This function returns the currently captured stack back trace of the thread referenced by the id parameter. If the thread is not known to the thread-manager the return value will be the zero.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception. The function get_thread_state is part of the thread related API. It queries the state of one of the threads known to the thread-manager.
- Return
- This function returns the thread state of the thread referenced by the id parameter. If the thread is not known to the thread-manager the return value will be terminated.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread being queried.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
- Parameters
id
: [in] The thread id of the thread the state should be modified for.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::size_t
get_thread_phase
(thread_id_type const &id, error_code &ec = throws)¶ The function get_thread_phase is part of the thread related API. It queries the phase of one of the threads known to the thread-manager.
- Return
- This function returns the thread phase of the thread referenced by the id parameter. If the thread is not known to the thread-manager the return value will be ~0.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread the phase should be modified for.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::size_t
get_numa_node_number
()¶
-
bool
get_thread_interruption_enabled
(thread_id_type const &id, error_code &ec = throws)¶ Returns whether the given thread can be interrupted at this point.
- Return
- This function returns true if the given thread can be interrupted at this point in time. It will return false otherwise.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread which should be queried.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
bool
set_thread_interruption_enabled
(thread_id_type const &id, bool enable, error_code &ec = throws)¶ Set whether the given thread can be interrupted at this point.
- Return
- This function returns the previous value of whether the given thread could have been interrupted.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread which should receive the new value.enable
: [in] This value will determine the new interruption enabled status for the given thread.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
bool
get_thread_interruption_requested
(thread_id_type const &id, error_code &ec = throws)¶ Returns whether the given thread has been flagged for interruption.
- Return
- This function returns true if the given thread was flagged for interruption. It will return false otherwise.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread which should be queried.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
interrupt_thread
(thread_id_type const &id, bool flag, error_code &ec = throws)¶ Flag the given thread for interruption.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread which should be interrupted.flag
: [in] The flag encodes whether the thread should be interrupted (if it is true), or ‘uninterrupted’ (if it is false).ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
void
interrupt_thread
(thread_id_type const &id, error_code &ec = throws)¶
-
void
interruption_point
(thread_id_type const &id, error_code &ec = throws)¶ Interrupt the current thread at this point if it was canceled. This will throw a thread_interrupted exception, which will cancel the thread.
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread which should be interrupted.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
threads::thread_priority
get_thread_priority
(thread_id_type const &id, error_code &ec = throws)¶ Return priority of the given thread
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread whose priority is queried.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
std::ptrdiff_t
get_stack_size
(thread_id_type const &id, error_code &ec = throws)¶ Return stack size of the given thread
- Note
- As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
id
: [in] The thread id of the thread whose priority is queried.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
threads::executors::current_executor
get_executor
(thread_id_type const &id, error_code &ec = throws)¶ Returns a reference to the executor which was used to create the given thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
threads::thread_pool_base *
get_pool
(thread_id_type const &id, error_code &ec = throws)¶ Returns a pointer to the pool that was used to run the current thread
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
enum
-
namespace
policies
¶ Enums
-
enum
scheduler_mode
¶ This enumeration describes the possible modes of a scheduler.
Values:
-
nothing_special
= 0¶ can be used to disable all other options.
As the name suggests, this option
-
do_background_work
= 0x1¶ The scheduler will periodically call a provided callback function from a special HPX thread to enable performing background-work, for instance driving networking progress or garbage-collect AGAS.
-
reduce_thread_priority
= 0x02¶ os-thread driving the scheduler will be reduced below normal.
The kernel priority of the
-
delay_exit
= 0x04¶ The scheduler will wait for some unspecified amount of time before exiting the scheduling loop while being terminated to make sure no other work is being scheduled during processing the shutdown request.
Some schedulers have the capability to act as ‘embedded’ schedulers. In this case it needs to periodically invoke a provided callback into the outer scheduler more frequently than normal. This option enables this behavior.
-
enable_elasticity
= 0x10¶ This option allows for the scheduler to dynamically increase and reduce the number of processing units it runs on. Setting this value not succeed for schedulers that do not support this functionality.
-
enable_stealing
= 0x20¶ schedulers to explicitly disable thread stealing
This option allows for certain
-
enable_idle_backoff
= 0x40¶ schedulers to explicitly disable exponential idle-back off
This option allows for certain
-
default_mode
= do_background_work | reduce_thread_priority | delay_exit | enable_stealing | enable_idle_backoff¶ This option represents the default mode.
-
all_flags
= do_background_work | reduce_thread_priority | delay_exit | fast_idle_mode | enable_elasticity | enable_stealing | enable_idle_backoff¶
-
-
enum
-
namespace
traits
¶
-
namespace
util
¶ Functions
-
std::ostream &
operator<<
(std::ostream &ost, checkpoint const &ckp)¶ Operator<< Overload
This overload is the main way to write data from a checkpoint to an object such as a file. Inside the function, the size of the checkpoint will be written to the stream before the checkpoint’s data. The operator>> overload uses this to read the correct number of bytes. Be mindful of this additional write and read when you use different facilities to write out or read in data to a checkpoint!
- Parameters
ost
: Output stream to write to.ckp
: Checkpoint to copy from.
- Return
- Operator<< returns the ostream object.
-
std::istream &
operator>>
(std::istream &ist, checkpoint &ckp)¶ Operator>> Overload
This overload is the main way to read in data from an object such as a file to a checkpoint. It is important to note that inside the function, the first variable to be read is the size of the checkpoint. This size variable is written to the stream before the checkpoint’s data in the operator<< overload. Be mindful of this additional read and write when you use different facilities to read in or write out data from a checkpoint!
- Parameters
ist
: Input stream to write from.ckp
: Checkpoint to write to.
- Return
- Operator>> returns the ostream object.
-
template<typename
T
, typename ...Ts
, typenameU
= typename std::enable_if<!hpx::traits::is_launch_policy<T>::value && !std::is_same<typename std::decay<T>::type, checkpoint>::value>::type>
hpx::future<checkpoint>save_checkpoint
(T &&t, Ts&&... ts)¶ Save_checkpoint
Save_checkpoint takes any number of objects which a user may wish to store and returns a future to a checkpoint object. Additionally the function can take a policy as a first object which changes its behavior depending on the policy passed to it. Most notably, if a sync policy is used save_checkpoint will simply return a checkpoint object.
- Template Parameters
T
: Containers passed to save_checkpoint to be serialized and placed into a checkpoint object.Ts
: More containers passed to save_checkpoint to be serialized and placed into a checkpoint object.U
: This parameter is used to make sure that T is not a launch policy or a checkpoint. This forces the compiler to choose the correct overload.
- Parameters
t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
- Return
- Save_checkpoint returns a future to a checkpoint with one exception: if you pass hpx::launch::sync as the first argument. In this case save_checkpoint will simply return a checkpoint.
-
template<typename
T
, typename ...Ts
>
hpx::future<checkpoint>save_checkpoint
(checkpoint &&c, T &&t, Ts&&... ts)¶ Save_checkpoint - Take a pre-initialized checkpoint
Save_checkpoint takes any number of objects which a user may wish to store and returns a future to a checkpoint object. Additionally the function can take a policy as a first object which changes its behavior depending on the policy passed to it. Most notably, if a sync policy is used save_checkpoint will simply return a checkpoint object.
- Template Parameters
T
: Containers passed to save_checkpoint to be serialized and placed into a checkpoint object.Ts
: More containers passed to save_checkpoint to be serialized and placed into a checkpoint object.
- Parameters
c
: Takes a pre-initialized checkpoint to copy data into.t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
- Return
- Save_checkpoint returns a future to a checkpoint with one exception: if you pass hpx::launch::sync as the first argument. In this case save_checkpoint will simply return a checkpoint.
-
template<typename
T
, typename ...Ts
>
hpx::future<checkpoint>save_checkpoint
(hpx::launch p, T &&t, Ts&&... ts)¶ Save_checkpoint - Policy overload
Save_checkpoint takes any number of objects which a user may wish to store and returns a future to a checkpoint object. Additionally the function can take a policy as a first object which changes its behavior depending on the policy passed to it. Most notably, if a sync policy is used save_checkpoint will simply return a checkpoint object.
- Template Parameters
T
: Containers passed to save_checkpoint to be serialized and placed into a checkpoint object.Ts
: More containers passed to save_checkpoint to be serialized and placed into a checkpoint object.
- Parameters
p
: Takes an HPX launch policy. Allows the user to change the way the function is launched i.e. async, sync, etc.t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
- Return
- Save_checkpoint returns a future to a checkpoint with one exception: if you pass hpx::launch::sync as the first argument. In this case save_checkpoint will simply return a checkpoint.
-
template<typename
T
, typename ...Ts
>
hpx::future<checkpoint>save_checkpoint
(hpx::launch p, checkpoint &&c, T &&t, Ts&&... ts)¶ Save_checkpoint - Policy overload & pre-initialized checkpoint
Save_checkpoint takes any number of objects which a user may wish to store and returns a future to a checkpoint object. Additionally the function can take a policy as a first object which changes its behavior depending on the policy passed to it. Most notably, if a sync policy is used save_checkpoint will simply return a checkpoint object.
- Template Parameters
T
: Containers passed to save_checkpoint to be serialized and placed into a checkpoint object.Ts
: More containers passed to save_checkpoint to be serialized and placed into a checkpoint object.
- Parameters
p
: Takes an HPX launch policy. Allows the user to change the way the function is launched i.e. async, sync, etc.c
: Takes a pre-initialized checkpoint to copy data into.t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
- Return
- Save_checkpoint returns a future to a checkpoint with one exception: if you pass hpx::launch::sync as the first argument. In this case save_checkpoint will simply return a checkpoint.
-
template<typename
T
, typename ...Ts
, typenameU
= typename std::enable_if<!std::is_same<typename std::decay<T>::type, checkpoint>::value>::type>
checkpointsave_checkpoint
(hpx::launch::sync_policy sync_p, T &&t, Ts&&... ts)¶ Save_checkpoint - Sync_policy overload
Save_checkpoint takes any number of objects which a user may wish to store and returns a future to a checkpoint object. Additionally the function can take a policy as a first object which changes its behavior depending on the policy passed to it. Most notably, if a sync policy is used save_checkpoint will simply return a checkpoint object.
- Template Parameters
T
: Containers passed to save_checkpoint to be serialized and placed into a checkpoint object.Ts
: More containers passed to save_checkpoint to be serialized and placed into a checkpoint object.U
: This parameter is used to make sure that T is not a checkpoint. This forces the compiler to choose the correct overload.
- Parameters
sync_p
: hpx::launch::sync_policyt
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
- Return
- Save_checkpoint which is passed hpx::launch::sync_policy will return a checkpoint which contains the serialized values checkpoint.
-
template<typename
T
, typename ...Ts
>
checkpointsave_checkpoint
(hpx::launch::sync_policy sync_p, checkpoint &&c, T &&t, Ts&&... ts)¶ Save_checkpoint - Sync_policy overload & pre-init. checkpoint
Save_checkpoint takes any number of objects which a user may wish to store and returns a future to a checkpoint object. Additionally the function can take a policy as a first object which changes its behavior depending on the policy passed to it. Most notably, if a sync policy is used save_checkpoint will simply return a checkpoint object.
- Template Parameters
T
: Containers passed to save_checkpoint to be serialized and placed into a checkpoint object.Ts
: More containers passed to save_checkpoint to be serialized and placed into a checkpoint object.
- Parameters
sync_p
: hpx::launch::sync_policyc
: Takes a pre-initialized checkpoint to copy data into.t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
- Return
- Save_checkpoint which is passed hpx::launch::sync_policy will return a checkpoint which contains the serialized values checkpoint.
-
template<typename
T
, typename ...Ts
>
voidrestore_checkpoint
(checkpoint const &c, T &t, Ts&... ts)¶ Resurrect
Restore_checkpoint takes a checkpoint object as a first argument and the containers which will be filled from the byte stream (in the same order as they were placed in save_checkpoint).
- Return
- Restore_checkpoint returns void.
- Template Parameters
T
: A container to restore.Ts
: Other containers to restore. Containers must be in the same order that they were inserted into the checkpoint.
- Parameters
c
: The checkpoint to restore.t
: A container to restore.ts
: Other containers to restore Containers must be in the same order that they were inserted into the checkpoint.
-
void
attach_debugger
()¶ Tries to break an attached debugger, if not supported a loop is invoked which gives enough time to attach a debugger manually.
-
template<typename F, typename ... Ts>HPX_HOST_DEVICE util::invoke_result<F, Ts...>::type hpx::util::invoke(F && f, Ts &&... vs)
Invokes the given callable object f with the content of the argument pack vs
- Return
- The result of the callable object when it’s called with the given argument types.
- Note
- This function is similar to
std::invoke
(C++17) - Parameters
f
: Requires to be a callable object. If f is a member function pointer, the first argument in the pack will be treated as the callee (this object).vs
: An arbitrary pack of arguments
- Exceptions
std::exception
: like objects thrown by call to object f with the argument types vs.
-
template<typename R, typename F, typename ... Ts>HPX_HOST_DEVICE R hpx::util::invoke_r(F && f, Ts &&... vs)
Invokes the given callable object f with the content of the argument pack vs
- Return
- The result of the callable object when it’s called with the given argument types.
- Note
- This function is similar to
std::invoke
(C++17) - Parameters
f
: Requires to be a callable object. If f is a member function pointer, the first argument in the pack will be treated as the callee (this object).vs
: An arbitrary pack of arguments
- Exceptions
std::exception
: like objects thrown by call to object f with the argument types vs.
- Template Parameters
R
: The result type of the function when it’s called with the content of the given argument types vs.
-
template<typename F, typename Tuple>HPX_HOST_DEVICE detail::invoke_fused_result<F, Tuple>::type hpx::util::invoke_fused(F && f, Tuple && t)
Invokes the given callable object f with the content of the sequenced type t (tuples, pairs)
- Return
- The result of the callable object when it’s called with the content of the given sequenced type.
- Note
- This function is similar to
std::apply
(C++17) - Parameters
f
: Must be a callable object. If f is a member function pointer, the first argument in the sequenced type will be treated as the callee (this object).t
: A type which is content accessible through a call to hpx::util::get.
- Exceptions
std::exception
: like objects thrown by call to object f with the arguments contained in the sequenceable type t.
-
template<typename R, typename F, typename Tuple>HPX_HOST_DEVICE R hpx::util::invoke_fused_r(F && f, Tuple && t)
Invokes the given callable object f with the content of the sequenced type t (tuples, pairs)
- Return
- The result of the callable object when it’s called with the content of the given sequenced type.
- Note
- This function is similar to
std::apply
(C++17) - Parameters
f
: Must be a callable object. If f is a member function pointer, the first argument in the sequenced type will be treated as the callee (this object).t
: A type which is content accessible through a call to hpx::util::get.
- Exceptions
std::exception
: like objects thrown by call to object f with the arguments contained in the sequenceable type t.
- Template Parameters
R
: The result type of the function when it’s called with the content of the given sequenced type.
-
template<typename Mapper, typename... T><unspecified> hpx::util::map_pack(Mapper && mapper, T &&... pack)
Maps the pack with the given mapper.
This function tries to visit all plain elements which may be wrapped in:
- homogeneous containers (
std::vector
,std::list
) - heterogenous containers
(hpx::tuple
,std::pair
,std::array
) and re-assembles the pack with the result of the mapper. Mapping from one type to a different one is supported.
Elements that aren’t accepted by the mapper are routed through and preserved through the hierarchy.
// Maps all integers to floats map_pack([](int value) { return float(value); }, 1, hpx::util::make_tuple(2, std::vector<int>{3, 4}), 5);
- Return
- The mapped element or in case the pack contains multiple elements, the pack is wrapped into a
hpx::tuple
. - Exceptions
std::exception
: like objects which are thrown by an invocation to the mapper.
- Parameters
mapper
: A callable object, which accept an arbitrary type and maps it to another type or the same one.pack
: An arbitrary variadic pack which may contain any type.
- homogeneous containers (
-
template<typename
Visitor
, typename ...T
>
autotraverse_pack_async
(Visitor &&visitor, T&&... pack)¶ Traverses the pack with the given visitor in an asynchronous way.
This function works in the same way as
traverse_pack
, however, we are able to suspend and continue the traversal at later time. Thus we require a visitor callable object which provides threeoperator()
overloads as depicted by the code sample below:struct my_async_visitor { template <typename T> bool operator()(async_traverse_visit_tag, T&& element) { return true; } template <typename T, typename N> void operator()(async_traverse_detach_tag, T&& element, N&& next) { } template <typename T> void operator()(async_traverse_complete_tag, T&& pack) { } };
See
traverse_pack
for a detailed description about the traversal behavior and capabilities.- Return
- A boost::intrusive_ptr that references an instance of the given visitor object.
- Parameters
visitor
: A visitor object which provides the threeoperator()
overloads that were described above. Additionally the visitor must be compatible for referencing it from aboost::intrusive_ptr
. The visitor should must have a virtual destructor!pack
: The arbitrary parameter pack which is traversed asynchronously. Nested objects inside containers and tuple like types are traversed recursively.
-
template<typename
Allocator
, typenameVisitor
, typename ...T
>
autotraverse_pack_async_allocator
(Allocator const &alloc, Visitor &&visitor, T&&... pack)¶ Traverses the pack with the given visitor in an asynchronous way.
This function works in the same way as
traverse_pack
, however, we are able to suspend and continue the traversal at later time. Thus we require a visitor callable object which provides threeoperator()
overloads as depicted by the code sample below:struct my_async_visitor { template <typename T> bool operator()(async_traverse_visit_tag, T&& element) { return true; } template <typename T, typename N> void operator()(async_traverse_detach_tag, T&& element, N&& next) { } template <typename T> void operator()(async_traverse_complete_tag, T&& pack) { } };
See
traverse_pack
for a detailed description about the traversal behavior and capabilities.- Return
- A boost::intrusive_ptr that references an instance of the given visitor object.
- Parameters
visitor
: A visitor object which provides the threeoperator()
overloads that were described above. Additionally the visitor must be compatible for referencing it from aboost::intrusive_ptr
. The visitor should must have a virtual destructor!pack
: The arbitrary parameter pack which is traversed asynchronously. Nested objects inside containers and tuple like types are traversed recursively.alloc
: Allocator instance to use to create the traversal frame.
-
template<typename ...
Args
>
autounwrap
(Args&&... args)¶ A helper function for retrieving the actual result of any hpx::lcos::future like type which is wrapped in an arbitrary way.
Unwraps the given pack of arguments, so that any hpx::lcos::future object is replaced by its future result type in the argument pack:
hpx::future<int>
->int
hpx::future<std::vector<float>>
->std::vector<float>
std::vector<future<float>>
->std::vector<float>
The function is capable of unwrapping hpx::lcos::future like objects that are wrapped inside any container or tuple like type, see hpx::util::map_pack() for a detailed description about which surrounding types are supported. Non hpx::lcos::future like types are permitted as arguments and passed through.
// Single arguments int i1 = hpx:util::unwrap(hpx::lcos::make_ready_future(0)); // Multiple arguments hpx::tuple<int, int> i2 = hpx:util::unwrap(hpx::lcos::make_ready_future(1), hpx::lcos::make_ready_future(2));
- Note
- This function unwraps the given arguments until the first traversed nested hpx::lcos::future which corresponds to an unwrapping depth of one. See hpx::util::unwrap_n() for a function which unwraps the given arguments to a particular depth or hpx::util::unwrap_all() that unwraps all future like objects recursively which are contained in the arguments.
- Return
- Depending on the count of arguments this function returns a hpx::util::tuple containing the unwrapped arguments if multiple arguments are given. In case the function is called with a single argument, the argument is unwrapped and returned.
- Parameters
args
: the arguments that are unwrapped which may contain any arbitrary future or non future type.
- Exceptions
std::exception
: like objects in case any of the given wrapped hpx::lcos::future objects were resolved through an exception. See hpx::lcos::future::get() for details.
-
template<std::size_t
Depth
, typename ...Args
>
autounwrap_n
(Args&&... args)¶ An alterntive version of hpx::util::unwrap(), which unwraps the given arguments to a certain depth of hpx::lcos::future like objects.
See unwrap for a detailed description.
- Template Parameters
Depth
: The count of hpx::lcos::future like objects which are unwrapped maximally.
-
template<typename ...
Args
>
autounwrap_all
(Args&&... args)¶ An alterntive version of hpx::util::unwrap(), which unwraps the given arguments recursively so that all contained hpx::lcos::future like objects are replaced by their actual value.
See hpx::util::unwrap() for a detailed description.
-
template<typename
T
>
autounwrapping
(T &&callable)¶ Returns a callable object which unwraps its arguments upon invocation using the hpx::util::unwrap() function and then passes the result to the given callable object.
auto callable = hpx::util::unwrapping([](int left, int right) { return left + right; }); int i1 = callable(hpx::lcos::make_ready_future(1), hpx::lcos::make_ready_future(2));
See hpx::util::unwrap() for a detailed description.
- Parameters
callable
: the callable object which which is called with the result of the corresponding unwrap function.
-
template<std::size_t
Depth
, typenameT
>
autounwrapping_n
(T &&callable)¶ Returns a callable object which unwraps its arguments upon invocation using the hpx::util::unwrap_n() function and then passes the result to the given callable object.
See hpx::util::unwrapping() for a detailed description.
-
template<typename
T
>
autounwrapping_all
(T &&callable)¶ Returns a callable object which unwraps its arguments upon invocation using the hpx::util::unwrap_all() function and then passes the result to the given callable object.
See hpx::util::unwrapping() for a detailed description.
-
std::ostream &
-
namespace
functional
¶
-
file
migrate_from_storage.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/error_code.hpp>#include <hpx/lcos/detail/future_data.hpp>#include <hpx/lcos/local/detail/condition_variable.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/util/steady_clock.hpp>#include <boost/intrusive/slist.hpp>#include <cstddef>#include <mutex>#include <utility>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <type_traits>#include <hpx/runtime/threads/coroutines/detail/get_stack_pointer.hpp>#include <limits>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/runtime/get_os_thread_count.hpp>#include <hpx/runtime/threads/cpu_mask.hpp>#include <hpx/util/assert.hpp>#include <climits>#include <cstdint>#include <string>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/runtime/threads/topology.hpp>#include <hpx/compat/thread.hpp>#include <thread>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/runtime/resource/partitioner_fwd.hpp>#include <hpx/runtime/threads/policies/callback_notifier.hpp>#include <hpx/runtime/threads_fwd.hpp>#include <hpx/util/function.hpp>#include <exception>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <memory>#include <hpx/util/spinlock.hpp>#include <hpx/util/itt_notify.hpp>#include <hpx/util/register_locks.hpp>#include <boost/smart_ptr/detail/spinlock.hpp>#include <hpx/util/static.hpp>#include <hpx/compat/mutex.hpp>#include <iosfwd>#include <vector>#include <hwloc.h>#include <hpx/util/atomic_count.hpp>#include <atomic>#include <hpx/util/thread_description.hpp>#include <hpx/util/unique_function.hpp>#include <boost/intrusive_ptr.hpp>#include <chrono>#include <hpx/runtime/threads/thread_helpers.hpp>#include <hpx/throw_exception.hpp>#include <hpx/traits/future_access.hpp>#include <hpx/traits/future_traits.hpp>#include <hpx/traits/is_future.hpp>#include <boost/ref.hpp>#include <functional>#include <hpx/traits/get_remote_result.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/assert_owns_lock.hpp>#include <hpx/traits/has_member_xxx.hpp>#include <hpx/util/bind.hpp>#include <hpx/traits/get_function_address.hpp>#include <hpx/traits/get_function_annotation.hpp>#include <hpx/traits/is_action.hpp>#include <hpx/traits/is_bind_expression.hpp>#include <hpx/traits/is_placeholder.hpp>#include <boost/bind/arg.hpp>#include <hpx/util/decay.hpp>#include <hpx/util/detail/pack.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/invoke_fused.hpp>#include <hpx/util/result_of.hpp>#include <hpx/util/tuple.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/util/one_shot.hpp>#include <hpx/util/unused.hpp>#include <boost/container/small_vector.hpp>#include <hpx/lcos/detail/future_traits.hpp>#include <hpx/util/always_void.hpp>#include <iterator>#include <hpx/lcos_fwd.hpp>#include <hpx/traits/is_component.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/traits/promise_remote_result.hpp>#include <hpx/runtime/actions/continuation_fwd.hpp>#include <hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory.hpp>#include <hpx/preprocessor/stringize.hpp>#include <hpx/preprocessor/strip_parens.hpp>#include <hpx/runtime/serialization/detail/non_default_constructible.hpp>#include <hpx/traits/needs_automatic_registration.hpp>#include <hpx/traits/polymorphic_traits.hpp>#include <hpx/traits/has_xxx.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/util/debug/demangle_helper.hpp>#include <hpx/util/jenkins_hash.hpp>#include <typeinfo>#include <unordered_map>#include <hpx/traits/acquire_shared_state.hpp>#include <hpx/util/range.hpp>#include <hpx/traits/detail/reserve.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/traits/is_future_range.hpp>#include <algorithm>#include <hpx/traits/concepts.hpp>#include <hpx/traits/future_then_result.hpp>#include <hpx/util/identity.hpp>#include <hpx/util/lazy_conditional.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <hpx/traits/executor_traits.hpp>#include <hpx/util/detected.hpp>#include <hpx/util/allocator_deleter.hpp>#include <hpx/util/internal_allocator.hpp>#include <hpx/util/lazy_enable_if.hpp>#include <hpx/util/serialize_exception.hpp>#include <hpx/lcos/local/packaged_continuation.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/execution_fwd.hpp>#include <hpx/parallel/executors/fused_bulk_execute.hpp>#include <hpx/util/deferred_call.hpp>#include <hpx/exception_list.hpp>#include <hpx/exception.hpp>#include <boost/system/error_code.hpp>#include <list>#include <hpx/lcos/dataflow.hpp>#include <hpx/lcos/detail/future_transforms.hpp>#include <hpx/traits/acquire_future.hpp>#include <array>#include <hpx/runtime/get_worker_thread_num.hpp>#include <hpx/traits/extract_action.hpp>#include <hpx/util/pack_traversal_async.hpp>#include <hpx/util/detail/pack_traversal_async_impl.hpp>#include <hpx/util/detail/container_category.hpp>#include <hpx/traits/is_tuple_like.hpp>#include <hpx/parallel/executors/parallel_executor.hpp>#include <hpx/async_launch_policy_dispatch.hpp>#include <hpx/lcos/async_fwd.hpp>#include <hpx/lcos/local/futures_factory.hpp>#include <hpx/lcos/local/latch.hpp>#include <hpx/util/cache_aligned_data.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/traits/is_iterator.hpp>#include <boost/iterator/iterator_categories.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <cstdlib>#include <hpx/parallel/executors/post_policy_dispatch.hpp>#include <hpx/parallel/executors/static_chunk_size.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/runtime/serialization/access.hpp>#include <hpx/runtime/serialization/brace_initializable_fwd.hpp>#include <hpx/traits/brace_initializable_traits.hpp>#include <hpx/runtime/serialization/input_archive.hpp>#include <hpx/runtime/serialization/basic_archive.hpp>#include <iostream>#include <map>#include <hpx/runtime/serialization/detail/raw_ptr.hpp>#include <hpx/runtime/serialization/detail/pointer.hpp>#include <hpx/runtime/serialization/detail/polymorphic_id_factory.hpp>#include <hpx/runtime/serialization/detail/polymorphic_intrusive_factory.hpp>#include <hpx/runtime/serialization/string.hpp>#include <hpx/runtime/serialization/input_container.hpp>#include <hpx/runtime/serialization/binary_filter.hpp>#include <hpx/runtime/serialization/container.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/util/spinlock_pool.hpp>#include <hpx/util/fibhash.hpp>#include <boost/version.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/traits/is_bitwise_serializable.hpp>#include <hpx/util/detail/yield_k.hpp>#include <hpx/runtime/naming/id_type_impl.hpp>#include <hpx/runtime/serialization/serialization_chunk.hpp>#include <cstring>#include <hpx/traits/serialization_access_data.hpp>#include <boost/cstdint.hpp>#include <boost/predef/other/endian.h>#include <hpx/runtime/serialization/output_archive.hpp>#include <hpx/runtime/serialization/output_container.hpp>#include <hpx/runtime/serialization/detail/polymorphic_nonintrusive_factory_impl.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <hpx/parallel/executors/execution_parameters_fwd.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/util/detail/unwrap_impl.hpp>#include <hpx/util/pack_traversal.hpp>#include <hpx/util/detail/pack_traversal_impl.hpp>#include <hpx/lcos/wait_all.hpp>#include <hpx/traits/detail/wrap_int.hpp>#include <stdexcept>#include <hpx/components/component_storage/server/migrate_from_storage.hpp>#include <hpx/runtime/components/runtime_support.hpp>#include <hpx/runtime/applier/applier.hpp>#include <hpx/runtime/agas_fwd.hpp>#include <hpx/runtime/applier_fwd.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <hpx/traits/component_type_database.hpp>#include <hpx/util_fwd.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime/parcelset/parcel.hpp>#include <hpx/runtime/actions_fwd.hpp>#include <hpx/runtime/parcelset_fwd.hpp>#include <hpx/util/thread_specific_ptr.hpp>#include <boost/thread/tss.hpp>#include <hpx/runtime/components/stubs/runtime_support.hpp>#include <hpx/async.hpp>#include <hpx/lcos/async.hpp>#include <hpx/lcos/detail/async_implementations.hpp>#include <hpx/lcos/detail/async_implementations_fwd.hpp>#include <hpx/lcos/packaged_action.hpp>#include <hpx/lcos/promise.hpp>#include <hpx/lcos/detail/promise_base.hpp>#include <hpx/lcos/detail/promise_lco.hpp>#include <hpx/lcos/base_lco_with_value.hpp>#include <hpx/lcos/base_lco.hpp>#include <hpx/runtime/actions/basic_action.hpp>#include <hpx/lcos/sync_fwd.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/runtime/components/pinned_ptr.hpp>#include <hpx/runtime/get_lva.hpp>#include <hpx/runtime/components_fwd.hpp>#include <hpx/traits/managed_component_policies.hpp>#include <hpx/traits/action_decorate_function.hpp>#include <hpx/traits/component_pin_support.hpp>#include <hpx/runtime/serialization/base_object.hpp>#include <hpx/runtime/threads/thread_init_data.hpp>#include <hpx/traits/action_remote_result.hpp>#include <hpx/runtime/actions/basic_action_fwd.hpp>#include <hpx/runtime/actions/continuation.hpp>#include <hpx/runtime/actions/action_priority.hpp>#include <hpx/traits/action_priority.hpp>#include <hpx/runtime/actions/trigger.hpp>#include <hpx/runtime/agas/interface.hpp>#include <boost/dynamic_bitset.hpp>#include <hpx/runtime/trigger_lco.hpp>#include <hpx/runtime/applier/detail/apply_implementations_fwd.hpp>#include <hpx/traits/is_continuation.hpp>#include <hpx/util/logging.hpp>#include <hpx/runtime/actions/detail/action_factory.hpp>#include <hpx/runtime/actions/detail/invocation_count_registry.hpp>#include <hpx/performance_counters/counters_fwd.hpp>#include <hpx/runtime/actions/preassigned_action_id.hpp>#include <hpx/runtime/actions/transfer_action.hpp>#include <hpx/runtime/actions/transfer_base_action.hpp>#include <hpx/runtime/actions/base_action.hpp>#include <hpx/runtime/threads/thread_id_type.hpp>#include <hpx/runtime/serialization/unique_ptr.hpp>#include <hpx/traits/action_does_termination_detection.hpp>#include <hpx/traits/action_message_handler.hpp>#include <hpx/traits/action_schedule_thread.hpp>#include <hpx/traits/action_serialization_filter.hpp>#include <hpx/traits/action_stacksize.hpp>#include <hpx/traits/action_was_object_migrated.hpp>#include <hpx/util/get_and_reset_value.hpp>#include <hpx/runtime/applier/apply_helper.hpp>#include <hpx/runtime_fwd.hpp>#include <hpx/runtime/basename_registration_fwd.hpp>#include <hpx/components_fwd.hpp>#include <hpx/runtime/components/make_client.hpp>#include <hpx/traits/is_client.hpp>#include <hpx/runtime/config_entry.hpp>#include <hpx/runtime/find_localities.hpp>#include <hpx/runtime/get_colocation_id.hpp>#include <hpx/runtime/get_locality_id.hpp>#include <hpx/runtime/get_locality_name.hpp>#include <hpx/runtime/get_num_localities.hpp>#include <hpx/runtime/get_thread_name.hpp>#include <hpx/runtime/report_error.hpp>#include <hpx/runtime/runtime_fwd.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/runtime/set_parcel_write_handler.hpp>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/runtime/startup_function.hpp>#include <hpx/state.hpp>#include <hpx/traits/action_continuation.hpp>#include <hpx/traits/action_decorate_continuation.hpp>#include <hpx/traits/action_select_direct_execution.hpp>#include <hpx/runtime/parcelset/detail/per_action_data_counter_registry.hpp>#include <hpx/runtime/actions/transfer_continuation_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <boost/utility/string_ref.hpp>#include <sstream>#include <hpx/runtime/actions/component_action.hpp>#include <hpx/runtime/components/server/managed_component_base.hpp>#include <hpx/runtime/components/server/create_component_fwd.hpp>#include <hpx/runtime/components/server/component_heap.hpp>#include <hpx/util/reinitializable_static.hpp>#include <hpx/util/bind_front.hpp>#include <hpx/util/static_reinit.hpp>#include <hpx/runtime/components/server/wrapper_heap.hpp>#include <hpx/util/generate_unique_ids.hpp>#include <hpx/util/wrapper_heap_base.hpp>#include <new>#include <hpx/runtime/components/server/wrapper_heap_list.hpp>#include <hpx/util/one_size_heap_list.hpp>#include <hpx/util/unlock_guard.hpp>#include <hpx/plugins/parcel/coalescing_message_handler_registration.hpp>#include <hpx/runtime/components/server/component_base.hpp>#include <hpx/util/ini.hpp>#include <boost/lexical_cast.hpp>#include <hpx/lcos/local/promise.hpp>#include <boost/utility/swap.hpp>#include <hpx/runtime/applier/apply.hpp>#include <hpx/runtime/applier/detail/apply_implementations.hpp>#include <hpx/traits/action_is_target_valid.hpp>#include <hpx/traits/component_supports_migration.hpp>#include <hpx/util/format.hpp>#include <cctype>#include <cstdio>#include <ostream>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/lcos/detail/async_colocated_fwd.hpp>#include <hpx/runtime/naming/unmanaged.hpp>#include <hpx/runtime/parcelset/detail/parcel_await.hpp>#include <hpx/runtime/parcelset/put_parcel.hpp>#include <hpx/runtime.hpp>#include <hpx/performance_counters/counters.hpp>#include <hpx/runtime/parcelset/locality.hpp>#include <hpx/runtime/serialization/map.hpp>#include <hpx/runtime/thread_hooks.hpp>#include <hpx/util/runtime_configuration.hpp>#include <hpx/runtime/components/static_factory_data.hpp>#include <hpx/util/plugin/export_plugin.hpp>#include <hpx/util/plugin/abstract_factory.hpp>#include <hpx/util/plugin/virtual_constructor.hpp>#include <hpx/util/plugin/config.hpp>#include <boost/any.hpp>#include <boost/shared_ptr.hpp>#include <hpx/util/plugin/concrete_factory.hpp>#include <hpx/util/plugin/plugin_wrapper.hpp>#include <boost/algorithm/string/case_conv.hpp>#include <hpx/util/plugin/dll.hpp>#include <hpx/util/plugin/detail/dll_dlopen.hpp>#include <boost/filesystem/convenience.hpp>#include <boost/filesystem/path.hpp>#include <link.h>#include <dlfcn.h>#include <limits.h>#include <hpx/plugins/plugin_registry_base.hpp>#include <hpx/util/plugin.hpp>#include <hpx/util/plugin/plugin_factory.hpp>#include <boost/filesystem.hpp>#include <set>#include <hpx/runtime/naming/split_gid.hpp>#include <hpx/runtime/parcelset/parcelhandler.hpp>#include <hpx/runtime/parcelset/parcelport.hpp>#include <hpx/performance_counters/parcels/data_point.hpp>#include <hpx/performance_counters/parcels/gatherer.hpp>#include <hpx/lcos/local/no_mutex.hpp>#include <hpx/runtime/parcelset/detail/per_action_data_counter.hpp>#include <hpx/util/high_resolution_timer.hpp>#include <hpx/util/high_resolution_clock.hpp>#include <hpx/plugins/parcelport_factory_base.hpp>#include <hpx/traits/component_type_is_compatible.hpp>#include <hpx/traits/is_valid_action.hpp>#include <hpx/runtime/applier/apply_callback.hpp>#include <boost/asio/error.hpp>#include <hpx/runtime/threads/thread.hpp>#include <hpx/lcos/sync.hpp>#include <hpx/lcos/detail/sync_implementations.hpp>#include <hpx/lcos/detail/sync_implementations_fwd.hpp>#include <hpx/lcos/async_continue.hpp>#include <hpx/lcos/async_continue_fwd.hpp>#include <hpx/util/bind_action.hpp>#include <hpx/runtime/actions/manage_object_action.hpp>#include <hpx/runtime/serialization/array.hpp>#include <boost/array.hpp>#include <hpx/runtime/serialization/serialize_buffer.hpp>#include <hpx/traits/supports_streaming_with_any.hpp>#include <boost/shared_array.hpp>#include <hpx/runtime/components/server/runtime_support.hpp>#include <hpx/compat/condition_variable.hpp>#include <condition_variable>#include <hpx/lcos/local/condition_variable.hpp>#include <hpx/lcos/local/mutex.hpp>#include <hpx/plugins/plugin_factory_base.hpp>#include <hpx/runtime/components/server/create_component.hpp>#include <hpx/runtime/find_here.hpp>#include <boost/program_options/options_description.hpp>#include <hpx/runtime/serialization/vector.hpp>#include <hpx/runtime/serialization/detail/serialize_collection.hpp>#include <hpx/runtime/components/server/migrate_component.hpp>#include <hpx/runtime/actions/plain_action.hpp>#include <hpx/runtime/get_ptr.hpp>#include <hpx/runtime/agas/gva.hpp>#include <boost/io/ios_state.hpp>#include <hpx/components/component_storage/export_definitions.hpp>#include <hpx/config/export_definitions.hpp>#include <hpx/components/component_storage/server/component_storage.hpp>#include <hpx/components/containers/unordered/unordered_map.hpp>#include <hpx/runtime/components/copy_component.hpp>#include <hpx/lcos/detail/async_colocated.hpp>#include <hpx/runtime/agas/primary_namespace.hpp>#include <hpx/runtime/agas/server/primary_namespace.hpp>#include <hpx/runtime/components/server/fixed_component_base.hpp>#include <hpx/runtime/applier/bind_naming_wrappers.hpp>#include <hpx/util/functional/colocated_helpers.hpp>#include <hpx/runtime/components/server/copy_component.hpp>#include <hpx/runtime/components/new.hpp>#include <hpx/runtime/components/default_distribution_policy.hpp>#include <hpx/runtime/serialization/shared_ptr.hpp>#include <hpx/runtime/components/server/distributed_metadata_base.hpp>#include <hpx/runtime/components/server/simple_component_base.hpp>#include <hpx/runtime/components/server/component.hpp>#include <hpx/traits/component_heap_type.hpp>#include <hpx/runtime/serialization/unordered_map.hpp>#include <hpx/components/containers/container_distribution_policy.hpp>#include <hpx/components/containers/unordered/partition_unordered_map_component.hpp>#include <hpx/lcos/reduce.hpp>#include <hpx/runtime/components/component_factory.hpp>#include <hpx/runtime/components/server/locking_hook.hpp>#include <hpx/runtime/threads/coroutines/coroutine.hpp>#include <hpx/runtime/threads/coroutines/coroutine_fwd.hpp>#include <hpx/runtime/threads/coroutines/detail/coroutine_accessor.hpp>#include <hpx/runtime/threads/coroutines/detail/coroutine_impl.hpp>#include <hpx/runtime/threads/coroutines/detail/context_base.hpp>#include <hpx/runtime/threads/coroutines/detail/context_impl.hpp>#include <hpx/runtime/threads/coroutines/detail/swap_context.hpp>#include <hpx/runtime/threads/coroutines/detail/tss.hpp>#include <hpx/runtime/threads/coroutines/detail/coroutine_self.hpp>#include <tuple>#include <hpx/components/containers/unordered/unordered_map_segmented_iterator.hpp>#include <hpx/util/iterator_adaptor.hpp>#include <hpx/util/iterator_facade.hpp>#include <boost/integer.hpp>
-
file
migrate_to_storage.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/traits/is_component.hpp>#include <hpx/components/component_storage/component_storage.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/components/component_storage/server/component_storage.hpp>#include <cstddef>#include <vector>#include <hpx/components/component_storage/server/migrate_to_storage.hpp>#include <hpx/throw_exception.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/components/component_storage/export_definitions.hpp>#include <cstdint>#include <memory>#include <utility>#include <type_traits>
-
file
error.hpp
- #include <hpx/config.hpp>#include <boost/system/error_code.hpp>#include <string>
-
file
error_code.hpp
- #include <hpx/config.hpp>#include <hpx/error.hpp>#include <hpx/exception_fwd.hpp>#include <boost/system/error_code.hpp>#include <exception>#include <stdexcept>#include <string>#include <hpx/throw_exception.hpp>
-
file
exception.hpp
- #include <hpx/config.hpp>#include <hpx/error.hpp>#include <hpx/error_code.hpp>#include <hpx/error.hpp>#include <hpx/exception_fwd.hpp>#include <boost/system/error_code.hpp>#include <exception>#include <stdexcept>#include <string>#include <hpx/throw_exception.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/exception_info.hpp>#include <hpx/error_code.hpp>#include <hpx/util/detail/pack.hpp>#include <cstddef>#include <type_traits>#include <hpx/util/tuple.hpp>#include <hpx/runtime/serialization/detail/non_default_constructible.hpp>#include <memory>#include <hpx/traits/is_bitwise_serializable.hpp>#include <hpx/util/decay.hpp>#include <boost/ref.hpp>#include </hpx/build/docs/hpx/util/functional>#include <utility>#include <boost/array.hpp>#include <array>#include <algorithm>#include <typeinfo>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/runtime/agas_fwd.hpp>#include <hpx/util/function.hpp>#include <cstdint>#include <boost/system/system_error.hpp>#include <hpx/config/warnings_prefix.hpp>#include <hpx/throw_exception.hpp>#include <hpx/config/warnings_suffix.hpp>
-
file
exception_fwd.hpp
- #include <hpx/config.hpp>#include <hpx/error.hpp>#include <hpx/throw_exception.hpp>
-
file
exception_list.hpp
- #include <hpx/config.hpp>#include <hpx/exception.hpp>#include <hpx/error.hpp>#include <hpx/error_code.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/exception_info.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <boost/system/error_code.hpp>#include <boost/system/system_error.hpp>#include <cstddef>#include <cstdint>#include <exception>#include <string>#include <hpx/config/warnings_prefix.hpp>#include <hpx/throw_exception.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/runtime/threads/thread_helpers.hpp>#include <hpx/runtime/threads_fwd.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/runtime/threads/coroutines/coroutine_fwd.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/runtime/threads/detail/combined_tagged_state.hpp>#include <hpx/util/assert.hpp>#include <hpx/runtime/threads/thread_id_type.hpp>#include <hpx/config/constexpr.hpp>#include <hpx/config/export_definitions.hpp>#include <functional>#include <iosfwd>#include <hpx/util_fwd.hpp>#include <hpx/util/function.hpp>#include <hpx/util/unique_function.hpp>#include <utility>#include <memory>#include <hpx/runtime/thread_pool_helpers.hpp>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/util/register_locks.hpp>#include <hpx/traits/has_member_xxx.hpp>#include <hpx/preprocessor/cat.hpp>#include <type_traits>#include <hpx/util/steady_clock.hpp>#include <chrono>#include <hpx/util/thread_description.hpp>#include <hpx/runtime/actions/basic_action_fwd.hpp>#include <hpx/runtime/actions/preassigned_action_id.hpp>#include <hpx/traits/get_function_address.hpp>#include <hpx/traits/get_function_annotation.hpp>#include <hpx/traits/is_action.hpp>#include <hpx/util/always_void.hpp>#include <hpx/util/decay.hpp>#include <atomic>#include <hpx/util/detail/yield_k.hpp>#include <sched.h>#include <time.h>#include <hpx/util/itt_notify.hpp>#include <boost/smart_ptr/detail/spinlock.hpp>#include <list>#include <mutex>
-
file
hpx_finalize.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>
-
file
hpx_init.hpp
- #include <hpx/config.hpp>#include <hpx/config/attributes.hpp>#include <hpx/config/defines.hpp>#include <hpx/config/compiler_specific.hpp>#include <hpx/config/branch_hints.hpp>#include <hpx/config/compiler_fence.hpp>#include <hpx/config/compiler_native_tls.hpp>#include <ciso646>#include <hpx/config/constexpr.hpp>#include <hpx/config/debug.hpp>#include <hpx/config/emulate_deleted.hpp>#include <hpx/config/export_definitions.hpp>#include <hpx/config/forceinline.hpp>#include <hpx/config/lambda_capture.hpp>#include <utility>#include <hpx/config/manual_profiling.hpp>#include <hpx/config/threads_stack.hpp>#include <hpx/config/version.hpp>#include <hpx/config/weak_symbol.hpp>#include <boost/version.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/stringize.hpp>#include <hpx/hpx_finalize.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/error.hpp>#include <boost/system/error_code.hpp>#include <string>#include <hpx/throw_exception.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <boost/current_function.hpp>#include <exception>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/hpx_suspend.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/util/unique_function.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <hpx/preprocessor/strip_parens.hpp>#include <type_traits>#include <hpx/traits/get_function_address.hpp>#include <cstddef>#include <memory>#include <hpx/traits/get_function_annotation.hpp>#include <hpx/util/itt_notify.hpp>#include <cstdint>#include <cstring>#include <hpx/traits/is_callable.hpp>#include <hpx/util/always_void.hpp>#include <hpx/util/result_of.hpp>#include <boost/ref.hpp>#include <hpx/util/detail/basic_function.hpp>#include <hpx/util/assert.hpp>#include <assert.h>#include <cstdlib>#include <iostream>#include <hpx/util/detail/empty_function.hpp>#include <hpx/util/detail/vtable/vtable.hpp>#include <hpx/util/detail/vtable/function_vtable.hpp>#include <hpx/util/detail/vtable/callable_vtable.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/void_guard.hpp>#include </hpx/build/docs/hpx/util/functional>#include <hpx/util/detail/vtable/copyable_vtable.hpp>#include <new>#include <hpx/util/detail/vtable/serializable_function_vtable.hpp>#include <hpx/runtime/serialization/detail/polymorphic_intrusive_factory.hpp>#include <hpx/util/debug/demangle_helper.hpp>#include <typeinfo>#include <hpx/util/jenkins_hash.hpp>#include <random>#include <unordered_map>#include <hpx/util/detail/function_registration.hpp>#include <hpx/util/detail/vtable/serializable_vtable.hpp>#include <hpx/util_fwd.hpp>#include <hpx/runtime/startup_function.hpp>#include <hpx/util/function.hpp>#include <boost/program_options/options_description.hpp>#include <boost/program_options/variables_map.hpp>#include <vector>
-
file
hpx_start.hpp
- #include <hpx/config.hpp>#include <hpx/hpx_finalize.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/runtime/startup_function.hpp>#include <hpx/util/function.hpp>#include <boost/program_options/options_description.hpp>#include <boost/program_options/variables_map.hpp>#include <cstddef>#include <string>#include <vector>
-
file
hpx_suspend.hpp
- #include <hpx/exception_fwd.hpp>
-
file
barrier.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/components/server/managed_component_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <boost/intrusive_ptr.hpp>#include <cstddef>#include <string>#include <utility>#include <vector>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>
-
file
broadcast.hpp
-
file
fold.hpp
-
file
gather.hpp
Defines
-
HPX_REGISTER_GATHER_DECLARATION
(type, name)¶ Declare a gather object named name for a given data type type.
The macro HPX_REGISTER_GATHER_DECLARATION can be used to declare all facilities necessary for a (possibly remote) gather operation.
The parameter type specifies for which data type the gather operations should be enabled.
The (optional) parameter name should be a unique C-style identifier which will be internally used to identify a particular gather operation. If this defaults to <type>_gather if not specified.
- Note
- The macro HPX_REGISTER_GATHER_DECLARATION can be used with 1 or 2 arguments. The second argument is optional and defaults to <type>_gather.
-
HPX_REGISTER_GATHER
(type, name)¶ Define a gather object named name for a given data type type.
The macro HPX_REGISTER_GATHER can be used to define all facilities necessary for a (possibly remote) gather operation.
The parameter type specifies for which data type the gather operations should be enabled.
The (optional) parameter name should be a unique C-style identifier which will be internally used to identify a particular gather operation. If this defaults to <type>_gather if not specified.
- Note
- The macro HPX_REGISTER_GATHER can be used with 1 or 2 arguments. The second argument is optional and defaults to <type>_gather.
-
-
file
split_future.hpp
-
file
wait_all.hpp
-
file
wait_any.hpp
-
file
wait_each.hpp
-
file
wait_some.hpp
-
file
when_all.hpp
-
file
when_any.hpp
-
file
when_each.hpp
-
file
when_some.hpp
-
file
algorithm.hpp
- #include <hpx/config.hpp>#include <algorithm>#include <hpx/parallel/algorithms/adjacent_find.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <hpx/throw_exception.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/decay.hpp>#include <type_traits>#include <utility>#include <hpx/parallel/exception_list.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/datapar/execution_policy.hpp>#include <hpx/parallel/execution_policy_fwd.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <hpx/parallel/executors/parallel_executor.hpp>#include <hpx/parallel/executors/rebind_executor.hpp>#include <hpx/parallel/executors/sequenced_executor.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/executor_traits.hpp>#include <hpx/traits/is_execution_policy.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <memory>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/util/detail/scoped_executor_parameters.hpp>#include <hpx/util/tuple.hpp>#include <string>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/cancellation_token.hpp>#include <atomic>#include <functional>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/result_of.hpp>#include <cstddef>#include <iterator>#include <vector>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/dataflow.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/exception_list.hpp>#include <hpx/lcos/wait_all.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/util/detail/chunk_size.hpp>#include <hpx/util/iterator_range.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/executors/execution_information.hpp>#include <hpx/runtime/threads/topology.hpp>#include <hpx/traits/detail/wrap_int.hpp>#include <hpx/parallel/executors/execution_information_fwd.hpp>#include <hpx/parallel/executors/execution_fwd.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/parallel/util/detail/chunk_size_iterator.hpp>#include <hpx/util/min.hpp>#include <hpx/util/iterator_facade.hpp>#include <hpx/parallel/util/detail/handle_local_exceptions.hpp>#include <hpx/async.hpp>#include <hpx/hpx_finalize.hpp>#include <exception>#include <list>#include <hpx/parallel/util/detail/partitioner_iteration.hpp>#include <hpx/util/invoke_fused.hpp>#include <hpx/parallel/util/detail/select_partitioner.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/tagged.hpp>#include <hpx/util/detail/pack.hpp>#include </hpx/build/docs/hpx/util/functional>#include <hpx/util/zip_iterator.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/util/functional/segmented_iterator_helpers.hpp>#include <hpx/parallel/algorithms/all_any_none.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/vector_pack_load_store.hpp>#include <hpx/parallel/traits/vector_pack_type.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/util/always_void.hpp>#include <hpx/parallel/util/invoke_projected.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/transfer.hpp>#include <hpx/parallel/segmented_algorithms/detail/transfer.hpp>#include <hpx/parallel/segmented_algorithms/detail/dispatch.hpp>#include <hpx/runtime/actions/plain_action.hpp>#include <hpx/runtime/components/colocating_distribution_policy.hpp>#include <hpx/lcos/detail/async_colocated.hpp>#include <hpx/lcos/detail/async_colocated_callback.hpp>#include <hpx/lcos/async_continue_callback.hpp>#include <hpx/lcos/async_callback_fwd.hpp>#include <hpx/lcos/async_fwd.hpp>#include <hpx/runtime/actions/basic_action_fwd.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/lcos/async_continue.hpp>#include <hpx/runtime/applier/apply_callback.hpp>#include <hpx/traits/extract_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/traits/promise_remote_result.hpp>#include <hpx/lcos/detail/async_colocated_callback_fwd.hpp>#include <hpx/lcos/detail/async_colocated_fwd.hpp>#include <hpx/runtime/agas/primary_namespace.hpp>#include <hpx/runtime/agas/server/primary_namespace.hpp>#include <hpx/lcos/detail/async_implementations.hpp>#include <hpx/runtime/applier/detail/apply_colocated_callback_fwd.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/runtime/applier/detail/apply_colocated_fwd.hpp>#include <hpx/traits/is_continuation.hpp>#include <hpx/runtime/applier/detail/apply_implementations.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/parallel/util/detail/handle_remote_exceptions.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/transfer.hpp>#include <hpx/traits/pointer_category.hpp>#include <cstring>#include <boost/shared_array.hpp>#include <hpx/parallel/algorithms/count.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/algorithms/detail/distance.hpp>#include <hpx/parallel/traits/vector_pack_count_bits.hpp>#include <hpx/parallel/algorithms/equal.hpp>#include <hpx/parallel/algorithms/fill.hpp>#include <hpx/traits/is_value_proxy.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/identity.hpp>#include <cstdint>#include <hpx/parallel/algorithms/find.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/algorithms/generate.hpp>#include <hpx/parallel/algorithms/includes.hpp>#include <hpx/parallel/algorithms/is_heap.hpp>#include <hpx/parallel/algorithms/is_partitioned.hpp>#include <hpx/parallel/algorithms/is_sorted.hpp>#include <hpx/parallel/algorithms/lexicographical_compare.hpp>#include <hpx/parallel/algorithms/mismatch.hpp>#include <hpx/parallel/algorithms/merge.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/parallel/algorithms/minmax.hpp>#include <hpx/parallel/algorithms/mismatch.hpp>#include <hpx/parallel/algorithms/move.hpp>#include <hpx/parallel/algorithms/partition.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/parallel/algorithms/remove.hpp>#include <hpx/parallel/algorithms/remove_copy.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/replace.hpp>#include <hpx/parallel/algorithms/reverse.hpp>#include <hpx/parallel/algorithms/rotate.hpp>#include <hpx/parallel/algorithms/reverse.hpp>#include <hpx/parallel/algorithms/search.hpp>#include <hpx/parallel/algorithms/set_difference.hpp>#include <hpx/parallel/algorithms/detail/set_operation.hpp>#include <hpx/parallel/algorithms/set_intersection.hpp>#include <hpx/parallel/algorithms/set_symmetric_difference.hpp>#include <hpx/parallel/algorithms/set_union.hpp>#include <hpx/parallel/algorithms/sort.hpp>#include <hpx/parallel/algorithms/swap_ranges.hpp>#include <hpx/parallel/algorithms/unique.hpp>#include <hpx/parallel/algorithms/for_loop.hpp>#include <hpx/parallel/algorithms/for_loop_induction.hpp>#include <cstdlib>#include <hpx/parallel/algorithms/for_loop_reduction.hpp>#include <hpx/runtime/get_os_thread_count.hpp>#include <hpx/runtime/get_worker_thread_num.hpp>#include <hpx/util/cache_aligned_data.hpp>
-
file
adjacent_difference.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/zip_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>
-
file
adjacent_find.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
all_any_none.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/range.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/invoke_projected.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
all_any_none.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/all_any_none.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/util/decay.hpp>#include <hpx/util/result_of.hpp>#include <hpx/parallel/traits/projected.hpp>#include <iterator>#include <type_traits>#include <hpx/parallel/util/projection_identity.hpp>#include <utility>
-
file
copy.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/detail/transfer.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/transfer.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <cstring>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>#include <boost/shared_array.hpp>
-
file
copy.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <type_traits>#include <utility>
-
file
count.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/range.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/distance.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/vector_pack_count_bits.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/invoke_projected.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <functional>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
count.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/count.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
destroy.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
equal.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
exclusive_scan.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/util/zip_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/inclusive_scan.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>#include <hpx/parallel/execution_policy.hpp>
-
file
fill.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_value_proxy.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>
-
file
fill.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_execution_policy.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/fill.hpp>#include <type_traits>#include <utility>
-
file
find.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/util/invoke_projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
find.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_execution_policy.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/find.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
for_each.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_value_proxy.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/identity.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <iterator>#include <type_traits>#include <utility>
-
file
for_each.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
for_loop.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/decay.hpp>#include <hpx/util/detail/pack.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tuple.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/for_loop_induction.hpp>#include <hpx/parallel/algorithms/for_loop_reduction.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
for_loop_induction.hpp
- #include <hpx/config.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <cstddef>#include <cstdlib>#include <type_traits>#include <utility>
-
file
for_loop_reduction.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/get_os_thread_count.hpp>#include <hpx/runtime/get_worker_thread_num.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/decay.hpp>#include <hpx/util/cache_aligned_data.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <boost/shared_array.hpp>#include <cstddef>#include <cstdlib>#include <functional>#include <type_traits>#include <utility>
-
file
generate.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>
-
file
generate.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/generate.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
includes.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/cancellation_token.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
inclusive_scan.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/util/zip_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>
-
file
is_heap.hpp
- #include <hpx/config.hpp>#include <hpx/async.hpp>#include <hpx/lcos/future.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <list>#include <vector>#include <type_traits>#include <utility>
-
file
is_heap.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/is_heap.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
is_partitioned.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/cancellation_token.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <functional>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
is_sorted.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/cancellation_token.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <functional>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
lexicographical_compare.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/algorithms/mismatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
merge.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/detail/transfer.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/detail/handle_local_exceptions.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/transfer.hpp>#include <algorithm>#include <cstddef>#include <exception>#include <iterator>#include <list>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
merge.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/parallel/algorithms/merge.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <type_traits>#include <utility>
-
file
minmax.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
minmax.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/minmax.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <type_traits>#include <utility>
-
file
mismatch.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
move.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/transfer.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/transfer.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>
-
file
partition.hpp
- #include <hpx/config.hpp>#include <hpx/async.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/exception_list.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/execution_information.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/detail/handle_local_exceptions.hpp>#include <hpx/parallel/util/invoke_projected.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <exception>#include <iterator>#include <list>#include <type_traits>#include <utility>#include <vector>#include <boost/shared_array.hpp>
-
file
partition.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/parallel/algorithms/partition.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <type_traits>#include <utility>
-
file
reduce.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/range.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/algorithms/detail/accumulate.hpp>#include <functional>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/distance.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>
-
file
reduce.hpp
-
file
reduce_by_key.hpp
- #include <hpx/config.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/algorithms/inclusive_scan.hpp>#include <hpx/parallel/algorithms/sort.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <hpx/util/range.hpp>#include <hpx/util/transform_iterator.hpp>#include <hpx/util/identity.hpp>#include <hpx/util/iterator_adaptor.hpp>#include <hpx/util/lazy_conditional.hpp>#include <hpx/util/result_of.hpp>#include <iterator>#include <type_traits>#include <hpx/util/tuple.hpp>#include <cstdint>#include <functional>#include <utility>#include <vector>
-
file
remove.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/detail/transfer.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/invoke_projected.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/transfer.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <cstring>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>#include <boost/shared_array.hpp>
-
file
remove.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/remove.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <type_traits>#include <utility>
-
file
remove_copy.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
remove_copy.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/remove_copy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
replace.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
replace.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/replace.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
reverse.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
reverse.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/reverse.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
rotate.hpp
- #include <hpx/config.hpp>#include <hpx/dataflow.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/reverse.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/transfer.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
rotate.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/rotate.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
search.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
search.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_execution_policy.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/search.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <cstddef>#include <type_traits>#include <utility>
-
file
set_difference.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/set_operation.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
set_intersection.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/set_operation.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
set_symmetric_difference.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/set_operation.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
set_union.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/algorithms/copy.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/set_operation.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
sort.hpp
- #include <hpx/config.hpp>#include <hpx/dataflow.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/decay.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/exception_list.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/execution_information.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <algorithm>#include <cstddef>#include <exception>#include <functional>#include <iterator>#include <list>#include <type_traits>#include <utility>
-
file
sort.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/parallel/algorithms/sort.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <type_traits>#include <utility>
-
file
sort_by_key.hpp
- #include <hpx/config.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/tuple.hpp>#include <hpx/parallel/algorithms/sort.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
swap_ranges.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/for_each.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <iterator>#include <type_traits>#include <utility>
-
file
transform.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/util/tuple.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/transform_loop.hpp>#include <hpx/parallel/util/cancellation_token.hpp>#include <hpx/traits/is_execution_policy.hpp>#include <hpx/util/invoke.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <hpx/parallel/util/zip_iterator.hpp>#include <cstdint>
-
file
transform.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/tagged_tuple.hpp>#include <hpx/parallel/algorithms/transform.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tuple.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/transform_loop.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <iterator>#include <type_traits>#include <utility>#include <hpx/parallel/traits/projected_range.hpp>
-
file
transform_exclusive_scan.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/result_of.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/transform_inclusive_scan.hpp>#include <hpx/util/invoke.hpp>#include <hpx/parallel/algorithms/inclusive_scan.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>#include <hpx/parallel/execution_policy.hpp>
-
file
transform_inclusive_scan.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/result_of.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/inclusive_scan.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>
-
file
transform_reduce.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/segmented_iterator_traits.hpp>#include <hpx/util/range.hpp>#include <hpx/util/result_of.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>
-
file
transform_reduce_binary.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/result_of.hpp>#include <hpx/util/zip_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <hpx/util/unused.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <numeric>#include <type_traits>#include <utility>#include <vector>
-
file
uninitialized_copy.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner_with_cleanup.hpp>#include <hpx/dataflow.hpp>#include <hpx/exception_list.hpp>#include <hpx/lcos/wait_all.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <hpx/parallel/util/detail/chunk_size.hpp>#include <hpx/parallel/util/detail/handle_local_exceptions.hpp>#include <hpx/parallel/util/detail/partitioner_iteration.hpp>#include <hpx/parallel/util/detail/scoped_executor_parameters.hpp>#include <hpx/parallel/util/detail/select_partitioner.hpp>#include <hpx/parallel/util/partitioner.hpp>#include <algorithm>#include <cstddef>#include <exception>#include <list>#include <memory>#include <type_traits>#include <utility>#include <vector>#include <hpx/parallel/util/zip_iterator.hpp>#include <iterator>
-
file
uninitialized_default_construct.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner_with_cleanup.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
uninitialized_fill.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner_with_cleanup.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
uninitialized_move.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner_with_cleanup.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
uninitialized_value_construct.hpp
- #include <hpx/config.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/void_guard.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/partitioner_with_cleanup.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
unique.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/util/unused.hpp>#include <hpx/parallel/algorithms/detail/dispatch.hpp>#include <hpx/parallel/algorithms/detail/is_negative.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/algorithms/detail/transfer.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/util/compare_projected.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <hpx/parallel/util/foreach_partitioner.hpp>#include <hpx/parallel/util/loop.hpp>#include <hpx/parallel/util/projection_identity.hpp>#include <hpx/parallel/util/scan_partitioner.hpp>#include <hpx/parallel/util/transfer.hpp>#include <hpx/parallel/util/zip_iterator.hpp>#include <algorithm>#include <cstddef>#include <cstring>#include <iterator>#include <memory>#include <type_traits>#include <utility>#include <vector>#include <boost/shared_array.hpp>
-
file
unique.hpp
- #include <hpx/config.hpp>#include <hpx/traits/concepts.hpp>#include <hpx/traits/is_iterator.hpp>#include <hpx/traits/is_range.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tagged_pair.hpp>#include <hpx/parallel/algorithms/unique.hpp>#include <hpx/parallel/tagspec.hpp>#include <hpx/parallel/traits/projected.hpp>#include <hpx/parallel/traits/projected_range.hpp>#include <type_traits>#include <utility>
-
file
execution_policy.hpp
- #include <hpx/config.hpp>#include <hpx/parallel/datapar/execution_policy.hpp>#include <hpx/parallel/execution_policy_fwd.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <hpx/lcos/future.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/stringize.hpp>#include <hpx/runtime/serialization/base_object.hpp>#include <hpx/traits/detail/wrap_int.hpp>#include <hpx/traits/has_member_xxx.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <hpx/util/decay.hpp>#include <hpx/util/detail/pack.hpp>#include <hpx/parallel/executors/execution_parameters_fwd.hpp>#include <boost/ref.hpp>#include <cstddef>#include <functional>#include <type_traits>#include <utility>#include <vector>#include <hpx/parallel/executors/parallel_executor.hpp>#include <hpx/parallel/executors/rebind_executor.hpp>#include <hpx/parallel/executors/execution_fwd.hpp>#include <hpx/traits/executor_traits.hpp>#include <hpx/parallel/executors/sequenced_executor.hpp>#include <hpx/async_launch_policy_dispatch.hpp>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/sync_launch_policy_dispatch.hpp>#include <hpx/lcos/sync_fwd.hpp>#include <hpx/lcos/local/futures_factory.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/traits/is_action.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/deferred_call.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/exception_list.hpp>#include <hpx/exception_list.hpp>#include <hpx/hpx_finalize.hpp>#include <hpx/util/assert.hpp>#include <exception>#include <iterator>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/is_execution_policy.hpp>#include <memory>
-
file
auto_chunk_size.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <hpx/util/high_resolution_clock.hpp>#include <hpx/util/steady_clock.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <type_traits>
-
file
dynamic_chunk_size.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <cstddef>#include <type_traits>
-
file
execution_fwd.hpp
- #include <utility>#include <type_traits>#include <hpx/config.hpp>#include <hpx/traits/executor_traits.hpp>
-
file
execution_information_fwd.hpp
- #include <hpx/config.hpp>#include <hpx/parallel/executors/execution_fwd.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/traits/executor_traits.hpp>#include <cstddef>#include <type_traits>#include <utility>
-
file
guided_chunk_size.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <algorithm>#include <cstddef>#include <type_traits>
-
file
parallel_executor.hpp
- #include <hpx/config.hpp>#include <hpx/async_launch_policy_dispatch.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/local/latch.hpp>#include <hpx/parallel/algorithms/detail/predicates.hpp>#include <hpx/parallel/executors/fused_bulk_execute.hpp>#include <hpx/parallel/executors/post_policy_dispatch.hpp>#include <hpx/parallel/executors/static_chunk_size.hpp>#include <hpx/runtime/get_worker_thread_num.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/runtime/threads/thread_helpers.hpp>#include <hpx/traits/future_traits.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/deferred_call.hpp>#include <hpx/util/internal_allocator.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/one_shot.hpp>#include <hpx/util/range.hpp>#include <hpx/util/unwrap.hpp>#include <algorithm>#include <cstddef>#include <type_traits>#include <utility>#include <vector>
-
file
persistent_auto_chunk_size.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <hpx/util/high_resolution_clock.hpp>#include <hpx/util/steady_clock.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <type_traits>
-
file
sequenced_executor.hpp
- #include <hpx/config.hpp>#include <hpx/async_launch_policy_dispatch.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/sync_launch_policy_dispatch.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/util/deferred_call.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/exception_list.hpp>#include <cstddef>#include <iterator>#include <type_traits>#include <utility>#include <vector>
-
file
service_executors.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/parallel/executors/static_chunk_size.hpp>#include <hpx/parallel/executors/thread_execution.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/lcos/local/futures_factory.hpp>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/traits/future_access.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <hpx/util/bind.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/deferred_call.hpp>#include <hpx/util/detail/pack.hpp>#include <hpx/util/range.hpp>#include <hpx/util/tuple.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/parallel/executors/execution.hpp>#include <algorithm>#include <type_traits>#include <utility>#include <vector>#include <hpx/runtime/threads/executors/service_executors.hpp>#include <hpx/compat/condition_variable.hpp>#include <hpx/compat/mutex.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/throw_exception.hpp>#include <hpx/util/atomic_count.hpp>#include <hpx/util/steady_clock.hpp>#include <hpx/util/thread_description.hpp>#include <hpx/util/unique_function.hpp>#include <atomic>#include <chrono>#include <cstddef>#include <cstdint>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/traits/executor_traits.hpp>
-
file
static_chunk_size.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/traits/is_executor_parameters.hpp>#include <hpx/parallel/executors/execution_parameters_fwd.hpp>#include <cstddef>#include <type_traits>
-
file
thread_pool_executors.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/parallel/executors/execution_parameters.hpp>#include <hpx/parallel/executors/thread_execution.hpp>#include <hpx/parallel/executors/thread_execution_information.hpp>#include <hpx/runtime/get_os_thread_count.hpp>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/runtime/threads/topology.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <hpx/parallel/executors/execution_information.hpp>#include <cstddef>#include <type_traits>#include <utility>#include <hpx/parallel/executors/thread_timed_execution.hpp>#include <hpx/lcos/local/packaged_task.hpp>#include <hpx/lcos/detail/future_data.hpp>#include <hpx/lcos/local/promise.hpp>#include <hpx/throw_exception.hpp>#include <hpx/traits/is_callable.hpp>#include <hpx/util/annotated_function.hpp>#include <hpx/util/thread_description.hpp>#include <hpx/util/unique_function.hpp>#include <exception>#include <memory>#include <hpx/util/deferred_call.hpp>#include <hpx/util/steady_clock.hpp>#include <hpx/parallel/executors/timed_execution.hpp>#include <hpx/parallel/executors/timed_execution_fwd.hpp>#include <hpx/parallel/executors/execution_fwd.hpp>#include <hpx/parallel/executors/timed_executors.hpp>#include <hpx/runtime/threads/thread.hpp>#include <hpx/traits/detail/wrap_int.hpp>#include <hpx/traits/executor_traits.hpp>#include <hpx/util/bind.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/parallel_executor.hpp>#include <hpx/parallel/executors/sequenced_executor.hpp>#include <chrono>#include <functional>#include <hpx/traits/is_executor.hpp>#include <vector>#include <hpx/runtime/threads/executors/thread_pool_executors.hpp>#include <hpx/lcos/local/counting_semaphore.hpp>#include <hpx/lcos/local/detail/counting_semaphore.hpp>#include <hpx/lcos/local/detail/condition_variable.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/assert_owns_lock.hpp>#include <algorithm>#include <cstdint>#include <mutex>#include <hpx/runtime/resource/detail/partitioner.hpp>#include <hpx/runtime/resource/partitioner.hpp>#include <hpx/runtime/resource/partitioner_fwd.hpp>#include <hpx/runtime/resource/detail/create_partitioner.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/find_prefix.hpp>#include <hpx/preprocessor/stringize.hpp>#include <string>#include <hpx/util/function.hpp>#include <boost/program_options.hpp>#include <hpx/runtime/threads/cpu_mask.hpp>#include <hpx/runtime/threads/policies/affinity_data.hpp>#include <atomic>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/util/command_line_handling.hpp>#include <hpx/hpx_init.hpp>#include <hpx/hpx_finalize.hpp>#include <hpx/hpx_suspend.hpp>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/runtime/startup_function.hpp>#include <boost/program_options/options_description.hpp>#include <boost/program_options/variables_map.hpp>#include <hpx/util/manage_config.hpp>#include <hpx/util/safe_lexical_cast.hpp>#include <boost/lexical_cast.hpp>#include <map>#include <hpx/util/runtime_configuration.hpp>#include <hpx/util/tuple.hpp>#include <iosfwd>#include <hpx/runtime/threads/thread_enums.hpp>
-
file
task_block.hpp
- #include <hpx/config.hpp>#include <hpx/async.hpp>#include <hpx/exception.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/lcos/when_all.hpp>#include <hpx/traits/is_future.hpp>#include <hpx/util/bind.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/decay.hpp>#include <hpx/parallel/exception_list.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <boost/utility/addressof.hpp>#include <memory>#include <exception>#include <mutex>#include <type_traits>#include <utility>#include <vector>
-
file
manage_counter_type.hpp
- #include <hpx/config.hpp>#include <hpx/error_code.hpp>#include <hpx/performance_counters/counters_fwd.hpp>#include <hpx/util/function.hpp>#include <cstddef>#include <cstdint>#include <string>#include <vector>
-
file
basic_action.hpp
- #include <hpx/config.hpp>#include <hpx/exception.hpp>#include <hpx/lcos/sync_fwd.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <hpx/preprocessor/stringize.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/runtime/actions/basic_action_fwd.hpp>#include <hpx/runtime/actions/continuation.hpp>#include <hpx/runtime/actions/detail/action_factory.hpp>#include <hpx/runtime/actions/detail/invocation_count_registry.hpp>#include <hpx/runtime/actions/preassigned_action_id.hpp>#include <hpx/runtime/actions/transfer_action.hpp>#include <hpx/runtime/actions/transfer_continuation_action.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/parcelset/detail/per_action_data_counter_registry.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/runtime_fwd.hpp>#include <hpx/traits/action_decorate_function.hpp>#include <hpx/traits/action_priority.hpp>#include <hpx/traits/action_remote_result.hpp>#include <hpx/traits/action_stacksize.hpp>#include <hpx/traits/is_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/util/detail/pack.hpp>#include <hpx/util/get_and_reset_value.hpp>#include <hpx/util/invoke_fused.hpp>#include <hpx/util/logging.hpp>#include <hpx/util/tuple.hpp>#include <boost/utility/string_ref.hpp>#include <atomic>#include <cstddef>#include <cstdint>#include <exception>#include <sstream>#include <string>#include <type_traits>#include <utility>
Defines
-
HPX_REGISTER_ACTION_DECLARATION
(...)¶ Declare the necessary component action boilerplate code.
The macro HPX_REGISTER_ACTION_DECLARATION can be used to declare all the boilerplate code which is required for proper functioning of component actions in the context of HPX.
The parameter action is the type of the action to declare the boilerplate for.
This macro can be invoked with an optional second parameter. This parameter specifies a unique name of the action to be used for serialization purposes. The second parameter has to be specified if the first parameter is not usable as a plain (non-qualified) C++ identifier, i.e. the first parameter contains special characters which cannot be part of a C++ identifier, such as ‘<’, ‘>’, or ‘:’.
namespace app { // Define a simple component exposing one action 'print_greeting' class HPX_COMPONENT_EXPORT server : public hpx::components::simple_component_base<server> { void print_greeting () { hpx::cout << "Hey, how are you?\n" << hpx::flush; } // Component actions need to be declared, this also defines the // type 'print_greeting_action' representing the action. HPX_DEFINE_COMPONENT_ACTION(server, print_greeting, print_greeting_action); }; } // Declare boilerplate code required for each of the component actions. HPX_REGISTER_ACTION_DECLARATION(app::server::print_greeting_action);
- Example:
- Note
- This macro has to be used once for each of the component actions defined using one of the HPX_DEFINE_COMPONENT_ACTION macros. It has to be visible in all translation units using the action, thus it is recommended to place it into the header file defining the component.
-
HPX_REGISTER_ACTION
(...)¶ Define the necessary component action boilerplate code.
The macro HPX_REGISTER_ACTION can be used to define all the boilerplate code which is required for proper functioning of component actions in the context of HPX.
The parameter action is the type of the action to define the boilerplate for.
This macro can be invoked with an optional second parameter. This parameter specifies a unique name of the action to be used for serialization purposes. The second parameter has to be specified if the first parameter is not usable as a plain (non-qualified) C++ identifier, i.e. the first parameter contains special characters which cannot be part of a C++ identifier, such as ‘<’, ‘>’, or ‘:’.
- Note
- This macro has to be used once for each of the component actions defined using one of the HPX_DEFINE_COMPONENT_ACTION or HPX_DEFINE_PLAIN_ACTION macros. It has to occur exactly once for each of the actions, thus it is recommended to place it into the source file defining the component.
- Note
- Only one of the forms of this macro HPX_REGISTER_ACTION or HPX_REGISTER_ACTION_ID should be used for a particular action, never both.
-
HPX_REGISTER_ACTION_ID
(action, actionname, actionid)¶ Define the necessary component action boilerplate code and assign a predefined unique id to the action.
The macro HPX_REGISTER_ACTION can be used to define all the boilerplate code which is required for proper functioning of component actions in the context of HPX.
The parameter action is the type of the action to define the boilerplate for.
The parameter actionname specifies an unique name of the action to be used for serialization purposes. The second parameter has to be usable as a plain (non-qualified) C++ identifier, it should not contain special characters which cannot be part of a C++ identifier, such as ‘<’, ‘>’, or ‘:’.
The parameter actionid specifies an unique integer value which will be used to represent the action during serialization.
- Note
- This macro has to be used once for each of the component actions defined using one of the HPX_DEFINE_COMPONENT_ACTION or global actions HPX_DEFINE_PLAIN_ACTION macros. It has to occur exactly once for each of the actions, thus it is recommended to place it into the source file defining the component.
- Note
- Only one of the forms of this macro HPX_REGISTER_ACTION or HPX_REGISTER_ACTION_ID should be used for a particular action, never both.
-
-
file
component_action.hpp
- #include <hpx/config.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <hpx/runtime/actions/basic_action.hpp>#include <hpx/runtime/components/pinned_ptr.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/traits/is_future.hpp>#include <boost/utility/string_ref.hpp>#include <cstdlib>#include <sstream>#include <string>#include <type_traits>#include <utility>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>
Defines
-
HPX_DEFINE_COMPONENT_ACTION
(...)¶ Registers a member function of a component as an action type with HPX.
The macro HPX_DEFINE_COMPONENT_ACTION can be used to register a member function of a component as an action type named action_type.
The parameter component is the type of the component exposing the member function func which should be associated with the newly defined action type. The parameter
action_type
is the name of the action type to register with HPX.namespace app { // Define a simple component exposing one action 'print_greeting' class HPX_COMPONENT_EXPORT server : public hpx::components::simple_component_base<server> { void print_greeting() const { hpx::cout << "Hey, how are you?\n" << hpx::flush; } // Component actions need to be declared, this also defines the // type 'print_greeting_action' representing the action. HPX_DEFINE_COMPONENT_ACTION(server, print_greeting, print_greeting_action); }; }
- Example:
The first argument must provide the type name of the component the action is defined for.
The second argument must provide the member function name the action should wrap.
The default value for the third argument (the typename of the defined action) is derived from the name of the function (as passed as the second argument) by appending ‘_action’. The third argument can be omitted only if the second argument with an appended suffix ‘_action’ resolves to a valid, unqualified C++ type name.
- Note
- The macro HPX_DEFINE_COMPONENT_ACTION can be used with 2 or 3 arguments. The third argument is optional.
-
-
file
plain_action.hpp
- #include <hpx/config.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <hpx/preprocessor/strip_parens.hpp>#include <hpx/runtime/actions/basic_action.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/traits/component_type_database.hpp>#include <hpx/util/assert.hpp>#include <boost/utility/string_ref.hpp>#include <cstdlib>#include <sstream>#include <stdexcept>#include <string>#include <utility>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>
Defines
-
HPX_DEFINE_PLAIN_ACTION
(...)¶ Defines a plain action type.
namespace app { void some_global_function(double d) { cout << d; } // This will define the action type 'app::some_global_action' which // represents the function 'app::some_global_function'. HPX_DEFINE_PLAIN_ACTION(some_global_function, some_global_action); }
- Example:
- Note
- Usually this macro will not be used in user code unless the intent is to avoid defining the action_type in global namespace. Normally, the use of the macro HPX_PLAIN_ACTION is recommended.
- Note
- The macro HPX_DEFINE_PLAIN_ACTION can be used with 1 or 2 arguments. The second argument is optional. The default value for the second argument (the typename of the defined action) is derived from the name of the function (as passed as the first argument) by appending ‘_action’. The second argument can be omitted only if the first argument with an appended suffix ‘_action’ resolves to a valid, unqualified C++ type name.
-
HPX_DECLARE_PLAIN_ACTION
(...)¶ Declares a plain action type.
-
HPX_PLAIN_ACTION
(...)¶ Defines a plain action type based on the given function func and registers it with HPX.
The macro HPX_PLAIN_ACTION can be used to define a plain action (e.g. an action encapsulating a global or free function) based on the given function func. It defines the action type name representing the given function. This macro additionally registers the newly define action type with HPX.
The parameter
func
is a global or free (non-member) function which should be encapsulated into a plain action. The parametername
is the name of the action type defined by this macro.namespace app { void some_global_function(double d) { cout << d; } } // This will define the action type 'some_global_action' which represents // the function 'app::some_global_function'. HPX_PLAIN_ACTION(app::some_global_function, some_global_action);
- Example:
- Note
- The macro HPX_PLAIN_ACTION has to be used at global namespace even if the wrapped function is located in some other namespace. The newly defined action type is placed into the global namespace as well.
- Note
- The macro HPX_PLAIN_ACTION_ID can be used with 1, 2, or 3 arguments. The second and third arguments are optional. The default value for the second argument (the typename of the defined action) is derived from the name of the function (as passed as the first argument) by appending ‘_action’. The second argument can be omitted only if the first argument with an appended suffix ‘_action’ resolves to a valid, unqualified C++ type name. The default value for the third argument is hpx::components::factory_check.
- Note
- Only one of the forms of this macro HPX_PLAIN_ACTION or HPX_PLAIN_ACTION_ID should be used for a particular action, never both.
-
HPX_PLAIN_ACTION_ID
(func, name, id)¶ Defines a plain action type based on the given function func and registers it with HPX.
The macro HPX_PLAIN_ACTION_ID can be used to define a plain action (e.g. an action encapsulating a global or free function) based on the given function func. It defines the action type actionname representing the given function. The parameter actionid
The parameter actionid specifies an unique integer value which will be used to represent the action during serialization.
The parameter
func
is a global or free (non-member) function which should be encapsulated into a plain action. The parametername
is the name of the action type defined by this macro.The second parameter has to be usable as a plain (non-qualified) C++ identifier, it should not contain special characters which cannot be part of a C++ identifier, such as ‘<’, ‘>’, or ‘:’.
namespace app { void some_global_function(double d) { cout << d; } } // This will define the action type 'some_global_action' which represents // the function 'app::some_global_function'. HPX_PLAIN_ACTION_ID(app::some_global_function, some_global_action, some_unique_id);
- Example:
- Note
- The macro HPX_PLAIN_ACTION_ID has to be used at global namespace even if the wrapped function is located in some other namespace. The newly defined action type is placed into the global namespace as well.
- Note
- Only one of the forms of this macro HPX_PLAIN_ACTION or HPX_PLAIN_ACTION_ID should be used for a particular action, never both.
-
-
file
applier_fwd.hpp
- #include <hpx/config.hpp>
-
file
basename_registration_fwd.hpp
- #include <hpx/config.hpp>#include <hpx/components_fwd.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/components/make_client.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <cstddef>#include <string>#include <utility>#include <vector>
-
file
binpacking_distribution_policy.hpp
- #include <hpx/config.hpp>#include <hpx/dataflow.hpp>#include <hpx/lcos/future.hpp>#include <hpx/performance_counters/performance_counter.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/util/bind_front.hpp>#include <hpx/performance_counters/counters_fwd.hpp>#include <hpx/performance_counters/stubs/performance_counter.hpp>#include <hpx/performance_counters/server/base_performance_counter.hpp>#include <hpx/lcos/base_lco_with_value.hpp>#include <hpx/performance_counters/counters.hpp>#include <hpx/performance_counters/performance_counter_base.hpp>#include <hpx/runtime/actions/component_action.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/components/server/component.hpp>#include <hpx/throw_exception.hpp>#include <hpx/util/atomic_count.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <string>#include <utility>#include <vector>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <hpx/runtime/serialization/string.hpp>#include <hpx/runtime/serialization/vector.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/bind_back.hpp>#include <hpx/util/unwrap.hpp>#include <algorithm>#include <cstddef>#include <cstdint>#include <iterator>#include <type_traits>
-
file
colocating_distribution_policy.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/detail/async_colocated.hpp>#include <hpx/lcos/detail/async_colocated_callback.hpp>#include <hpx/lcos/detail/async_implementations.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/applier/detail/apply_colocated_callback_fwd.hpp>#include <hpx/runtime/applier/detail/apply_colocated_fwd.hpp>#include <hpx/runtime/applier/detail/apply_implementations.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <hpx/traits/extract_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <algorithm>#include <cstddef>#include <type_traits>#include <utility>#include <vector>
-
file
component_factory.hpp
Defines
-
HPX_REGISTER_COMPONENT
(type, name, mode)¶ Define a component factory for a component type.
This macro is used create and to register a minimal component factory for a component type which allows it to be remotely created using the hpx::new_<> function.
This macro can be invoked with one, two or three arguments
- Parameters
type
: The type parameter is a (fully decorated) type of the component type for which a factory should be defined.name
: The name parameter specifies the name to use to register the factory. This should uniquely (system-wide) identify the component type. The name parameter must conform to the C++ identifier rules (without any namespace). If this parameter is not given, the first parameter is used.mode
: The mode parameter has to be one of the defined enumeration values of the enumeration hpx::components::factory_state_enum. The default for this parameter is hpx::components::factory_enabled.
-
-
file
copy_component.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/async.hpp>#include <hpx/lcos/detail/async_colocated.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/actions/plain_action.hpp>#include <hpx/runtime/components/server/copy_component.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/traits/is_component.hpp>#include <type_traits>
-
file
default_distribution_policy.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/packaged_action.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/runtime/applier/apply.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <hpx/runtime/serialization/vector.hpp>#include <hpx/runtime/serialization/shared_ptr.hpp>#include <hpx/traits/extract_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/util/assert.hpp>#include <algorithm>#include <cstddef>#include <memory>#include <type_traits>#include <utility>#include <vector>
-
file
migrate_component.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/async.hpp>#include <hpx/lcos/detail/async_colocated.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/actions/plain_action.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/components/server/migrate_component.hpp>#include <hpx/runtime/components/target_distribution_policy.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/lcos/detail/async_implementations_fwd.hpp>#include <hpx/lcos/packaged_action.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/runtime/agas/interface.hpp>#include <hpx/runtime/applier/detail/apply_implementations_fwd.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <hpx/traits/extract_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <algorithm>#include <cstddef>#include <type_traits>#include <utility>#include <vector>#include <hpx/traits/is_component.hpp>
-
file
new.hpp
- #include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/components/default_distribution_policy.hpp>#include <hpx/runtime/components/server/create_component.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/traits/is_client.hpp>#include <hpx/traits/is_component.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/util/lazy_enable_if.hpp>#include <algorithm>#include <cstddef>#include <type_traits>#include <utility>#include <vector>
-
file
find_here.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/naming/id_type.hpp>
-
file
find_localities.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <vector>
-
file
get_colocation_id.hpp
- #include <hpx/exception_fwd.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/id_type.hpp>
-
file
get_locality_id.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <cstdint>
-
file
get_locality_name.hpp
- #include <hpx/config.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <string>
-
file
get_num_localities.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/components/component_type.hpp>#include <cstdint>
-
file
get_os_thread_count.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <cstddef>
-
file
get_ptr.hpp
- #include <hpx/config.hpp>#include <hpx/runtime_fwd.hpp>#include <hpx/runtime/agas/gva.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/get_lva.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/throw_exception.hpp>#include <hpx/traits/component_pin_support.hpp>#include <hpx/traits/component_type_is_compatible.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/bind_back.hpp>#include <memory>
-
file
get_thread_name.hpp
- #include <hpx/config.hpp>#include <hpx/util/itt_notify.hpp>#include <string>
-
file
get_worker_thread_num.hpp
- #include <hpx/config.hpp>#include <hpx/error_code.hpp>#include <cstddef>
-
file
launch_policy.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/runtime/serialization/serialization_fwd.hpp>#include <type_traits>#include <utility>
-
file
unmanaged.hpp
- #include <hpx/runtime/naming/name.hpp>
-
file
report_error.hpp
- #include <hpx/config.hpp>#include <cstddef>#include <exception>
-
file
partitioner.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/resource/partitioner_fwd.hpp>#include <hpx/runtime/resource/detail/create_partitioner.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/util/function.hpp>#include <boost/program_options.hpp>#include <cstddef>#include <string>#include <utility>#include <vector>
-
file
partitioner_fwd.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/threads/policies/callback_notifier.hpp>#include <hpx/runtime/threads_fwd.hpp>#include <hpx/util/function.hpp>#include <cstddef>#include <memory>#include <string>
-
file
runtime_mode.hpp
- #include <hpx/config.hpp>#include <string>
-
file
set_parcel_write_handler.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/parcelset_fwd.hpp>#include <hpx/util/function.hpp>#include <boost/system/error_code.hpp>
-
file
shutdown_function.hpp
- #include <hpx/config.hpp>#include <hpx/util/unique_function.hpp>
-
file
startup_function.hpp
- #include <hpx/config.hpp>#include <hpx/util/unique_function.hpp>
-
file
scheduler_mode.hpp
-
file
thread_data_fwd.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/threads/coroutines/coroutine_fwd.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/runtime/threads/thread_id_type.hpp>#include <hpx/util_fwd.hpp>#include <hpx/util/function.hpp>#include <hpx/util/unique_function.hpp>#include <cstddef>#include <cstdint>#include <utility>#include <memory>
-
file
thread_enums.hpp
- #include <hpx/config.hpp>#include <hpx/runtime/threads/detail/combined_tagged_state.hpp>#include <cstddef>#include <cstdint>
-
file
thread_helpers.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/runtime/threads_fwd.hpp>#include <hpx/runtime/thread_pool_helpers.hpp>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/runtime/threads/thread_enums.hpp>#include <hpx/util_fwd.hpp>#include <hpx/util/unique_function.hpp>#include <hpx/util/register_locks.hpp>#include <hpx/util/steady_clock.hpp>#include <hpx/util/thread_description.hpp>#include <atomic>#include <chrono>#include <cstddef>#include <cstdint>#include <type_traits>#include <utility>
-
file
thread_pool_base.hpp
- #include <hpx/config.hpp>#include <hpx/compat/barrier.hpp>#include <hpx/compat/condition_variable.hpp>#include <hpx/compat/mutex.hpp>#include <climits>#include <cstddef>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/compat/thread.hpp>#include <hpx/error_code.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/local/no_mutex.hpp>#include <hpx/lcos/local/spinlock.hpp>#include <hpx/runtime/thread_pool_helpers.hpp>#include <hpx/runtime/threads/cpu_mask.hpp>#include <hpx/runtime/threads/policies/affinity_data.hpp>#include <hpx/runtime/threads/policies/callback_notifier.hpp>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/runtime/threads/thread_init_data.hpp>#include <hpx/runtime/threads/topology.hpp>#include <hpx/state.hpp>#include <hpx/util/steady_clock.hpp>#include <hpx/util_fwd.hpp>#include <cstdint>#include <exception>#include <functional>#include <iosfwd>#include <memory>#include <mutex>#include <string>#include <vector>
-
file
trigger_lco.hpp
- #include <hpx/config.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/actions/continuation_fwd.hpp>#include <hpx/runtime/actions/action_priority.hpp>#include <hpx/runtime/applier/detail/apply_implementations_fwd.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/util/assert.hpp>#include <hpx/util/decay.hpp>#include <exception>#include <type_traits>#include <utility>
-
file
runtime_fwd.hpp
- #include <hpx/config.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/runtime/basename_registration_fwd.hpp>#include <hpx/runtime/config_entry.hpp>#include <hpx/runtime/find_localities.hpp>#include <hpx/runtime/get_colocation_id.hpp>#include <hpx/runtime/get_locality_id.hpp>#include <hpx/runtime/get_locality_name.hpp>#include <hpx/runtime/get_num_localities.hpp>#include <hpx/runtime/get_os_thread_count.hpp>#include <hpx/runtime/get_thread_name.hpp>#include <hpx/runtime/get_worker_thread_num.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/runtime/report_error.hpp>#include <hpx/runtime/runtime_fwd.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/runtime/set_parcel_write_handler.hpp>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/runtime/startup_function.hpp>#include <hpx/util/function.hpp>#include <hpx/util_fwd.hpp>#include <cstddef>#include <cstdint>#include <string>
-
file
throw_exception.hpp
- #include <hpx/config.hpp>#include <hpx/error.hpp>#include <hpx/exception_fwd.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <boost/current_function.hpp>#include <boost/system/error_code.hpp>#include <exception>#include <string>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>
Defines
-
HPX_THROW_EXCEPTION
(errcode, f, msg)¶ Throw a hpx::exception initialized from the given parameters.
The macro HPX_THROW_EXCEPTION can be used to throw a hpx::exception. The purpose of this macro is to prepend the source file name and line number of the position where the exception is thrown to the error message. Moreover, this associates additional diagnostic information with the exception, such as file name and line number, locality id and thread id, and stack backtrace from the point where the exception was thrown.
The parameter
errcode
holds the hpx::error code the new exception should encapsulate. The parameterf
is expected to hold the name of the function exception is thrown from and the parametermsg
holds the error message the new exception should encapsulate.void raise_exception() { // Throw a hpx::exception initialized from the given parameters. // Additionally associate with this exception some detailed // diagnostic information about the throw-site. HPX_THROW_EXCEPTION(hpx::no_success, "raise_exception", "simulated error"); }
- Example:
-
HPX_THROWS_IF
(ec, errcode, f, msg)¶ Either throw a hpx::exception or initialize hpx::error_code from the given parameters.
The macro HPX_THROWS_IF can be used to either throw a hpx::exception or to initialize a hpx::error_code from the given parameters. If &ec == &hpx::throws, the semantics of this macro are equivalent to HPX_THROW_EXCEPTION. If &ec != &hpx::throws, the hpx::error_code instance
ec
is initialized instead.The parameter
errcode
holds the hpx::error code from which the new exception should be initialized. The parameterf
is expected to hold the name of the function exception is thrown from and the parametermsg
holds the error message the new exception should encapsulate.
-
-
file
is_execution_policy.hpp
- #include <hpx/config.hpp>#include <hpx/util/decay.hpp>#include <type_traits>
-
file
checkpoint.hpp
- #include <hpx/dataflow.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/serialization/serialize.hpp>#include <hpx/runtime/serialization/vector.hpp>#include <cstddef>#include <fstream>#include <iosfwd>#include <sstream>#include <string>#include <type_traits>#include <utility>#include <vector>
This header defines the save_checkpoint and restore_checkpoint functions. These functions are designed to help HPX application developer’s checkpoint their applications. Save_checkpoint serializes one or more objects and saves them as a byte stream. Restore_checkpoint converts the byte stream back into instances of the objects.
-
file
debugging.hpp
- #include <hpx/config.hpp>
-
file
invoke.hpp
- #include <hpx/config.hpp>#include <hpx/util/result_of.hpp>#include <hpx/util/void_guard.hpp>#include <boost/ref.hpp>#include <functional>#include <type_traits>#include <utility>
-
file
invoke_fused.hpp
- #include <hpx/config.hpp>#include <hpx/util/detail/pack.hpp>#include <hpx/util/invoke.hpp>#include <hpx/util/result_of.hpp>#include <hpx/util/tuple.hpp>#include <hpx/util/void_guard.hpp>#include <cstddef>#include <type_traits>#include <utility>
-
file
pack_traversal.hpp
- #include <hpx/util/detail/pack_traversal_impl.hpp>#include <hpx/util/tuple.hpp>#include <type_traits>#include <utility>
-
file
pack_traversal_async.hpp
- #include <hpx/util/detail/pack_traversal_async_impl.hpp>#include <utility>
-
file
unwrap.hpp
- #include <hpx/config.hpp>#include <hpx/util/detail/unwrap_impl.hpp>#include <cstddef>#include <utility>
-
file
unwrapped.hpp
- #include <hpx/config.hpp>
-
dir
/hpx/source/hpx/runtime/actions
-
dir
/hpx/source/hpx/parallel/algorithms
-
dir
/hpx/source/hpx/components/component_storage
-
dir
/hpx/source/hpx/components
-
dir
/hpx/source/hpx/runtime/components
-
dir
/hpx/source/hpx/parallel/container_algorithms
-
dir
/hpx/source/hpx/parallel/executors
-
dir
/hpx/source/hpx
-
dir
/hpx/source/hpx/lcos
-
dir
/hpx/source/hpx/runtime/naming
-
dir
/hpx/source/hpx/parallel
-
dir
/hpx/source/hpx/performance_counters
-
dir
/hpx/source/hpx/runtime/threads/policies
-
dir
/hpx/source/hpx/runtime/resource
-
dir
/hpx/source/hpx/runtime
-
dir
/hpx/source
-
dir
/hpx/source/hpx/runtime/threads
-
dir
/hpx/source/hpx/traits
-
dir
/hpx/source/hpx/util