MaCh3 2.2.1
Reference Guide
Loading...
Searching...
No Matches
Monitor.h
Go to the documentation of this file.
1#pragma once
2
3// C++ includes
4#include <iostream>
5#include <fstream>
6#include <string>
7#include <vector>
8#include <cstdlib>
9
10// MaCh3 includes
11#include "Manager/MaCh3Logger.h"
13#include "Manager/YamlHelper.h"
14
16// ROOT include
17#include "TTree.h"
18#include "TBranch.h"
19#include "TMacro.h"
20#include "TChain.h"
21#include "TStopwatch.h"
23
24
28
29namespace MaCh3Utils {
31 void MaCh3Welcome();
33 void GetOSInfo();
35 void GetCPUInfo();
37 void GetGPUInfo();
39 void NThreadsSanity();
43 std::string TerminalToString(std::string cmd);
45 void EstimateDataTransferRate(TChain* chain, const Long64_t entry);
47 void GetDiskUsage();
52 void PrintProgressBar(const Long64_t Done, const Long64_t All);
56 std::string GetMaCh3Version();
61 int getValue(const std::string& Type);
66 int parseLine(const std::string& line);
69 void PrintConfig(const YAML::Node& node);
74 void MaCh3Usage(int argc, char **argv);
75}
76
77namespace M3 {
79 int GetNThreads();
80
82 inline int GetThreadIndex() {
83 #ifdef MULTITHREAD
84 return omp_get_thread_num();
85 #else
86 return 0;
87 #endif
88 }
89}
#define _MaCh3_Safe_Include_Start_
KS: Avoiding warning checking for headers.
Definition: Core.h:106
#define _MaCh3_Safe_Include_End_
KS: Restore warning checking after including external headers.
Definition: Core.h:117
KS: Based on this https://github.com/gabime/spdlog/blob/a2b4262090fd3f005c2315dcb5be2f0f1774a005/incl...
Utility functions for handling YAML nodes.
Definition: Core.h:19
int GetThreadIndex()
thread index inside parallel loop
Definition: Monitor.h:82
int GetNThreads()
number of threads which we need for example for TRandom3
Definition: Monitor.cpp:322
void GetOSInfo()
KS: Find out more about operational system.
Definition: Monitor.cpp:87
std::string TerminalToString(std::string cmd)
KS: Convoluted code to grab output from terminal to string.
Definition: Monitor.cpp:177
void PrintProgressBar(const Long64_t Done, const Long64_t All)
KS: Simply print progress bar.
Definition: Monitor.cpp:212
std::string GetMaCh3Version()
KS: Get version of MaCh3.
Definition: Monitor.cpp:45
void GetDiskUsage()
KS: Find out about Disk usage.
Definition: Monitor.cpp:167
void NThreadsSanity()
KS: Check if user is not using huge number of threads and throw error.
Definition: Monitor.cpp:121
void GetCPUInfo()
KS: Check what CPU you are using.
Definition: Monitor.cpp:98
void GetGPUInfo()
KS: Check what GPU you are using.
Definition: Monitor.cpp:142
int getValue(const std::string &Type)
CW: Get info like RAM.
Definition: Monitor.cpp:235
void PrintConfig(const YAML::Node &node)
KS: Print Yaml config using logger.
Definition: Monitor.cpp:294
void MaCh3Usage(int argc, char **argv)
KS: Almost all MaCh3 executables have the same usage, prepare simple printer.
Definition: Monitor.cpp:309
void MaCh3Welcome()
KS: Prints welcome message with MaCh3 logo.
Definition: Monitor.cpp:11
int parseLine(const std::string &line)
CW: Get memory, which is probably silly.
Definition: Monitor.cpp:284
void EstimateDataTransferRate(TChain *chain, const Long64_t entry)
KS: Check what CPU you are using.
Definition: Monitor.cpp:195