2#define TBB_USE_CAPTURED_EXCEPTION 0 
    7#pragma GCC diagnostic push 
    8#pragma GCC diagnostic ignored "-Wshadow" 
   11#define TBB_PREVIEW_GLOBAL_CONTROL 1  
   12#include "tbb/global_control.h" 
   14#pragma GCC diagnostic pop 
  132   return tbb::this_task_arena::isolate([&] {
 
 
  162                                  const std::function<
void(
unsigned int i)> &
f)
 
  164   if (
GetPoolSize() > tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism)) {
 
  165      Warning(
"TThreadExecutor::ParallelFor",
 
  166              "tbb::global_control is limiting the number of parallel workers." 
  167              " Proceeding with %zu threads this time",
 
  168              tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism));
 
  171      tbb::this_task_arena::isolate([&] {
 
  172         tbb::parallel_for(start, end, step, 
f);
 
 
  184                                       const std::function<
double(
double a, 
double b)> &
redfunc)
 
  186   if (
GetPoolSize() > tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism)) {
 
  187      Warning(
"TThreadExecutor::ParallelReduce",
 
  188              "tbb::global_control is limiting the number of parallel workers." 
  189              " Proceeding with %zu threads this time",
 
  190              tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism));
 
  192   return fTaskArenaW->Access().execute([&] { 
return ROOT::Internal::ParallelReduceHelper<double>(
objs, 
redfunc); });
 
 
  202                                      const std::function<
float(
float a, 
float b)> &
redfunc)
 
  204   if (
GetPoolSize() > tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism)) {
 
  205      Warning(
"TThreadExecutor::ParallelReduce",
 
  206              "tbb::global_control is limiting the number of parallel workers." 
  207              " Proceeding with %zu threads this time",
 
  208              tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism));
 
  210   return fTaskArenaW->Access().execute([&] { 
return ROOT::Internal::ParallelReduceHelper<float>(
objs, 
redfunc); });
 
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
const_iterator begin() const
const_iterator end() const
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.
unsigned GetPoolSize() const
Returns the number of worker threads in the task arena.
std::shared_ptr< ROOT::Internal::RTaskArenaWrapper > fTaskArenaW
Pointer to the TBB task arena wrapper.
TThreadExecutor(UInt_t nThreads=0u)
Class constructor.
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
static T ParallelReduceHelper(const std::vector< T > &objs, const std::function< T(T a, T b)> &redfunc)
A helper function to implement the TThreadExecutor::ParallelReduce methods.
std::shared_ptr< ROOT::Internal::RTaskArenaWrapper > GetGlobalTaskArena(unsigned maxConcurrency=0)
Factory function returning a shared pointer to the instance of the global RTaskArenaWrapper.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...