Loading...
Searching...
No Matches
gridfire::MultiscalePartitioningEngineView::CacheStats Struct Reference

Struct for tracking cache statistics. More...

Collaboration diagram for gridfire::MultiscalePartitioningEngineView::CacheStats:
[legend]

## 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

enum class gridfire::MultiscalePartitioningEngineView::CacheStats::operators

strong

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

  op | The operator that resulted in a cache hit.

Exceptions

  std::invalid_argument | if `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

  op | The 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

  op | The operator that resulted in a cache miss.

Exceptions

  std::invalid_argument | if `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

  op | The 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

Initial value:
= {
{operators::CalculateRHSAndEnergy, 0},
{operators::GenerateJacobianMatrix, 0},
{operators::CalculateMolarReactionFlow, 0},
{operators::GetSpeciesTimescales, 0},
{operators::GetSpeciesDestructionTimescales, 0},
{operators::Other, 0}
}
gridfire::MultiscalePartitioningEngineView::CacheStats::operators::CalculateMolarReactionFlow
@ CalculateMolarReactionFlow
Definition engine_multiscale.h:975
gridfire::MultiscalePartitioningEngineView::CacheStats::operators::Other
@ Other
Definition engine_multiscale.h:978
gridfire::MultiscalePartitioningEngineView::CacheStats::operators::GetSpeciesTimescales
@ GetSpeciesTimescales
Definition engine_multiscale.h:976
gridfire::MultiscalePartitioningEngineView::CacheStats::operators::GenerateJacobianMatrix
@ GenerateJacobianMatrix
Definition engine_multiscale.h:974
gridfire::MultiscalePartitioningEngineView::CacheStats::operators::GetSpeciesDestructionTimescales
@ GetSpeciesDestructionTimescales
Definition engine_multiscale.h:977
gridfire::MultiscalePartitioningEngineView::CacheStats::operators::CalculateRHSAndEnergy
@ CalculateRHSAndEnergy
Definition engine_multiscale.h:973

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

## m_operatorMisses

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

Initial value:
= {
{operators::CalculateRHSAndEnergy, 0},
{operators::GenerateJacobianMatrix, 0},
{operators::CalculateMolarReactionFlow, 0},
{operators::GetSpeciesTimescales, 0},
{operators::GetSpeciesDestructionTimescales, 0},
{operators::Other, 0}
}

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:

- src/include/gridfire/engine/views/engine_multiscale.h
- src/lib/engine/views/engine_multiscale.cpp