27#include <initializer_list>
68 template <
class F,
class R,
class Cond = val
idMapReturnCond<F>>
70 template <
class F,
class INTEGER,
class R,
class Cond = val
idMapReturnCond<F, INTEGER>>
72 template <
class F,
class T,
class R,
class Cond = val
idMapReturnCond<F, T>>
74 template <
class F,
class T,
class R,
class Cond = val
idMapReturnCond<F, T>>
76 template <
class F,
class T,
class R,
class Cond = val
idMapReturnCond<F, T>>
88 template <
class F,
class Cond = val
idMapReturnCond<F>>
89 auto MapImpl(
F func,
unsigned nTimes) -> std::vector<InvokeResult_t<F>>;
90 template <
class F,
class INTEGER,
class Cond = val
idMapReturnCond<F, INTEGER>>
92 template <
class F,
class T,
class Cond = val
idMapReturnCond<F, T>>
93 auto MapImpl(
F func, std::vector<T> &args) -> std::vector<InvokeResult_t<F, T>>;
94 template <
class F,
class T,
class Cond = val
idMapReturnCond<F, T>>
95 auto MapImpl(
F func,
const std::vector<T> &args) -> std::vector<InvokeResult_t<F, T>>;
103# define R__EXECUTOR_THREAD ROOT::TThreadExecutor
105# define R__EXECUTOR_THREAD Unused_t
108# define R__EXECUTOR_PROCESS ROOT::TProcessExecutor
110# define R__EXECUTOR_PROCESS Unused_t
117#undef R__EXECUTOR_THREAD
118#undef R__EXECUTOR_PROCESS
122 template<
class F,
class CONTAINER>
135 template<
class F,
class T>
137 std::vector<typename MapRetType<F, typename std::decay<T>::type>
::type> res;
161template <
class F,
class Cond>
172template <
class F,
class INTEGER,
class Cond>
183template <
class F,
class T,
class Cond>
194template <
class F,
class T,
class Cond>
212template <
class F,
class R,
class Cond>
216 static_assert(std::is_invocable_v<R, std::vector<InvokeResult_t<F>>>,
"redfunc does not have the correct signature");
220 return Reduce(
Map(func, nTimes), redfunc);
235template <
class F,
class INTEGER,
class R,
class Cond>
238 static_assert(std::is_invocable_v<R, std::vector<InvokeResult_t<F, INTEGER>>>,
239 "redfunc does not have the correct signature");
258template <
class F,
class T,
class R,
class Cond>
261 static_assert(std::is_invocable_v<R, std::vector<InvokeResult_t<F, T>>>,
262 "redfunc does not have the correct signature");
281template <
class F,
class T,
class R,
class Cond>
284 static_assert(std::is_invocable_v<R, std::vector<InvokeResult_t<F, T>>>,
285 "redfunc does not have the correct signature");
304template <
class F,
class T,
class R,
class Cond>
307 static_assert(std::is_invocable_v<R, std::vector<InvokeResult_t<F, T>>>,
308 "redfunc does not have the correct signature");
322 unsigned poolSize{0u};
This class implements the interface to execute the same task multiple times, sequentially or in paral...
auto MapReduce(F func, unsigned nTimes, R redfunc, unsigned nChunks) -> InvokeResult_t< F >
Execute a function nTimes (Map) and accumulate the results into a single value (Reduce).
auto ResolveExecutorAndMap(F func, T &&args) -> std::vector< typename MapRetType< F, typename std::decay< T >::type >::type >
Function called from Map to select and execute the correct Executor according to the set Execution Po...
std::unique_ptr< ROOT::TThreadExecutor > fThreadExecutor
std::unique_ptr< ROOT::TSequentialExecutor > fSequentialExecutor
ROOT::EExecutionPolicy Policy() const
Return the execution policy the executor is set to.
auto MapImpl(F func, unsigned nTimes) -> std::vector< InvokeResult_t< F > >
Execute a function without arguments several times.
TExecutor(unsigned nWorkers=0)
Class constructor.
TExecutor & operator=(const TExecutor &)=delete
TExecutor(const TExecutor &)=delete
ROOT::EExecutionPolicy fExecPolicy
unsigned GetPoolSize() const
Return the number of pooled workers.
std::unique_ptr< ROOT::TProcessExecutor > fProcessExecutor
ROOT::TSequentialExecutor Unused_t
This class defines an interface to execute the same task multiple times, possibly in parallel and wit...
ROOT::TypeTraits::InvokeResult_t< F, Args... > InvokeResult_t
auto Map(F func, unsigned nTimes) -> std::vector< InvokeResult_t< F > >
T * Reduce(const std::vector< T * > &mergeObjs)
A pseudo container class which is a generator of indices.
namespace associated R package for ROOT.
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
Helper class to get the correct return type from the Map function, necessary to infer the ResolveExec...
InvokeResult_t< F, typename CONTAINER::value_type > type