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< TH2I > | analyze (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< json > | durations_ |
std::vector< std::string > | eval_partitions_names_ |
json | gradients_ |
TH2I | matrix_ |
json | metadata_ |
std::vector< std::string > | tasks_names_ |
#include <RooFit/MultiProcess/HeatmapAnalyzer.h>
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_dir | Directory 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.
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_gradient | Gradient 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.
|
private |
Definition at line 179 of file HeatmapAnalyzer.cxx.
json const RooFit::MultiProcess::HeatmapAnalyzer::getMetadata | ( | ) |
Definition at line 174 of file HeatmapAnalyzer.cxx.
std::vector< std::string > const RooFit::MultiProcess::HeatmapAnalyzer::getPartitionNames | ( | ) |
Definition at line 169 of file HeatmapAnalyzer.cxx.
std::vector< std::string > const RooFit::MultiProcess::HeatmapAnalyzer::getTaskNames | ( | ) |
Definition at line 164 of file HeatmapAnalyzer.cxx.
|
private |
Definition at line 194 of file HeatmapAnalyzer.cxx.
|
private |
Definition at line 49 of file HeatmapAnalyzer.h.
|
private |
Definition at line 52 of file HeatmapAnalyzer.h.
|
private |
Definition at line 47 of file HeatmapAnalyzer.h.
|
private |
Definition at line 45 of file HeatmapAnalyzer.h.
|
private |
Definition at line 48 of file HeatmapAnalyzer.h.
|
private |
Definition at line 51 of file HeatmapAnalyzer.h.