System Utilities

These classes define system utility methods. Defined in src/utils/SysUtils.h

class Caesar::SysUtils : public TObject

Public Functions

SysUtils()

Class constructor: initialize structures.

virtual ~SysUtils()

Class destructor: free allocated memory.

Public Static Functions

static bool CheckFile(std::string path, FileInfo &info, bool match_extension = false, std::string extension = "")

Check if a file exists in filesystem.

static bool CheckDir(std::string path)

Check if directory exists in filesystem.

static inline timespec TimeDiff(timespec start, timespec end)

Compute the difference between two timestamps.

static inline timespec TimeSum(timespec time1, timespec time2)

Compute the sum of two timestamps.

static inline std::string GetISOTimestamp()

Get current timestamp in ISO 8601 format string.

static inline double TimeToSec(timespec time)

Convert a timestamp to seconds.

static inline double TimeToNSec(timespec time)

Convert a timestamp to nanoseconds.

static int GetFITSImageSize(const std::string &filename, long int &Nx, long int &Ny)

Get the size of a FITS image.

static int GetNCores()

Get the number of cores in system.

static void SetOMPThreads(int nthreads)

Set the number of threads to be used by OpenMP (if enabled at build)

static int GetOMPThreads()

Get the number of threads currently used by OpenMP (return 0 if OMP is disabled at build)

static int GetOMPMaxThreads()

Get the maximum number of threads that can be used by OpenMP (return 0 if OMP is disabled at build)

static int GetOMPCores()

Get the number of cores currently used by OpenMP (return 0 if OMP is disabled at build)

static int GetOMPThreadId()

Get thread id (return 0 if OMP is disabled at build)

static bool IsMPIInitialized()

Is MPI run initialized (return 0 if MPI is disabled at build)

static bool IsMPIFinalized()

Is MPI run finalized (return true if MPI is disabled at build)

static int GetProcMemoryInfo(ProcMemInfo &info)

Get process used virtual memory.

static std::string GetHost()

Get hostname.

static int GetProcId()

Get processor id.

static std::string GetAsciiLogo()

Get ascii art logo.

static void PrintAsciiLogo()

Print ascii art logo.

class FileInfo : public TObject
class Caesar::ProcMemInfo : public TObject

Public Functions

inline ProcMemInfo()

ProcMemInfo constructor.

inline virtual ~ProcMemInfo()

ProcMemInfo destructor.

inline std::string GetPrintable()

Get process mem info in printable string form.

inline void PrintInfo()

Print process mem info.