runtime_distributed¶
The contents of this module can be included with the header
hpx/modules/runtime_distributed.hpp
. These headers may be used by user-code but are not
guaranteed stable (neither header location nor contents). You are using these at
your own risk. If you wish to use non-public functionality from a module we
strongly suggest only including the module header hpx/modules/runtime_distributed.hpp
, not
the particular header in which the functionality you would like to use is
defined. See Public API for a list of names that are part of the public
HPX API.
-
namespace
hpx
Functions
-
bool
tolerate_node_faults
()¶
-
class
runtime_distributed
: public runtime¶ - #include <runtime_distributed.hpp>
The runtime class encapsulates the HPX runtime system in a simple to use way. It makes sure all required parts of the HPX runtime system are properly initialized.
Public Functions
-
hpx::runtime_distributed::runtime_distributed(util::runtime_configuration & rtcfg, int(*pre_main)(runtime_mode) = nullptr)
Construct a new HPX runtime instance
- Parameters
locality_mode
: [in] This is the mode the given runtime instance should be executed in.
-
~runtime_distributed
()¶ The destructor makes sure all HPX runtime services are properly shut down before exiting.
-
int
start
(util::function_nonser<hpx_main_function_type> const &func, bool blocking = false)¶ Start the runtime system.
- Return
If a blocking is a true, this function will return the value as returned as the result of the invocation of the function object given by the parameter
func
. Otherwise it will return zero.- Parameters
func
: [in] This is the main function of an HPX application. It will be scheduled for execution by the thread manager as soon as the runtime has been initialized. This function is expected to expose an interface as defined by the typedef hpx_main_function_type.blocking
: [in] This allows to control whether this call blocks until the runtime system has been stopped. If this parameter is true the function runtime::start will call runtime::wait internally.
-
int
start
(bool blocking = false)¶ Start the runtime system.
- Return
If a blocking is a true, this function will return the value as returned as the result of the invocation of the function object given by the parameter
func
. Otherwise it will return zero.- Parameters
blocking
: [in] This allows to control whether this call blocks until the runtime system has been stopped. If this parameter is true the function runtime::start will call runtime::wait internally .
-
int
wait
()¶ Wait for the shutdown action to be executed.
- Return
This function will return the value as returned as the result of the invocation of the function object given by the parameter
func
.
-
void
stop
(bool blocking = true)¶ Initiate termination of the runtime system.
- Parameters
blocking
: [in] This allows to control whether this call blocks until the runtime system has been fully stopped. If this parameter is false then this call will initiate the stop action but will return immediately. Use a second call to stop with this parameter set to true to wait for all internal work to be completed.
-
int
finalize
(double shutdown_timeout)¶
-
void
stop_helper
(bool blocking, std::condition_variable &cond, std::mutex &mtx)¶ Stop the runtime system, wait for termination.
- Parameters
blocking
: [in] This allows to control whether this call blocks until the runtime system has been fully stopped. If this parameter is false then this call will initiate the stop action but will return immediately. Use a second call to stop with this parameter set to true to wait for all internal work to be completed.
-
int
suspend
()¶ Suspend the runtime system.
-
int
resume
()¶ Resume the runtime system.
-
bool
report_error
(std::size_t num_thread, std::exception_ptr const &e, bool terminate_all = true)¶ Report a non-recoverable error to the runtime system.
- Parameters
num_thread
: [in] The number of the operating system thread the error has been detected in.e
: [in] This is an instance encapsulating an exception which lead to this function call.terminate_all
: [in] Kill all localities attached to the currently running application (default: true)
-
bool
report_error
(std::exception_ptr const &e, bool terminate_all = true)¶ Report a non-recoverable error to the runtime system.
- Note
This function will retrieve the number of the current shepherd thread and forward to the report_error function above.
- Parameters
e
: [in] This is an instance encapsulating an exception which lead to this function call.terminate_all
: [in] Kill all localities attached to the currently running application (default: true)
-
int
run
(util::function_nonser<hpx_main_function_type> const &func)¶ Run the HPX runtime system, use the given function for the main thread and block waiting for all threads to finish.
- Note
The parameter func is optional. If no function is supplied, the runtime system will simply wait for the shutdown action without explicitly executing any main thread.
- Return
This function will return the value as returned as the result of the invocation of the function object given by the parameter
func
.- Parameters
func
: [in] This is the main function of an HPX application. It will be scheduled for execution by the thread manager as soon as the runtime has been initialized. This function is expected to expose an interface as defined by the typedef hpx_main_function_type. This parameter is optional and defaults to none main thread function, in which case all threads have to be scheduled explicitly.
-
int
run
()¶ Run the HPX runtime system, initially use the given number of (OS) threads in the thread-manager and block waiting for all threads to finish.
- Return
This function will always return 0 (zero).
-
bool
is_networking_enabled
()¶
-
template<typename
F
>
components::server::console_error_dispatcher::sink_typeset_error_sink
(F &&sink)¶
-
performance_counters::registry &
get_counter_registry
()¶ Allow access to the registry counter registry instance used by the HPX runtime.
-
performance_counters::registry const &
get_counter_registry
() const¶ Allow access to the registry counter registry instance used by the HPX runtime.
-
void
register_counter_types
()¶ Install all performance counters related to this runtime instance.
-
void
start_active_counters
(error_code &ec = throws)¶
-
void
stop_active_counters
(error_code &ec = throws)¶
-
void
reset_active_counters
(error_code &ec = throws)¶
-
void
reinit_active_counters
(bool reset = true, error_code &ec = throws)¶
-
void
evaluate_active_counters
(bool reset = false, char const *description = nullptr, error_code &ec = throws)¶
-
void
stop_evaluating_counters
(bool terminate = false)¶
-
naming::resolver_client &
get_agas_client
()¶ Allow access to the AGAS client instance used by the HPX runtime.
-
hpx::threads::threadmanager &
get_thread_manager
()¶ Allow access to the thread manager instance used by the HPX runtime.
-
void
init_id_pool_range
()¶
-
util::unique_id_ranges &
get_id_pool
()¶
-
void
initialize_agas
()¶ Initialize AGAS operation.
-
void
add_pre_startup_function
(startup_function_type f)¶ Add a function to be executed inside a HPX thread before hpx_main but guaranteed to be executed before any startup function registered with add_startup_function.
- Note
The difference to a startup function is that all pre-startup functions will be (system-wide) executed before any startup function.
- Parameters
f
: The function ‘f’ will be called from inside a HPX thread before hpx_main is executed. This is very useful to setup the runtime environment of the application (install performance counters, etc.)
-
void
add_startup_function
(startup_function_type f)¶ Add a function to be executed inside a HPX thread before hpx_main
- Parameters
f
: The function ‘f’ will be called from inside a HPX thread before hpx_main is executed. This is very useful to setup the runtime environment of the application (install performance counters, etc.)
-
void
add_pre_shutdown_function
(shutdown_function_type f)¶ Add a function to be executed inside a HPX thread during hpx::finalize, but guaranteed before any of the shutdown functions is executed.
- Note
The difference to a shutdown function is that all pre-shutdown functions will be (system-wide) executed before any shutdown function.
- Parameters
f
: The function ‘f’ will be called from inside a HPX thread while hpx::finalize is executed. This is very useful to tear down the runtime environment of the application (uninstall performance counters, etc.)
-
void
add_shutdown_function
(shutdown_function_type f)¶ Add a function to be executed inside a HPX thread during hpx::finalize
- Parameters
f
: The function ‘f’ will be called from inside a HPX thread while hpx::finalize is executed. This is very useful to tear down the runtime environment of the application (uninstall performance counters, etc.)
-
hpx::util::io_service_pool *
get_thread_pool
(char const *name)¶ Access one of the internal thread pools (io_service instances) HPX is using to perform specific tasks. The three possible values for the argument
name
are “main_pool”, “io_pool”, “parcel_pool”, and “timer_pool”. For any other argument value the function will return zero.
-
bool
register_thread
(char const *name, std::size_t num = 0, bool service_thread = true, error_code &ec = throws)¶ Register an external OS-thread with HPX.
-
notification_policy_type
get_notification_policy
(char const *prefix, runtime_local::os_thread_type type)¶ Generate a new notification policy instance for the given thread name prefix
-
std::uint32_t
get_locality_id
(error_code &ec) const¶
-
std::uint32_t
get_num_localities
(hpx::launch::sync_policy, error_code &ec) const¶
-
std::uint32_t
get_num_localities
(hpx::launch::sync_policy, components::component_type type, error_code &ec) const¶
-
lcos::future<std::uint32_t>
get_num_localities
(components::component_type type) const¶
Private Functions
-
runtime_distributed *
This
()¶
-
threads::thread_result_type
run_helper
(util::function_nonser<runtime::hpx_main_function_type> const &func, int &result)¶
-
void
init_tss_helper
(char const *context, runtime_local::os_thread_type type, std::size_t local_thread_num, std::size_t global_thread_num, char const *pool_name, char const *postfix, bool service_thread)¶
-
void
init_tss_ex
(std::string const &locality, char const *context, runtime_local::os_thread_type type, std::size_t local_thread_num, std::size_t global_thread_num, char const *pool_name, char const *postfix, bool service_thread, error_code &ec)¶
Private Members
-
runtime_mode
mode_
¶
-
util::unique_id_ranges
id_pool_
¶
-
naming::resolver_client
agas_client_
¶
-
used_cores_map_type
used_cores_map_
¶
-
std::unique_ptr<components::server::runtime_support>
runtime_support_
¶
-
std::shared_ptr<util::query_counters>
active_counters_
¶
-
int (*
pre_main_
)(runtime_mode)¶
-
-
bool
-
namespace
hpx
-
namespace
applier
-
namespace
-
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
-
namespace
components
Functions
-
template<typename
Component
>
future<naming::id_type>copy
(naming::id_type const &to_copy)¶ Copy given component to the specified target locality.
The function copy<Component> will create a copy of the component referenced by to_copy on the locality specified with target_locality. It returns a future referring to the newly created component instance.
- Return
A future representing the global id of the newly (copied) component instance.
- Note
The new component instance is created on the locality of the component instance which is to be copied.
- Parameters
to_copy
: [in] The global id of the component to copy
- Template Parameters
The
: only template argument specifies the component type to create.
-
template<typename
Component
>
future<naming::id_type>copy
(naming::id_type const &to_copy, naming::id_type const &target_locality)¶ Copy given component to the specified target locality.
The function copy<Component> will create a copy of the component referenced by to_copy on the locality specified with target_locality. It returns a future referring to the newly created component instance.
- Return
A future representing the global id of the newly (copied) component instance.
- Parameters
to_copy
: [in] The global id of the component to copytarget_locality
: [in ] The locality where the copy should be created.
- Template Parameters
The
: only template argument specifies the component type to create.
-
template<typename
Derived
, typenameStub
>
Derivedcopy
(client_base<Derived, Stub> const &to_copy, naming::id_type const &target_locality = naming::invalid_id)¶ Copy given component to the specified target locality.
The function copy will create a copy of the component referenced by the client side object to_copy on the locality specified with target_locality. It returns a new client side object future referring to the newly created component instance.
- Return
A future representing the global id of the newly (copied) component instance.
- Note
If the second argument is omitted (or is invalid_id) the new component instance is created on the locality of the component instance which is to be copied.
- Parameters
to_copy
: [in] The client side object representing the component to copytarget_locality
: [in, optional] The locality where the copy should be created (default is same locality as source).
- Template Parameters
The
: only template argument specifies the component type to create.
-
template<typename
-
namespace
-
namespace
hpx
Functions
-
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
- 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
- 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
(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
- 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
-
namespace
hpx
Functions
-
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
- 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
-
namespace
hpx
Functions
-
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
- 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
(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
- 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
- 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.
-
std::vector<naming::id_type>
-
namespace
hpx
Functions
-
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
-
future<std::string>
-
namespace
hpx
Functions
-
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.
-
lcos::future<std::uint32_t>
-
namespace
hpx
-
namespace
components
Functions
-
template<typename
Component
, typenameDistPolicy
>
future<naming::id_type>migrate
(naming::id_type const &to_migrate, DistPolicy const &policy)¶ Migrate the given component to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.policy
: [in] A distribution policy which will be used to determine the locality to migrate this object to.
- Template Parameters
Component
: Specifies the component type of the component to migrate.DistPolicy
: Specifies the distribution policy to use to determine the destination locality.
-
template<typename
Derived
, typenameStub
, typenameDistPolicy
>
Derivedmigrate
(client_base<Derived, Stub> const &to_migrate, DistPolicy const &policy)¶ Migrate the given component to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.policy
: [in] A distribution policy which will be used to determine the locality to migrate this object to.
- Template Parameters
Derived
: Specifies the component type of the component to migrate.DistPolicy
: Specifies the distribution policy to use to determine the destination locality.
-
template<typename
Component
>
future<naming::id_type>migrate
(naming::id_type const &to_migrate, naming::id_type const &target_locality)¶ Migrate the component with the given id to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
A future representing the global id of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The global id of the component to migrate.target_locality
: [in] The locality where the component should be migrated to.
- Template Parameters
Component
: Specifies the component type of the component to migrate.
-
template<typename
Derived
, typenameStub
>
Derivedmigrate
(client_base<Derived, Stub> const &to_migrate, naming::id_type const &target_locality)¶ Migrate the given component to the specified target locality
The function migrate<Component> will migrate the component referenced by to_migrate to the locality specified with target_locality. It returns a future referring to the migrated component instance.
- Return
A client side representation of representing of the migrated component instance. This should be the same as migrate_to.
- Parameters
to_migrate
: [in] The client side representation of the component to migrate.target_locality
: [in] The id of the locality to migrate this object to.
- Template Parameters
Derived
: Specifies the component type of the component to migrate.
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
components
-
class
runtime_support
: public hpx::components::stubs::runtime_support¶ - #include <runtime_support.hpp>
The runtime_support class is the client side representation of a server::runtime_support component
Public Functions
-
runtime_support
(naming::id_type const &gid = naming::invalid_id)¶ Create a client side representation for the existing server::runtime_support instance with the given global id gid.
-
template<typename
Component
, typename ...Ts
>
naming::id_typecreate_component
(Ts&&... vs)¶ Create a new component type using the runtime_support.
-
template<typename
Component
, typename ...Ts
>
lcos::future<naming::id_type>create_component_async
(Ts&&... vs)¶ Asynchronously create a new component using the runtime_support.
-
template<typename
Component
, typename ...Ts
>
std::vector<naming::id_type>bulk_create_component
(std::size_t, Ts&&... vs)¶ Asynchronously create N new default constructed components using the runtime_support
-
template<typename
Component
, typename ...Ts
>
lcos::future<std::vector<naming::id_type>>bulk_create_components_async
(std::size_t, Ts&&... vs)¶ Asynchronously create a new component using the runtime_support.
-
int
load_components
()¶
-
void
call_startup_functions
(bool pre_startup)¶
-
void
shutdown
(double timeout = -1)¶
-
void
shutdown_all
(double timeout = -1)¶ Shutdown the runtime systems of all localities.
-
void
terminate
()¶
-
void
terminate_all
()¶ Terminate the runtime systems of all localities.
Private Types
-
typedef stubs::runtime_support
base_type
¶
-
-
class
-
namespace
-
namespace
hpx
-
namespace
components
-
namespace
server
-
namespace
-
namespace
-
namespace
hpx
-
namespace
components
-
namespace
server
Functions
-
template<typename
Component
, typenameDistPolicy
>
future<id_type>migrate_component
(id_type const &to_migrate, naming::address const &addr, DistPolicy const &policy)¶
-
template<typename
Component
, typenameDistPolicy
>
future<id_type>trigger_migrate_component
(id_type const &to_migrate, DistPolicy const &policy, naming::id_type const &id, naming::address const &addr)¶
-
template<typename
Component
, typenameDistPolicy
>
future<id_type>perform_migrate_component
(id_type const &to_migrate, DistPolicy const &policy)¶
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
components
-
namespace
server
-
class
runtime_support
¶ Public Types
-
typedef runtime_support
type_holder
¶
Public Functions
-
runtime_support
(hpx::util::runtime_configuration &cfg)¶
-
~runtime_support
()¶
-
void
delete_function_lists
()¶
-
void
tidy
()¶
-
template<typename
Component
, typenameT
, typename ...Ts
>
naming::gid_typecreate_component
(T v, Ts... vs)¶
-
template<typename
Component
, typenameT
, typename ...Ts
>
std::vector<naming::gid_type>bulk_create_component
(std::size_t count, T v, Ts... vs)¶
-
void
shutdown
(double timeout, naming::id_type const &respond_to)¶ Gracefully shutdown this runtime system instance.
-
void
shutdown_all
(double timeout)¶ Gracefully shutdown runtime system instances on all localities.
-
HPX_NORETURN void hpx::components::server::runtime_support::terminate(naming::id_type const & respond_to)
Shutdown this runtime system instance.
-
HPX_NORETURN void hpx::components::server::runtime_support::terminate_all()
Shutdown runtime system instances on all localities.
-
void
terminate_all_act
()¶
-
int
load_components
()¶ Load all components on this locality.
-
void
call_startup_functions
(bool pre_startup)¶
-
void
call_shutdown_functions
(bool pre_shutdown)¶
-
void
garbage_collect
()¶ Force a garbage collection operation in the AGAS layer.
-
naming::gid_type
create_performance_counter
(performance_counters::counter_info const &info)¶ Create the given performance counter instance.
-
void
remove_from_connection_cache
(naming::gid_type const &gid, parcelset::endpoints_type const &eps)¶ Remove the given locality from our connection cache.
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, load_components)¶ termination detection
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, call_startup_functions)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, call_shutdown_functions)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, shutdown)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, shutdown_all)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, terminate_act, terminate_action)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, terminate_all_act, terminate_all_action)¶
-
HPX_DEFINE_COMPONENT_DIRECT_ACTION
(runtime_support, get_config)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, garbage_collect)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, create_performance_counter)¶
-
HPX_DEFINE_COMPONENT_ACTION
(runtime_support, remove_from_connection_cache)¶
-
void
run
()¶ Start the runtime_support component.
-
void
wait
()¶ Wait for the runtime_support component to notify the calling thread.
This function will be called from the main thread, causing it to block while the HPX functionality is executed. The main thread will block until the shutdown_action is executed, which in turn notifies all waiting threads.
-
void
stop
(double timeout, naming::id_type const &respond_to, bool remove_from_remote_caches)¶ Notify all waiting (blocking) threads allowing the system to be properly stopped.
- Note
This function can be called from any thread.
-
void
stopped
()¶ called locally only
-
void
notify_waiting_main
()¶
-
bool
was_stopped
() const¶
-
void
add_pre_startup_function
(startup_function_type f)¶
-
void
add_startup_function
(startup_function_type f)¶
-
void
add_pre_shutdown_function
(shutdown_function_type f)¶
-
void
add_shutdown_function
(shutdown_function_type f)¶
-
void
remove_here_from_connection_cache
()¶
-
void
remove_here_from_console_connection_cache
()¶
Public Static Functions
-
static component_type
get_component_type
()¶
-
static void
set_component_type
(component_type t)¶
-
static constexpr void
finalize
()¶ finalize() will be called just before the instance gets destructed
- Parameters
self
: [in] The HPX thread used to execute this function.appl
: [in] The applier to be used for finalization of the component instance.
Protected Functions
-
int
load_components
(util::section &ini, naming::gid_type const &prefix, naming::resolver_client &agas_client, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
-
bool
load_component
(hpx::util::plugin::dll &d, util::section &ini, std::string const &instance, std::string const &component, filesystem::path const &lib, naming::gid_type const &prefix, naming::resolver_client &agas_client, bool isdefault, bool isenabled, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
-
bool
load_component_dynamic
(util::section &ini, std::string const &instance, std::string const &component, filesystem::path lib, naming::gid_type const &prefix, naming::resolver_client &agas_client, bool isdefault, bool isenabled, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
-
bool
load_startup_shutdown_functions
(hpx::util::plugin::dll &d, error_code &ec)¶
-
bool
load_commandline_options
(hpx::util::plugin::dll &d, hpx::program_options::options_description &options, error_code &ec)¶
-
bool
load_component_static
(util::section &ini, std::string const &instance, std::string const &component, filesystem::path const &lib, naming::gid_type const &prefix, naming::resolver_client &agas_client, bool isdefault, bool isenabled, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
-
bool
load_startup_shutdown_functions_static
(std::string const &mod, error_code &ec)¶
-
bool
load_commandline_options_static
(std::string const &mod, hpx::program_options::options_description &options, error_code &ec)¶
-
bool
load_plugins
(util::section &ini, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
-
bool
load_plugin
(hpx::util::plugin::dll &d, util::section &ini, std::string const &instance, std::string const &component, filesystem::path const &lib, bool isenabled, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
-
bool
load_plugin_dynamic
(util::section &ini, std::string const &instance, std::string const &component, filesystem::path lib, bool isenabled, hpx::program_options::options_description &options, std::set<std::string> &startup_handled)¶
Private Types
-
typedef plugin_factory
plugin_factory_type
¶
-
typedef std::map<std::string, plugin_factory_type>
plugin_map_type
¶
-
typedef std::vector<static_factory_load_data_type>
static_modules_type
¶
Private Members
-
bool
stop_called_
¶
-
bool
stop_done_
¶
-
bool
terminated_
¶
-
plugin_map_mutex_type
p_mtx_
¶
-
plugin_map_type
plugins_
¶
-
modules_map_type &
modules_
¶
-
static_modules_type
static_modules_
¶
-
std::list<startup_function_type>
pre_startup_functions_
¶
-
std::list<startup_function_type>
startup_functions_
¶
-
std::list<shutdown_function_type>
pre_shutdown_functions_
¶
-
std::list<shutdown_function_type>
shutdown_functions_
¶
-
struct
plugin_factory
¶ Public Functions
-
typedef runtime_support
-
class
-
namespace
-
namespace
-
namespace
hpx
-
namespace
components
-
namespace
stubs
¶ -
struct
runtime_support
¶ Subclassed by hpx::components::runtime_support
Public Static Functions
-
template<typename
Component
, typename ...Ts
>
static lcos::future<naming::id_type>create_component_async
(naming::id_type const &gid, Ts&&... vs)¶ Create a new component type using the runtime_support with the given targetgid. This is a non-blocking call. The caller needs to call future::get on the result of this function to obtain the global id of the newly created object.
-
template<typename
Component
, typename ...Ts
>
static naming::id_typecreate_component
(naming::id_type const &gid, Ts&&... vs)¶ Create a new component type using the runtime_support with the given targetgid. Block for the creation to finish.
-
template<typename
Component
, typename ...Ts
>
static lcos::future<std::vector<naming::id_type>>bulk_create_component_colocated_async
(naming::id_type const &gid, std::size_t count, Ts&&... vs)¶ Create multiple new components type using the runtime_support colocated with the with the given targetgid. This is a non-blocking call.
-
template<typename
Component
, typename ...Ts
>
static std::vector<naming::id_type>bulk_create_component_colocated
(naming::id_type const &gid, std::size_t count, Ts&&... vs)¶ Create multiple new components type using the runtime_support colocated with the with the given targetgid. Block for the creation to finish.
-
template<typename
Component
, typename ...Ts
>
static lcos::future<std::vector<naming::id_type>>bulk_create_component_async
(naming::id_type const &gid, std::size_t count, Ts&&... vs)¶ Create multiple new components type using the runtime_support on the given locality. This is a non-blocking call.
-
template<typename
Component
, typename ...Ts
>
static std::vector<naming::id_type>bulk_create_component
(naming::id_type const &gid, std::size_t count, Ts&&... vs)¶ Create multiple new components type using the runtime_support on the given locality. Block for the creation to finish.
-
template<typename
Component
, typename ...Ts
>
static lcos::future<naming::id_type>create_component_colocated_async
(naming::id_type const &gid, Ts&&... vs)¶ Create a new component type using the runtime_support with the given targetgid. This is a non-blocking call. The caller needs to call future::get on the result of this function to obtain the global id of the newly created object.
-
template<typename
Component
, typename ...Ts
>
static naming::id_typecreate_component_colocated
(naming::id_type const &gid, Ts&&... vs)¶ Create a new component type using the runtime_support with the given targetgid. Block for the creation to finish.
-
static lcos::future<void>
call_startup_functions_async
(naming::id_type const &gid, bool pre_startup)¶
-
static lcos::future<void>
shutdown_async
(naming::id_type const &targetgid, double timeout = -1)¶ Shutdown the given runtime system.
-
static void
shutdown_all
(naming::id_type const &targetgid, double timeout = -1)¶ Shutdown the runtime systems of all localities.
-
static void
shutdown_all
(double timeout = -1)¶
-
static lcos::future<void>
terminate_async
(naming::id_type const &targetgid)¶ Retrieve configuration information.
Terminate the given runtime system
-
static void
terminate_all
(naming::id_type const &targetgid)¶ Terminate the runtime systems of all localities.
-
static void
terminate_all
()¶
-
static lcos::future<naming::id_type>
create_performance_counter_async
(naming::id_type targetgid, performance_counters::counter_info const &info)¶
-
static naming::id_type
create_performance_counter
(naming::id_type targetgid, performance_counters::counter_info const &info, error_code &ec = throws)¶
-
template<typename
-
struct
-
namespace
-
namespace