32#ifndef TRIUMVIRATE_INCLUDE_MONITOR_HPP_INCLUDED_
33#define TRIUMVIRATE_INCLUDE_MONITOR_HPP_INCLUDED_
44#include <gsl/gsl_version.h>
50#define OMP_ATOMIC _Pragma("omp atomic")
51#define OMP_CRITICAL _Pragma("omp critical")
102 const double BYTES_PER_GBYTES = 1073741824.;
103 return double(num) *
sizeof(T) / BYTES_PER_GBYTES;
117 const double BYTES_PER_GBYTES = 1073741824.;
118 return double(num) *
sizeof(T) / BYTES_PER_GBYTES;
222 void log(
LogLevel level_entry,
const char* fmt_string, ...);
236 void log(
int level_entry,
const char* fmt_string, ...);
246 void debug(
const char* fmt_string, ...);
256 void stat(
const char* fmt_string, ...);
266 void info(
const char* fmt_string, ...);
276 void warn(
const char* fmt_string, ...);
286 void error(
const char* fmt_string, ...);
289 void emit(std::string log_type,
const char* fmt_string, std::va_list args);
326 void set_nodes(std::vector<float> nodes);
351 void update(
int task_idx_now);
360 void update(
float progress_now);
365 std::vector<float> nodes;
366 int next_node_idx = 0;
372 void set_default_pcpt_nodes();
401 virtual const char*
what() const noexcept;
418 IOError(
const char* fmt_string, ...);
425 virtual const char*
what() const noexcept;
449 virtual const char*
what() const noexcept;
473 virtual const char*
what() const noexcept;
Exception raised when an input/output operation fails.
std::string err_mesg
error message
Exception raised when the data to be operated on are invalid.
std::string err_mesg
error message
Exception raised when parameters are invalid.
std::string err_mesg
error message
Logger with logging level differentiation.
Logger(LogLevel level)
Construct the logger with the specified threshold level.
void info(const char *fmt_string,...)
Emit a information-level message.
void debug(const char *fmt_string,...)
Emit a debugging-level message.
void error(const char *fmt_string,...)
Emit a warning-level message.
void warn(const char *fmt_string,...)
Emit a warning-level message.
void stat(const char *fmt_string,...)
Emit a status-level message.
int level_limit
logger threshold level
void log(LogLevel level_entry, const char *fmt_string,...)
Log a message at the specified level.
void reset_level(LogLevel level)
Reset the logger threshold level.
Progress bar for tracking tasks.
float progress
progress value in [0, 1] interval
int task_count
total task count
ProgressBar(int task_count, std::string name="")
Construct a progress bar.
void set_task_idx(int task_idx)
Set current (or initial) task index.
void set_nodes(std::vector< float > nodes)
Set progress bar width.
void set_bar_width(int bar_width)
Set progress bar width.
std::string name
progress bar name
void update(int task_idx_now)
Update the progress bar.
void set_progress(float progress)
Set current (or initial) progress value.
Exception raised when a function or method is unimplemented.
virtual const char * what() const noexcept
Exception string representation.
std::string err_mesg
error message
UnimplementedError(const char *fmt_string,...)
Construct an trv::sys::UnimplementedError exception.
double gbytesMem
current memory usage in gibibytes
std::string show_timestamp()
Return the timestamp string including the elapsed time.
double size_in_gb(long long num)
Return size in gibibytes.
void update_maxmem()
Update the maximum memory usage estimate.
void display_prog_licence()
Display program licence in stdout.
bool fftw_wisdom_b_imported
wisdom import status for backward transform
void display_prog_logo()
Display program logo in stdout.
bool fftw_wisdom_f_imported
wisdom import status for forward transform
float max_count_grid
maximum number of grids
Logger logger
default logger (at NSET logging level)
int max_count_rgrid
maximum number of 3-d real grids
float count_grid
number of grids
int max_count_cgrid
maximum number of 3-d complex grids
std::string show_current_datetime()
Return the current date-time string in 'YYYY-MM-DD HH:MM:SS' format.
void display_prog_logbars(int endpoint)
Display program log bars in stdout.
int count_fft
number of FFTs
int count_cgrid
number of 3-d complex grids
double gbytesMaxMem
maximum memory usage in gibibytes
int count_rgrid
number of 3-d real grids
int count_ifft
number of IFFTs
void update_maxcntgrid()
Update the maximum 3-d grid counts.
void display_prog_info()
Display program information in stdout.
std::string show_elapsed_time(double duration_in_seconds)
Return the elapsed-time string in 'HH:MM:SS' format.