Class that facilitates the use of parallel_core class for parallel loop. More...
#include <parallel_driver.h>
Public Member Functions | |
| parallel_driver (recursive_configurable *parent, std::string parallel_name=shkz_default_parallel_name, std::string splitter_name=shkz_default_splitter_name) | |
| Constructor for parallel_driver. More... | |
| parallel_driver (std::string parallel_name=shkz_default_parallel_name, std::string splitter_name=shkz_default_splitter_name) | |
| Constructor for parallel_driver. More... | |
| int | get_thread_num () const |
| Get the number of maximal threads set. More... | |
| void | set_thread_num (int maximal_threads) |
| Set the number of maximal threads set. More... | |
| const parallel_core * | get () const |
| Get a pointer to the internal instance of parallel_core. More... | |
| void | run (const std::vector< std::function< void()> > &functions) |
| Run operations in parallel. More... | |
| void | for_each_byte_safe (size_t size, std::function< void(size_t n, int thread_index)> func) const |
| Perform a parallel loop operation. Thread is guaranteed the same if (n mod 8) is the same. More... | |
| void | for_each (size_t size, std::function< void(size_t n, int thread_index)> func) const |
| Perform a parallel loop operation. More... | |
| void | for_each (size_t size, std::function< void(size_t n)> func) const |
| Perform a parallel loop operation. More... | |
| void | for_each (const shape2 &shape, std::function< void(int i, int j, int thread_index)> func) const |
| Perform a two dimensional parallel loop operation. More... | |
| void | for_each (const shape2 &shape, std::function< void(int i, int j)> func) const |
| Perform a two dimensional parallel loop operation. More... | |
| void | for_each (const shape3 &shape, std::function< void(int i, int j, int k, int thread_index)> func) const |
| Perform a three dimensional parallel loop operation. More... | |
| void | for_each (const shape3 &shape, std::function< void(int i, int j, int k)> func) const |
| Perform a three dimensional parallel loop operation. More... | |
Public Member Functions inherited from configurable | |
| virtual void | initialize (const environment_map &environment) |
| Initialize the program. Used to get things ready for actual use. More... | |
| virtual void | setup_now (configuration &config=get_global_configuration()) |
| Run load - configure - initialize processes. | |
| virtual bool | not_recursive () |
| Check if this instance is not derived from recursive_configurable. More... | |
Public Member Functions inherited from credit | |
| credit ()=default | |
| Default constructor. | |
| credit (std::string name, std::string argument_name) | |
| Constructor for credit. More... | |
| virtual void | set_name (std::string name, std::string argument_name="") |
| Set name (and perhaps, argument name together) More... | |
| virtual std::string | get_name () const |
| Get the name. | |
| virtual void | set_argument_name (std::string argument_name) |
| Set an argument name. More... | |
| virtual std::string | get_argument_name () const |
| Get an argument name. More... | |
| virtual double | get_version () const |
| Get version. More... | |
| virtual std::string | get_author () const |
| Get author's name. More... | |
| virtual std::tuple< int, int, int > | get_date () const |
| Get currently set date. More... | |
| virtual std::string | get_email_address () const |
| Get email address. More... | |
Additional Inherited Members | |
Public Types inherited from configurable | |
| using | environment_map = std::map< std::string, const void * > |
| Type for environment_map. | |
Static Public Member Functions inherited from configurable | |
| static configuration & | set_global_configuration (const configuration &config) |
| Assign the global settings of the program. More... | |
| static configuration & | get_global_configuration () |
| Get the global settings of the program. More... | |
| template<class T > | |
| static const T & | get_env (const environment_map &environment, std::string key) |
| Extract an specified type of pointer from the input environment. More... | |
Protected Member Functions inherited from configurable | |
| bool | check_set (const environment_map &environment, std::vector< std::string > names) |
| Check if the values for a variable keys exist. More... | |
Protected Attributes inherited from credit | |
| std::string | m_name |
| Name of credit. | |
| std::string | m_argument_name |
| Argument name. | |
Class that facilitates the use of parallel_core class for parallel loop.
|
inline |
Constructor for parallel_driver.
| [in] | parent | Pointer to an instance of recursive_configurable. |
| [in] | parallel_name | Core name of the parallelization engine. "stdthread" is set as default. |
| [in] | splitter_name | Core name of the parallel enumeration splitter name. "sequential_splitter" is set as default. |
|
inline |
Constructor for parallel_driver.
| [in] | parallel_name | Core name of the parallelization engine. "stdthread" is set as default. |
| [in] | splitter_name | Core name of the parallel enumeration splitter name. "sequential_splitter" is set as default. |
|
inline |
Perform a two dimensional parallel loop operation.
| [in] | shape | Two dimensional shape. |
| [in] | func | Function that processes a loop. |
|
inline |
Perform a two dimensional parallel loop operation.
| [in] | shape | Two dimensional shape. |
| [in] | ordering | Ordering of the loop. |
| [in] | func | Function that processes a loop. |
|
inline |
Perform a three dimensional parallel loop operation.
| [in] | shape | Three dimensional shape. |
| [in] | func | Function that processes a loop. |
|
inline |
Perform a three dimensional parallel loop operation.
| [in] | shape | Three dimensional shape. |
| [in] | func | Function that processes a loop. |
|
inline |
Perform a parallel loop operation.
| [in] | size | Size of the loop. |
| [in] | func | Function that processes a loop. |
|
inline |
Perform a parallel loop operation.
| [in] | size | Size of the loop. |
| [in] | func | Function that processes a loop. |
|
inline |
Perform a parallel loop operation. Thread is guaranteed the same if (n mod 8) is the same.
| [in] | size | Size of the loop. |
| [in] | func | Function that processes a loop. |
|
inline |
Get a pointer to the internal instance of parallel_core.
|
inline |
Get the number of maximal threads set.
|
inline |
Run operations in parallel.
| [in] | functions | List of operation functions that are ran in parallel. |
|
inline |
Set the number of maximal threads set.
| maximal_threads | Number of threads to set. |