This class provides a simple interface to execute the same task multiple times in parallel threads, possibly with different arguments every time.
This class inherits its interfaces from ROOT::TExecutorCRTP
, adapting them for multithreaded parallelism and extends them supporting:
Foreach
operations.The two possible usages of the Map method are:
For either signature, func is executed as many times as needed by a pool of nThreads threads, where nThreads typically defaults to the number of cores.
A collection containing the result of each execution is returned.
Note: the user is responsible for the deletion of any object that might be created upon execution of func, returned objects included: ROOT::TThreadExecutor never deletes what it returns, it simply forgets it.
func | a callable object, such as a lambda expression, an std::function, a functor object or a function that takes zero arguments (for the first signature) or one (for the second signature). |
args | a standard vector, a ROOT::TSeq of integer type or an initializer list for the second signature. An integer only for the first. |
Note: in cases where the function to be executed takes more than zero/one argument but all are fixed except zero/one, the function can be wrapped in a lambda or via std::bind to give it the right signature.
An std::vector. The elements in the container will be the objects returned by func.
This set of methods behaves exactly like Map, but takes an additional function as a third argument. This function is applied to the set of objects returned by the corresponding Map execution to "squash" them into a single object. This function should be independent of the size of the vector returned by Map due to optimization of the number of chunks.
If this function is a binary operator, the "squashing" will be performed in parallel. This is exclusive to ROOT::TThreadExecutor and not any other ROOT::TExecutorCRTP-derived classes.
An integer can be passed as the fourth argument indicating the number of chunks we want to divide our work in. This may be useful to avoid the overhead introduced when running really short tasks.
Definition at line 41 of file TThreadExecutor.hxx.
Public Member Functions | |
TThreadExecutor (const TThreadExecutor &)=delete | |
TThreadExecutor (UInt_t nThreads=0u) | |
Class constructor. | |
template<class F , class T > | |
void | Foreach (F func, const std::vector< T > &args, unsigned nChunks=0) |
Execute a function in parallel over the elements of a immutable vector, dividing the execution in nChunks. | |
template<class F , class INTEGER > | |
void | Foreach (F func, ROOT::TSeq< INTEGER > args, unsigned nChunks=0) |
Execute a function in parallel over a sequence of indexes, dividing the execution in nChunks. | |
template<class F , class T > | |
void | Foreach (F func, std::initializer_list< T > args, unsigned nChunks=0) |
Execute a function in parallel over the elements of an initializer_list, dividing the execution in nChunks. | |
template<class F , class T > | |
void | Foreach (F func, std::vector< T > &args, unsigned nChunks=0) |
Execute a function in parallel over the elements of a vector, dividing the execution in nChunks. | |
template<class F > | |
void | Foreach (F func, unsigned nTimes, unsigned nChunks=0) |
Execute a function without arguments several times in parallel, dividing the execution in nChunks. | |
unsigned | GetPoolSize () const |
Returns the number of worker threads in the task arena. | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | Map (F func, const std::vector< T > &args, R redfunc, unsigned nChunks) -> std::vector< InvokeResult_t< F, T > > |
Execute a function in parallel over the elements of an immutable vector, dividing the execution in nChunks and providing a result per chunk. | |
template<class F , class INTEGER , class R , class Cond = validMapReturnCond<F, INTEGER>> | |
auto | Map (F func, ROOT::TSeq< INTEGER > args, R redfunc, unsigned nChunks) -> std::vector< InvokeResult_t< F, INTEGER > > |
Execute a function in parallel over the elements of a sequence, dividing the execution in nChunks and providing a result per chunk. | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | Map (F func, std::initializer_list< T > args, R redfunc, unsigned nChunks) -> std::vector< InvokeResult_t< F, T > > |
Execute a function in parallel over the elements of an initializer_list, dividing the execution in nChunks and providing a result per chunk. | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | Map (F func, std::vector< T > &args, R redfunc, unsigned nChunks) -> std::vector< InvokeResult_t< F, T > > |
Execute a function in parallel over the elements of a vector, dividing the execution in nChunks and providing a result per chunk. | |
template<class F , class R , class Cond = validMapReturnCond<F>> | |
auto | Map (F func, unsigned nTimes, R redfunc, unsigned nChunks) -> std::vector< InvokeResult_t< F > > |
Execute a function nTimes in parallel, dividing the execution in nChunks and providing a result per chunk. | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | MapReduce (F func, const std::vector< T > &args, R redfunc) -> InvokeResult_t< F, T > |
Execute a function over the elements of an immutable vector in parallel (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | MapReduce (F func, const std::vector< T > &args, R redfunc, unsigned nChunks) -> InvokeResult_t< F, T > |
Execute a function in parallel over the elements of an immutable vector (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class INTEGER , class R , class Cond = validMapReturnCond<F, INTEGER>> | |
auto | MapReduce (F func, ROOT::TSeq< INTEGER > args, R redfunc, unsigned nChunks) -> InvokeResult_t< F, INTEGER > |
Execute a function in parallel over the elements of a vector (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | MapReduce (F func, std::initializer_list< T > args, R redfunc, unsigned nChunks) -> InvokeResult_t< F, T > |
Execute a function in parallel over the elements of an initializer_list (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | MapReduce (F func, std::vector< T > &args, R redfunc) -> InvokeResult_t< F, T > |
Execute a function over the elements of a vector in parallel (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class T , class R , class Cond = validMapReturnCond<F, T>> | |
auto | MapReduce (F func, std::vector< T > &args, R redfunc, unsigned nChunks) -> InvokeResult_t< F, T > |
Execute a function in parallel over the elements of a vector (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class R , class Cond = validMapReturnCond<F>> | |
auto | MapReduce (F func, unsigned nTimes, R redfunc) -> InvokeResult_t< F > |
Execute a function nTimes in parallel (Map) and accumulate the results into a single value (Reduce). | |
template<class F , class R , class Cond = validMapReturnCond<F>> | |
auto | MapReduce (F func, unsigned nTimes, R redfunc, unsigned nChunks) -> InvokeResult_t< F > |
Execute a function in parallel over the elements of a vector (Map) and accumulate the results into a single value (Reduce). | |
TThreadExecutor & | operator= (const TThreadExecutor &)=delete |
template<class T , class BINARYOP > | |
auto | Reduce (const std::vector< T > &objs, BINARYOP redfunc) -> decltype(redfunc(objs.front(), objs.front())) |
"Reduce" an std::vector into a single object in parallel by passing a binary function as the second argument defining the reduction operation. | |
template<class T , class R > | |
auto | Reduce (const std::vector< T > &objs, R redfunc) -> decltype(redfunc(objs)) |
"Reduce" an std::vector into a single object by passing a function as the second argument defining the reduction operation. | |
Public Member Functions inherited from ROOT::TExecutorCRTP< TThreadExecutor > | |
TExecutorCRTP ()=default | |
TExecutorCRTP (const TExecutorCRTP &)=delete | |
auto | Map (F func, const std::vector< T > &args) -> std::vector< InvokeResult_t< F, T > > |
Execute a function over the elements of an immutable vector. | |
auto | Map (F func, ROOT::TSeq< INTEGER > args) -> std::vector< InvokeResult_t< F, INTEGER > > |
Execute a function over a sequence of indexes. | |
auto | Map (F func, std::initializer_list< T > args) -> std::vector< InvokeResult_t< F, T > > |
Execute a function over the elements of an initializer_list. | |
auto | Map (F func, std::vector< T > &args) -> std::vector< InvokeResult_t< F, T > > |
Execute a function over the elements of a vector. | |
auto | Map (F func, unsigned nTimes) -> std::vector< InvokeResult_t< F > > |
Execute a function without arguments several times. | |
T * | MapReduce (F func, const std::vector< T * > &args) |
Execute a function over the TObject-inheriting elements of an immutable vector (Map) and merge the objects into a single one (Reduce). | |
auto | MapReduce (F func, const std::vector< T > &args, R redfunc) -> InvokeResult_t< F, T > |
Execute a function over the elements of an immutable vector (Map) and accumulate the results into a single value (Reduce). | |
auto | MapReduce (F func, ROOT::TSeq< INTEGER > args, R redfunc) -> InvokeResult_t< F, INTEGER > |
Execute a function over a sequence of indexes (Map) and accumulate the results into a single value (Reduce). | |
auto | MapReduce (F func, std::initializer_list< T > args, R redfunc) -> InvokeResult_t< F, T > |
Execute a function over the elements of an initializer_list (Map) and accumulate the results into a single value (Reduce). | |
T * | MapReduce (F func, std::vector< T * > &args) |
Execute a function over the TObject-inheriting elements of a vector (Map) and merge the objects into a single one (Reduce). | |
auto | MapReduce (F func, std::vector< T > &args, R redfunc) -> InvokeResult_t< F, T > |
Execute a function over the elements of a vector (Map) and accumulate the results into a single value (Reduce). | |
auto | MapReduce (F func, unsigned nTimes, R redfunc) -> InvokeResult_t< F > |
Execute a function without arguments several times (Map) and accumulate the results into a single value (Reduce). | |
TExecutorCRTP & | operator= (const TExecutorCRTP &)=delete |
T * | Reduce (const std::vector< T * > &mergeObjs) |
"Reduce" an std::vector into a single object by using the object's Merge method. | |
auto | Reduce (const std::vector< T > &objs, R redfunc) -> decltype(redfunc(objs)) |
"Reduce" an std::vector into a single object by passing a function as the second argument defining the reduction operation. | |
Private Member Functions | |
template<class F , class T , class Cond = validMapReturnCond<F, T>> | |
auto | MapImpl (F func, const std::vector< T > &args) -> std::vector< InvokeResult_t< F, T > > |
Execute a function over the elements of a vector in parallel. | |
template<class F , class INTEGER , class Cond = validMapReturnCond<F, INTEGER>> | |
auto | MapImpl (F func, ROOT::TSeq< INTEGER > args) -> std::vector< InvokeResult_t< F, INTEGER > > |
Execute a function over a sequence of indexes in parallel. | |
template<class F , class T , class Cond = validMapReturnCond<F, T>> | |
auto | MapImpl (F func, std::vector< T > &args) -> std::vector< InvokeResult_t< F, T > > |
Execute a function over the elements of a vector in parallel. | |
template<class F , class Cond = validMapReturnCond<F>> | |
auto | MapImpl (F func, unsigned nTimes) -> std::vector< InvokeResult_t< F > > |
Execute a function without arguments several times in parallel. | |
void | ParallelFor (unsigned start, unsigned end, unsigned step, const std::function< void(unsigned int i)> &f) |
Execute a function in parallel over the indices of a loop. | |
double | ParallelReduce (const std::vector< double > &objs, const std::function< double(double a, double b)> &redfunc) |
"Reduce" in parallel an std::vector<double> into a single double value | |
float | ParallelReduce (const std::vector< float > &objs, const std::function< float(float a, float b)> &redfunc) |
"Reduce" in parallel an std::vector<float> into a single float value | |
template<class T , class R > | |
auto | SeqReduce (const std::vector< T > &objs, R redfunc) -> decltype(redfunc(objs)) |
"Reduce", sequentially, an std::vector into a single object | |
Private Attributes | |
std::shared_ptr< ROOT::Internal::RTaskArenaWrapper > | fTaskArenaW = nullptr |
Pointer to the TBB task arena wrapper. | |
friend | TExecutorCRTP |
Additional Inherited Members | |
Protected Types inherited from ROOT::TExecutorCRTP< TThreadExecutor > | |
using | InvokeResult_t = ROOT::TypeTraits::InvokeResult_t< F, Args... > |
using | validMapReturnCond = std::enable_if_t<!std::is_reference< InvokeResult_t< F, T... > >::value &&!std::is_void< InvokeResult_t< F, T... > >::value > |
type definition used in templated functions for not allowing mapping functions that return references or void. | |
#include <ROOT/TThreadExecutor.hxx>
|
explicit |
Class constructor.
If the scheduler is active (e.g. because another TThreadExecutor is in flight, or ROOT::EnableImplicitMT() was called), work with the current pool of threads. If not, initialize the pool of threads, spawning nThreads. nThreads' default value, 0, initializes the pool with as many logical threads as are available in the system (see NLogicalCores in RTaskArenaWrapper.cxx).
At construction time, TThreadExecutor automatically enables ROOT's thread-safety locks as per calling ROOT::EnableThreadSafety().
Definition at line 149 of file TThreadExecutor.cxx.
|
delete |
void ROOT::TThreadExecutor::Foreach | ( | F | func, |
const std::vector< T > & | args, | ||
unsigned | nChunks = 0 |
||
) |
Execute a function in parallel over the elements of a immutable vector, dividing the execution in nChunks.
func | Function to be executed on the elements of the vector passed as second parameter. |
args | Immutable vector of elements passed as an argument to func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 230 of file TThreadExecutor.hxx.
void ROOT::TThreadExecutor::Foreach | ( | F | func, |
ROOT::TSeq< INTEGER > | args, | ||
unsigned | nChunks = 0 |
||
) |
Execute a function in parallel over a sequence of indexes, dividing the execution in nChunks.
func | Function to be executed. Must take an element of the sequence passed assecond argument as a parameter. |
args | Sequence of indexes to execute func on. |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 168 of file TThreadExecutor.hxx.
void ROOT::TThreadExecutor::Foreach | ( | F | func, |
std::initializer_list< T > | args, | ||
unsigned | nChunks = 0 |
||
) |
Execute a function in parallel over the elements of an initializer_list, dividing the execution in nChunks.
func | Function to be executed on the elements of the initializer_list passed as second parameter. |
args | initializer_list for a vector to apply func on. |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 194 of file TThreadExecutor.hxx.
void ROOT::TThreadExecutor::Foreach | ( | F | func, |
std::vector< T > & | args, | ||
unsigned | nChunks = 0 |
||
) |
Execute a function in parallel over the elements of a vector, dividing the execution in nChunks.
func | Function to be executed on the elements of the vector passed as second parameter. |
args | Vector of elements passed as an argument to func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 206 of file TThreadExecutor.hxx.
void ROOT::TThreadExecutor::Foreach | ( | F | func, |
unsigned | nTimes, | ||
unsigned | nChunks = 0 |
||
) |
Execute a function without arguments several times in parallel, dividing the execution in nChunks.
func | Function to be executed. |
nTimes | Number of times function should be called. |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 145 of file TThreadExecutor.hxx.
unsigned ROOT::TThreadExecutor::GetPoolSize | ( | ) | const |
Returns the number of worker threads in the task arena.
Definition at line 216 of file TThreadExecutor.cxx.
auto ROOT::TThreadExecutor::Map | ( | F | func, |
const std::vector< T > & | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> std::vector<InvokeResult_t<F, T>> |
Execute a function in parallel over the elements of an immutable vector, dividing the execution in nChunks and providing a result per chunk.
Definition at line 435 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::Map | ( | F | func, |
ROOT::TSeq< INTEGER > | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> std::vector<InvokeResult_t<F, INTEGER>> |
Execute a function in parallel over the elements of a sequence, dividing the execution in nChunks and providing a result per chunk.
Definition at line 367 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::Map | ( | F | func, |
std::initializer_list< T > | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> std::vector<InvokeResult_t<F, T>> |
Execute a function in parallel over the elements of an initializer_list, dividing the execution in nChunks and providing a result per chunk.
Definition at line 469 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::Map | ( | F | func, |
std::vector< T > & | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> std::vector<InvokeResult_t<F, T>> |
Execute a function in parallel over the elements of a vector, dividing the execution in nChunks and providing a result per chunk.
Definition at line 401 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::Map | ( | F | func, |
unsigned | nTimes, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> std::vector<InvokeResult_t<F>> |
Execute a function nTimes
in parallel, dividing the execution in nChunks and providing a result per chunk.
Definition at line 288 of file TThreadExecutor.hxx.
|
private |
Execute a function over the elements of a vector in parallel.
Implementation of the Map method.
func | Function to be executed on the elements of the vector passed as second parameter. |
args | Vector of elements passed as an argument to func . |
Definition at line 343 of file TThreadExecutor.hxx.
|
private |
Execute a function over a sequence of indexes in parallel.
Implementation of the Map method.
func | Function to be executed. Must take an element of the sequence passed assecond argument as a parameter. |
args | Sequence of indexes to execute func on. |
Definition at line 272 of file TThreadExecutor.hxx.
|
private |
Execute a function over the elements of a vector in parallel.
Implementation of the Map method.
func | Function to be executed on the elements of the vector passed as second parameter. |
args | Vector of elements passed as an argument to func . |
Definition at line 319 of file TThreadExecutor.hxx.
|
private |
Execute a function without arguments several times in parallel.
Implementation of the Map method.
func | Function to be executed. |
nTimes | Number of times function should be called. |
Definition at line 253 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
const std::vector< T > & | args, | ||
R | redfunc | ||
) | -> InvokeResult_t<F, T> |
Execute a function over the elements of an immutable vector in parallel (Map) and accumulate the results into a single value (Reduce).
func | Function to be executed on the elements of the vector passed as second parameter. |
args | Immutable vector of elements passed as an argument to func . |
redfunc | Reduction function to combine the results of the calls to func . Must return the same type as func . |
Definition at line 534 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
const std::vector< T > & | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> InvokeResult_t<F, T> |
Execute a function in parallel over the elements of an immutable vector (Map) and accumulate the results into a single value (Reduce).
Benefits from partial reduction into nChunks
intermediate results.
Benefits from partial reduction into nChunks
intermediate results if the execution policy is multithreaded. Otherwise, it ignores the nChunks argument and performs a normal MapReduce operation.
func | Function to be executed. Must take an element of the sequence passed assecond argument as a parameter. |
args | Immutable vector, whose elements are passed as an argument to func . |
redfunc | Reduction function to combine the results of the calls to func into partial results, and these into a final result. Must return the same type as func and should be callable with const std::vector<T> where T is the output of func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 556 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
ROOT::TSeq< INTEGER > | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> InvokeResult_t<F, INTEGER> |
Execute a function in parallel over the elements of a vector (Map) and accumulate the results into a single value (Reduce).
Benefits from partial reduction into nChunks
intermediate results.
Benefits from partial reduction into nChunks
intermediate results if the execution policy is multithreaded. Otherwise, it ignores the nChunks argument and performs a normal MapReduce operation.
func | Function to be executed. Must take an element of the sequence passed assecond argument as a parameter. |
args | Sequence of indexes to execute func on. |
redfunc | Reduction function to combine the results of the calls to func into partial results, and these into a final result. Must return the same type as func and should be callable with std::vector<T> where T is the output of func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 503 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
std::initializer_list< T > | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> InvokeResult_t<F, T> |
Execute a function in parallel over the elements of an initializer_list (Map) and accumulate the results into a single value (Reduce).
Benefits from partial reduction into nChunks
intermediate results.
Benefits from partial reduction into nChunks
intermediate results if the execution policy is multithreaded. Otherwise, it ignores the nChunks argument and performs a normal MapReduce operation.
func | Function to be executed. Must take an element of the sequence passed as second argument as a parameter. |
args | initializer_list for a vector to apply func on. |
redfunc | Reduction function to combine the results of the calls to func into partial results, and these into a final result. Must return the same type as func and should be callable with const std::vector<T> where T is the output of func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 515 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
std::vector< T > & | args, | ||
R | redfunc | ||
) | -> InvokeResult_t<F, T> |
Execute a function over the elements of a vector in parallel (Map) and accumulate the results into a single value (Reduce).
func | Function to be executed on the elements of the vector passed as second parameter. |
args | Vector of elements passed as an argument to func . |
redfunc | Reduction function to combine the results of the calls to func . Must return the same type as func . |
Definition at line 525 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
std::vector< T > & | args, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> InvokeResult_t<F, T> |
Execute a function in parallel over the elements of a vector (Map) and accumulate the results into a single value (Reduce).
Benefits from partial reduction into nChunks
intermediate results.
Benefits from partial reduction into nChunks
intermediate results if the execution policy is multithreaded. Otherwise, it ignores the nChunks argument and performs a normal MapReduce operation.
func | Function to be executed. Must take an element of the sequence passed assecond argument as a parameter. |
args | Vector of elements passed as an argument to func . |
redfunc | Reduction function to combine the results of the calls to func into partial results, and these into a final result. Must return the same type as func and should be callable with const std::vector<T> where T is the output of func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 545 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
unsigned | nTimes, | ||
R | redfunc | ||
) | -> InvokeResult_t<F> |
Execute a function nTimes
in parallel (Map) and accumulate the results into a single value (Reduce).
func | Function to be executed. |
nTimes | Number of times function should be called. |
redfunc | Reduction function to combine the results of the calls to func . Must return the same type as func . |
Definition at line 481 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::MapReduce | ( | F | func, |
unsigned | nTimes, | ||
R | redfunc, | ||
unsigned | nChunks | ||
) | -> InvokeResult_t<F> |
Execute a function in parallel over the elements of a vector (Map) and accumulate the results into a single value (Reduce).
Benefits from partial reduction into nChunks
intermediate results.
Benefits from partial reduction into nChunks
intermediate results if the execution policy is multithreaded. Otherwise, it ignores the nChunks argument and performs a normal MapReduce operation.
func | Function to be executed. Must take an element of the sequence passed as second argument as a parameter. |
nTimes | Number of times function should be called. |
redfunc | Reduction function to combine the results of the calls to func into partial results, and these into a final result. Must return the same type as func and should be callable with const std::vector<T> where T is the output of func . |
nChunks | Number of chunks to split the input data for processing. |
Definition at line 492 of file TThreadExecutor.hxx.
|
delete |
|
private |
Execute a function in parallel over the indices of a loop.
start | Start index of the loop. |
end | End index of the loop. |
step | Step size of the loop. |
f | function to execute. |
Definition at line 161 of file TThreadExecutor.cxx.
|
private |
"Reduce" in parallel an std::vector<double> into a single double value
objs | A vector of elements to combine. |
redfunc | Reduction function to combine the elements of the vector objs . |
Definition at line 183 of file TThreadExecutor.cxx.
|
private |
"Reduce" in parallel an std::vector<float> into a single float value
objs | A vector of elements to combine. |
redfunc | Reduction function to combine the elements of the vector objs . |
Definition at line 201 of file TThreadExecutor.cxx.
auto ROOT::TThreadExecutor::Reduce | ( | const std::vector< T > & | objs, |
BINARYOP | redfunc | ||
) | -> decltype(redfunc(objs.front(), objs.front())) |
"Reduce" an std::vector into a single object in parallel by passing a binary function as the second argument defining the reduction operation.
objs | A vector of elements to combine. |
redfunc | Binary reduction function to combine the elements of the vector objs . |
Definition at line 580 of file TThreadExecutor.hxx.
auto ROOT::TThreadExecutor::Reduce | ( | const std::vector< T > & | objs, |
R | redfunc | ||
) | -> decltype(redfunc(objs)) |
"Reduce" an std::vector into a single object by passing a function as the second argument defining the reduction operation.
objs | A vector of elements to combine. |
redfunc | Reduction function to combine the elements of the vector objs |
Definition at line 565 of file TThreadExecutor.hxx.
|
private |
"Reduce", sequentially, an std::vector into a single object
objs | A vector of elements to combine. |
redfunc | Reduction function to combine the elements of the vector objs . |
Definition at line 594 of file TThreadExecutor.hxx.
|
private |
Pointer to the TBB task arena wrapper.
Definition at line 133 of file TThreadExecutor.hxx.
|
private |
Definition at line 42 of file TThreadExecutor.hxx.