Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::RooFitDriver Class Reference

Definition at line 37 of file RooFitDriver.h.

Public Types

using DataSpansMap = std::map< RooFit::Detail::DataKey, RooSpan< const double > >
 

Public Member Functions

 RooFitDriver (const RooAbsReal &absReal, RooFit::BatchModeOption batchMode=RooFit::BatchModeOption::Cpu)
 Construct a new RooFitDriver.
 
 ~RooFitDriver ()
 
RooArgSet getParameters () const
 
double getVal ()
 Returns the value of the top node in the computation graph.
 
std::vector< doublegetValues ()
 
void print (std::ostream &os) const
 
void setData (DataSpansMap const &dataSpans)
 
void setData (RooAbsData const &data, std::string const &rangeName="", RooSimultaneous const *simPdf=nullptr, bool skipZeroWeights=false, bool takeGlobalObservablesFromData=true)
 
RooAbsRealtopNode () const
 

Private Member Functions

void assignToGPU (NodeInfo &info)
 Assign a node to be computed in the GPU.
 
void computeCPUNode (const RooAbsArg *node, NodeInfo &info)
 
void determineOutputSizes ()
 
double getValHeterogeneous ()
 Returns the value of the top node in the computation graph.
 
void markGPUNodes ()
 Decides which nodes are assigned to the GPU in a CUDA fit.
 
void processVariable (NodeInfo &nodeInfo)
 Process a variable in the computation graph.
 
void setClientsDirty (NodeInfo &nodeInfo)
 Flags all the clients of a given node dirty.
 
void setOperMode (RooAbsArg *arg, RooAbsArg::OperMode opMode)
 Temporarily change the operation mode of a RooAbsArg until the RooFitDriver gets deleted.
 
void syncDataTokens ()
 If there are servers with the same name that got de-duplicated in the _nodes list, we need to set their data tokens too.
 

Private Attributes

const RooFit::BatchModeOption _batchMode = RooFit::BatchModeOption::Off
 
Detail::BufferManager _bufferManager
 
std::stack< RooHelpers::ChangeOperModeRAII_changeOperModeRAIIs
 
double_cudaMemDataset = nullptr
 
RooFit::Detail::DataMap _dataMapCPU
 
RooFit::Detail::DataMap _dataMapCUDA
 
int _getValInvocations = 0
 
std::vector< NodeInfo_nodes
 
RooAbsReal_topNode
 
std::stack< std::vector< double > > _vectorBuffers
 

#include </home/sftnight/build/workspace/root-makedoc-v628/rootspi/rdoc/src/v6-28-00-patches/roofit/roofitcore/src/RooFitDriver.h>

Member Typedef Documentation

◆ DataSpansMap

Constructor & Destructor Documentation

◆ RooFitDriver()

RooFitDriver::RooFitDriver ( const RooAbsReal absReal,
RooFit::BatchModeOption  batchMode = RooFit::BatchModeOption::Cpu 
)

Construct a new RooFitDriver.

The constructor analyzes and saves metadata about the graph, useful for the evaluation of it that will be done later. In case the CUDA mode is selected, there's also some CUDA-related initialization.

Parameters
[in]absRealThe RooAbsReal object that sits on top of the computation graph that we want to evaluate.
[in]batchModeThe computation mode, accepted values are RooBatchCompute::Cpu and RooBatchCompute::Cuda.

Definition at line 148 of file RooFitDriver.cxx.

◆ ~RooFitDriver()

RooFitDriver::~RooFitDriver ( )

Definition at line 304 of file RooFitDriver.cxx.

Member Function Documentation

◆ assignToGPU()

void RooFitDriver::assignToGPU ( NodeInfo info)
private

Assign a node to be computed in the GPU.

Scan it's clients and also assign them in case they only depend on GPU nodes.

Definition at line 495 of file RooFitDriver.cxx.

◆ computeCPUNode()

void RooFitDriver::computeCPUNode ( const RooAbsArg node,
NodeInfo info 
)
private

Definition at line 328 of file RooFitDriver.cxx.

◆ determineOutputSizes()

void RooFitDriver::determineOutputSizes ( )
private

Definition at line 544 of file RooFitDriver.cxx.

◆ getParameters()

RooArgSet RooFitDriver::getParameters ( ) const

Definition at line 625 of file RooFitDriver.cxx.

◆ getVal()

double RooFitDriver::getVal ( )

Returns the value of the top node in the computation graph.

Definition at line 393 of file RooFitDriver.cxx.

