Base Excutor class.
Definition at line 36 of file Executor.h.
Public Types | |
template<class F , class... T> | |
using | noReferenceCond = typename std::enable_if<"Function can't return a reference" &&!(std::is_reference< typename std::result_of< F(T...)>::type >::value)>::type |
Public Member Functions | |
Executor () | |
Default constructor of TMVA Executor class if ROOT::EnableIMplicitMT has not been called then by default a serial executor will be created A user can create a thread pool and enable multi-thread excution by calling TMVA::Config::Instance()::EnableMT(nthreads) For releasing the thread pool used by TMVA one can do it by calling TMVA::Config::Instance()::DisableMT() or calling TMVA::Config::Instance()::EnableMT with only one thread. | |
Executor (int nthreads) | |
Constructor of TMVA Executor class Explicit specify the number of threads. | |
template<class Function , class INTEGER > | |
void | Foreach (Function func, ROOT::TSeq< INTEGER > args, unsigned nChunks=0) |
template<class Function , class T > | |
void | Foreach (Function func, std::vector< T > &args, unsigned nChunks=0) |
template<class Function > | |
void | Foreach (Function func, unsigned int nTimes, unsigned nChunks=0) |
wrap TExecutor::Foreach | |
ROOT::TThreadExecutor * | GetMultiThreadExecutor () |
unsigned int | GetPoolSize () const |
template<class F , class INTEGER , class Cond = noReferenceCond<F, INTEGER>> | |
auto | Map (F func, ROOT::TSeq< INTEGER > args) -> std::vector< typename std::result_of< F(INTEGER)>::type > |
template<class F , class Cond = noReferenceCond<F>> | |
auto | Map (F func, unsigned nTimes) -> std::vector< typename std::result_of< F()>::type > |
Wrap TExecutor::Map functions. | |
template<class F , class INTEGER , class R , class Cond = noReferenceCond<F, INTEGER>> | |
auto | MapReduce (F func, ROOT::TSeq< INTEGER > args, R redfunc) -> typename std::result_of< F(INTEGER)>::type |
Wrap TExecutor::MapReduce functions. | |
template<class F , class INTEGER , class R , class Cond = noReferenceCond<F, INTEGER>> | |
auto | MapReduce (F func, ROOT::TSeq< INTEGER > args, R redfunc, unsigned nChunks) -> typename std::result_of< F(INTEGER)>::type |
template<class T , class R > | |
auto | Reduce (const std::vector< T > &objs, R redfunc) -> decltype(redfunc(objs)) |
Wrap Reduce function. | |
Public Attributes | |
std::unique_ptr< ROOT::TThreadExecutor > | fMTExecImpl |
std::unique_ptr< ROOT::TSequentialExecutor > | fSeqExecImpl |
#include <TMVA/Executor.h>
using TMVA::Executor::noReferenceCond = typename std::enable_if<"Function can't return a reference" && !(std::is_reference<typename std::result_of<F(T...)>::type>::value)>::type |
Definition at line 41 of file Executor.h.
|
inline |
Default constructor of TMVA Executor class if ROOT::EnableIMplicitMT has not been called then by default a serial executor will be created A user can create a thread pool and enable multi-thread excution by calling TMVA::Config::Instance()::EnableMT(nthreads) For releasing the thread pool used by TMVA one can do it by calling TMVA::Config::Instance()::DisableMT() or calling TMVA::Config::Instance()::EnableMT with only one thread.
Definition at line 53 of file Executor.h.
|
inlineexplicit |
Constructor of TMVA Executor class Explicit specify the number of threads.
In this case if nthreads is > 1 a multi-threaded executor will be created and TMVA will run in MT. If nthreads = 1 instead TMVA will run in sequential mode If nthreads = 0 TMVA will use the default thread pool size
Definition at line 74 of file Executor.h.
|
inline |
Definition at line 122 of file Executor.h.
|
inline |
Definition at line 116 of file Executor.h.
|
inline |
wrap TExecutor::Foreach
Definition at line 111 of file Executor.h.
|
inline |
Definition at line 90 of file Executor.h.
|
inline |
Definition at line 100 of file Executor.h.
|
inline |
Definition at line 139 of file Executor.h.
|
inline |
Wrap TExecutor::Map functions.
Definition at line 134 of file Executor.h.
|
inline |
Wrap TExecutor::MapReduce functions.
Definition at line 146 of file Executor.h.
|
inline |
Definition at line 151 of file Executor.h.
|
inline |
Wrap Reduce function.
Definition at line 158 of file Executor.h.
std::unique_ptr<ROOT::TThreadExecutor> TMVA::Executor::fMTExecImpl |
Definition at line 165 of file Executor.h.
std::unique_ptr<ROOT::TSequentialExecutor> TMVA::Executor::fSeqExecImpl |
Definition at line 169 of file Executor.h.