21namespace MultiProcess {
53 if (std::string(
file->GetName()).find(
"p_") == std::string::npos)
56 std::ifstream
f(logs_dir +
"/" + std::string(
file->GetName()));
58 if (std::string(
file->GetName()).find(
"999") != std::string::npos)
65 for (
auto &&el : durations_json.items()) {
66 if (el.key().find(
"eval_task") != std::string::npos &&
69 else if (el.key().find(
"eval_partition") != std::string::npos &&
73 else if (el.key().find(
"metadata") != std::string::npos) {
80 durations_json.erase(
"metadata");
94 int gradient_start_t =
gradients_[
"master:gradient"][analyzed_gradient * 2 - 2];
95 int gradient_end_t =
gradients_[
"master:gradient"][analyzed_gradient * 2 - 1];
97 std::unique_ptr<TH2I> total_matrix =
103 std::unique_ptr<TH2I> partial_matrix =
107 for (
auto &&el : durations_json.items()) {
109 std::upper_bound(durations_json[el.key()].begin(), durations_json[el.key()].end(), gradient_start_t);
111 std::upper_bound(durations_json[el.key()].begin(), durations_json[el.key()].end(), gradient_end_t);
112 durations_json[el.key()].erase(end_interval, durations_json[el.key()].end());
113 durations_json[el.key()].erase(durations_json[el.key()].begin(), beg_interval);
121 for (
size_t idx = 0; idx < durations_json[eval_partition_name].size(); idx += 2) {
122 if (durations_json[eval_partition_name][idx + 1] > gradient_end_t ||
123 durations_json[eval_partition_name][idx] < gradient_start_t)
125 std::string task_name =
findTaskForDuration(durations_json, durations_json[eval_partition_name][idx],
126 durations_json[eval_partition_name][idx + 1]);
133 int eval_partitions_idx =
136 partial_matrix->SetBinContent(eval_partitions_idx, tasks_idx,
137 durations_json[eval_partition_name][idx + 1].get<int>() -
138 durations_json[eval_partition_name][idx].get<int>());
142 total_matrix->Add(partial_matrix.get());
146 total_matrix->SetStats(0);
149 TAxis *
y = total_matrix->GetYaxis();
150 TAxis *
x = total_matrix->GetXaxis();
151 for (std::size_t i = 0; i !=
tasks_names_.size(); ++i) {
153 y->ChangeLabel(i + 1, 30, 0.01, -1, -1, -1,
"");
157 x->ChangeLabel(i + 1, 30, -1, -1, -1, -1,
"");
159 x->LabelsOption(
"v");
181 for (
auto &&el : durations.items()) {
182 if (el.key().find(
"eval_partition") != std::string::npos)
185 for (
size_t idx = 0; idx < durations[el.key()].size(); idx += 2) {
186 if (durations[el.key()][idx] <= start_t && durations[el.key()][idx + 1] >= end_t) {
196 char const *digits =
"0123456789";
197 std::vector<int> digit_vec;
198 std::vector<std::pair<int, std::string>> pair_vec;
199 for (
auto &&el : task_names) {
200 std::size_t
const n = el.find_first_of(digits);
201 pair_vec.push_back(std::make_pair(stoi(el.substr(
n)), el));
204 std::sort(pair_vec.begin(), pair_vec.end());
206 for (
size_t i = 0; i < task_names.size(); i++) {
207 task_names[i] = pair_vec[i].second;
std::unique_ptr< TH2I > analyze(int analyzed_gradient)
This method is the main functionality in this class.
std::vector< std::string > const getPartitionNames()
std::vector< std::string > const getTaskNames()
HeatmapAnalyzer(std::string const &logs_dir)
HeatmapAnalyzer Constructor.
std::vector< json > durations_
std::vector< std::string > tasks_names_
std::string findTaskForDuration(json durations, int start_t, int end_t)
void sortTaskNames(std::vector< std::string > &task_names)
std::vector< std::string > eval_partitions_names_
Class to manage histogram axis.
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
Mother of all ROOT objects.
Describes an Operating System directory for the browser.
virtual TList * GetListOfFiles() const
Returns a TList of TSystemFile objects representing the contents of the directory.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...