GRVY-0.38.0
grvy.h
Go to the documentation of this file.
1 // -*-c++-*-
2 //-----------------------------------------------------------------------bl-
3 //--------------------------------------------------------------------------
4 //
5 // libGRVY - a utility library for scientific computing.
6 //
7 // Copyright (C) 2008-2013,2018-2022 The PECOS Development Team
8 // Additional Copyright (C) 2018 individual authors
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the Version 2.1 GNU Lesser General
12 // Public License as published by the Free Software Foundation.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
22 // Boston, MA 02110-1301 USA
23 //
24 //-----------------------------------------------------------------------el-
25 //
26 // grvy.h: Basic API Definitions
27 //
28 //--------------------------------------------------------------------------
29 //--------------------------------------------------------------------------
30 
31 #include<stddef.h>
32 
33 #ifndef GRVY_H_
34 #define GRVY_H_
35 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
54 /* Library version/build information */
55 
56 #define GRVY_MAJOR_VERSION 0
57 #define GRVY_MINOR_VERSION 38
58 #define GRVY_MICRO_VERSION 0
59 
60 #define GRVY_BUILD_USER "runner"
61 #define GRVY_BUILD_ARCH "x86_64-pc-linux-gnu"
62 #define GRVY_BUILD_HOST "fv-az108-71"
63 #define GRVY_BUILD_DATE "2023-07-12 16:53"
64 #define GRVY_BUILD_VERSION "8f03925"
65 
66 #define GRVY_LIB_VERSION "0.38.0"
67 #define GRVY_LIB_RELEASE "Development Build"
68 
69 #define GRVY_CXX "g++"
70 #define GRVY_CXXFLAGS "-g -O2"
71 
72 #define GRVY_FC "gfortran"
73 #define GRVY_FCFLAGS "-g -O2"
74 #define GRVY_MPI_ENABLED 0
75 #define GRVY_OCORE_ENABLED 0
76 
77 #if GRVY_MPI_ENABLED == 1
78 // MPI implementations try to include C++ code via mpi.h unless you
79 // tell them not to; this breaks when we do it in an extern "C" block.
80 #define MPICH_SKIP_MPICXX
81 #define OMPI_SKIP_MPICXX
82 #include <mpi.h>
83 #endif
84 
85 
113  //-----------------------------------------------------------------
114  // Versioning Utilities
115  //-----------------------------------------------------------------
116 
139  extern void grvy_version_stdout ();
140 
146  extern int grvy_get_numeric_version ();
147 
150  //-----------------------------------------------------------------
151  // Input Parsing Utilities
152  //-----------------------------------------------------------------
153 
195  extern int grvy_input_fopen (const char *filename);
196 
199  extern int grvy_input_fclose ();
200 
224  extern int grvy_input_fdump ();
225 
228  extern int grvy_input_fdump_delim (const char* prefix);
229 
232  extern int grvy_input_fdump_file (const char* prefix, const char *filename);
233 
258  extern int grvy_input_fread_int (const char* keyword, int *value);
259 
265  extern int grvy_input_fread_float (const char* keyword, float *value);
266 
272  extern int grvy_input_fread_double (const char* keyword, double *value);
273 
284  extern int grvy_input_fread_char (const char* keyword, char **value);
285 
306  extern int grvy_input_fread_int_vec (const char* keyword, int *values, int nelems);
307 
312  extern int grvy_input_fread_float_vec (const char* keyword, float *values, int nelems);
313 
318  extern int grvy_input_fread_double_vec (const char* keyword, double *values, int nelems);
319 
324  extern int grvy_input_fread_char_ivec (const char* keyword, char **values, int elem);
325 
326 
346  extern int grvy_input_fread_int_ivec (const char* keyword, int *value, int elem);
347 
352  extern int grvy_input_fread_float_ivec (const char* keyword, float *value, int elem);
353 
358  extern int grvy_input_fread_double_ivec (const char* keyword, double *value, int elem);
359 
381  extern int grvy_input_register_int (const char *keyword, int value);
382 
384  extern int grvy_input_register_float (const char *keyword, float value);
385 
387  extern int grvy_input_register_double (const char *keyword, double value);
388 
390  extern int grvy_input_register_char (const char *keyword, char *value);
391 
408  extern int grvy_input_register_get_int (const char *keyword, int *value);
409 
411  extern int grvy_input_register_get_float (const char *keyword, float *value);
412 
414  extern int grvy_input_register_get_double (const char *keyword, double *value);
415 
417  extern int grvy_input_register_get_char (const char *keyword, char **value);
418 
421  //-----------------------------------------------------------------
422  // Performance Timer Utilities
423  //-----------------------------------------------------------------
424 
490  extern void grvy_timer_init (const char *description);
491 
493  extern void grvy_timer_begin (const char *id);
494 
496  extern void grvy_timer_end (const char *id);
497 
500  extern void grvy_timer_reset ();
501 
503  extern void grvy_timer_finalize ();
504 
509  extern double grvy_timer ();
510 
526  extern double grvy_timer_elapsed_global ();
527 
536  extern void grvy_timer_summarize ();
537 
544  int grvy_timer_set_summarize_width (const int maxwidth);
545 
563  extern double grvy_timer_elapsedseconds (const char *id);
565  extern double grvy_timer_stats_mean (const char *id);
567  extern double grvy_timer_stats_variance (const char *id);
569  extern double grvy_timer_stats_min (const char *id);
571  extern double grvy_timer_stats_max (const char *id);
573  extern int grvy_timer_stats_count (const char *id);
574 
594  extern double grvy_timer_elapsedseconds_inc (const char *id);
596  extern double grvy_timer_stats_mean_inc (const char *id);
598  extern double grvy_timer_stats_variance_inc (const char *id);
600  extern double grvy_timer_stats_min_inc (const char *id);
602  extern double grvy_timer_stats_max_inc (const char *id);
603 
638  // Mode 1: Saving internal GRVY timer values to historical repository
639 
645  extern int grvy_timer_save_hist (const char *experiment_name, const char *comment,
646  int num_procs, const char *filename);
647 
650  extern int grvy_timer_save_hist_exp (const char *experiment_name, const char *comment,
651  int num_procs, int jobId, const char *code_revision,
652  double flops, const char *filename);
653 
654  // Mode 2: Saving external user-provided global timing to historical repository
655 
658  extern int grvy_timer_save_hist_ext (double timing, const char *machinename,const char*experiment,
659  const char *comment,int num_procs, const char *filename);
660 
663  extern int grvy_timer_save_hist_ext_exp (double timing, const char *machinename, const char*experiment,
664  const char *comment, int num_procs, int jobId,
665  const char *code_revision, double flops, const char *filename);
666 
673  void grvy_summarize_hist_timing (const char *filename, const char *delimiter,
674  const char *outdir);
675 
678  //-----------------------------------------------------------------
679  // MPI Out-of-Core Utilities
680  //-----------------------------------------------------------------
681 
682 #if GRVY_OCORE_ENABLED == 1
683 
705  // extern int grvy_ocore_split_comm (MPI_Comm GLOB_COMM, MPI_Comm WORK_COMM, MPI_Comm OCORE_COMM, int mode);
706  extern int grvy_ocore_init (const char *input_file, int num_ocore_tasks, MPI_Comm GLOB_COMM);
707  extern int grvy_ocore_init_fortran (const char *input_file, int num_ocore_tasks, int GLOB_COMM_COMM);
708  extern void grvy_ocore_finalize ();
709 
710  extern int grvy_ocore_master ();
711  extern int grvy_ocore_enabled ();
712  extern int grvy_ocore_blocksize ();
713  extern size_t grvy_ocore_num_active ();
714 
729  extern int grvy_ocore_write_double (size_t record_id, double *data);
730  extern int grvy_ocore_write_float (size_t record_id, float *data);
731  extern int grvy_ocore_write_int (size_t record_id, int *data);
732  extern int grvy_ocore_write_int64 (size_t record_id, long long int *data);
733 
734  extern int grvy_ocore_read_double (size_t record_id, double *data);
735  extern int grvy_ocore_read_float (size_t record_id, float *data);
736  extern int grvy_ocore_read_int (size_t record_id, int *data);
737  extern int grvy_ocore_read_int64 (size_t record_id, long long int *data);
738 
751  extern size_t grvy_ocore_pop_record_float ( float *data);
752  extern size_t grvy_ocore_pop_record_double ( double *data);
753  extern size_t grvy_ocore_pop_record_int ( int *data);
754  extern size_t grvy_ocore_pop_record_int64 (long long int *data);
755 
756 #endif
757 
760  //-----------------------------------------------------------------
761  // Floating-Point Utilities
762  //-----------------------------------------------------------------
763 
785  extern int grvy_double_isnan (double *value);
787  extern int grvy_double_isinf (double *vauel);
789  extern int grvy_float_isnan (float *value);
791  extern int grvy_float_isinf (float *value);
792 
795  //-----------------------------------------------------------------
796  // Logging Utilities
797  //-----------------------------------------------------------------
798 
825  /* Available logging priorities; roughly mimics syslog priority levels.
826  * Also provides a NOLOG option to disable all log messages.
827  */
828 
829  typedef enum {GRVY_NOLOG = -1,
830  GRVY_FATAL = 0,
831  GRVY_ERROR = 100,
832  GRVY_WARN = 200,
833  GRVY_INFO = 300,
834  GRVY_DEBUG = 400,
835  GRVY_ALL = 500
836  } PriorityLevel;
837 
851  extern void grvy_log_setlevel (int priority);
853  extern int grvy_log_getlevel ();
855  extern void grvy_log_setmask (int loglevel, const char *delimiter);
857  extern int grvy_printf (int loglevel, const char *format,...);
858 
890  extern int grvy_check_file_path (const char *name_template);
891 
902  extern int grvy_create_unique_dir ( char *name_template);
903 
912  extern int grvy_create_scratch_dir ( char *name_template);
913 
924  extern int grvy_copy_dir (const char *from_dir, const char *to_dir);
925 
928  /*
929  * Doxygen API Definitions
930  */
931 
1091 #ifdef __cplusplus
1092 }
1093 
1109 
1110 //--------------------------
1111 // C++ GRVY Interfaces
1112 //--------------------------
1113 
1114 #include<vector>
1115 #include<map>
1116 #include<string>
1117 #include<memory>
1118 
1119 // Forward declare GetPot class so we don't need
1120 // to include header here.
1121 
1122 namespace GRVYGetPot
1123  {
1124  class GetPot;
1125  }
1126 
1127 //--------------------
1128 // Input Parsing Class
1129 //--------------------
1130 
1154 
1155 // \namespace GRVY
1156 // \brief Namespace containing all libGRVY classes.
1157 
1158 namespace GRVY {
1159 
1160  void GRVY_version_stdout();
1161  int GRVY_get_numeric_version();
1162 
1168  /* \brief Input Parsing Class
1169  *
1170  */
1171 
1172 class GRVY_Input_Class {
1173 
1174  public:
1175  GRVY_Input_Class ();
1176  ~GRVY_Input_Class ();
1177 
1193  int Open (const char *filename);
1198  int Load (std::stringstream &buffer);
1199 
1201  int Close ();
1202 
1225  int Fdump ();
1226 
1228  int Fdump (const char *prefix);
1229 
1231  int Fdump (const char *prefix, const char *filename);
1232 
1252  template <typename T> int Read_Var (std::string keyword, T *value );
1253  template <typename T> int Read_Var (std::string keyword, T *value, T vardef);
1254 
1255  template <typename T> int Read_Var (const char *keyword, T *value );
1256  template <typename T> int Read_Var (const char *keyword, T *value, T vardef);
1257 
1258  // Character string reads
1259 
1260  int Read_Var (const char *keyword, std::string *value);
1261  int Read_Var (const char *keyword, char **value);
1262  int Read_Var (const char *keyword, std::string *value, std::string vardef);
1263 
1264  // Bool Read Functions
1265 
1266  int Read_Var (const char *var, bool *value, bool vardef);
1267  int Read_Var (std::string var, bool *value, bool vardef);
1268 
1284  template <typename T> int Read_Var_Vec (std::string keyword, T *values, int nelems);
1285  template <typename T> int Read_Var_Vec (const char *keyword, T *values, int nelems);
1286  template <typename T> int Read_Var_Vec (std::string keyword, T *values, int nelems, T vardef);
1287  template <typename T> int Read_Var_Vec (const char *keyword, T *values, int nelems, T vardef);
1288 
1304  template <typename T> int Read_Var_iVec (std::string keyword, T *value, int elem);
1305  template <typename T> int Read_Var_iVec (const char *keyword, T *value, int elem);
1306  template <typename T> int Read_Var_iVec (std::string keyword, T *value, int elem, T vardef);
1307  template <typename T> int Read_Var_iVec (const char *keyword, T *value, int elem, T vardef);
1308 
1309  // Character String Read Functions
1310 
1311  int Read_Var_iVec (const char *keyword, char **value, int elem);
1312  int Read_Var_iVec (const char *keyword, std::string *value, int elem);
1313 
1333  void Register_Var (const char *keyword, int var);
1334  void Register_Var (const char *keyword, float var);
1335  void Register_Var (const char *keyword, double var);
1336  void Register_Var (const char *keyword, bool var);
1337  void Register_Var (const char *keyword, const char *var);
1338  void Register_Var (const char *keyword, std::string var);
1339 
1355  int Get_Var (const char *keyword, int *value);
1356  int Get_Var (const char *keyword, float *value);
1357  int Get_Var (const char *keyword, double *value);
1358  int Get_Var (const char *keyword, char **value);
1359  int Get_Var (const char *keyword, std::string *value);
1360 
1361  void PrintRegVars (const char *prefix);
1362 
1365  private:
1366  class GRVY_Input_ClassImp ; // forward declaration to Input class implementation
1367  std::unique_ptr<GRVY_Input_ClassImp> m_pimpl; // pointer to implementation
1368 
1369 };
1370 
1371  /* @} */
1372 
1373 //--------------------------
1374 // Performance Timing Class
1375 //--------------------------
1376 
1420 class GRVY_Timer_Class {
1421 
1422  public:
1423  GRVY_Timer_Class ();
1424  ~GRVY_Timer_Class ();
1425 
1442  void Init (std::string name);
1443  void BeginTimer (std::string id);
1444  void EndTimer (std::string id);
1445  void Finalize ();
1446 
1461  double ElapsedSeconds (std::string id); // return elapsed time for specifc timer id
1462  double ElapsedGlobal (); // return elapsed time since Init()
1463  double RawTimer (); // raw timer
1464 
1465  void Reset (); // reset all timers
1466  void Summarize (); // pretty-print timing information
1467  int SetSummarizeWidth(const int width); // set max output width for summarize stdout
1468 
1469  size_t StatsCount (std::string id); // # of calls to timer (id)
1470  double StatsMean (std::string id); // mean time for timer (id)
1471  double StatsVariance (std::string id); // variance for timer (id)
1472  double StatsMin (std::string id); // min value for timer (id)
1473  double StatsMax (std::string id); // max value for timer (id)
1474 
1475  /* Inclusive timing routines */
1476 
1477  double ElapsedSeconds_inc(std::string id); // return elapsed time for specifc timer id
1478  double StatsMean_inc (std::string id); // mean time for timer (id)
1479  double StatsVariance_inc (std::string id); // variance for timer (id)
1480  double StatsMin_inc (std::string id); // min value for timer (id)
1481  double StatsMax_inc (std::string id); // max value for timer (id)
1482 
1521  // Mode 1: Saving internal GRVY timer values to historical repository
1522 
1523  int SaveHistTiming (std::string experiment, std::string comment, int num_procs,
1524  std::string filename);
1525 
1526  int SaveHistTiming (std::string experiment, std::string comment, int num_procs,
1527  int jobId, std::string code_revision, double flops, std::string filename);
1528 
1529  // Mode 2: Saving user-provided global timing to historical repository
1530 
1531  int SaveHistTiming (double timing, std::string machinename, std::string experiment,
1532  std::string comment, int num_procs, std::string filename);
1533 
1534  int SaveHistTiming (double timing, std::string machinename, std::string experiment,
1535  std::string comment, int num_procs, int jobId, std::string code_revision,
1536  double flops, std::string filename);
1537 
1538  // ---------------
1539  // Query Functions
1540  // ---------------
1541 
1542  void SummarizeHistTiming (std::string filename, std::string delimiter, std::string outdir);
1543 
1547  // Class options
1548 
1549  int SetOption (std::string option, bool flag);
1550 
1551 private:
1552  class GRVY_Timer_ClassImp; // forward declaration to Timer implementation
1553  std::unique_ptr<GRVY_Timer_ClassImp> m_pimpl; // pointer to implementation
1554 
1555 };
1556 
1557  //--------------------------
1558  // MPI Out-of-Core Class
1559  //--------------------------
1560 
1578 class GRVY_MPI_Ocore_Class {
1579 
1580 public:
1581  GRVY_MPI_Ocore_Class();
1582  ~GRVY_MPI_Ocore_Class();
1583 
1584 #if GRVY_OCORE_ENABLED == 1
1585 
1597  int Initialize (std::string inputfile, int num_ocore_tasks, MPI_Comm GLOB_COMM);
1598  void Finalize ();
1599  size_t NumActive (); // number of currently active records
1600  bool isMaster (); // is the calling task the master task (in GLOB_COMM)?
1601  bool isWorkTask (); // is the calling task a worker task used by application (in GLOB_COMM)?
1602  bool isOcoreTask (); // is the calling task used by Ocore (in GLOB_COMM)?
1603  bool isEnabled (); // is MPI Ocore enabled? (can be controlled via input file)
1604  int Blocksize (); // Ocore blocksize
1605 
1608  // Read/Write Functions
1609 
1625  template <typename T> int Write (size_t offset,T *data );
1626  template <typename T> int Read (size_t offset,T *data );
1627 
1630  // Record retrieval/removal
1631 
1645  template <typename T> size_t PopRecord (T *data );
1646 
1647 #endif
1648 
1651 private:
1652  class GRVY_MPI_Ocore_ClassImp; // forward declaration to Ocore implementation
1653  std::unique_ptr<GRVY_MPI_Ocore_ClassImp> m_pimpl; // pointer to implementation
1654 };
1655 
1656 
1657 
1658 //--------------------
1659 // HDF5 Utility Class
1660 //--------------------
1661 
1662  class GRVY_HDF5_Class //: private boost::noncopyable
1663  {
1664  friend class GRVY_Timer_Class;
1665 
1666  public:
1667  GRVY_HDF5_Class ();
1668  ~GRVY_HDF5_Class ();
1669 
1670  GRVY_HDF5_Class (const GRVY_HDF5_Class &rhs);
1671  GRVY_HDF5_Class &operator= (GRVY_HDF5_Class );
1672 
1673  // File-related functions
1674 
1675  int Create (std::string filename, bool overwrite_existing);
1676  int Open (std::string filename, bool read_only );
1677  bool Exists (std::string filename);
1678  int Close ();
1679 
1680  // Group-related functions
1681 
1682  int GroupCreate (std::string groupname);
1683  int GroupOpen (std::string groupname);
1684  bool GroupExists (std::string groupname);
1685 
1686  std::vector<std::string> ListSubGroups(std::string groupname);
1687 
1688  // Dataset-related functions
1689 
1690  int DatasetOpen (std::string groupname, std::string datasetname);
1691  bool DatasetExists(std::string groupname, std::string datasetname);
1692 
1693  // Attribute-related functions
1694 
1695  int AttributeOpen (std::string groupname, std::string attribute);
1696  bool AttributeExists(std::string groupname, std::string attribute);
1697 
1698  int AttributeWrite(std::string groupname, std::string attribute, short int value);
1699  int AttributeWrite(std::string groupname, std::string attribute, int value);
1700  int AttributeWrite(std::string groupname, std::string attribute, long value);
1701  int AttributeWrite(std::string groupname, std::string attribute, unsigned short int value);
1702  int AttributeWrite(std::string groupname, std::string attribute, unsigned int value);
1703  int AttributeWrite(std::string groupname, std::string attribute, unsigned long value);
1704  int AttributeWrite(std::string groupname, std::string attribute, float value);
1705  int AttributeWrite(std::string groupname, std::string attribute, double value);
1706  int AttributeWrite(std::string groupname, std::string attribute, std::string value);
1707 
1708  int AttributeRead (std::string groupname, std::string attribute, short int &value);
1709  int AttributeRead (std::string groupname, std::string attribute, int &value);
1710  int AttributeRead (std::string groupname, std::string attribute, long &value);
1711  int AttributeRead (std::string groupname, std::string attribute, unsigned short int &value);
1712  int AttributeRead (std::string groupname, std::string attribute, unsigned int &value);
1713  int AttributeRead (std::string groupname, std::string attribute, unsigned long &value);
1714  int AttributeRead (std::string groupname, std::string attribute, float &value);
1715  int AttributeRead (std::string groupname, std::string attribute, double &value);
1716  int AttributeRead (std::string groupname, std::string attribute, std::string &value);
1717 
1718  // Dataset-related functions
1719 
1720  // Packet Table related functions
1721 
1722  private:
1723  class GRVY_HDF5_ClassImp; // forward declaration of HDF5 implementation
1724  std::unique_ptr<GRVY_HDF5_ClassImp> m_pimpl; // pointer to implementation
1725  };
1726 }
1727 
1728 #endif
1729 
1730 #endif
grvy_printf
int grvy_printf(int loglevel, const char *format,...)
Post log message at loglevel priority using printf() style formatting.
grvy_input_fdump_file
int grvy_input_fdump_file(const char *prefix, const char *filename)
Dump input file settings to an open file with a provided prefix delimiter.
grvy_input_fclose
int grvy_input_fclose()
Close the currently open libGRVY style input file.
grvy_timer_save_hist
int grvy_timer_save_hist(const char *experiment_name, const char *comment, int num_procs, const char *filename)
Save current libGRVY timing results to HDF file for logging.
grvy_input_fread_float
int grvy_input_fread_float(const char *keyword, float *value)
Read a single input float value corresponding to the keyword path.
grvy_timer_stats_min
double grvy_timer_stats_min(const char *id)
Returns the minimum (exclusive) measured timing (in seconds) for defined timer id.
grvy_timer
double grvy_timer()
Basic wallclock timer which provides the time since epoch in seconds.
grvy_timer_finalize
void grvy_timer_finalize()
Finalize global timing process - stops the active global timer.
grvy_timer_elapsedseconds_inc
double grvy_timer_elapsedseconds_inc(const char *id)
Returns total (inclusive) elapsed time (in seconds) for defined timer id.
grvy_timer_begin
void grvy_timer_begin(const char *id)
Identify beginning of code section to time with unique id string.
grvy_timer_stats_count
int grvy_timer_stats_count(const char *id)
Returns the total number of timer calls for defined timer id.
grvy_timer_init
void grvy_timer_init(const char *description)
Initialize timer library with a description string which initiates the global timing process (the des...
grvy_timer_summarize
void grvy_timer_summarize()
Print a concise summary of all defined timers to stdout. This routine shows the relative runtime perc...
grvy_timer_elapsedseconds
double grvy_timer_elapsedseconds(const char *id)
Returns total (exclusive) elapsed time (in seconds) for defined timer id.
grvy_input_fread_int
int grvy_input_fread_int(const char *keyword, int *value)
Read a single input integer value corresponding to the keyword path.
grvy_create_scratch_dir
int grvy_create_scratch_dir(char *name_template)
Identical to grvy_create_unique_dir(), except that the new directory and all of its contents are dele...
grvy_input_register_char
int grvy_input_register_char(const char *keyword, char *value)
Register default character string value corresponding to the keyword path.
grvy_timer_set_summarize_width
int grvy_timer_set_summarize_width(const int maxwidth)
Set max allowed width of grvy_timer_summarize() output. The normal default is to limit output width t...
grvy_timer_stats_min_inc
double grvy_timer_stats_min_inc(const char *id)
Returns the minimum (inclusive) measured timing (in seconds) for defined timer id.
grvy_input_register_int
int grvy_input_register_int(const char *keyword, int value)
Register default integer value corresponding to the keyword path.
grvy_timer_stats_max_inc
double grvy_timer_stats_max_inc(const char *id)
Returns the largest (inclusive) measured timing (in seconds) for defined timer id.
grvy_timer_save_hist_ext_exp
int grvy_timer_save_hist_ext_exp(double timing, const char *machinename, const char *experiment, const char *comment, int num_procs, int jobId, const char *code_revision, double flops, const char *filename)
Save a single timing result to HDF file for logging (expanded version)..
grvy_input_fdump_delim
int grvy_input_fdump_delim(const char *prefix)
Dump input file settings to stdout prefixed by a delimiter.
grvy_input_fread_char_ivec
int grvy_input_fread_char_ivec(const char *keyword, char **values, int elem)
Read a character array of size nelems corresponding to the keyword path.
grvy_input_fread_float_ivec
int grvy_input_fread_float_ivec(const char *keyword, float *value, int elem)
Read the ith entry (elem) from an array of doubles corresponding to the keyword path.
grvy_check_file_path
int grvy_check_file_path(const char *name_template)
Checks a desired output pathname and creates any non-existing parent directories. The Unix pathname t...
grvy_timer_stats_mean_inc
double grvy_timer_stats_mean_inc(const char *id)
Returns the mean (inclusive) value (in seconds) for defined timer id.
grvy_double_isnan
int grvy_double_isnan(double *value)
Check if input double value is not a number (NaN)
grvy_log_getlevel
int grvy_log_getlevel()
Get current logging priority level.
grvy_timer_reset
void grvy_timer_reset()
Resets all actively defined timers (accumulated time and calling statistics are reinitialized).
grvy_input_fread_char
int grvy_input_fread_char(const char *keyword, char **value)
Read a single input character string value corresponding to the keyword path. For convenience,...
grvy_timer_end
void grvy_timer_end(const char *id)
Identify end of code section to time with a matching id string.
grvy_create_unique_dir
int grvy_create_unique_dir(char *name_template)
Creates a new, unique directory with 0700 permissions using the provided name_template....
grvy_float_isnan
int grvy_float_isnan(float *value)
Check if input float value is not a number (NaN)
grvy_float_isinf
int grvy_float_isinf(float *value)
Check if input float value is infinite (Inf)
grvy_timer_stats_variance_inc
double grvy_timer_stats_variance_inc(const char *id)
Returns the variance (inclusive) for defined timer id.
grvy_input_register_double
int grvy_input_register_double(const char *keyword, double value)
Register default double value corresponding to the keyword path.
grvy_input_fread_int_vec
int grvy_input_fread_int_vec(const char *keyword, int *values, int nelems)
Read an integer array of size nelems corresponding to the keyword path.
grvy_input_register_get_double
int grvy_input_register_get_double(const char *keyword, double *value)
Retrieve registered default double value corresponding to the keyword path.
grvy_input_fread_double_ivec
int grvy_input_fread_double_ivec(const char *keyword, double *value, int elem)
Read the ith entry (elem) from an array of doubles corresponding to the keyword path.
grvy_input_fopen
int grvy_input_fopen(const char *filename)
Open a libGRVY style input file.
grvy_log_setlevel
void grvy_log_setlevel(int priority)
Set current logging priority level.
grvy_input_register_get_char
int grvy_input_register_get_char(const char *keyword, char **value)
Retrieve registered default character string value corresponding to the keyword path.
grvy_input_register_float
int grvy_input_register_float(const char *keyword, float value)
Register default float value corresponding to the keyword path.
grvy_timer_save_hist_exp
int grvy_timer_save_hist_exp(const char *experiment_name, const char *comment, int num_procs, int jobId, const char *code_revision, double flops, const char *filename)
Save current libGRVY timing results to HDF file for logging (expanded version).
grvy_input_fread_double
int grvy_input_fread_double(const char *keyword, double *value)
Read a single input double value corresponding to the keyword path.
grvy_input_fread_double_vec
int grvy_input_fread_double_vec(const char *keyword, double *values, int nelems)
Read a double array of size nelems corresponding to the keyword path.
grvy_get_numeric_version
int grvy_get_numeric_version()
Obtain numeric library version.
grvy_input_fread_int_ivec
int grvy_input_fread_int_ivec(const char *keyword, int *value, int elem)
Read the ith entry (elem) from an array of integers corresponding to the keyword path.
grvy_input_fread_float_vec
int grvy_input_fread_float_vec(const char *keyword, float *values, int nelems)
Read a float array of size nelems corresponding to the keyword path.
grvy_input_register_get_float
int grvy_input_register_get_float(const char *keyword, float *value)
Retrieve registered default float value corresponding to the keyword path.
grvy_timer_elapsed_global
double grvy_timer_elapsed_global()
Returns total elapsed time (in seconds) for the global timer.
grvy_timer_stats_mean
double grvy_timer_stats_mean(const char *id)
Returns the mean (exclusive) value (in seconds) for defined timer id.
grvy_timer_save_hist_ext
int grvy_timer_save_hist_ext(double timing, const char *machinename, const char *experiment, const char *comment, int num_procs, const char *filename)
Save a single timing result to HDF file for logging.
grvy_log_setmask
void grvy_log_setmask(int loglevel, const char *delimiter)
Set logging mask delimiter which prepends messages of loglevel priority.
grvy_summarize_hist_timing
void grvy_summarize_hist_timing(const char *filename, const char *delimiter, const char *outdir)
Summarize and dump historical timing information to ascii files from logged results stored previously...
grvy_version_stdout
void grvy_version_stdout()
Echo library versioning and configuration information to stdout.
grvy_input_register_get_int
int grvy_input_register_get_int(const char *keyword, int *value)
Retrieve registered default integer value corresponding to the keyword path.
grvy_input_fdump
int grvy_input_fdump()
Dump input file settings to stdout.
grvy_timer_stats_variance
double grvy_timer_stats_variance(const char *id)
Returns the variance (exclusive) for defined timer id.
grvy_double_isinf
int grvy_double_isinf(double *vauel)
Check if input double value is infinite (Inf)
grvy_copy_dir
int grvy_copy_dir(const char *from_dir, const char *to_dir)
Recursively copies contents of existing directory (from_dir) to a new directory (to_dir)....
grvy_timer_stats_max
double grvy_timer_stats_max(const char *id)
Returns the largest (exclusive) measured timing (in seconds) for defined timer id.

Generated on Wed Jul 12 2023 16:53:23 for GRVY-0.38.0 by  doxygen 1.8.17