GridFire 0.6.0
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::MultiscalePartitioningEngineView::CacheStats Struct Reference

Struct for tracking cache statistics. More...

Public Types

enum class  operators {
  CalculateRHSAndEnergy , GenerateJacobianMatrix , CalculateMolarReactionFlow , GetSpeciesTimescales ,
  GetSpeciesDestructionTimescales , Other , All
}
 

Public Member Functions

void hit (const operators op=operators::Other)
 Increments the hit counter for a given operator.
 
void miss (const operators op=operators::Other)
 Increments the miss counter for a given operator.
 
size_t hits (const operators op=operators::All) const
 Gets the number of hits for a specific operator or all operators.
 
size_t misses (const operators op=operators::All) const
 Gets the number of misses for a specific operator or all operators.
 

Public Attributes

std::map< operators,std::string > operatorsNameMap
 Map from operators to their string names for logging.
 
size_t m_hit = 0
 Total number of cache hits.
 
size_t m_miss = 0
 Total number of cache misses.
 
std::map< operators,size_t > m_operatorHits
 Map from operators to the number of cache hits for that operator.
 
std::map< operators,size_t > m_operatorMisses
 Map from operators to the number of cache misses for that operator.
 

Detailed Description

Struct for tracking cache statistics.

Purpose
A simple utility to monitor the performance of the QSE cache by counting hits and misses for various engine operations.

Member Enumeration Documentation

◆ operators

Enumerator
CalculateRHSAndEnergy 
GenerateJacobianMatrix 
CalculateMolarReactionFlow 
GetSpeciesTimescales 
GetSpeciesDestructionTimescales 
Other 
All 

Member Function Documentation

◆ hit()

void gridfire::MultiscalePartitioningEngineView::CacheStats::hit ( const operators op = operators::Other)

Increments the hit counter for a given operator.

Parameters
opThe operator that resulted in a cache hit.
Exceptions
std::invalid_argumentif op is All.

◆ hits()

size_t gridfire::MultiscalePartitioningEngineView::CacheStats::hits ( const operators op = operators::All) const
nodiscard

Gets the number of hits for a specific operator or all operators.

Parameters
opThe operator to get the number of hits for. Defaults to All.
Returns
The number of hits.

◆ miss()

void gridfire::MultiscalePartitioningEngineView::CacheStats::miss ( const operators op = operators::Other)

Increments the miss counter for a given operator.

Parameters
opThe operator that resulted in a cache miss.
Exceptions
std::invalid_argumentif op is All.

◆ misses()

size_t gridfire::MultiscalePartitioningEngineView::CacheStats::misses ( const operators op = operators::All) const
nodiscard

Gets the number of misses for a specific operator or all operators.

Parameters
opThe operator to get the number of misses for. Defaults to All.
Returns
The number of misses.

Member Data Documentation

◆ m_hit

size_t gridfire::MultiscalePartitioningEngineView::CacheStats::m_hit = 0

Total number of cache hits.

◆ m_miss

size_t gridfire::MultiscalePartitioningEngineView::CacheStats::m_miss = 0

Total number of cache misses.

◆ m_operatorHits

std::map<operators, size_t> gridfire::MultiscalePartitioningEngineView::CacheStats::m_operatorHits

◆ m_operatorMisses

std::map<operators, size_t> gridfire::MultiscalePartitioningEngineView::CacheStats::m_operatorMisses
Initial value:

Map from operators to the number of cache misses for that operator.

◆ operatorsNameMap

std::map<operators, std::string> gridfire::MultiscalePartitioningEngineView::CacheStats::operatorsNameMap
Initial value:
= {
{operators::CalculateRHSAndEnergy, "calculateRHSAndEnergy"},
{operators::GenerateJacobianMatrix, "generateJacobianMatrix"},
{operators::CalculateMolarReactionFlow, "calculateMolarReactionFlow"},
{operators::GetSpeciesTimescales, "getSpeciesTimescales"},
{operators::GetSpeciesDestructionTimescales, "getSpeciesDestructionTimescales"},
{operators::Other, "other"}
}

Map from operators to their string names for logging.


The documentation for this struct was generated from the following files: