Utopia  2
Framework for studying models of complex & adaptive systems.
Public Types | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
Utopia::ParallelExecution Class Reference

Static information on the status of parallel execution. More...

#include <parallel.hh>

Public Types

enum  Setting { enabled , disabled }
 Possible settings for parallel execution. More...
 

Static Public Member Functions

static void init (const DataIO::Config &cfg)
 Initialize parallel features based on configuration setting. More...
 
static void set (const Setting value)
 Choose a setting for parallel execution at runtime. More...
 
static bool is_enabled ()
 Query if parallel execution is currently enabled. More...
 
static bool is_applied ()
 Actually check if parallel features are applied at runtime. More...
 

Static Private Member Functions

static std::shared_ptr< spdlog::logger > get_logger ()
 Fetch the core logger. More...
 

Static Private Attributes

static bool _enabled = false
 Runtime setting for parallel execution. More...
 

Detailed Description

Static information on the status of parallel execution.

Note
Using this class requires the Utopia core logger to be set up, which can conveniently done by calling Utopia::setup_loggers().

Member Enumeration Documentation

◆ Setting

Possible settings for parallel execution.

Enumerator
enabled 

Enable parallel execution.

disabled 

Disable parallel execution.

Member Function Documentation

◆ get_logger()

static std::shared_ptr<spdlog::logger> Utopia::ParallelExecution::get_logger ( )
inlinestaticprivate

Fetch the core logger.

Returns
Valid shared pointer to the logger
Exceptions
runtime_errorIf logger does not exist

◆ init()

static void Utopia::ParallelExecution::init ( const DataIO::Config cfg)
inlinestatic

Initialize parallel features based on configuration setting.

Parameters
cfgParameter space config node
Note
If the required parameter is not found, parallel features are disabled by default.

◆ is_applied()

static bool Utopia::ParallelExecution::is_applied ( )
inlinestatic

Actually check if parallel features are applied at runtime.

Note
This method is implemented for testing purposes only and should not be used to change model or algorithm behavior!

◆ is_enabled()

static bool Utopia::ParallelExecution::is_enabled ( )
inlinestatic

Query if parallel execution is currently enabled.

Note
This value does not imply if parallel execution actually applies. If prerequisites are not met, parallel algorithms will default to sequential execution.

◆ set()

static void Utopia::ParallelExecution::set ( const Setting  value)
inlinestatic

Choose a setting for parallel execution at runtime.

This setting may be changed at any time during runtime. However, algorithms currently running will continue with the policy they have been started with.

Member Data Documentation

◆ _enabled

bool Utopia::ParallelExecution::_enabled = false
inlinestaticprivate

Runtime setting for parallel execution.


The documentation for this class was generated from the following file: