NeoPZ
|
#include <run_stats_table.h>
Public Member Functions | |
RunStatsTable (const char *arg, const char *desc) | |
~RunStatsTable () | |
void | start () |
void | lap () |
void | stop () |
int | flush_to_file () |
bool | was_set () const |
Private Member Functions | |
int | read_from_file (CSVStringTable &table, string filename) |
int | write_to_file (const CSVStringTable &table, string filename) |
Private Attributes | |
RunStatsRecorder | stats |
clarg::argString | filename |
bool | stats_recorded |
Class to record execution statistics into tables. For performance reasons it should be declared globally in order to ensure it is only constructed and destructed once.
Typical usage
RunStatsTable dohrstruct_create_rst("-cre_rst", "Run statistics table for dohrstruct->Create()"za);
// Track statistics. Only measure if "-cre_rst" was set. dohrstruct_create_rst.start(); dohrstruct_create_rst.lap(); dohrstruct_create_rst.stop();
// Optional: Updates the table contents. Reads the file into the // table, add the statistics and writes the file back. Only performed // if the filename was provided. dohrstruct_create_rst.flush_to_file();
// Automatically calls flush_to_file(). ~dohrstruct_create_srt()
Definition at line 34 of file run_stats_table.h.
|
inline |
Constructor.
Definition at line 39 of file run_stats_table.h.
|
inline |
Destructor. Update the file.
Definition at line 43 of file run_stats_table.h.
References filename, flush_to_file(), clarg::argT< T >::get_value(), and clarg::arg_base::was_set().
|
inline |
Optional: Updates the table contents. Reads the file into the table, add the statistics and writes the file back. Only performed if the filename was provided. Returns 0 if ok 1 if number of cells in one or more rows does not match the number of column headers when reading the file. 2 nothing to be flushed. -1 if could not read the table headers -2 could not open the file for read. -3 could not open the file for write. -4 error when appending statistics to the table.
Definition at line 84 of file run_stats_table.h.
References filename, clarg::argT< T >::get_value(), read_from_file(), stats_recorded, and write_to_file().
Referenced by ~RunStatsTable().
|
inline |
Track statistics. Add lap.
Definition at line 68 of file run_stats_table.h.
References filename, stats_recorded, and clarg::arg_base::was_set().
|
inlineprivate |
Reads the table contents from a file. Returns 0 if ok, 1 if number of cells in one or more rows does not match the number of column headers -1 if could not read the table headers -2 could not open the file.
Definition at line 121 of file run_stats_table.h.
References CSVTable< Tvar >::read().
Referenced by flush_to_file().
|
inline |
Track statistics. Starts the measurement.
Definition at line 66 of file run_stats_table.h.
References filename, stats_recorded, and clarg::arg_base::was_set().
Referenced by TPZStructMatrixGCTP::Assemble(), TPZDohrStructMatrix::Assemble(), TPZStructMatrixGC::Assemble(), TPZStructMatrixST::Assemble(), TPZStructMatrixCS::Assemble(), TPZStructMatrixTBBFlow::Assemble(), TPZStructMatrixOT::Assemble(), TPZStructMatrixOR::Assemble(), synchronized_threads_t::execute_n_threads(), main(), profile(), run_decompose_cholesky(), run_decompose_ldlt(), TPZStructMatrixOT::Serial_Assemble(), TPZStructMatrixGC::TPZStructMatrixGC(), TPZStructMatrixGCTP::TPZStructMatrixGCTP(), and TPZStructMatrixOT::TPZStructMatrixOT().
|
inline |
Track statistics. Stops the measurement.
Definition at line 70 of file run_stats_table.h.
References filename, stats_recorded, and clarg::arg_base::was_set().
Referenced by TPZStructMatrixGCTP::Assemble(), TPZDohrStructMatrix::Assemble(), TPZStructMatrixGC::Assemble(), TPZStructMatrixST::Assemble(), TPZStructMatrixCS::Assemble(), TPZStructMatrixTBBFlow::Assemble(), TPZStructMatrixOT::Assemble(), TPZStructMatrixOR::Assemble(), synchronized_threads_t::execute_n_threads(), main(), profile(), run_decompose_cholesky(), run_decompose_ldlt(), TPZStructMatrixOT::Serial_Assemble(), TPZStructMatrixGC::TPZStructMatrixGC(), TPZStructMatrixGCTP::TPZStructMatrixGCTP(), and TPZStructMatrixOT::TPZStructMatrixOT().
|
inline |
Definition at line 109 of file run_stats_table.h.
References filename, and clarg::arg_base::was_set().
Referenced by main().
|
inlineprivate |
Writes the table contents to a file. Returns 0 if ok. -3 could not open the file for write.
Definition at line 138 of file run_stats_table.h.
References CSVTable< Tvar >::write().
Referenced by flush_to_file().
|
private |
Definition at line 153 of file run_stats_table.h.
Referenced by flush_to_file(), lap(), start(), stop(), was_set(), and ~RunStatsTable().
|
private |
Definition at line 152 of file run_stats_table.h.
|
private |
Definition at line 154 of file run_stats_table.h.
Referenced by flush_to_file(), lap(), start(), and stop().