Triumvirate C++ API 0.5.0
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
trv::sys Namespace Reference

Classes

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

Enumerations

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

Functions

bool if_filepath_is_set (const std::string &pathstr)
 Check if a file path is set.
 
void make_write_dir (std::string dirstr)
 Make write directory.
 
template<typename T >
double size_in_gb (long long num)
 Return size in gibibytes.
 
template<typename T >
double size_in_gb (int num)
 Return size in gibibytes.
 
void update_maxmem ()
 Update the maximum memory usage estimate.
 
void update_maxcntgrid ()
 Update the maximum 3-d grid counts.
 
std::string show_current_datetime ()
 Return the current date-time string in 'YYYY-MM-DD HH:MM:SS' format.
 
std::string show_elapsed_time (double duration_in_seconds)
 Return the elapsed-time string in 'HH:MM:SS' format.
 
std::string show_timestamp ()
 Return the timestamp string including the elapsed time.
 
void display_prog_logo ()
 Display program logo in stdout.
 
void display_prog_licence ()
 Display program licence in stdout.
 
void display_prog_info ()
 Display program information in stdout.
 
void display_prog_logbars (int endpoint)
 Display program log bars in stdout.
 

Variables

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

Enumeration Type Documentation

◆ LogLevel

Logging levels.

Enumerator
NSET 

0: unset

DBUG 

10: debugging

STAT 

20: status

INFO 

30: info

WARN 

40: warning

ERRO 

50: error/critical

Definition at line 160 of file monitor.hpp.

Function Documentation

◆ if_filepath_is_set()

bool trv::sys::if_filepath_is_set ( const std::string & pathstr)

Check if a file path is set.

Parameters
pathstrFile path string.
Returns
{ true , false }

Definition at line 37 of file io.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_write_dir()

void trv::sys::make_write_dir ( std::string dirstr)

Make write directory.

Parameters
dirstrDirectory path string.
Exceptions
trv::sys::IOErrorWhen write directory cannot be created.

Definition at line 57 of file io.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size_in_gb() [1/2]

template<typename T >
double trv::sys::size_in_gb ( long long num)

Return size in gibibytes.

Template Parameters
TA typename.
Parameters
numNumber of type-double elements.
Returns
Size in gibibytes.

Definition at line 101 of file monitor.hpp.

+ Here is the caller graph for this function:

◆ size_in_gb() [2/2]

template<typename T >
double trv::sys::size_in_gb ( int num)

Return size in gibibytes.

Template Parameters
TA typename.
Parameters
numNumber of type-double elements.
Returns
Size in gibibytes.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 116 of file monitor.hpp.

◆ update_maxmem()

void trv::sys::update_maxmem ( )

Update the maximum memory usage estimate.

Definition at line 68 of file monitor.cpp.

+ Here is the caller graph for this function:

◆ update_maxcntgrid()

void trv::sys::update_maxcntgrid ( )

Update the maximum 3-d grid counts.

Definition at line 73 of file monitor.cpp.

+ Here is the caller graph for this function:

◆ show_current_datetime()

std::string trv::sys::show_current_datetime ( )

Return the current date-time string in 'YYYY-MM-DD HH:MM:SS' format.

Returns
Timestamp string.

Definition at line 85 of file monitor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_elapsed_time()

std::string trv::sys::show_elapsed_time ( double duration_in_seconds)

Return the elapsed-time string in 'HH:MM:SS' format.

Parameters
duration_in_secondsDuration in seconds.
Returns
Elapsed-time string.

Definition at line 102 of file monitor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_timestamp()

std::string trv::sys::show_timestamp ( )

Return the timestamp string including the elapsed time.

Returns
Timestamp string.

Definition at line 128 of file monitor.cpp.

+ Here is the call graph for this function:

◆ display_prog_logo()

void trv::sys::display_prog_logo ( )

Display program logo in stdout.

Definition at line 475 of file monitor.cpp.

+ Here is the caller graph for this function:

◆ display_prog_licence()

void trv::sys::display_prog_licence ( )

Display program licence in stdout.

Definition at line 489 of file monitor.cpp.

+ Here is the caller graph for this function:

◆ display_prog_info()

void trv::sys::display_prog_info ( )

Display program information in stdout.

Definition at line 508 of file monitor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ display_prog_logbars()

void trv::sys::display_prog_logbars ( int endpoint)

Display program log bars in stdout.

Parameters
endpointProgress bar endpoint, either 0 (start) or 1 (finish).

Definition at line 534 of file monitor.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ currTask

int trv::sys::currTask = 0

current task

Definition at line 44 of file monitor.cpp.

◆ gbytesMem

double trv::sys::gbytesMem = 0.

current memory usage in gibibytes

Definition at line 46 of file monitor.cpp.

◆ gbytesMaxMem

double trv::sys::gbytesMaxMem = 0.

maximum memory usage in gibibytes

Definition at line 47 of file monitor.cpp.

◆ count_rgrid

int trv::sys::count_rgrid = 0

number of 3-d real grids

Definition at line 49 of file monitor.cpp.

◆ count_cgrid

int trv::sys::count_cgrid = 0

number of 3-d complex grids

Definition at line 50 of file monitor.cpp.

◆ count_grid

float trv::sys::count_grid = 0.

number of grids

Definition at line 51 of file monitor.cpp.

◆ max_count_rgrid

int trv::sys::max_count_rgrid = 0

maximum number of 3-d real grids

Definition at line 52 of file monitor.cpp.

◆ max_count_cgrid

int trv::sys::max_count_cgrid = 0

maximum number of 3-d complex grids

Definition at line 53 of file monitor.cpp.

◆ max_count_grid

float trv::sys::max_count_grid = 0.

maximum number of grids

Definition at line 54 of file monitor.cpp.

◆ count_fft

int trv::sys::count_fft = 0

number of FFTs

Definition at line 56 of file monitor.cpp.

◆ count_ifft

int trv::sys::count_ifft = 0

number of IFFTs

Definition at line 57 of file monitor.cpp.

◆ fftw_wisdom_f_imported

bool trv::sys::fftw_wisdom_f_imported = false

wisdom import status for forward transform

Definition at line 59 of file monitor.cpp.

◆ fftw_wisdom_b_imported

bool trv::sys::fftw_wisdom_b_imported = false

wisdom import status for backward transform

Definition at line 60 of file monitor.cpp.

◆ logger

Logger trv::sys::logger
extern

default logger (at NSET logging level)

◆ clockStart

auto trv::sys::clockStart = std::chrono::steady_clock::now()

program starting time

Definition at line 62 of file monitor.cpp.