API reference

Main HPX library reference

template <typename Action>
struct async_result
#include <colocating_distribution_policy.hpp>

Note
This function is part of the invocation policy implemented by this class

Public Types

template<>
using type = hpx::future<typename traits::promise_local_result<typename hpx::traits::extract_action<Action>::remote_result_type>::type>
template <typename Action>
struct async_result
#include <default_distribution_policy.hpp>

Note
This function is part of the invocation policy implemented by this class

Public Types

template<>
using type = hpx::future<typename traits::promise_local_result<typename hpx::traits::extract_action<Action>::remote_result_type>::type>
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 represent
  • perf_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 represent
  • perf_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 represent
  • perf_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 create
  • vs: [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

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, typename Stub>
colocating_distribution_policy operator()(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 create
  • vs: [in] The arguments which will be forwarded to the constructors of the new objects.

template <typename Action, typename ... Ts>
async_result<Action>::type async(launch policy, Ts&&... vs) const
template <typename Action, typename Callback, typename ... Ts>
async_result<Action>::type async_cb(launch policy, Callback &&cb, Ts&&... vs) const

Note
This function is part of the invocation policy implemented by this class

template <typename Action, typename Continuation, typename ... Ts>
bool apply(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>
bool apply(threads::thread_priority priority, Ts&&... vs) const
template <typename Action, typename Continuation, typename Callback, typename ... Ts>
bool apply_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, typename Callback, typename ... Ts>
bool apply_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

hpx::id_type get_next_target() const

Returns the locality which is anticipated to be used for the next async operation

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 create
  • vs: [in] The arguments which will be forwarded to the constructors of the new objects.

template <typename Action, typename ... Ts>
async_result<Action>::type async(launch policy, Ts&&... vs) const
template <typename Action, typename Callback, typename ... Ts>
async_result<Action>::type async_cb(launch policy, Callback &&cb, Ts&&... vs) const

Note
This function is part of the invocation policy implemented by this class

template <typename Action, typename Continuation, typename ... Ts>
bool apply(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>
bool apply(threads::thread_priority priority, Ts&&... vs) const
template <typename Action, typename Continuation, typename Callback, typename ... Ts>
bool apply_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, typename Callback, typename ... Ts>
bool apply_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

hpx::id_type get_next_target() const

Returns the locality which is anticipated to be used for the next async operation

template <>
template<>
struct hash<hpx::threads::thread_id>
#include <thread_data_fwd.hpp>

Public Functions

std::size_t operator()(hpx::threads::thread_id const &v) const
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.

template <typename ExPolicy = parallel::execution::parallel_policy>
class task_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.

A task_block

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>
void run(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

template <typename Executor, typename F, typename ... Ts>
void run(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

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

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.

Private Members

mutex_type mtx_
std::vector<hpx::future<void>> tasks_
parallel::exception_list errors_
threads::thread_id_type id_
ExPolicy policy_
class task_canceled_exception : public 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()
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 void suspend_processing_unit_direct(std::size_t virt_core, error_code &ec = throws) = 0

Suspends the given processing unit. Blocks until the 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.

virtual void resume_processing_unit_direct(std::size_t virt_core, error_code &ec = throws) = 0

Resumes the given processing unit. Blocks until the 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_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 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.

struct thread_pool_init_parameters
#include <thread_pool_base.hpp>

Public Functions

thread_pool_init_parameters(std::string const &name, std::size_t index, policies::scheduler_mode mode, std::size_t num_threads, std::size_t thread_offset, hpx::threads::policies::callback_notifier &notifier, hpx::threads::policies::detail::affinity_data const &affinity_data, hpx::threads::detail::network_background_callback_type const &network_background_callback = hpx::threads::detail::network_background_callback_type(), std::size_t max_background_threads = std::size_t(-1), std::size_t max_idle_loop_count = HPX_IDLE_LOOP_COUNT_MAX, std::size_t max_busy_loop_count = HPX_BUSY_LOOP_COUNT_MAX)

Public Members

std::string const &name_
std::size_t index_
policies::scheduler_mode mode_
std::size_t num_threads_
std::size_t thread_offset_
hpx::threads::policies::callback_notifier &notifier_
hpx::threads::policies::detail::affinity_data const &affinity_data_
hpx::threads::detail::network_background_callback_type const &network_background_callback_
std::size_t max_background_threads_
std::size_t max_idle_loop_count_
std::size_t max_busy_loop_count_
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>
struct unwrap_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>
struct when_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.

template <typename Sequence>
struct when_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.

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

Typedefs

typedef util::unique_function_nonser<void()> shutdown_function_type

The type of a function which is registered to be executed as a shutdown or pre-shutdown function.

typedef util::unique_function_nonser<void()> startup_function_type

The type of a function which is registered to be executed as a startup or pre-startup function.

Enums

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(hpx::program_options::variables_map &vm)> const &f, hpx::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 by f as a HPX thread. This overload will not call hpx_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 in argc/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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • 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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 before f 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)(hpx::program_options::variables_map &vm), hpx::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 by f as a HPX thread. This overload will not call hpx_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 in argc/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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • 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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • startup: [in] A function to be executed inside a HPX thread before f 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(hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • startup: [in] A function to be executed inside a HPX thread before f 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(hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 before f 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 empty hpx_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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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(hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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(hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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)(hpx::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 call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • app_name: [in] The name of the application.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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)(hpx::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 call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • app_name: [in] The name of the application.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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(util::function_nonser<int(int, char **)> const &f, 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 call hpx_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 configuration passed in cfg.
Parameters
  • f: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. If f is nullptr the HPX runtime environment will be started without invoking f.
  • 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(hpx::program_options::variables_map &vm)> const &f, hpx::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 by f as a HPX thread. It will return immediately after that. Use hpx::wait and hpx::stop to synchronize with the runtime system’s execution. This overload will not call hpx_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 in argc/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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • 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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 before f 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)(hpx::program_options::variables_map &vm), hpx::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 by f as a HPX thread. It will return immediately after that. Use hpx::wait and hpx::stop to synchronize with the runtime system’s execution. This overload will not call hpx_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 in argc/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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • 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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • startup: [in] A function to be executed inside a HPX thread before f 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(hpx::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 and hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • startup: [in] A function to be executed inside a HPX thread before f 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(hpx::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 and hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 before f 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 and hpx::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 empty hpx_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 in argc/argv. Otherwise it will be executed as specified by the parametermode.
Parameters
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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(hpx::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 and hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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(hpx::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 and hpx::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 empty hpx_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 in argc/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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 and hpx::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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 and hpx::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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 and hpx::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)(hpx::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 and hpx::stop to synchronize with the runtime system’s execution. This overload will schedule the function given by f as a HPX thread. It will not call hpx_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 in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 and hpx::stop to synchronize with the runtime system’s execution. This overload will schedule the function given by f as a HPX thread. It will not call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • app_name: [in] The name of the application.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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)(hpx::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 and hpx::stop to synchronize with the runtime system’s execution. This overload will schedule the function given by f as a HPX thread. It will not call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 and hpx::stop to synchronize with the runtime system’s execution. This overload will schedule the function given by f as a HPX thread. It will not call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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 and hpx::stop to synchronize with the runtime system’s execution. This overload will schedule the function given by f as a HPX thread. It will not call hpx_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. If f is nullptr the HPX runtime environment will be started without invoking f.
  • argc: [in] The number of command line arguments passed in argv. This is usually the unchanged value as passed by the operating system (to main()).
  • argv: [in] The command line arguments for this application, usually that is the value as passed by the operating system (to main()).
  • 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(int, char **)> const &f, 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 and hpx::stop to synchronize with the runtime system’s execution. This overload will schedule the function given by f as a HPX thread. It will not call hpx_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 configuration passed in cfg.
Parameters
  • f: [in] The function to be scheduled as an HPX thread. Usually this function represents the main entry point of any HPX application. If f is nullptr the HPX runtime environment will be started without invoking f.
  • 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 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 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 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 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.

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 create
  • compress: [in] The created filter should support compression
  • next_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 = ~static_cast<std::size_t>(0))

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 = ~static_cast<std::size_t>(0))

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 = ~static_cast<std::size_t>(0))

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, typename Stub>
hpx::future<bool> register_with_basename(std::string base_name, components::client_base<Client, Stub> &client, std::size_t sequence_nr = ~static_cast<std::size_t>(0))

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 = ~static_cast<std::size_t>(0))

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.

template <typename Component>
hpx::future<std::shared_ptr<Component>> get_ptr(naming::id_type const &id)

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.

template <typename Derived, typename Stub>
hpx::future<std::shared_ptr<typename components::client_base<Derived, Stub>::server_component_type>> get_ptr(components::client_base<Derived, Stub> const &c)

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.

template <typename Component>
std::shared_ptr<Component> get_ptr(launch::sync_policy p, naming::id_type const &id, error_code &ec = throws)

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.

template <typename Derived, typename Stub>
std::shared_ptr<typename components::client_base<Derived, Stub>::server_component_type> get_ptr(launch::sync_policy p, components::client_base<Derived, Stub> const &c, error_code &ec = throws)

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)

Returns the internal representation (runtime_mode constant) from the readable string representing the name.

This represents the internal representation from the readable string representing the name.

Parameters
  • mode: this represents the runtime mode

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.

See
hpx::register_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.

See
hpx::register_pre_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>
void set_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>::type set_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>::type set_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>
void set_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>::type set_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>::type set_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, typenameTs>
<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.
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, typenameTs>
<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 is hpx::launch::sync the function will directly return an hpx::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.
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, typenameTs>
<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.
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 create
  • 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, typenameTs>
<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.
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, typenameTs>
<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.
Parameters
  • policy: [in] The distribution policy used to decide where to place the newly created.
  • count: [in] The number of component instances to create
  • 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 ... 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:
tuple<future<void> > split_future(future<tuple<> > && f);
array<future<void>, 1> split_future(future<array<T, 0> > && f);
here the returned futures are directly representing the futures which were passed to the function.
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>
void wait_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>
void wait_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_t N>
void wait_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>
void wait_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>
InputIter wait_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, typename Container = 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, typename Container = 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>
void wait_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>
void wait_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 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>
void wait_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>
void wait_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>
InputIter wait_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, typename Container = 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, typename Container = 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>
void wait_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_t N>
void wait_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>
void wait_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>
InputIter wait_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, typename Container = 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, typename Container = 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, typename Future>
void wait_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, typename Iterator>
void wait_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>
void wait_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, typename Iterator>
void wait_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, typename Future>
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, typename Iterator>
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, typename Iterator>
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.

namespace actions
namespace applier

Functions

applier &get_applier()

The function get_applier returns a reference to the (thread specific) applier instance.

applier *get_applier_ptr()

The function get_applier returns a pointer to the (thread specific) applier instance. The returned pointer is NULL if the current thread is not known to HPX or if the runtime system is not active.

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, typename Stub>
Derived migrate_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 copy
  • target_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, typename Stub>
Derived copy(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 copy
  • target_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, typename DistPolicy>
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, typename Stub, typename DistPolicy>
Derived migrate(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, typename Stub>
Derived migrate(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.

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.

namespace parallel
namespace v2

Functions

template <typename ExPolicy, typename F>
util::detail::algorithm_result<ExPolicy>::type define_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>
void define_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, typename F>
util::detail::algorithm_result<ExPolicy>::type define_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>
void define_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).

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.

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.

namespace threads

Functions

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_data *get_self_id_data()

The function get_self_id_data returns the data of the HPX thread id associated with the current thread (or nullptr 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 run
  • started: [in,out] A helper variable allowing to track the state of the timer helper thread
  • 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, 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 run
  • 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.

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.

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.

namespace policies

Enums

enum scheduler_mode

This enumeration describes the possible modes of a scheduler.

Values:

nothing_special = 0x000

can be used to disable all other options.

As the name suggests, this option

do_background_work = 0x001

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 = 0x002

os-thread driving the scheduler will be reduced below normal.

The kernel priority of the

delay_exit = 0x004

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.

fast_idle_mode = 0x008

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 = 0x010

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 = 0x020

that support work thread/stealing to enable/disable it

This option allows schedulers

enable_stealing_numa = 0x040

that support it to disallow stealing between numa domains

This option allows schedulers

assign_work_round_robin = 0x080

that support it to add tasks round robin to queues on each core

This option tells schedulers

assign_work_thread_parent = 0x100

This option tells schedulers that support it to add tasks round to the same core/queue that the parent task is running on

steal_high_priority_first = 0x200

This option tells schedulers that support it to always (try to) steal high priority tasks from other queues before finishing their own lower priority tasks

steal_after_local = 0x400

This option tells schedulers that support it to steal tasks only when their local queues are empty

enable_idle_backoff = 0x800

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_stealing_numa |

assign_work_round_robin |

steal_after_local |

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_stealing_numa |

assign_work_round_robin |

assign_work_thread_parent |

steal_high_priority_first |

steal_after_local |

enable_idle_backoff


namespace traits
namespace util

Functions

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.

void may_attach_debugger(std::string const &category)

Attaches a debugger if category is equal to the configuration entry hpx.attach-debugger.

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.

template <typename Visitor, typename... T>
auto traverse_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 three operator() 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 hpx::intrusive_ptr that references an instance of the given visitor object.
Parameters
  • visitor: A visitor object which provides the three operator() overloads that were described above. Additionally the visitor must be compatible for referencing it from a hpx::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, typename Visitor, typename... T>
auto traverse_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 three operator() 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 hpx::intrusive_ptr that references an instance of the given visitor object.
Parameters
  • visitor: A visitor object which provides the three operator() overloads that were described above. Additionally the visitor must be compatible for referencing it from a hpx::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>
auto unwrap(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>
auto unwrap_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>
auto unwrap_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>
auto unwrapping(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, typename T>
auto unwrapping_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>
auto unwrapping_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.

namespace functional
namespace std
file migrate_from_storage.hpp
#include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/allocator_support/allocator_deleter.hpp>#include <hpx/allocator_support/internal_allocator.hpp>#include <hpx/assertion.hpp>#include <hpx/concepts/concepts.hpp>#include <hpx/errors.hpp>#include <hpx/functional/bind.hpp>#include <hpx/functional/function.hpp>#include <hpx/functional/invoke.hpp>#include <hpx/functional/result_of.hpp>#include <hpx/functional/traits/is_callable.hpp>#include <hpx/lcos/detail/future_data.hpp>#include <hpx/coroutines/detail/get_stack_pointer.hpp>#include <hpx/functional/unique_function.hpp>#include <hpx/synchronization/condition_variable.hpp>#include <hpx/synchronization/spinlock.hpp>#include <hpx/memory/intrusive_ptr.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/coroutines/thread_enums.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <type_traits>#include <utility>#include <hpx/runtime/threads/thread_executor.hpp>#include <hpx/runtime/get_os_thread_count.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/coroutines/coroutine_fwd.hpp>#include <hpx/coroutines/thread_id_type.hpp>#include <hpx/util_fwd.hpp>#include <cstddef>#include <cstdint>#include <memory>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/thread_support/atomic_count.hpp>#include <hpx/timing/steady_clock.hpp>#include <hpx/topology/cpu_mask.hpp>#include <hpx/topology/topology.hpp>#include <hpx/util/thread_description.hpp>#include <hpx/runtime/actions/basic_action_fwd.hpp>#include <hpx/runtime/actions/preassigned_action_id.hpp>#include <hpx/functional/traits/get_function_address.hpp>#include <hpx/functional/traits/get_function_annotation.hpp>#include <hpx/functional/traits/is_action.hpp>#include <iosfwd>#include <string>#include <chrono>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/runtime/threads/thread_helpers.hpp>#include <hpx/basic_execution/register_locks.hpp>#include <hpx/runtime/thread_pool_helpers.hpp>#include <hpx/runtime/threads/register_thread.hpp>#include <hpx/runtime/threads/policies/scheduler_base.hpp>#include <hpx/concurrency/cache_line_data.hpp>#include <hpx/format.hpp>#include <hpx/runtime/threads/policies/thread_queue_init_parameters.hpp>#include <limits>#include <hpx/runtime/threads/thread_init_data.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/runtime/agas_fwd.hpp>#include <hpx/runtime/threads_fwd.hpp>#include <hpx/runtime/threads/thread_pool_base.hpp>#include <hpx/concurrency/barrier.hpp>#include <hpx/runtime/threads/detail/network_background_callback.hpp>#include <hpx/affinity/affinity_data.hpp>#include <hpx/runtime/threads/policies/callback_notifier.hpp>#include <deque>#include <exception>#include <hpx/state.hpp>#include <thread>#include <functional>#include <mutex>#include <vector>#include <atomic>#include <condition_variable>#include <hpx/runtime/threads/thread_data.hpp>#include <hpx/basic_execution/this_thread.hpp>#include <hpx/concurrency/spinlock_pool.hpp>#include <hpx/coroutines/coroutine.hpp>#include <hpx/coroutines/detail/combined_tagged_state.hpp>#include <hpx/logging.hpp>#include <hpx/runtime/get_locality_id.hpp>#include <hpx/util/backtrace.hpp>#include <forward_list>#include <stack>#include <hpx/runtime/threads/thread_data_stackful.hpp>#include <hpx/runtime/threads/execution_agent.hpp>#include <hpx/basic_execution/agent_base.hpp>#include <hpx/basic_execution/context_base.hpp>#include <hpx/basic_execution/resource_base.hpp>#include <hpx/coroutines/detail/coroutine_impl.hpp>#include <hpx/coroutines/detail/coroutine_stackful_self.hpp>#include <hpx/runtime/threads/thread_data_stackless.hpp>#include <hpx/coroutines/stackless_coroutine.hpp>#include <hpx/thread_support/assert_owns_lock.hpp>#include <hpx/traits/future_access.hpp>#include <hpx/traits/future_traits.hpp>#include <hpx/traits/is_future.hpp>#include <boost/ref.hpp>#include <hpx/traits/get_remote_result.hpp>#include <hpx/type_support/decay.hpp>#include <hpx/type_support/unused.hpp>#include <hpx/util/annotated_function.hpp>#include <boost/container/small_vector.hpp>#include <hpx/lcos/detail/future_traits.hpp>#include <hpx/type_support/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/serialization/detail/polymorphic_nonintrusive_factory.hpp>#include <hpx/traits/acquire_shared_state.hpp>#include <hpx/iterator_support/traits/is_range.hpp>#include <hpx/iterator_support/range.hpp>#include <hpx/traits/is_future_range.hpp>#include <hpx/util/detail/reserve.hpp>#include <algorithm>#include <hpx/traits/future_then_result.hpp>#include <hpx/datastructures/detail/pack.hpp>#include <hpx/type_support/identity.hpp>#include <hpx/type_support/lazy_conditional.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <hpx/traits/executor_traits.hpp>#include <hpx/type_support/lazy_enable_if.hpp>#include <hpx/type_support/void_guard.hpp>#include <hpx/util/serialize_exception.hpp>#include <hpx/lcos/local/packaged_continuation.hpp>#include <hpx/parallel/executors/execution.hpp>#include <hpx/parallel/executors/post_policy_dispatch.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/components/component_storage/server/migrate_from_storage.hpp>
file migrate_to_storage.hpp
#include <hpx/config.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/assertion.hpp>#include <hpx/errors.hpp>#include <hpx/functional/bind_back.hpp>#include <hpx/memory/intrusive_ptr.hpp>#include <hpx/runtime/agas/interface.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/functional/unique_function.hpp>#include <hpx/preprocessor/cat.hpp>#include <hpx/preprocessor/expand.hpp>#include <hpx/preprocessor/nargs.hpp>#include <hpx/preprocessor/stringize.hpp>#include <hpx/preprocessor/strip_parens.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/thread_support/atomic_count.hpp>#include <hpx/traits/component_type_database.hpp>#include <cstdint>#include <hpx/type_support/decay.hpp>#include <string>#include <hpx/runtime/components_fwd.hpp>#include <hpx/traits/managed_component_policies.hpp>#include <hpx/type_support/always_void.hpp>#include <cstddef>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/allocator_support/internal_allocator.hpp>#include <hpx/basic_execution/register_locks.hpp>#include <hpx/concurrency/itt_notify.hpp>#include <hpx/concurrency/spinlock_pool.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <hpx/serialization/traits/is_bitwise_serializable.hpp>#include <hpx/traits/get_remote_result.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/synchronization/detail/yield_k.hpp>#include <functional>#include <iosfwd>#include <mutex>#include <vector>#include <hpx/config/warnings_prefix.hpp>#include <hpx/runtime/naming/id_type_impl.hpp>#include <hpx/config/warnings_suffix.hpp>#include <boost/dynamic_bitset.hpp>#include <map>#include <utility>#include <hpx/runtime/components/make_client.hpp>#include <hpx/traits/is_client.hpp>#include <type_traits>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/lcos/async_fwd.hpp>#include <hpx/lcos/detail/async_colocated_fwd.hpp>#include <hpx/runtime/actions/basic_action_fwd.hpp>#include <hpx/traits/extract_action.hpp>#include <hpx/traits/is_continuation.hpp>#include <hpx/lcos/detail/async_implementations_fwd.hpp>#include <hpx/runtime/naming/unmanaged.hpp>#include <hpx/serialization/serialize.hpp>#include <hpx/traits/acquire_future.hpp>#include <hpx/iterator_support/range.hpp>#include <hpx/util/detail/reserve.hpp>#include <hpx/concepts/has_member_xxx.hpp>#include <hpx/traits/is_future.hpp>#include <hpx/traits/is_future_range.hpp>#include <hpx/iterator_support/traits/is_range.hpp>#include <algorithm>#include <array>#include <iterator>#include <hpx/traits/action_remote_result.hpp>#include <hpx/traits/future_access.hpp>#include <hpx/traits/future_traits.hpp>#include <exception>#include <hpx/traits/is_component.hpp>#include <hpx/components/component_storage/component_storage.hpp>#include <hpx/components/component_storage/server/migrate_to_storage.hpp>
file hpx_finalize.hpp
#include <hpx/config.hpp>#include <hpx/errors.hpp>
file hpx_init.hpp
#include <hpx/config.hpp>#include <hpx/hpx_finalize.hpp>#include <hpx/errors.hpp>#include <hpx/hpx_suspend.hpp>#include <hpx/program_options.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <string>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/functional/unique_function.hpp>#include <hpx/runtime/startup_function.hpp>#include <hpx/functional/function.hpp>#include <cstddef>#include <vector>
file hpx_start.hpp
#include <hpx/config.hpp>#include <hpx/hpx_finalize.hpp>#include <hpx/program_options.hpp>#include <hpx/runtime/runtime_mode.hpp>#include <hpx/runtime/shutdown_function.hpp>#include <hpx/runtime/startup_function.hpp>#include <hpx/functional/function.hpp>#include <cstddef>#include <string>#include <vector>
file hpx_suspend.hpp
#include <hpx/errors.hpp>
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 task_block.hpp
#include <hpx/config.hpp>#include <hpx/async.hpp>#include <hpx/async_launch_policy_dispatch.hpp>#include <hpx/assertion.hpp>#include <hpx/coroutines/thread_enums.hpp>#include <hpx/functional/deferred_call.hpp>#include <hpx/functional/invoke.hpp>#include <hpx/functional/traits/is_action.hpp>#include <hpx/lcos/async_fwd.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/local/futures_factory.hpp>#include <hpx/allocator_support/allocator_deleter.hpp>#include <hpx/allocator_support/internal_allocator.hpp>#include <hpx/errors.hpp>#include <hpx/lcos/detail/future_data.hpp>#include <hpx/memory/intrusive_ptr.hpp>#include <hpx/runtime/get_worker_thread_num.hpp>#include <cstddef>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/runtime/threads/thread_helpers.hpp>#include <hpx/traits/future_access.hpp>#include <hpx/util/thread_description.hpp>#include <hpx/parallel/executors/execution.hpp>#include <cstdint>#include <exception>#include <memory>#include <type_traits>#include <utility>#include <hpx/runtime/threads/thread_pool_base.hpp>#include <hpx/lcos/async.hpp>#include <hpx/functional/bind_back.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/functional/unique_function.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/datastructures/tuple.hpp>#include <hpx/functional/invoke_fused.hpp>#include <hpx/lcos/sync_fwd.hpp>#include <hpx/type_support/decay.hpp>#include <hpx/logging.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_fwd.hpp>#include <hpx/runtime/actions/continuation_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/runtime/naming/address.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/runtime/naming_fwd.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <hpx/serialization/traits/is_bitwise_serializable.hpp>#include <iosfwd>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/traits/is_component.hpp>#include <hpx/traits/action_decorate_function.hpp>#include <hpx/concepts/has_xxx.hpp>#include <hpx/type_support/detail/wrap_int.hpp>#include <hpx/traits/component_pin_support.hpp>#include <hpx/runtime/parcelset_fwd.hpp>#include <hpx/serialization/base_object.hpp>#include <hpx/serialization/input_archive.hpp>#include <hpx/serialization/output_archive.hpp>#include <hpx/runtime/threads/thread_init_data.hpp>#include <hpx/traits/action_remote_result.hpp>#include <hpx/debugging/demangle_helper.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/traits/extract_action.hpp>#include <hpx/runtime/actions/trigger.hpp>#include <hpx/type_support/unused.hpp>#include <hpx/runtime/agas/interface.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/serialization/serialize.hpp>#include <hpx/runtime/trigger_lco.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/applier/detail/apply_implementations_fwd.hpp>#include <hpx/traits/is_continuation.hpp>#include <hpx/traits/future_traits.hpp>#include <hpx/util/serializable_unique_function.hpp>#include <hpx/util/detail/serializable_basic_function.hpp>#include <hpx/functional/detail/basic_function.hpp>#include <hpx/functional/detail/vtable/function_vtable.hpp>#include <hpx/util/detail/vtable/serializable_function_vtable.hpp>#include <hpx/serialization/detail/polymorphic_intrusive_factory.hpp>#include <hpx/functional/detail/function_registration.hpp>#include <hpx/functional/detail/empty_function.hpp>#include <hpx/util/detail/vtable/serializable_vtable.hpp>#include <hpx/functional/detail/vtable/vtable.hpp>#include <new>#include <string>#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/functional/function.hpp>#include <vector>#include <hpx/hashing/jenkins_hash.hpp>#include <hpx/type_support/static.hpp>#include <unordered_map>#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/parcelset/detail/per_action_data_counter_registry.hpp>#include <hpx/serialization/tuple.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/runtime/config_entry.hpp>#include <cstdlib>#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/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_fwd.hpp>#include <hpx/traits/action_stacksize.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/datastructures/detail/pack.hpp>#include <hpx/util/get_and_reset_value.hpp>#include <boost/utility/string_ref.hpp>#include <atomic>#include <sstream>#include <hpx/runtime/actions/component_action.hpp>#include <hpx/traits/is_client.hpp>#include <hpx/traits/is_future.hpp>#include <hpx/runtime/components/server/managed_component_base.hpp>#include <hpx/runtime/components/server/component_heap.hpp>#include <hpx/static_reinit/reinitializable_static.hpp>#include <hpx/runtime/components/server/create_component_fwd.hpp>#include <hpx/runtime/components/server/wrapper_heap.hpp>#include <hpx/concurrency/itt_notify.hpp>#include <hpx/synchronization/spinlock.hpp>#include <hpx/util/generate_unique_ids.hpp>#include <hpx/concurrency/spinlock.hpp>#include <mutex>#include <hpx/util/wrapper_heap_base.hpp>#include <hpx/runtime/components/server/wrapper_heap_list.hpp>#include <hpx/util/one_size_heap_list.hpp>#include <list>#include <hpx/thread_support/unlock_guard.hpp>#include <iostream>#include <hpx/traits/managed_component_policies.hpp>#include <stdexcept>#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 <map>#include <hpx/type_support/void_guard.hpp>#include <hpx/thread_support/atomic_count.hpp>#include <hpx/traits/component_type_database.hpp>#include <hpx/local_lcos/promise.hpp>#include <hpx/runtime/applier/apply.hpp>#include <hpx/runtime/applier/apply_helper.hpp>#include <hpx/state.hpp>#include <hpx/traits/action_continuation.hpp>#include <hpx/traits/action_decorate_continuation.hpp>#include <hpx/traits/action_schedule_thread.hpp>#include <hpx/traits/action_select_direct_execution.hpp>#include <thread>#include <chrono>#include <hpx/runtime/applier/detail/apply_implementations.hpp>#include <hpx/runtime/parcelset/parcel.hpp>#include <hpx/traits/action_is_target_valid.hpp>#include <hpx/traits/action_was_object_migrated.hpp>#include <hpx/traits/component_supports_migration.hpp>#include <hpx/format.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/parcelset/detail/parcel_await.hpp>#include <hpx/runtime/parcelset/put_parcel.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/runtime/threads/policies/scheduler_base.hpp>#include <hpx/runtime/threads/thread_data.hpp>#include <hpx/timing/steady_clock.hpp>#include <hpx/traits/is_launch_policy.hpp>#include <hpx/type_support/lazy_enable_if.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/functional/result_of.hpp>#include <hpx/traits/promise_remote_result.hpp>#include <hpx/traits/is_executor.hpp>#include <hpx/util/bind_action.hpp>#include <hpx/functional/bind.hpp>#include <hpx/functional/traits/is_bind_expression.hpp>#include <hpx/functional/traits/is_placeholder.hpp>#include <hpx/parallel/executors/parallel_executor.hpp>#include <functional>#include <hpx/lcos/dataflow.hpp>#include <hpx/coroutines/detail/get_stack_pointer.hpp>#include <hpx/lcos/detail/future_transforms.hpp>#include <hpx/lcos/detail/future_traits.hpp>#include <hpx/traits/acquire_future.hpp>#include <hpx/traits/acquire_shared_state.hpp>#include <hpx/util/detail/reserve.hpp>#include <algorithm>#include <iterator>#include <hpx/type_support/always_void.hpp>#include <hpx/util/annotated_function.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/iterator_support/traits/is_range.hpp>#include <hpx/datastructures/traits/is_tuple_like.hpp>#include <boost/ref.hpp>#include <hpx/lcos/when_all.hpp>#include <hpx/parallel/exception_list.hpp>#include <hpx/parallel/execution_policy.hpp>#include <hpx/parallel/util/detail/algorithm_result.hpp>#include <boost/utility/addressof.hpp>
file manage_counter_type.hpp
#include <hpx/config.hpp>#include <hpx/errors.hpp>#include <hpx/performance_counters/counters_fwd.hpp>#include <hpx/functional/function.hpp>#include <cstddef>#include <cstdint>#include <string>#include <vector>
file basic_action.hpp
#include <hpx/config.hpp>#include <hpx/datastructures/tuple.hpp>#include <hpx/errors.hpp>#include <hpx/functional/invoke_fused.hpp>#include <hpx/lcos/sync_fwd.hpp>#include <hpx/logging.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_fwd.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/serialization/tuple.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/coroutines/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/functional/traits/is_action.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/datastructures/detail/pack.hpp>#include <hpx/util/get_and_reset_value.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_DECLARATION_(...)
HPX_REGISTER_ACTION_DECLARATION_1(action)
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_client.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/assertion.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 <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 parameter name 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 parameter name 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/assertion.hpp>#include <hpx/dataflow.hpp>#include <hpx/lcos/future.hpp>#include <hpx/lcos/dataflow.hpp>#include <hpx/performance_counters/performance_counter.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/functional/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/errors.hpp>#include <hpx/lcos/base_lco_with_value.hpp>#include <hpx/performance_counters/counters.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <hpx/functional/function.hpp>#include <cstddef>#include <cstdint>#include <string>#include <utility>#include <vector>#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/allocator_support/internal_allocator.hpp>#include <hpx/traits/component_heap_type.hpp>#include <new>#include <hpx/thread_support/atomic_count.hpp>#include <hpx/runtime/components/stubs/stub_base.hpp>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/serialization/string.hpp>#include <hpx/serialization/vector.hpp>#include <hpx/traits/is_distribution_policy.hpp>#include <hpx/functional/bind_back.hpp>#include <hpx/util/unwrap.hpp>#include <hpx/util/detail/unwrap_impl.hpp>#include <hpx/traits/future_traits.hpp>#include <hpx/traits/is_future.hpp>#include <hpx/datastructures/traits/is_tuple_like.hpp>#include <hpx/functional/invoke.hpp>#include <hpx/functional/invoke_fused.hpp>#include <hpx/util/pack_traversal.hpp>#include <hpx/util/detail/pack_traversal_impl.hpp>#include <hpx/datastructures/detail/pack.hpp>#include <hpx/datastructures/tuple.hpp>#include <hpx/functional/result_of.hpp>#include <hpx/functional/traits/is_callable.hpp>#include <hpx/traits/pack_traversal_rebind_container.hpp>#include <array>#include <memory>#include <list>#include <type_traits>#include <hpx/type_support/always_void.hpp>#include <hpx/util/detail/container_category.hpp>#include <hpx/util/detail/reserve.hpp>#include <iterator>#include <algorithm>
file colocating_distribution_policy.hpp
#include <hpx/config.hpp>#include <hpx/lcos/detail/async_colocated.hpp>#include <hpx/assertion.hpp>#include <hpx/lcos/async_continue_fwd.hpp>#include <hpx/lcos/async_fwd.hpp>#include <hpx/lcos/detail/async_colocated_fwd.hpp>#include <hpx/lcos/future.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/runtime/agas/primary_namespace.hpp>#include <hpx/runtime/agas_fwd.hpp>#include <hpx/runtime/parcelset_fwd.hpp>#include <hpx/runtime/agas/gva.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/datastructures/tuple.hpp>#include <cstdint>#include <memory>#include <utility>#include <vector>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>#include <hpx/runtime/agas/server/primary_namespace.hpp>#include <hpx/lcos/base_lco_with_value.hpp>#include <hpx/synchronization/condition_variable.hpp>#include <hpx/runtime/actions/component_action.hpp>#include <hpx/runtime/components/server/fixed_component_base.hpp>#include <hpx/runtime/applier/applier.hpp>#include <hpx/runtime/applier_fwd.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/runtime/parcelset/parcel.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/threadmanager.hpp>#include <cstddef>#include <hpx/runtime/applier/bind_naming_wrappers.hpp>#include <hpx/errors.hpp>#include <hpx/runtime/components/server/create_component_fwd.hpp>#include <hpx/runtime/components_fwd.hpp>#include <hpx/runtime_fwd.hpp>#include <hpx/traits/is_component.hpp>#include <hpx/functional/unique_function.hpp>#include <sstream>#include <type_traits>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/traits/action_message_handler.hpp>#include <hpx/traits/action_serialization_filter.hpp>#include <hpx/allocator_support/internal_allocator.hpp>#include <atomic>#include <list>#include <map>#include <mutex>#include <string>#include <hpx/traits/extract_action.hpp>#include <hpx/traits/is_continuation.hpp>#include <hpx/traits/promise_local_result.hpp>#include <hpx/functional/bind.hpp>#include <hpx/util/bind_action.hpp>#include <hpx/util/functional/colocated_helpers.hpp>#include <hpx/format.hpp>#include <hpx/functional/result_of.hpp>#include <hpx/runtime/actions/continuation.hpp>#include <hpx/serialization/serialize.hpp>#include <hpx/serialization/unique_ptr.hpp>#include <hpx/type_support/decay.hpp>#include <hpx/type_support/unused.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/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/is_distribution_policy.hpp>#include <hpx/traits/promise_remote_result.hpp>#include <hpx/lcos/detail/async_colocated_callback_fwd.hpp>#include <hpx/lcos/detail/async_implementations.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/stubs/stub_base.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/find_here.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <algorithm>
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/assertion.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 <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>#include <hpx/runtime/components/server/copy_component.hpp>#include <hpx/runtime/actions/plain_action.hpp>#include <hpx/runtime/components/stubs/runtime_support.hpp>#include <hpx/async.hpp>#include <hpx/errors.hpp>#include <hpx/lcos/detail/async_colocated_fwd.hpp>#include <hpx/runtime/actions/manage_object_action.hpp>#include <hpx/runtime/actions/action_support.hpp>#include <hpx/serialization/array.hpp>#include <hpx/serialization/base_object.hpp>#include <hpx/serialization/serialize_buffer.hpp>#include <hpx/static_reinit/reinitializable_static.hpp>#include <cstddef>#include <cstdint>#include <cstring>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/components/server/runtime_support.hpp>#include <hpx/synchronization/condition_variable.hpp>#include <hpx/synchronization/mutex.hpp>#include <hpx/synchronization/spinlock.hpp>#include <hpx/performance_counters/counters.hpp>#include <hpx/plugin.hpp>#include <hpx/plugins/plugin_factory_base.hpp>#include <hpx/datastructures/detail/pack.hpp>#include <hpx/plugins/plugin_registry_base.hpp>#include <hpx/util_fwd.hpp>#include <vector>#include <hpx/util/ini.hpp>#include <hpx/program_options.hpp>#include <hpx/runtime/actions/component_action.hpp>#include <hpx/runtime/components/server/create_component.hpp>#include <hpx/runtime/components/server/create_component_fwd.hpp>#include <hpx/runtime/components/server/component_heap.hpp>#include <hpx/runtime/components/static_factory_data.hpp>#include <hpx/datastructures/any.hpp>#include <hpx/preprocessor/stringize.hpp>#include <map>#include <hpx/runtime/find_here.hpp>#include <hpx/runtime/parcelset/locality.hpp>#include <hpx/runtime/parcelset_fwd.hpp>#include <hpx/serialization/map.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <hpx/iterator_support/traits/is_iterator.hpp>#include <memory>#include <type_traits>#include <hpx/traits/action_does_termination_detection.hpp>#include <hpx/traits/is_component.hpp>#include <atomic>#include <condition_variable>#include <list>#include <mutex>#include <set>#include <thread>#include <hpx/runtime/naming/name.hpp>#include <hpx/serialization/vector.hpp>#include <hpx/type_support/decay.hpp>#include <hpx/runtime/get_ptr.hpp>#include <hpx/runtime/agas/gva.hpp>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/get_lva.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime_fwd.hpp>#include <hpx/traits/component_pin_support.hpp>#include <hpx/traits/component_type_is_compatible.hpp>#include <hpx/functional/bind_back.hpp>#include <hpx/traits/get_remote_result.hpp>
file default_distribution_policy.hpp
#include <hpx/config.hpp>#include <hpx/assertion.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/find_here.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <hpx/serialization/shared_ptr.hpp>#include <hpx/serialization/vector.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 <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/actions/plain_action.hpp>#include <hpx/runtime/agas/interface.hpp>#include <hpx/runtime/components/stubs/runtime_support.hpp>#include <hpx/runtime/get_ptr.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/traits/component_supports_migration.hpp>#include <hpx/traits/is_component.hpp>#include <cstdint>#include <memory>#include <utility>#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/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/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 <vector>
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/assertion.hpp>#include <hpx/lcos/dataflow.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/find_here.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/serialization/serialization_fwd.hpp>#include <hpx/serialization/shared_ptr.hpp>#include <hpx/serialization/vector.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 <memory>#include <type_traits>#include <utility>#include <vector>#include <hpx/runtime/components/server/create_component.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/traits/is_client.hpp>#include <hpx/traits/is_component.hpp>#include <hpx/type_support/lazy_enable_if.hpp>
file find_here.hpp
#include <hpx/config.hpp>#include <hpx/errors.hpp>#include <hpx/runtime/naming/id_type.hpp>
file find_localities.hpp
#include <hpx/config.hpp>#include <hpx/errors.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <vector>
file get_colocation_id.hpp
#include <hpx/errors.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/errors.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/errors.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/assertion.hpp>#include <hpx/runtime/agas/gva.hpp>#include <hpx/runtime/components/component_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/errors.hpp>#include <boost/io/ios_state.hpp>#include <cstdint>#include <hpx/runtime/components/client_base.hpp>#include <hpx/runtime/get_lva.hpp>#include <hpx/runtime/launch_policy.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime_fwd.hpp>#include <hpx/traits/component_pin_support.hpp>#include <hpx/traits/component_type_is_compatible.hpp>#include <hpx/functional/bind_back.hpp>#include <memory>
file get_thread_name.hpp
#include <hpx/config.hpp>#include <string>
file get_worker_thread_num.hpp
#include <hpx/config.hpp>#include <hpx/errors.hpp>#include <cstddef>
file launch_policy.hpp
#include <hpx/config.hpp>#include <hpx/coroutines/thread_enums.hpp>#include <hpx/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 runtime_mode.hpp
#include <hpx/config.hpp>#include <string>
file set_parcel_write_handler.hpp
#include <hpx/config.hpp>
file shutdown_function.hpp
#include <hpx/config.hpp>#include <hpx/functional/unique_function.hpp>
file startup_function.hpp
#include <hpx/config.hpp>#include <hpx/functional/unique_function.hpp>
file scheduler_mode.hpp
#include <cstdint>
file thread_data_fwd.hpp
#include <hpx/config.hpp>#include <hpx/coroutines/coroutine_fwd.hpp>#include <hpx/coroutines/thread_enums.hpp>#include <hpx/coroutines/thread_id_type.hpp>#include <hpx/errors.hpp>#include <hpx/functional/function.hpp>#include <hpx/functional/unique_function.hpp>#include <hpx/util_fwd.hpp>#include <cstddef>#include <cstdint>#include <memory>#include <utility>
file thread_helpers.hpp
#include <hpx/config.hpp>#include <hpx/basic_execution/register_locks.hpp>#include <hpx/coroutines/thread_enums.hpp>#include <hpx/errors.hpp>#include <hpx/functional/unique_function.hpp>#include <hpx/runtime/thread_pool_helpers.hpp>#include <hpx/runtime/threads/policies/scheduler_mode.hpp>#include <hpx/runtime/threads/register_thread.hpp>#include <hpx/runtime/threads/thread_data_fwd.hpp>#include <hpx/runtime/threads/thread_pool_base.hpp>#include <hpx/runtime/threads_fwd.hpp>#include <hpx/timing/steady_clock.hpp>#include <hpx/util/thread_description.hpp>#include <hpx/util_fwd.hpp>#include <atomic>#include <chrono>#include <cstddef>#include <cstdint>#include <functional>#include <type_traits>#include <utility>
file thread_pool_base.hpp
#include <hpx/config.hpp>#include <hpx/concurrency/barrier.hpp>#include <hpx/errors.hpp>#include <hpx/runtime/thread_pool_helpers.hpp>#include <hpx/runtime/threads/detail/network_background_callback.hpp>#include <hpx/affinity/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/topology/cpu_mask.hpp>#include <hpx/topology/topology.hpp>#include <hpx/timing/steady_clock.hpp>#include <hpx/state.hpp>#include <hpx/util_fwd.hpp>#include <thread>#include <cstddef>#include <cstdint>#include <exception>#include <functional>#include <iosfwd>#include <memory>#include <mutex>#include <string>#include <vector>#include <hpx/config/warnings_prefix.hpp>#include <hpx/config/warnings_suffix.hpp>
file trigger_lco.hpp
#include <hpx/config.hpp>#include <hpx/assertion.hpp>#include <hpx/lcos_fwd.hpp>#include <hpx/runtime/actions/action_priority.hpp>#include <hpx/runtime/actions/continuation_fwd.hpp>#include <hpx/runtime/actions_fwd.hpp>#include <hpx/runtime/applier/detail/apply_implementations_fwd.hpp>#include <hpx/runtime/naming/address.hpp>#include <hpx/runtime/naming/id_type.hpp>#include <hpx/runtime/naming/name.hpp>#include <hpx/type_support/decay.hpp>#include <exception>#include <type_traits>#include <utility>
file runtime_fwd.hpp
#include <hpx/config.hpp>#include <hpx/errors.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/functional/function.hpp>#include <hpx/util_fwd.hpp>#include <cstddef>#include <cstdint>#include <string>
file debugging.hpp
#include <hpx/config.hpp>#include <string>
file pack_traversal.hpp
#include <hpx/util/detail/pack_traversal_impl.hpp>#include <hpx/datastructures/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>
dir /home/simbergm/src/hpx-worktrees/release/hpx/runtime/actions
dir /home/simbergm/src/hpx-worktrees/release/components/component_storage
dir /home/simbergm/src/hpx-worktrees/release/components/component_storage/include/hpx/components/component_storage
dir /home/simbergm/src/hpx-worktrees/release/components
dir /home/simbergm/src/hpx-worktrees/release/components/component_storage/include/hpx/components
dir /home/simbergm/src/hpx-worktrees/release/hpx/runtime/components
dir /home/simbergm/src/hpx-worktrees/release/components/component_storage/include/hpx
dir /home/simbergm/src/hpx-worktrees/release/hpx
dir /home/simbergm/src/hpx-worktrees/release/components/component_storage/include
dir /home/simbergm/src/hpx-worktrees/release/hpx/lcos
dir /home/simbergm/src/hpx-worktrees/release/hpx/runtime/naming
dir /home/simbergm/src/hpx-worktrees/release/hpx/parallel
dir /home/simbergm/src/hpx-worktrees/release/hpx/performance_counters
dir /home/simbergm/src/hpx-worktrees/release/hpx/runtime/threads/policies
dir /home/simbergm/src/hpx-worktrees/release/hpx/runtime
dir /home/simbergm/src/hpx-worktrees/release/hpx/runtime/threads
dir /home/simbergm/src/hpx-worktrees/release/hpx/util