A result of an RDataFrame execution, that knows how to merge with other results of the same type.
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:
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 129 of file RMergeableValue.hxx.
Public Member Functions | |
RMergeableValue ()=default | |
Default constructor. | |
RMergeableValue (const T &value) | |
Constructor taking the action result by const reference. | |
const T & | GetValue () const |
Retrieve the result wrapped by this mergeable. | |
Public Member Functions inherited from ROOT::Detail::RDF::RMergeableValueBase | |
RMergeableValueBase ()=default | |
Default constructor. | |
virtual | ~RMergeableValueBase ()=default |
Protected Attributes | |
T | fValue |
Private Member Functions | |
virtual void | Merge (const RMergeableValue< T > &)=0 |
Aggregate the information contained in another RMergeableValue into this. | |
Friends | |
template<typename T1 , typename... Ts> | |
void | MergeValues (RMergeableValue< T1 > &OutputMergeable, const RMergeableValue< Ts > &... InputMergeables) |
template<typename T1 , typename... Ts> | |
std::unique_ptr< RMergeableValue< T1 > > | MergeValues (std::unique_ptr< RMergeableValue< T1 > > OutputMergeable, std::unique_ptr< RMergeableValue< Ts > >... InputMergeables) |
#include <ROOT/RDF/RMergeableValue.hxx>
|
inline |
Constructor taking the action result by const reference.
This involves a copy of the result into the data member, but gives full ownership of data to the mergeable.
Definition at line 157 of file RMergeableValue.hxx.
|
default |
Default constructor.
Needed to allow serialization of ROOT objects. See [TBufferFile::WriteObjectClass] (classTBufferFile.html::a209078a4cb58373b627390790bf0c9c1)
|
inline |
Retrieve the result wrapped by this mergeable.
Definition at line 166 of file RMergeableValue.hxx.
|
privatepure virtual |
Aggregate the information contained in another RMergeableValue into this.
Virtual function reimplemented in all the subclasses.
Merge
methods in the RMergeableValue family are private. To merge multiple RMergeableValue objects please use [MergeValues] (namespaceROOT_1_1Detail_1_1RDF.html::af16fefbe2d120983123ddf8a1e137277). Implemented in ROOT::Detail::RDF::RMergeableMean, ROOT::Detail::RDF::RMergeableStdDev, ROOT::Detail::RDF::RMergeableFill< T >, ROOT::Detail::RDF::RMergeableMax< T >, ROOT::Detail::RDF::RMergeableMin< T >, ROOT::Detail::RDF::RMergeableSum< T >, and ROOT::Detail::RDF::RMergeableCount.
|
friend |
|
friend |
|
protected |
Definition at line 149 of file RMergeableValue.hxx.