15#include "RConfigure.h"
31 if (handles.empty()) {
32 Warning(
"RunGraphs",
"Got an empty list of handles, now quitting.");
37 const unsigned int nToRun =
38 std::count_if(handles.begin(), handles.end(), [](
const auto &
h) { return !h.IsReady(); });
39 if (nToRun < handles.size()) {
40 Warning(
"RunGraphs",
"Got %lu handles from which %lu link to results which are already ready.", handles.size(),
41 handles.size() - nToRun);
48 std::set<
RResultHandle,
decltype(sameGraph)> s(handles.begin(), handles.end(), sameGraph);
49 std::vector<RResultHandle> uniqueLoops(s.begin(), s.end());
55 const auto effectiveVerbosity =
60 uniqueLoops[0].fLoopManager->Jit();
65 uniqueLoops[0].fLoopManager->Jit();
70 <<
"Just-in-time compilation phase for RunGraphs (" << uniqueLoops.size()
71 <<
" unique computation graphs) completed"
72 << (sw.
RealTime() > 1
e-3 ?
" in " + std::to_string(sw.
RealTime()) +
" seconds." :
" in less than 1ms.");
77 h.fLoopManager->Run(
false);
86 std::for_each(uniqueLoops.begin(), uniqueLoops.end(), run);
92 <<
"Finished RunGraphs run (" << uniqueLoops.size() <<
" unique computation graphs, " << sw.
CpuTime() <<
"s CPU, "
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
ELogLevel GetEffectiveVerbosity(const RLogManager &mgr) const
static RLogManager & Get()
Change the verbosity level (global or specific to the RLogChannel passed to the constructor) for the ...
This class provides a simple interface to execute the same task multiple times in parallel threads,...
void Foreach(F func, unsigned nTimes, unsigned nChunks=0)
Execute a function without arguments several times in parallel, dividing the execution in nChunks.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void Stop()
Stop the stopwatch.
ROOT::Experimental::RLogChannel & RDFLogChannel()
RLogChannel & GetChannelOrManager()
@ kDebug
Debug information; only useful for developers; can have added verbosity up to 255-kDebug.
void RunGraphs(std::vector< RResultHandle > handles)
Trigger the event loop of multiple RDataFrames concurrently.
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.