Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::MultiProcess::Config Class Reference

Configuration for MultiProcess infrastructure.

This class offers user-accessible configuration of the MultiProcess infrastructure. Since the rest of the MultiProcess classes are only accessible at compile time, a separate class is needed to set configuration. Currently, the configurable parts are:

  1. the number of workers to be deployed,
  2. the number of event-tasks in LikelihoodJobs,
  3. and the number of component-tasks in LikelihoodJobs.

The default number of workers is set using 'std::thread::hardware_concurrency()'. To change it, use 'Config::setDefaultNWorkers()' to set it to a different value before creation of a new JobManager instance. Note that it cannot be set to zero and also cannot be changed after JobManager has been instantiated.

Use Config::getDefaultNWorkers() to access the current value.

Under Config::LikelihoodJob, we find two members for the number of tasks to use to calculate the range of events and components in parallel, respectively: defaultNEventTasks and defaultNComponentTasks. Newly created LikelihoodJobs will then use these values at construction time. Note that (like with the number of workers) the number cannot be changed for an individual LikelihoodJob after it has been created.

Both event- and component-based tasks by default are set to automatic mode using the automaticNEventTasks and automaticNComponentTasks constants (both under Config::LikelihoodJob as well). These are currently set to zero, but this could change. Automatic mode for events means that the number of tasks is set to the number of workers in the JobManager, with events divided equally over workers. For components, the automatic mode uses just 1 task for all components. These automatic modes may change in the future (for instance, we may switch them around).

Under Config::Queue, we can set the desired queue type: FIFO or Priority. This setting is used when a JobManager is spun up, i.e. usually when the first Job starts. At this point, the Queue is also created according to the setting. The default is FIFO. When using a Priority Queue, the priority of tasks in a Job can be set using either setTaskPriorities or suggestTaskOrder. If no priorities are set, the Priority queue simply assumes equal priority for all tasks. The resulting order then depends on the implementation of std::priority_queue.

Definition at line 24 of file Config.h.

Classes

struct  LikelihoodJob
 
struct  Queue
 

Static Public Member Functions

static unsigned int getDefaultNWorkers ()
 
static bool getTimingAnalysis ()
 
static void setDefaultNWorkers (unsigned int N_workers)
 
static void setTimingAnalysis (bool timingAnalysis)
 

Static Private Attributes

static unsigned int defaultNWorkers_ = std::thread::hardware_concurrency()
 
static bool timingAnalysis_ = false
 

#include <RooFit/MultiProcess/Config.h>

Member Function Documentation

◆ getDefaultNWorkers()

unsigned int RooFit::MultiProcess::Config::getDefaultNWorkers ( )
static

Definition at line 92 of file Config.cxx.

◆ getTimingAnalysis()

bool RooFit::MultiProcess::Config::getTimingAnalysis ( )
static

Definition at line 87 of file Config.cxx.

◆ setDefaultNWorkers()

void RooFit::MultiProcess::Config::setDefaultNWorkers ( unsigned int  N_workers)
static

Definition at line 67 of file Config.cxx.

◆ setTimingAnalysis()

void RooFit::MultiProcess::Config::setTimingAnalysis ( bool  timingAnalysis)
static

Definition at line 78 of file Config.cxx.

Member Data Documentation

◆ defaultNWorkers_

unsigned int RooFit::MultiProcess::Config::defaultNWorkers_ = std::thread::hardware_concurrency()
staticprivate

Definition at line 51 of file Config.h.

◆ timingAnalysis_

bool RooFit::MultiProcess::Config::timingAnalysis_ = false
staticprivate

Definition at line 52 of file Config.h.

  • roofit/multiprocess/inc/RooFit/MultiProcess/Config.h
  • roofit/multiprocess/src/Config.cxx