SpECTRE  v2022.06.14
Events::MonitorMemory< Dim, ObservationValueTag > Class Template Reference

Event run on the DgElementArray that will monitor the memory usage of parallel components in megabytes. More...

#include <MonitorMemory.hpp>

Classes

struct  ComponentsToMonitor
 

Public Types

using options = tmpl::list< ComponentsToMonitor >
 
using observed_reduction_data_tags = observers::make_reduction_data_tags< tmpl::list< ReductionData > >
 
using compute_tags_for_observation_box = tmpl::list<>
 
using argument_tags = tmpl::list< ObservationValueTag, domain::Tags::Element< Dim > >
 
using observation_registration_tags = tmpl::list<>
 
using is_ready_argument_tags = tmpl::list<>
 

Public Member Functions

 MonitorMemory (CkMigrateMessage *msg)
 
 WRAPPED_PUPable_decl_template (MonitorMemory)
 
template<typename Metavariables >
 MonitorMemory (const std::optional< std::vector< std::string > > &components_to_monitor, const Options::Context &context, Metavariables)
 
template<typename Metavariables , typename ArrayIndex , typename ParallelComponent >
void operator() (const typename ObservationValueTag::type &observation_value, const ::Element< Dim > &element, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ParallelComponent *const) const
 
std::optional< std::pair< observers::TypeOfObservation, observers::ObservationKey > > get_observation_type_and_key_for_registration () const
 
template<typename Metavariables , typename ArrayIndex , typename Component >
bool is_ready (Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const Component *const) const
 
bool needs_evolved_variables () const override
 Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run. More...
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from Event
 Event (CkMigrateMessage *msg)
 
 WRAPPED_PUPable_abstract (Event)
 
template<typename ComputeTagsList , typename DataBoxType , typename Metavariables , typename ArrayIndex , typename ComponentPointer >
void run (const ObservationBox< ComputeTagsList, DataBoxType > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer) const
 
template<typename DbTags , typename Metavariables , typename ArrayIndex , typename ComponentPointer >
bool is_ready (const db::DataBox< DbTags > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index, const ComponentPointer) const
 
virtual bool needs_evolved_variables () const =0
 Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run. More...
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<size_t Dim, typename ObservationValueTag>
class Events::MonitorMemory< Dim, ObservationValueTag >

Event run on the DgElementArray that will monitor the memory usage of parallel components in megabytes.

Details

Given a list of parallel component names from Options, this will calculate the memory usage of each component and write it to disk in the reductions file under the /MemoryMonitors/ group. The name of each file is the pretty_type::name of each parallel component.

The parallel components available to monitor are the ones defined in the component_list type alias in the metavariables. In addition to these components, you can also monitor the size of the GlobalCache. Currently, you cannot monitor the size of the MutableGlobalCache. To see which parallel components are available to monitor, request to monitor an invalid parallel component ("Blah" for example) in the input file. An ERROR will occur and a list of the available components to monitor will be printed.

Note
Currently, the only Parallel::Algorithms::Array parallel component that can be monitored is the DgElementArray itself.

Member Function Documentation

◆ needs_evolved_variables()

template<size_t Dim, typename ObservationValueTag >
bool Events::MonitorMemory< Dim, ObservationValueTag >::needs_evolved_variables ( ) const
inlineoverridevirtual

Whether the event uses anything depending on the evolved_variables. If this returns false, anything depending on the evolved variables may have an incorrect value when the event is run.

Implements Event.

Member Data Documentation

◆ help

template<size_t Dim, typename ObservationValueTag >
constexpr Options::String Events::MonitorMemory< Dim, ObservationValueTag >::help
staticconstexpr
Initial value:
=
"Observe memory usage of parallel components."

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