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.

Header hpx/runtime_configuration/agas_service_mode.hpp

namespace hpx
namespace agas

Enums

enum service_mode

Values:

service_mode_invalid = -1
service_mode_bootstrap = 0
service_mode_hosted = 1

Header hpx/runtime_configuration/component_registry_base.hpp

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).

Header hpx/runtime_configuration/ini.hpp

Defines

HPX_SECTION_VERSION
namespace hpx
namespace util
class section
#include <ini.hpp>

Subclassed by hpx::util::runtime_configuration

Public Types

typedef util::function_nonser<void(std::string const&, std::string const&)> entry_changed_func
typedef std::pair<std::string, entry_changed_func> entry_type
typedef std::map<std::string, entry_type> entry_map
typedef std::map<std::string, section> section_map

Public Functions

section()
section(std::string const &filename, section *root = nullptr)
section(section const &in)
~section()
section &operator=(section const &rhs)
void parse(std::string const &sourcename, std::vector<std::string> const &lines, bool verify_existing = true, bool weed_out_comments = true, bool replace_existing = true)
void parse(std::string const &sourcename, std::string const &line, bool verify_existing = true, bool weed_out_comments = true, bool replace_existing = true)
void read(std::string const &filename)
void merge(std::string const &second)
void merge(section &second)
void dump(int ind = 0, std::ostream &strm = std::cout) const
void add_section(std::string const &sec_name, section &sec, section *root = nullptr)
section *add_section_if_new(std::string const &sec_name)
bool has_section(std::string const &sec_name) const
section *get_section(std::string const &sec_name)
section const *get_section(std::string const &sec_name) const
section_map &get_sections()
section_map const &get_sections() const
void add_entry(std::string const &key, entry_type const &val)
void add_entry(std::string const &key, std::string const &val)
bool has_entry(std::string const &key) const
std::string get_entry(std::string const &key) const
std::string get_entry(std::string const &key, std::string const &dflt) const
template<typename T>
std::string get_entry(std::string const &key, T dflt) const
void add_notification_callback(std::string const &key, entry_changed_func const &callback)
entry_map const &get_entries() const
std::string expand(std::string const &str) const
void expand(std::string &str, std::string::size_type len) const
void set_root(section *r, bool recursive = false)
section *get_root() const
std::string get_name() const
std::string get_parent_name() const
std::string get_full_name() const
void set_name(std::string const &name)

Protected Functions

void line_msg(std::string msg, std::string const &file, int lnum = 0, std::string const &line = "")
section &clone_from(section const &rhs, section *root = nullptr)

Private Types

using mutex_type = util::spinlock

Private Functions

section *this_()
template<typename Archive>
void save(Archive &ar, const unsigned int version) const
template<typename Archive>
void load(Archive &ar, const unsigned int version)
void add_section(std::unique_lock<mutex_type> &l, std::string const &sec_name, section &sec, section *root = nullptr)
bool has_section(std::unique_lock<mutex_type> &l, std::string const &sec_name) const
section *get_section(std::unique_lock<mutex_type> &l, std::string const &sec_name)
section const *get_section(std::unique_lock<mutex_type> &l, std::string const &sec_name) const
section *add_section_if_new(std::unique_lock<mutex_type> &l, std::string const &sec_name)
void add_entry(std::unique_lock<mutex_type> &l, std::string const &fullkey, std::string const &key, std::string val)
void add_entry(std::unique_lock<mutex_type> &l, std::string const &fullkey, std::string const &key, entry_type const &val)
bool has_entry(std::unique_lock<mutex_type> &l, std::string const &key) const
std::string get_entry(std::unique_lock<mutex_type> &l, std::string const &key) const
std::string get_entry(std::unique_lock<mutex_type> &l, std::string const &key, std::string const &dflt) const
void add_notification_callback(std::unique_lock<mutex_type> &l, std::string const &key, entry_changed_func const &callback)
std::string expand(std::unique_lock<mutex_type> &l, std::string in) const
void expand(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type) const
void expand_bracket(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type) const
void expand_brace(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type) const
std::string expand_only(std::unique_lock<mutex_type> &l, std::string in, std::string const &expand_this) const
void expand_only(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type, std::string const &expand_this) const
void expand_bracket_only(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type, std::string const &expand_this) const
void expand_brace_only(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type, std::string const &expand_this) const

Private Members

section *root_
entry_map entries_
section_map sections_
std::string name_
std::string parent_name_
mutex_type mtx_

Friends

friend hpx::util::hpx::serialization::access

Header hpx/runtime_configuration/init_ini_data.hpp

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)

Header hpx/runtime_configuration/plugin_registry_base.hpp

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&)

Header hpx/runtime_configuration/runtime_configuration.hpp

namespace hpx
namespace util
class runtime_configuration : public hpx::util::section
#include <runtime_configuration.hpp>

Public Functions

runtime_configuration(char const *argv0, runtime_mode mode)
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::uint32_t num_localities
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_

Header hpx/runtime_configuration/runtime_configuration_fwd.hpp

Header hpx/runtime_configuration/runtime_mode.hpp

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

Header hpx/runtime_configuration/static_factory_data.hpp

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

void init_registry_module(static_factory_load_data_type const&)
void init_registry_factory(static_factory_load_data_type const&)
void init_registry_commandline(static_factory_load_data_type const&)
void init_registry_startup_shutdown(static_factory_load_data_type const&)
struct static_factory_load_data_type
#include <static_factory_data.hpp>

Public Members

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