◆ getValHeterogeneous()

double RooFitDriver::getValHeterogeneous ( )
private

Returns the value of the top node in the computation graph.

Definition at line 420 of file RooFitDriver.cxx.

◆ getValues()

std::vector< double > RooFitDriver::getValues ( )

Definition at line 315 of file RooFitDriver.cxx.

◆ markGPUNodes()

void RooFitDriver::markGPUNodes ( )
private

Decides which nodes are assigned to the GPU in a CUDA fit.

Definition at line 528 of file RooFitDriver.cxx.

◆ print()

void RooFitDriver::print ( std::ostream &  os) const

Definition at line 569 of file RooFitDriver.cxx.

◆ processVariable()

void RooFitDriver::processVariable ( NodeInfo nodeInfo)
private

Process a variable in the computation graph.

This is a separate non-inlined function such that we can see in performance profiles how long this takes.

Definition at line 369 of file RooFitDriver.cxx.

◆ setClientsDirty()

void RooFitDriver::setClientsDirty ( NodeInfo nodeInfo)
private

Flags all the clients of a given node dirty.

This is a separate non-inlined function such that we can see in performance profiles how long this takes.

Definition at line 385 of file RooFitDriver.cxx.

◆ setData() [1/2]

void RooFitDriver::setData ( DataSpansMap const &  dataSpans)

Definition at line 236 of file RooFitDriver.cxx.

◆ setData() [2/2]

void RooFitDriver::setData ( RooAbsData const &  data,
std::string const &  rangeName = "",
RooSimultaneous const *  simPdf = nullptr,
bool  skipZeroWeights = false,
bool  takeGlobalObservablesFromData = true 
)

Definition at line 228 of file RooFitDriver.cxx.

◆ setOperMode()

void RooFitDriver::setOperMode ( RooAbsArg arg,
RooAbsArg::OperMode  opMode 
)
private

Temporarily change the operation mode of a RooAbsArg until the RooFitDriver gets deleted.

Definition at line 557 of file RooFitDriver.cxx.

◆ syncDataTokens()

void RooFitDriver::syncDataTokens ( )
private

If there are servers with the same name that got de-duplicated in the _nodes list, we need to set their data tokens too.

We find such nodes by visiting the servers of every known node.

Definition at line 212 of file RooFitDriver.cxx.

◆ topNode()

RooAbsReal & RooFitDriver::topNode ( ) const

Definition at line 564 of file RooFitDriver.cxx.

Member Data Documentation

◆ _batchMode

const RooFit::BatchModeOption ROOT::Experimental::RooFitDriver::_batchMode = RooFit::BatchModeOption::Off
private

Definition at line 82 of file RooFitDriver.h.

◆ _bufferManager

Detail::BufferManager ROOT::Experimental::RooFitDriver::_bufferManager
private

Definition at line 79 of file RooFitDriver.h.

◆ _changeOperModeRAIIs

std::stack<RooHelpers::ChangeOperModeRAII> ROOT::Experimental::RooFitDriver::_changeOperModeRAIIs
private

Definition at line 97 of file RooFitDriver.h.

◆ _cudaMemDataset

double* ROOT::Experimental::RooFitDriver::_cudaMemDataset = nullptr
private

Definition at line 84 of file RooFitDriver.h.

◆ _dataMapCPU

RooFit::Detail::DataMap ROOT::Experimental::RooFitDriver::_dataMapCPU
private

Definition at line 87 of file RooFitDriver.h.

◆ _dataMapCUDA

RooFit::Detail::DataMap ROOT::Experimental::RooFitDriver::_dataMapCUDA
private

Definition at line 88 of file RooFitDriver.h.

◆ _getValInvocations

int ROOT::Experimental::RooFitDriver::_getValInvocations = 0
private

Definition at line 83 of file RooFitDriver.h.

◆ _nodes

std::vector<NodeInfo> ROOT::Experimental::RooFitDriver::_nodes
private

Definition at line 91 of file RooFitDriver.h.

◆ _topNode

RooAbsReal& ROOT::Experimental::RooFitDriver::_topNode
private

Definition at line 81 of file RooFitDriver.h.

◆ _vectorBuffers

std::stack<std::vector<double> > ROOT::Experimental::RooFitDriver::_vectorBuffers
private

Definition at line 94 of file RooFitDriver.h.

  • roofit/roofitcore/src/RooFitDriver.h
  • roofit/roofitcore/src/RooFitDriver.cxx