Triumvirate C++ API 0.5.0
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
monitor.hpp File Reference

Provide tracking of program resources and exceptions. More...

#include <chrono>
#include <cstdarg>
#include <cstdio>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
#include <fftw3.h>
#include <gsl/gsl_version.h>
+ Include dependency graph for monitor.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  trv::sys::Logger
 Logger with logging level differentiation. More...
 
class  trv::sys::ProgressBar
 Progress bar for tracking tasks. More...
 
class  trv::sys::UnimplementedError
 Exception raised when a function or method is unimplemented. More...
 
class  trv::sys::IOError
 Exception raised when an input/output operation fails. More...
 
class  trv::sys::InvalidParameterError
 Exception raised when parameters are invalid. More...
 
class  trv::sys::InvalidDataError
 Exception raised when the data to be operated on are invalid. More...
 

Namespaces

namespace  trv
 
namespace  trv::sys
 

Enumerations

enum  trv::sys::LogLevel {
  trv::sys::NSET = 0 , trv::sys::DBUG = 10 , trv::sys::STAT = 20 , trv::sys::INFO = 30 ,
  trv::sys::WARN = 40 , trv::sys::ERRO = 50
}
 Logging levels. More...
 

Functions

template<typename T >
double trv::sys::size_in_gb (long long num)
 Return size in gibibytes.
 
template<typename T >
double trv::sys::size_in_gb (int num)
 Return size in gibibytes.
 
void trv::sys::update_maxmem ()
 Update the maximum memory usage estimate.
 
void trv::sys::update_maxcntgrid ()
 Update the maximum 3-d grid counts.
 
std::string trv::sys::show_current_datetime ()
 Return the current date-time string in 'YYYY-MM-DD HH:MM:SS' format.
 
std::string trv::sys::show_elapsed_time (double duration_in_seconds)
 Return the elapsed-time string in 'HH:MM:SS' format.
 
std::string trv::sys::show_timestamp ()
 Return the timestamp string including the elapsed time.
 
void trv::sys::display_prog_logo ()
 Display program logo in stdout.
 
void trv::sys::display_prog_licence ()
 Display program licence in stdout.
 
void trv::sys::display_prog_info ()
 Display program information in stdout.
 
void trv::sys::display_prog_logbars (int endpoint)
 Display program log bars in stdout.
 

Variables

int trv::sys::currTask = 0
 current task
 
double trv::sys::gbytesMem = 0.
 current memory usage in gibibytes
 
double trv::sys::gbytesMaxMem = 0.
 maximum memory usage in gibibytes
 
int trv::sys::count_rgrid = 0
 number of 3-d real grids
 
int trv::sys::count_cgrid = 0
 number of 3-d complex grids
 
float trv::sys::count_grid = 0.
 number of grids
 
int trv::sys::max_count_rgrid = 0
 maximum number of 3-d real grids
 
int trv::sys::max_count_cgrid = 0
 maximum number of 3-d complex grids
 
float trv::sys::max_count_grid = 0.
 maximum number of grids
 
int trv::sys::count_fft = 0
 number of FFTs
 
int trv::sys::count_ifft = 0
 number of IFFTs
 
bool trv::sys::fftw_wisdom_f_imported = false
 wisdom import status for forward transform
 
bool trv::sys::fftw_wisdom_b_imported = false
 wisdom import status for backward transform
 
Logger trv::sys::logger
 default logger (at NSET logging level)
 

Detailed Description

Provide tracking of program resources and exceptions.

Authors
Mike S Wang (https://github.com/MikeSWang), Naonori S Sugiyama (https://github.com/naonori)

This module defines the global variables and functions to track time and memory usage of the program. It also defines custom exceptions used in the program.

Definition in file monitor.hpp.