Logo ROOT  
Reference Guide
No Matches
RooFit::MultiProcess::HeatmapAnalyzer Class Reference

Reads and processes logfiles produced by RooFit::MultiProcess::ProcessTimer.

RooFit::MultiProcess::ProcessTimer records timings of multiple processes simultaneously and allows for these timings to be written out in json format, one for each process. This class, the HeatmapAnalyzer, can read these json files and produce a heatmap from them with partial derivatives on the y-axis, likelihood evaluations on the x-axis, and time expenditures on the z-axis. This class also contains some convenience functions for inspecting these log files.

Note that this class requires the logfiles to contain three specific keys in the json:

  • master:gradient containing an array of gradient timestamps
  • *eval_task*<task_number> containing an array of task evaluation timestamps.
  • *eval_partition* containing an array of partition evaluation timestamps

Definition at line 28 of file HeatmapAnalyzer.h.

Public Member Functions

 HeatmapAnalyzer (std::string const &logs_dir)
 HeatmapAnalyzer Constructor.
std::unique_ptr< TH2Ianalyze (int analyzed_gradient)
 This method is the main functionality in this class.
json const getMetadata ()
std::vector< std::string > const getPartitionNames ()
std::vector< std::string > const getTaskNames ()

Private Member Functions

std::string findTaskForDuration (json durations, int start_t, int end_t)
void sortTaskNames (std::vector< std::string > &task_names)

Private Attributes

std::vector< jsondurations_
std::vector< std::string > eval_partitions_names_
json gradients_
TH2I matrix_
json metadata_
std::vector< std::string > tasks_names_

#include <RooFit/MultiProcess/HeatmapAnalyzer.h>

Constructor & Destructor Documentation

◆ HeatmapAnalyzer()

RooFit::MultiProcess::HeatmapAnalyzer::HeatmapAnalyzer ( std::string const &  logs_dir)

HeatmapAnalyzer Constructor.

This method reads the input files in the folder specified by the user and creates internal attributes used by the other methods in this class.

[in]logs_dirDirectory where log files are stored in the format outputted by RooFit::MultiProcess::ProcessTimer. There can be other files in this directory as well.

Definition at line 47 of file HeatmapAnalyzer.cxx.

Member Function Documentation

◆ analyze()

std::unique_ptr< TH2I > RooFit::MultiProcess::HeatmapAnalyzer::analyze ( int  analyzed_gradient)

This method is the main functionality in this class.

It does the heavy lifting of matching duration timestamps to tasks and partition evaluations.

[in]analyzed_gradientGradient to analyze. For example, setting to 1 analyzes the first gradient (ordered by time) in the logs.

Definition at line 92 of file HeatmapAnalyzer.cxx.

◆ findTaskForDuration()

std::string RooFit::MultiProcess::HeatmapAnalyzer::findTaskForDuration ( json  durations,
int  start_t,
int  end_t 

Definition at line 179 of file HeatmapAnalyzer.cxx.

◆ getMetadata()

json const RooFit::MultiProcess::HeatmapAnalyzer::getMetadata ( )

Definition at line 174 of file HeatmapAnalyzer.cxx.

◆ getPartitionNames()

std::vector< std::string > const RooFit::MultiProcess::HeatmapAnalyzer::getPartitionNames ( )

Definition at line 169 of file HeatmapAnalyzer.cxx.

◆ getTaskNames()

std::vector< std::string > const RooFit::MultiProcess::HeatmapAnalyzer::getTaskNames ( )

Definition at line 164 of file HeatmapAnalyzer.cxx.

◆ sortTaskNames()

void RooFit::MultiProcess::HeatmapAnalyzer::sortTaskNames ( std::vector< std::string > &  task_names)

Definition at line 194 of file HeatmapAnalyzer.cxx.

Member Data Documentation

◆ durations_

std::vector<json> RooFit::MultiProcess::HeatmapAnalyzer::durations_

Definition at line 49 of file HeatmapAnalyzer.h.

◆ eval_partitions_names_

std::vector<std::string> RooFit::MultiProcess::HeatmapAnalyzer::eval_partitions_names_

Definition at line 52 of file HeatmapAnalyzer.h.

◆ gradients_

json RooFit::MultiProcess::HeatmapAnalyzer::gradients_

Definition at line 47 of file HeatmapAnalyzer.h.

◆ matrix_

TH2I RooFit::MultiProcess::HeatmapAnalyzer::matrix_

Definition at line 45 of file HeatmapAnalyzer.h.

◆ metadata_

json RooFit::MultiProcess::HeatmapAnalyzer::metadata_

Definition at line 48 of file HeatmapAnalyzer.h.

◆ tasks_names_

std::vector<std::string> RooFit::MultiProcess::HeatmapAnalyzer::tasks_names_

Definition at line 51 of file HeatmapAnalyzer.h.

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