piranha
0.10
|
Global settings. More...
#include <piranha/settings.hpp>
Inherits piranha::detail::base_settings<>.
Static Public Member Functions | |
static unsigned | get_n_threads () |
Get the number of threads available for use by piranha. More... | |
static void | set_n_threads (unsigned n) |
Set the number of threads available for use by piranha. More... | |
static void | reset_n_threads () |
Reset the number of threads available for use by piranha. More... | |
static void | set_thread_binding (bool flag) |
Set the thread binding policy. More... | |
static bool | get_thread_binding () |
Get the thread binding policy. More... | |
static unsigned | get_cache_line_size () |
Get the cache line size. More... | |
static void | set_cache_line_size (unsigned n) |
Set the cache line size. More... | |
static void | reset_cache_line_size () |
Reset the cache line size. More... | |
static unsigned long | get_max_term_output () |
Get max term output. More... | |
static void | set_max_term_output (unsigned long n) |
Set max term output. More... | |
static void | reset_max_term_output () |
Reset max term output. More... | |
static unsigned long long | get_min_work_per_thread () |
Get the minimum work per thread. More... | |
static void | set_min_work_per_thread (unsigned long long n) |
Set the minimum work per thread. More... | |
static void | reset_min_work_per_thread () |
Reset the minimum work per thread. More... | |
Global settings.
This class stores the global settings of piranha's runtime environment. The methods of this class are thread-safe.
Definition at line 89 of file settings.hpp.
|
inlinestatic |
Get the cache line size.
The initial value is set to the output of piranha::runtime_info::get_cache_line_size(). The value can be overridden with set_cache_line_size() in case the detection fails and the value is set to zero.
std::system_error | in case of failure(s) by threading primitives. |
Definition at line 166 of file settings.hpp.
|
inlinestatic |
Get max term output.
std::system_error | in case of failure(s) by threading primitives. |
Definition at line 202 of file settings.hpp.
|
inlinestatic |
Get the minimum work per thread.
Definition at line 233 of file settings.hpp.
|
inlinestatic |
Get the number of threads available for use by piranha.
The initial value is set to the maximum between 1 and piranha::runtime_info::get_hardware_concurrency(). This function is equivalent to piranha::thread_pool::size().
unspecified | any exception thrown by piranha::thread_pool::size(). |
Definition at line 101 of file settings.hpp.
|
inlinestatic |
Get the thread binding policy.
This method is an alias for piranha::thread_pool::get_binding(). It will return the flag set by settings::set_thread_binding() (which is false
by default on program startup).
unspecified | any exception thrown by piranha::thread_pool::get_binding(). |
Definition at line 153 of file settings.hpp.
|
inlinestatic |
Reset the cache line size.
Will set the value to the output of piranha::runtime_info::get_cache_line_size().
std::system_error | in case of failure(s) by threading primitives. |
Definition at line 191 of file settings.hpp.
|
inlinestatic |
Reset max term output.
Will set the max term output value to the default.
std::system_error | in case of failure(s) by threading primitives. |
Definition at line 224 of file settings.hpp.
|
inlinestatic |
Reset the minimum work per thread.
The value will be reset to the default initial value.
Definition at line 254 of file settings.hpp.
|
inlinestatic |
Reset the number of threads available for use by piranha.
Will set the number of threads to the maximum between 1 and piranha::runtime_info::get_hardware_concurrency().
unspecified | any exception thrown by set_n_threads(). |
Definition at line 123 of file settings.hpp.
|
inlinestatic |
Set the cache line size.
Overrides the detected cache line size. This method should be used only if the automatic detection fails.
n | data cache line size (in bytes). |
std::system_error | in case of failure(s) by threading primitives. |
Definition at line 180 of file settings.hpp.
|
inlinestatic |
Set max term output.
n | maximum number of terms to be displayed when printing series. |
std::system_error | in case of failure(s) by threading primitives. |
Definition at line 213 of file settings.hpp.
|
inlinestatic |
Set the minimum work per thread.
n | the minimum work per thread. |
std::invalid_argument | if is zero. |
Definition at line 243 of file settings.hpp.
|
inlinestatic |
Set the number of threads available for use by piranha.
This function is equivalent to piranha::thread_pool::resize().
n | the desired number of threads. |
unspecified | any exception thrown by piranha::thread_pool::resize(). |
Definition at line 113 of file settings.hpp.
|
inlinestatic |
Set the thread binding policy.
This method is an alias for piranha::thread_pool::set_binding(). If flag
is true
, each thread used by piranha will be bound to a different processor/core. If flag
is false
, this method will unbind piranha's threads from any processor/core to which they might be bound.
By default piranha's threads are not bound to any specific processor/core.
flag | the desired thread binding policy. |
unspecified | any exception thrown by piranha::thread_pool::set_binding(). |
Definition at line 140 of file settings.hpp.