MaCh3  2.5.0
Reference Guide
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"
12 #include "Manager/MaCh3Exception.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 
29 namespace M3 {
30 namespace Utils {
32  void MaCh3Welcome();
34  void GetOSInfo();
36  void GetCPUInfo();
38  void GetGPUInfo();
40  void NThreadsSanity();
44  std::string TerminalToString(std::string cmd);
46  void EstimateDataTransferRate(TChain* chain, const Long64_t entry);
48  void GetDiskUsage();
53  void PrintProgressBar(const Long64_t Done, const Long64_t All);
57  std::string GetMaCh3Version();
62  int getValue(const std::string& Type);
67  int parseLine(const std::string& line);
70  void PrintConfig(const YAML::Node& node);
72  void Print(const TTree* tree);
77  void MaCh3Usage(int argc, char **argv);
78 } // end Utils namespace
79 
81  int GetNThreads();
84  void AddPath(std::string& FilePath);
86  inline int GetThreadIndex() {
87  #ifdef MULTITHREAD
88  return omp_get_thread_num();
89  #else
90  return 0;
91  #endif
92  }
93 } // end M3 namespace
#define _MaCh3_Safe_Include_Start_
KS: Avoiding warning checking for headers.
Definition: Core.h:126
#define _MaCh3_Safe_Include_End_
KS: Restore warning checking after including external headers.
Definition: Core.h:141
Defines the custom exception class used throughout MaCh3.
MaCh3 Logging utilities built on top of SPDLOG.
Utility functions for handling YAML nodes.
void GetGPUInfo()
KS: Check what GPU you are using.
Definition: Monitor.cpp:144
void GetDiskUsage()
KS: Find out about Disk usage.
Definition: Monitor.cpp:177
void NThreadsSanity()
KS: Check if user is not using huge number of threads and throw error.
Definition: Monitor.cpp:123
void EstimateDataTransferRate(TChain *chain, const Long64_t entry)
KS: Check what CPU you are using.
Definition: Monitor.cpp:212
int parseLine(const std::string &line)
CW: Get memory, which is probably silly.
Definition: Monitor.cpp:301
void PrintConfig(const YAML::Node &node)
KS: Print Yaml config using logger.
Definition: Monitor.cpp:311
int getValue(const std::string &Type)
CW: Get info like RAM.
Definition: Monitor.cpp:252
void PrintProgressBar(const Long64_t Done, const Long64_t All)
KS: Simply print progress bar.
Definition: Monitor.cpp:229
void MaCh3Welcome()
KS: Prints welcome message with MaCh3 logo.
Definition: Monitor.cpp:13
void Print(const TTree *tree)
Definition: Monitor.cpp:326
void MaCh3Usage(int argc, char **argv)
KS: Almost all MaCh3 executables have the same usage, prepare simple printer.
Definition: Monitor.cpp:360
void GetOSInfo()
KS: Find out more about operational system.
Definition: Monitor.cpp:89
std::string TerminalToString(std::string cmd)
KS: Convoluted code to grab output from terminal to string.
Definition: Monitor.cpp:187
void GetCPUInfo()
KS: Check what CPU you are using.
Definition: Monitor.cpp:100
std::string GetMaCh3Version()
KS: Get version of MaCh3.
Definition: Monitor.cpp:47
Main namespace for MaCh3 software.
int GetThreadIndex()
thread index inside parallel loop
Definition: Monitor.h:86
int GetNThreads()
number of threads which we need for example for TRandom3
Definition: Monitor.cpp:372
void AddPath(std::string &FilePath)
Prepends the MACH3 environment path to FilePath if it is not already present.
Definition: Monitor.cpp:382