template<typename T>
class ROOT::Detail::RDF::RMergeableValue< T >
A result of an RDataFrame execution, that knows how to merge with other results of the same type.
- Template Parameters
-
T | Type of the action result. |
Results of the execution of an RDataFrame computation graph do not natively know how to merge with other results of the same type. In a distributed environment it is often needed to have a merging mechanism for partial results coming from the execution of an analysis on different chunks of the same dataset that has happened on different executors. In order to achieve this, RMergeableValue stores the result of the RDataFrame action and has a Merge
method to allow the aggregation of information coming from another similar result into the current.
A mergeable value can be retrieved from an RResultPtr through the [GetMergeableValue] (namespaceROOT_1_1Detail_1_1RDF.html::a8b3a9c7b416826acc952d78a56d14ecb) free function and a sequence of mergeables can be merged together with the helper function [MergeValues] (namespaceROOT_1_1Detail_1_1RDF.html::af16fefbe2d120983123ddf8a1e137277). All the classes and functions involved are inside the ROOT::Detail::RDF
namespace.
In a nutshell:
auto h1 =
d.Histo1D(
"Branch_A");
auto h2 =
d.Histo1D(
"Branch_A");
auto mergedptr =
MergeValues(std::move(mergeableh1), std::move(mergeableh2));
const auto &mergedhisto = mergedptr->GetValue();
friend std::unique_ptr< RMergeableValue< T1 > > MergeValues(std::unique_ptr< RMergeableValue< T1 > > OutputMergeable, std::unique_ptr< RMergeableValue< Ts > >... InputMergeables)
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
std::unique_ptr< RMergeableVariations< T > > GetMergeableValue(ROOT::RDF::Experimental::RResultMap< T > &rmap)
Retrieve mergeable values after calling ROOT::RDF::VariationsFor .
Though this snippet can run on a single thread of a single machine, it is straightforward to generalize it to a distributed case, e.g. where mergeableh1
and mergeableh2
are created on separate machines and sent to a reduce
process where the MergeValues
function is called. The final user would then just be given the final merged result coming from mergedptr->GetValue
.
RMergeableValue is the base class for all the different specializations that may be needed according to the peculiarities of the result types. The following subclasses, their names hinting at the action operation of the result, are currently available:
Definition at line 143 of file RMergeableValue.hxx.