runtime_configuration

The contents of this module can be included with the header hpx/modules/runtime_configuration.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_configuration.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
namespace agas

Enums

enum service_mode

Values:

service_mode_invalid = -1
service_mode_bootstrap = 0
service_mode_hosted = 1

Defines

HPX_REGISTER_COMMANDLINE_REGISTRY(RegistryType, componentname)

The macro HPX_REGISTER_COMMANDLINE_REGISTRY is used to register the given component factory with Hpx.Plugin. This macro has to be used for each of the components.

HPX_REGISTER_COMMANDLINE_REGISTRY_DYNAMIC(RegistryType, componentname)
HPX_REGISTER_COMMANDLINE_OPTIONS()

The macro HPX_REGISTER_COMMANDLINE_OPTIONS is used to define the required Hpx.Plugin entry point for the command line option registry. This macro has to be used in not more than one compilation unit of a component module.

HPX_REGISTER_COMMANDLINE_OPTIONS_DYNAMIC()
namespace hpx
namespace components
struct component_commandline_base
#include <component_commandline_base.hpp>

The component_commandline_base has to be used as a base class for all component command-line line handling registries.

Public Functions

virtual ~component_commandline_base()
virtual hpx::program_options::options_description add_commandline_options() = 0

Return any additional command line options valid for this component.

Return

The module is expected to fill a options_description object with any additional command line options this component will handle.

Note

This function will be executed by the runtime system during system startup.

Defines

HPX_REGISTER_COMPONENT_FACTORY(componentname)

This macro is used to register the given component factory with Hpx.Plugin. This macro has to be used for each of the component factories.

HPX_REGISTER_COMPONENT_MODULE()

This macro is used to define the required Hpx.Plugin entry points. This macro has to be used in exactly one compilation unit of a component module.

HPX_REGISTER_COMPONENT_MODULE_DYNAMIC()

Defines

HPX_REGISTER_COMPONENT_REGISTRY(RegistryType, componentname)

This macro is used to register the given component factory with Hpx.Plugin. This macro has to be used for each of the components.

HPX_REGISTER_COMPONENT_REGISTRY_DYNAMIC(RegistryType, componentname)
HPX_REGISTER_REGISTRY_MODULE()

This macro is used to define the required Hpx.Plugin entry points. This macro has to be used in exactly one compilation unit of a component module.

HPX_REGISTER_REGISTRY_MODULE_DYNAMIC()
namespace hpx
namespace components
struct component_registry_base
#include <component_registry_base.hpp>

The component_registry_base has to be used as a base class for all component registries.

Public Functions

virtual ~component_registry_base()
virtual bool get_component_info(std::vector<std::string> &fillini, std::string const &filepath, bool is_static = false) = 0

Return the ini-information for all contained components.

Return

Returns true if the parameter fillini has been successfully initialized with the registry data of all implemented in this module.

Parameters
  • fillini: [in, out] The module is expected to fill this vector with the ini-information (one line per vector element) for all components implemented in this module.

virtual void register_component_type() = 0

Return the unique identifier of the component type this factory is responsible for.

Return

Returns the unique identifier of the component type this factory instance is responsible for. This function throws on any error.

Parameters
  • locality: [in] The id of the locality this factory is responsible for.

  • agas_client: [in] The AGAS client to use for component id registration (if needed).

namespace hpx
namespace util

Functions

bool handle_ini_file(section &ini, std::string const &loc)
bool handle_ini_file_env(section &ini, char const *env_var, char const *file_suffix = nullptr)
bool init_ini_data_base(section &ini, std::string &hpx_ini_file)
std::vector<std::shared_ptr<components::component_registry_base>> load_component_factory_static(util::section &ini, std::string name, hpx::util::plugin::get_plugins_list_type get_factory, error_code &ec = throws)
void merge_component_inis(section &ini)
std::vector<std::shared_ptr<plugins::plugin_registry_base>> init_ini_data_default(std::string const &libs, section &ini, std::map<std::string, filesystem::path> &basenames, std::map<std::string, hpx::util::plugin::dll> &modules, std::vector<std::shared_ptr<components::component_registry_base>> &component_registries)

Defines

HPX_REGISTER_PLUGIN_BASE_REGISTRY(PluginType, name)

This macro is used to register the given component factory with Hpx.Plugin. This macro has to be used for each of the components.

HPX_REGISTER_PLUGIN_REGISTRY_MODULE()

This macro is used to define the required Hpx.Plugin entry points. This macro has to be used in exactly one compilation unit of a component module.

HPX_REGISTER_PLUGIN_REGISTRY_MODULE_DYNAMIC()
namespace hpx
namespace plugins
struct plugin_registry_base
#include <plugin_registry_base.hpp>

The plugin_registry_base has to be used as a base class for all plugin registries.

Public Functions

virtual ~plugin_registry_base()
virtual bool get_plugin_info(std::vector<std::string> &fillini) = 0

Return the configuration information for any plugin implemented by this module

Return

Returns true if the parameter fillini has been successfully initialized with the registry data of all implemented in this module.

Parameters
  • fillini: [in, out] The module is expected to fill this vector with the ini-information (one line per vector element) for all plugins implemented in this module.

virtual void init(int*, char***, util::runtime_configuration&)
namespace hpx
namespace util

Functions

bool register_lock_globally(void const*)
bool unregister_lock_globally(void const*)
void enable_global_lock_detection()
void disable_global_lock_detection()
namespace hpx
namespace util
class runtime_configuration : public section

Public Functions

runtime_configuration(char const *argv0, runtime_mode mode, std::vector<std::string> const &extra_static_ini_defs = {})
void reconfigure(std::string const &ini_file)
void reconfigure(std::vector<std::string> const &ini_defs)
std::vector<std::shared_ptr<plugins::plugin_registry_base>> load_modules(std::vector<std::shared_ptr<components::component_registry_base>> &component_registries)
void load_components_static(std::vector<components::static_factory_load_data_type> const &static_modules)
agas::service_mode get_agas_service_mode() const
std::uint32_t get_num_localities() const
void set_num_localities(std::uint32_t)
bool enable_networking() const
std::uint32_t get_first_used_core() const
void set_first_used_core(std::uint32_t)
std::size_t get_ipc_data_buffer_cache_size() const
std::size_t get_agas_local_cache_size(std::size_t dflt = HPX_AGAS_LOCAL_CACHE_SIZE) const
bool get_agas_caching_mode() const
bool get_agas_range_caching_mode() const
std::size_t get_agas_max_pending_refcnt_requests() const
bool load_application_configuration(char const *filename, error_code &ec = throws)
bool get_itt_notify_mode() const
bool enable_lock_detection() const
bool enable_global_lock_detection() const
bool enable_minimal_deadlock_detection() const
bool enable_spinlock_deadlock_detection() const
std::size_t get_spinlock_deadlock_detection_limit() const
std::size_t trace_depth() const
std::size_t get_os_thread_count() const
std::string get_cmd_line() const
std::ptrdiff_t get_default_stack_size() const
std::ptrdiff_t get_stack_size(threads::thread_stacksize stacksize) const
std::size_t get_thread_pool_size(char const *poolname) const
std::string get_endian_out() const
std::uint64_t get_max_inbound_message_size() const
std::uint64_t get_max_outbound_message_size() const
std::map<std::string, hpx::util::plugin::dll> &modules()

Public Members

runtime_mode mode_

Private Functions

std::ptrdiff_t init_stack_size(char const *entryname, char const *defaultvaluestr, std::ptrdiff_t defaultvalue) const
std::ptrdiff_t init_small_stack_size() const
std::ptrdiff_t init_medium_stack_size() const
std::ptrdiff_t init_large_stack_size() const
std::ptrdiff_t init_huge_stack_size() const
void pre_initialize_ini()
void post_initialize_ini(std::string &hpx_ini_file, std::vector<std::string> const &cmdline_ini_defs)
void pre_initialize_logging_ini()
void reconfigure()
void load_component_paths(std::vector<std::shared_ptr<plugins::plugin_registry_base>> &plugin_registries, std::vector<std::shared_ptr<components::component_registry_base>> &component_registries, std::string const &component_base_paths, std::string const &component_path_suffixes, std::set<std::string> &component_paths, std::map<std::string, filesystem::path> &basenames)
void load_component_path(std::vector<std::shared_ptr<plugins::plugin_registry_base>> &plugin_registries, std::vector<std::shared_ptr<components::component_registry_base>> &component_registries, std::string const &path, std::set<std::string> &component_paths, std::map<std::string, filesystem::path> &basenames)

Private Members

std::string hpx_ini_file
std::vector<std::string> cmdline_ini_defs
std::vector<std::string> extra_static_ini_defs
std::uint32_t num_localities
std::uint32_t num_os_threads
std::ptrdiff_t small_stacksize
std::ptrdiff_t medium_stacksize
std::ptrdiff_t large_stacksize
std::ptrdiff_t huge_stacksize
bool need_to_call_pre_initialize
std::map<std::string, hpx::util::plugin::dll> modules_
namespace hpx

Enums

enum runtime_mode

A HPX runtime can be executed in two different modes: console mode and worker mode.

Values:

invalid = -1
console = 0

The runtime is the console locality.

worker = 1

The runtime is a worker locality.

connect = 2

The runtime is a worker locality connecting late

local = 3

The runtime is fully local.

default_ = 4

The runtime mode will be determined based on the command line arguments

last

Functions

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

Defines

HPX_DECLARE_FACTORY_STATIC(name, base)
HPX_DEFINE_FACTORY_STATIC(module, name, base)
HPX_INIT_REGISTRY_MODULE_STATIC(name, base)
HPX_INIT_REGISTRY_FACTORY_STATIC(name, componentname, base)
HPX_INIT_REGISTRY_COMMANDLINE_STATIC(name, base)
HPX_INIT_REGISTRY_STARTUP_SHUTDOWN_STATIC(name, base)
namespace hpx
namespace components

Functions

bool &get_initial_static_loading()
std::vector<static_factory_load_data_type> &get_static_module_data()
void init_registry_module(static_factory_load_data_type const&)
bool get_static_factory(std::string const &instance, util::plugin::get_plugins_list_type &f)
void init_registry_factory(static_factory_load_data_type const&)
bool get_static_commandline(std::string const &instance, util::plugin::get_plugins_list_type &f)
void init_registry_commandline(static_factory_load_data_type const&)
bool get_static_startup_shutdown(std::string const &instance, util::plugin::get_plugins_list_type &f)
void init_registry_startup_shutdown(static_factory_load_data_type const&)
struct static_factory_load_data_type

Public Members

char const *name
hpx::util::plugin::get_plugins_list_type get_factory