IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
SAMRAI::tbox::Statistician Class Reference

#include <tbox/Statistician.h>

Public Member Functions

virtual Pointer< StatisticgetStatistic (const std::string &name, const std::string &stat_type)
 
virtual bool checkStatisticExists (Pointer< Statistic > &stat, const std::string &name) const
 
virtual int getNumberProcessorStats () const
 
virtual int getNumberPatchStats () const
 
virtual void resetProcessorStatistics ()
 
virtual void resetPatchStatistics ()
 
virtual void resetStatistics ()
 
virtual int getProcStatId (const std::string &name) const
 
virtual int getGlobalProcStatSequenceLength (int proc_stat_id)
 
virtual double getGlobalProcStatValue (int proc_stat_id, int seq_num, int proc_num)
 
virtual double getGlobalProcStatSum (int proc_stat_id, int seq_num)
 
virtual double getGlobalProcStatMax (int proc_stat_id, int seq_num)
 
virtual int getGlobalProcStatMaxProcessorId (int proc_stat_id, int seq_num)
 
virtual double getGlobalProcStatMin (int proc_stat_id, int seq_num)
 
virtual int getGlobalProcStatMinProcessorId (int proc_stat_id, int seq_num)
 
virtual void printGlobalProcStatData (int proc_stat_id, std::ostream &os, int precision=12)
 
virtual void printGlobalProcStatDataFormatted (int proc_stat_id, std::ostream &os, int precision=12)
 
virtual void printGlobalProcStatDataFormatted (int proc_stat_id, int proc_id, std::ostream &os, int precision=12)
 
virtual int getPatchStatId (const std::string &name) const
 
virtual int getGlobalPatchStatSequenceLength (int patch_stat_id)
 
virtual int getGlobalPatchStatNumberPatches (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatPatchMapping (int patch_stat_id, int seq_num, int patch_num)
 
virtual double getGlobalPatchStatValue (int patch_stat_id, int seq_num, int patch_num)
 
virtual double getGlobalPatchStatSum (int patch_stat_id, int seq_num)
 
virtual double getGlobalPatchStatMax (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatMaxPatchId (int patch_stat_id, int seq_num)
 
virtual double getGlobalPatchStatMin (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatMinPatchId (int patch_stat_id, int seq_num)
 
virtual double getGlobalPatchStatProcessorSum (int patch_stat_id, int processor_id, int seq_num)
 
virtual double getGlobalPatchStatProcessorSumMax (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatProcessorSumMaxId (int patch_stat_id, int seq_num)
 
virtual double getGlobalPatchStatProcessorSumMin (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatProcessorSumMinId (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatNumberPatchesOnProc (int patch_stat_id, int seq_num, int proc_id)
 
virtual int getGlobalPatchStatMaxPatchesPerProc (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatMaxPatchesPerProcId (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatMinPatchesPerProc (int patch_stat_id, int seq_num)
 
virtual int getGlobalPatchStatMinPatchesPerProcId (int patch_stat_id, int seq_num)
 
virtual void printGlobalPatchStatData (int patch_stat_id, std::ostream &os, int precision=12)
 
virtual void printGlobalPatchStatDataFormatted (int patch_stat_id, std::ostream &os, int precision=12)
 
virtual void finalize ()
 
virtual void printLocalStatData (std::ostream &os, int precision=12) const
 
virtual void printAllGlobalStatData (std::ostream &os, int precision=12)
 
virtual void printAllSummedGlobalStatData (std::ostream &os, int precision=12)
 
virtual void printAllSummedGlobalStatData (const std::string &filename, int precision=12)
 
virtual void printSpreadSheetOutput (const std::string &dirname=std::string(), int precision=12)
 
virtual void printSpreadSheetOutputForProcessor (const int proc_id, const std::string &dirname=std::string(), int precision=12)
 

Static Public Member Functions

static StatisticiancreateStatistician (bool register_for_restart=true, bool read_from_restart=true)
 
static StatisticiangetStatistician ()
 
static void freeStatistician ()
 

Protected Member Functions

 Statistician ()
 
virtual ~Statistician ()
 
void registerSingletonSubclassInstance (Statistician *subclass_instance)
 
virtual void checkStatsForConsistency (Array< int > &total_patches)
 
virtual bool checkProcStatExists (Pointer< Statistic > &stat, const std::string &name) const
 
virtual bool checkPatchStatExists (Pointer< Statistic > &stat, const std::string &name) const
 

Private Member Functions

int getMaximumNumberOfStatistics ()
 
void setMaximumNumberOfStatistics (const int size)
 
void initRestartDatabase (bool register_for_restart, bool read_from_restart)
 

Static Private Member Functions

static void makeStatisticianInstance (bool register_for_restart=true, bool read_from_restart=true)
 

Private Attributes

StatisticRestartDatabased_restart_database_instance
 
int d_num_proc_stats
 
Array< Pointer< Statistic > > d_proc_statistics
 
int d_num_patch_stats
 
Array< Pointer< Statistic > > d_patch_statistics
 
bool d_must_call_finalize
 
Array< Array< Array< double > > > d_global_proc_stat_data
 
Array< Array< Array< double > > > d_global_patch_stat_data
 
Array< Array< Array< double > > > d_global_patch_stat_proc_data
 
Array< Array< Array< int > > > d_global_patch_stat_mapping
 

Static Private Attributes

static Statisticians_statistician_instance
 
static bool s_registered_callback
 
static const int DEFAULT_NUMBER_OF_TIMERS_INCREMENT = 128
 

Friends

class StatisticRestartDatabase
 

Detailed Description

Class Statistician is a Singleton class that manages a simple database of Statistic objects. This class provides a single point of access to statistic objects so that any one of them may be updated or recorded at any point in the code. Access to the Singleton statistician instance follows the standard SAMRAI implementation found in other classes with similar Singleton behavior. See static member functions below for more information.

Statistic objects can be to the database or accessed in code as follows:

Pointer<Statistic> stat = 
      Statistician::getStatistician->
      getStatistic("name", "PROC_STAT");

Here ‘name’ is the name string identifier for the statistic object and ‘PROC_STAT’ is the type of statistic. See discussion for the getStatistic() method below for more information.

The statistic state is saved to restart files when restart file generation is active. This allows users to continue to accumulate timing information when restarting a run. If desired, all statistics can be reset when restarting by calling the function resetAllStatistics().

A variety of print options exist to dump statistics data. Notably, the printSpreadSheetOutput("print_dir") will write statistics data in a tab-separated format to files in the supplied directory name. The naming convention for statistics data is "\<name\>-\<type\>.txt" where <name> is the name of the statistic and <type> is either proc or patch stat. The files may be read in to a spreadsheet program such as MS Excel.

For more information about data that can be recorded with statistics, consult the header file for the Statistic class.

See also
tbox::Statistic

Constructor & Destructor Documentation

◆ Statistician()

SAMRAI::tbox::Statistician::Statistician ( )
protected

The constructor for Statistician is protected. Consistent with the definition of a Singleton class, only a statistician object can have access to the constructor for the class.

◆ ~Statistician()

virtual SAMRAI::tbox::Statistician::~Statistician ( )
protectedvirtual

Statistician is a Singleton class; its destructor is protected.

Member Function Documentation

◆ createStatistician()

static Statistician* SAMRAI::tbox::Statistician::createStatistician ( bool  register_for_restart = true,
bool  read_from_restart = true 
)
static

Create the singleton instance of the statistic manager and return a pointer to it. This function is provided so that so that users can control whether statistic information will be written to/read from restart files.

The statistic restart database object is also resistered for writing subsequent restart files when the first boolean argument is true.
Whether the statistic database will write statistics to restart files during program execution is determined by this argument (true by default). Regardless of the value of this argument, statistics that exist in the restart file will be read from restart when a run is restarted and the second argument is true.

Generally, this routine should only be called once during program execution. If the statistician has been previously created (e.g., by an earlier call to this routine) this routine will do nothing other than return the pointer to the existing singleton instance.

◆ getStatistician()

static Statistician* SAMRAI::tbox::Statistician::getStatistician ( )
static

Return a pointer to the singleton statistician instance. All access to the Statistician object is through the getStatistician() function. For example, to add a statistic object with the name "my_stat" to the statistician, use the following call: Statistician::getStatistician()->addStatistic("my_stat").

◆ freeStatistician()

static void SAMRAI::tbox::Statistician::freeStatistician ( )
static

Deallocate the Statistician instance. Note that it is not necessary to call freeStatistician() at program termination, since it is automatically called by the ShutdownRegistry class.

◆ getStatistic()

virtual Pointer<Statistic> SAMRAI::tbox::Statistician::getStatistic ( const std::string &  name,
const std::string &  stat_type 
)
virtual

Return pointer to statistic object with the given name string. If a statistics with the given name already exists in the database of statistics, the statistic with that name will be returned.
Otherwise, a new statistic will be created with that name. The stat_type string identifier is only used when a new statistic object must be created. The two avaible options are processor statistics and patch statistics which are indicated by the strings "PROC_STAT" and "PATCH_STAT", respectively.

When assertion checking is active, an assertion will result if wither string is empty.

◆ checkStatisticExists()

virtual bool SAMRAI::tbox::Statistician::checkStatisticExists ( Pointer< Statistic > &  stat,
const std::string &  name 
) const
virtual

Return true if a statistic whose name matches the argument string exists in the database of statistics controlled by the statistician. If a match is found, the statistic pointer in the argument list is set to that statistic. Otherwise, return false and return a null pointer. If the name string is empty, a null pointer is returned.

◆ getNumberProcessorStats()

virtual int SAMRAI::tbox::Statistician::getNumberProcessorStats ( ) const
virtual

Return integer number of local processor statistics maintained by statistician.

◆ getNumberPatchStats()

virtual int SAMRAI::tbox::Statistician::getNumberPatchStats ( ) const
virtual

Return integer number of local patch statistics maintained by statistician.

◆ resetProcessorStatistics()

virtual void SAMRAI::tbox::Statistician::resetProcessorStatistics ( )
virtual

Reset all processor statistics to contain no information. The primary intent of this function is to avoid using restarted statistic values when performing a restarted run. However, it can be called anytime.

◆ resetPatchStatistics()

virtual void SAMRAI::tbox::Statistician::resetPatchStatistics ( )
virtual

Reset all patch statistics to contain no information. The primary intent of this function is to avoid using restarted statistic values when performing a restarted run. However, it can be called anytime.

◆ resetStatistics()

virtual void SAMRAI::tbox::Statistician::resetStatistics ( )
virtual

Reset all patch and processor statistics to contain no information.

◆ getProcStatId()

virtual int SAMRAI::tbox::Statistician::getProcStatId ( const std::string &  name) const
virtual

Return integer instance identifier for processor statistic with given name. If this statistician object maintains no processor statistic with that name, then a warning message results and the return value will be the invalid instance identifier "-1".

◆ getGlobalProcStatSequenceLength()

virtual int SAMRAI::tbox::Statistician::getGlobalProcStatSequenceLength ( int  proc_stat_id)
virtual

Return number of sequence entries for processor statistic with given integer identifier. For convenience, the routine getProcStatId() is provided to map the statistic string name to the proper integer identifier.

When assertion checking is active, the identifier must be valid or an assertion will result.

◆ getGlobalProcStatValue()

virtual double SAMRAI::tbox::Statistician::getGlobalProcStatValue ( int  proc_stat_id,
int  seq_num,
int  proc_num 
)
virtual

Return statistic data value for processor statistic with given integer identifier, sequence number, and processor number. For convenience, the routine getProcStatId() is provided to map the statistic string name to the proper integer identifier. The function getGlobalProcStatSequenceLength() provides the sequence length for a given processor statistic.

When assertion checking is active, the identifier, sequence number, and processor number must be valid or an assertion will result.

◆ getGlobalProcStatSum()

virtual double SAMRAI::tbox::Statistician::getGlobalProcStatSum ( int  proc_stat_id,
int  seq_num 
)
virtual

Return global sum of processor statistic with given integer identifier and sequence number. To identify the correct integer identifier and valid sequence numbers, the method getProcStatId() maps the statistic string name to its integer identifier and the method getGlobalProcStatSequenceLength() returns the maximum sequence length for the processor statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalProcStatMax()

virtual double SAMRAI::tbox::Statistician::getGlobalProcStatMax ( int  proc_stat_id,
int  seq_num 
)
virtual

Return global max of processor statistic with given integer identifier and sequence number. To identify the correct integer identifier and valid sequence numbers, the method getProcStatId() maps the statistic string name to its integer identifier and the method getGlobalProcStatSequenceLength() returns the maximum sequence length for the processor statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalProcStatMaxProcessorId()

virtual int SAMRAI::tbox::Statistician::getGlobalProcStatMaxProcessorId ( int  proc_stat_id,
int  seq_num 
)
virtual

Returns rank of processor holding global max for the processor statistic specified by the given integer identifyer and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalProcStatMin()

virtual double SAMRAI::tbox::Statistician::getGlobalProcStatMin ( int  proc_stat_id,
int  seq_num 
)
virtual

Return global min of processor statistic with given integer identifier and sequence number. To identify the correct integer identifier and valid sequence numbers, the method getProcStatId() maps the statistic string name to its integer identifier and the method getGlobalProcStatSequenceLength() returns the maximum sequence length for the processor statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalProcStatMinProcessorId()

virtual int SAMRAI::tbox::Statistician::getGlobalProcStatMinProcessorId ( int  proc_stat_id,
int  seq_num 
)
virtual

Returns rank of processor holding global max for the processor statistic specified by the given integer identifyer and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ printGlobalProcStatData()

virtual void SAMRAI::tbox::Statistician::printGlobalProcStatData ( int  proc_stat_id,
std::ostream &  os,
int  precision = 12 
)
virtual

Print global processor statistic data for a particular statistic to given output stream. Floating point precision may be specified (default is 12). Note that this method generates a general dump of the data but does NOT generate it in tabulated form. To generate tabulated data, see the printGlobalProcStatDataFormatted() method.

◆ printGlobalProcStatDataFormatted() [1/2]

virtual void SAMRAI::tbox::Statistician::printGlobalProcStatDataFormatted ( int  proc_stat_id,
std::ostream &  os,
int  precision = 12 
)
virtual

Print processor stat data in formatted output to given output stream. Floating point precision may be specified (default is 12).

◆ printGlobalProcStatDataFormatted() [2/2]

virtual void SAMRAI::tbox::Statistician::printGlobalProcStatDataFormatted ( int  proc_stat_id,
int  proc_id,
std::ostream &  os,
int  precision = 12 
)
virtual

Print stat data for specified processor in formatted output to given output stream. Floating point precision may be specified (default is 12).

◆ getPatchStatId()

virtual int SAMRAI::tbox::Statistician::getPatchStatId ( const std::string &  name) const
virtual

Return integer instance identifier for patch statistic with given name. If this statistician object maintains no patch statistic with that name, then a warning message results and the return value will be the invalid instance identifier "-1".

◆ getGlobalPatchStatSequenceLength()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatSequenceLength ( int  patch_stat_id)
virtual

Return number of sequence entries for patch statistic with given integer identifier. For convenience, the routine getPatchStatId() is provided to map the statistic string name to the proper integer identifier.

When assertion checking is active, the identifier must be valid or an assertion will result.

◆ getGlobalPatchStatNumberPatches()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatNumberPatches ( int  patch_stat_id,
int  seq_num 
)
virtual

Return number of patch entries for patch statistic with given integer identifier, and sequence number. For convenience, the routine getPatchStatId() is provided to map the statistic string name to the proper integer identifier. The function getGlobalPatchStatSequenceLength() provides the sequence length for a given patch statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatPatchMapping()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatPatchMapping ( int  patch_stat_id,
int  seq_num,
int  patch_num 
)
virtual

Return global processor mapping for patch statistic with given integer identifier, sequence number, and patch number. For convenience, the routine getPatchStatId() is provided to map the statistic string name to the proper integer identifier. The function getGlobalPatchStatSequenceLength() provides the sequence length for a given patch statistic. The function getGlobalPatchStatNumberPatches() gives the number of patches associated with a patch statistic and sequence number.

When assertion checking is active, the identifier, sequence number, and patch number must be valid or an assertion will result.

◆ getGlobalPatchStatValue()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatValue ( int  patch_stat_id,
int  seq_num,
int  patch_num 
)
virtual

Return statistic data value for patch statistic with given integer identifier, sequence number, and patch number. For convenience, the routine getPatchStatId() is provided to map the statistic string name to the proper integer identifier. The function getGlobalPatchStatSequenceLength() provides the sequence length for a given patch statistic. The function getGlobalPatchStatNumberPatches() gives the number of patches associated with a patch statistic and sequence number.

When assertion checking is active, the identifier, sequence number, and patch number must be valid or an assertion will result.

◆ getGlobalPatchStatSum()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatSum ( int  patch_stat_id,
int  seq_num 
)
virtual

Return global sum of patch statistic with given integer identifier and sequence number. To identify the correct integer identifier and valid sequence numbers, the method getPatchStatId() maps the statistic string name to its integer identifier and the method getGlobalPatchStatSequenceLength() returns the maximum sequence length for the processor statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMax()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatMax ( int  patch_stat_id,
int  seq_num 
)
virtual

Return global max of patch statistic with given integer identifier and sequence number. To identify the correct integer identifier and valid sequence numbers, the method getPatchStatId() maps the statistic string name to its integer identifier and the method getGlobalPatchStatSequenceLength() returns the maximum sequence length for the processor statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMaxPatchId()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatMaxPatchId ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns ID of patch holding global max for the patch statistic specified by the given integer identifyer and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMin()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatMin ( int  patch_stat_id,
int  seq_num 
)
virtual

Return global min of patch statistic with given integer identifier and sequence number. To identify the correct integer identifier and valid sequence numbers, the method getPatchStatId() maps the statistic string name to its integer identifier and the method getGlobalPatchStatSequenceLength() returns the maximum sequence length for the processor statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMinPatchId()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatMinPatchId ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns patch ID of patch holding global min for the patch statistic specified by the given integer identifyer and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatProcessorSum()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatProcessorSum ( int  patch_stat_id,
int  processor_id,
int  seq_num 
)
virtual

Returns the sum of patch statistic information for a particular processor. The patch statistic is specified by its integer identifyer and sequence number.

When assertion checking is active, the identifier, processor id, and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatProcessorSumMax()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatProcessorSumMax ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the maximum value of the patch statistic data summed on each processor. That is, patch statistic information is summed on each processor, and this method returns the maximum value, across all processors, of this summed data. The patch statistic is specified by its integer identifyer and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatProcessorSumMaxId()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatProcessorSumMaxId ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the processor ID which holds the maximum value of summed patch statistic information across processors. See the discussion for the method getGlobalPatchStatProcessorSumMax() for more information on the summed patch statistic information on processors.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatProcessorSumMin()

virtual double SAMRAI::tbox::Statistician::getGlobalPatchStatProcessorSumMin ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the minimum value of the patch statistic data summed on each processor. That is, patch statistic information is summed on each processor, and this method returns the minimum value, across all processors, of this summed data. The patch statistic is specified by its integer identifyer and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatProcessorSumMinId()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatProcessorSumMinId ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the processor ID which holds the minimum value of summed patch statistic information across processors. See the discussion for the method getGlobalPatchStatProcessorSumMin() for more information on the summed patch statistic information on processors.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatNumberPatchesOnProc()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatNumberPatchesOnProc ( int  patch_stat_id,
int  seq_num,
int  proc_id 
)
virtual

Return number of patches on the specified processor number for patch statistic with given identifier, and sequence number.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMaxPatchesPerProc()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatMaxPatchesPerProc ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the maximum number of patches per processor for the specified patch statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMaxPatchesPerProcId()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatMaxPatchesPerProcId ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the processor ID holding the maximum number of patches per processor for the specified patch statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMinPatchesPerProc()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatMinPatchesPerProc ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the minimum number of patches per processor for the specified patch statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ getGlobalPatchStatMinPatchesPerProcId()

virtual int SAMRAI::tbox::Statistician::getGlobalPatchStatMinPatchesPerProcId ( int  patch_stat_id,
int  seq_num 
)
virtual

Returns the processor ID holding the minimum number of patches per processor for the specified patch statistic.

When assertion checking is active, the identifier and sequence number must be valid or an assertion will result.

◆ printGlobalPatchStatData()

virtual void SAMRAI::tbox::Statistician::printGlobalPatchStatData ( int  patch_stat_id,
std::ostream &  os,
int  precision = 12 
)
virtual

Print global processor statistic data for a particular statistic to given output stream. Floating point precision may be specified (default is 12). Note that this method generates a general dump of the data but does NOT generate it in tabulated form. To generate tabulated data, see the printGlobalPatchStatDataFormatted() method.

◆ printGlobalPatchStatDataFormatted()

virtual void SAMRAI::tbox::Statistician::printGlobalPatchStatDataFormatted ( int  patch_stat_id,
std::ostream &  os,
int  precision = 12 
)
virtual

Print patch stat data in formatted output to given output stream. Floating point precision may be specified (default is 12).

◆ finalize()

virtual void SAMRAI::tbox::Statistician::finalize ( )
virtual

Gather all statistic information to the statistician object on processor zero. Typically, this routine is called after a calculation has completed so that statistic data can be retrieved, analized, printed to a file, etc. It is not essential that this routine be called, however, as each "get" and "print" routine checks to see if statistic data has been finalized before it peforms its function.

◆ printLocalStatData()

virtual void SAMRAI::tbox::Statistician::printLocalStatData ( std::ostream &  os,
int  precision = 12 
) const
virtual

Print data to given output stream for local statistics managed by this statistician object. Note that no fancy formatting is done. Floating point precision can be specified (default is 12).

◆ printAllGlobalStatData()

virtual void SAMRAI::tbox::Statistician::printAllGlobalStatData ( std::ostream &  os,
int  precision = 12 
)
virtual

Print global statistic data information to given output stream. The data will NOT be in tabulated form. Floating point precision can be specified (default is 12).

◆ printAllSummedGlobalStatData() [1/2]

virtual void SAMRAI::tbox::Statistician::printAllSummedGlobalStatData ( std::ostream &  os,
int  precision = 12 
)
virtual

Print sums of all global statistic data information to given output stream. Floating point precision can be specified (default is 12).

◆ printAllSummedGlobalStatData() [2/2]

virtual void SAMRAI::tbox::Statistician::printAllSummedGlobalStatData ( const std::string &  filename,
int  precision = 12 
)
virtual

Print sums of all global statistic data information to specified filename. Floating point precision can be specified (default is 12).

◆ printSpreadSheetOutput()

virtual void SAMRAI::tbox::Statistician::printSpreadSheetOutput ( const std::string &  dirname = std::string(),
int  precision = 12 
)
virtual

Write all statistics data in tab-separated format to files in the supplied directory name. The naming convention used is "\<name\>-\<type\>.txt" where <name> is the name of the statistic and <type> is either proc or patch stat. Floating point precision may be specified (default is 12). The files may be read in to a spreadsheet program such as MS Excel. If no directory name is supplied, the files will be written to the directory where the application is run.

◆ printSpreadSheetOutputForProcessor()

virtual void SAMRAI::tbox::Statistician::printSpreadSheetOutputForProcessor ( const int  proc_id,
const std::string &  dirname = std::string(),
int  precision = 12 
)
virtual

Write tab-separated statistics data for specified processor. This method is identical to "printSpreadSheetOutput()" (above), but only prints data for a single processor. This may be useful for information that is the same across all processors. This method will only print processor stats. Any patch stats will be ignored.

◆ registerSingletonSubclassInstance()

void SAMRAI::tbox::Statistician::registerSingletonSubclassInstance ( Statistician subclass_instance)
protected

Initialize Singleton instance with instance of subclass. This function is used to make the singleton object unique when inheriting from this base class.

◆ checkStatsForConsistency()

virtual void SAMRAI::tbox::Statistician::checkStatsForConsistency ( Array< int > &  total_patches)
protectedvirtual

During finalize() check statistic information on all processors for consistency before generating arrays of data.

◆ checkProcStatExists()

virtual bool SAMRAI::tbox::Statistician::checkProcStatExists ( Pointer< Statistic > &  stat,
const std::string &  name 
) const
protectedvirtual

Return true if a processor statistic whose name matches the argument string exists in the database of statistics controlled by the statistician. If a match is found, the statistic pointer in the argument list is set to that statistic. Otherwise, return false and return a null pointer.

◆ checkPatchStatExists()

virtual bool SAMRAI::tbox::Statistician::checkPatchStatExists ( Pointer< Statistic > &  stat,
const std::string &  name 
) const
protectedvirtual

Return true if a patch statistic whose name matches the argument string exists in the database of statistics controlled by the statistician. If a match is found, the statistic pointer in the argument list is set to that statistic. Otherwise, return false and return a null pointer.

◆ getMaximumNumberOfStatistics()

int SAMRAI::tbox::Statistician::getMaximumNumberOfStatistics ( )
private

◆ setMaximumNumberOfStatistics()

void SAMRAI::tbox::Statistician::setMaximumNumberOfStatistics ( const int  size)
private

◆ makeStatisticianInstance()

static void SAMRAI::tbox::Statistician::makeStatisticianInstance ( bool  register_for_restart = true,
bool  read_from_restart = true 
)
staticprivate

◆ initRestartDatabase()

void SAMRAI::tbox::Statistician::initRestartDatabase ( bool  register_for_restart,
bool  read_from_restart 
)
private

Friends And Related Function Documentation

◆ StatisticRestartDatabase

friend class StatisticRestartDatabase
friend

Member Data Documentation

◆ s_statistician_instance

Statistician* SAMRAI::tbox::Statistician::s_statistician_instance
staticprivate

Static data members to manage the singleton statistician instance.

◆ s_registered_callback

bool SAMRAI::tbox::Statistician::s_registered_callback
staticprivate

◆ d_restart_database_instance

StatisticRestartDatabase* SAMRAI::tbox::Statistician::d_restart_database_instance
private

◆ d_num_proc_stats

int SAMRAI::tbox::Statistician::d_num_proc_stats
private

◆ d_proc_statistics

Array< Pointer<Statistic> > SAMRAI::tbox::Statistician::d_proc_statistics
private

◆ d_num_patch_stats

int SAMRAI::tbox::Statistician::d_num_patch_stats
private

◆ d_patch_statistics

Array< Pointer<Statistic> > SAMRAI::tbox::Statistician::d_patch_statistics
private

◆ d_must_call_finalize

bool SAMRAI::tbox::Statistician::d_must_call_finalize
private

◆ d_global_proc_stat_data

Array< Array< Array<double> > > SAMRAI::tbox::Statistician::d_global_proc_stat_data
private

◆ d_global_patch_stat_data

Array< Array< Array<double> > > SAMRAI::tbox::Statistician::d_global_patch_stat_data
private

◆ d_global_patch_stat_proc_data

Array< Array< Array<double> > > SAMRAI::tbox::Statistician::d_global_patch_stat_proc_data
private

◆ d_global_patch_stat_mapping

Array< Array< Array<int> > > SAMRAI::tbox::Statistician::d_global_patch_stat_mapping
private

◆ DEFAULT_NUMBER_OF_TIMERS_INCREMENT

const int SAMRAI::tbox::Statistician::DEFAULT_NUMBER_OF_TIMERS_INCREMENT = 128
staticprivate

The documentation for this class was generated from the following file: