SpECTRE  v2024.04.12
Parallel::Main< Metavariables > Class Template Reference

The main function of a Charm++ executable. See the Parallelization documentation for an overview of Metavariables, Phases, and parallel components. More...

#include <Main.hpp>

Public Types

using component_list = typename Metavariables::component_list
 
using const_global_cache_tags = get_const_global_cache_tags< Metavariables >
 
using mutable_global_cache_tags = get_mutable_global_cache_tags< Metavariables >
 
using phase_change_tags_and_combines_list = PhaseControl::get_phase_change_tags< Metavariables >
 

Public Member Functions

 Main (CkArgMsg *msg)
 
 Main (CkMigrateMessage *msg)
 
void pup (PUP::er &p) override
 
void allocate_remaining_components_and_execute_initialization_phase ()
 Allocate singleton components and the initial elements of array components, then execute the initialization phase on each component.
 
void execute_next_phase ()
 Determine the next phase of the simulation and execute it.
 
void start_load_balance ()
 Place the Charm++ call that starts load balancing. More...
 
void start_write_checkpoint ()
 Place the Charm++ call that starts writing a checkpoint Reset the checkpoint counter to zero if the checkpoints directory does not exist (this happens when the simulation continues in a new segment). More...
 
template<typename InvokeCombine , typename... Tags>
void phase_change_reduction (ReductionData< ReductionDatum< tuples::TaggedTuple< Tags... >, InvokeCombine, funcl::Identity, std::index_sequence<> > > reduction_data)
 Reduction target for data used in phase change decisions. More...
 
void add_exception_message (std::string exception_message)
 Add an exception to the list of exceptions. Upon a phase change we print all the received exceptions and exit. More...
 
void did_all_elements_terminate (bool all_elements_terminated)
 A reduction target used to determine if all the elements of the array, group, nodegroup, or singleton parallel components terminated successfully. More...
 
void post_deadlock_analysis_termination ()
 Prints exit info and stops the executable with failure if a deadlock was detected.
 

Detailed Description

template<typename Metavariables>
class Parallel::Main< Metavariables >

The main function of a Charm++ executable. See the Parallelization documentation for an overview of Metavariables, Phases, and parallel components.

Constructor & Destructor Documentation

◆ Main()

template<typename Metavariables >
Parallel::Main< Metavariables >::Main ( CkArgMsg *  msg)
explicit

Member Function Documentation

◆ add_exception_message()

template<typename Metavariables >
void Parallel::Main< Metavariables >::add_exception_message ( std::string  exception_message)

Add an exception to the list of exceptions. Upon a phase change we print all the received exceptions and exit.

Upon receiving an exception all algorithms are terminated to guarantee quiescence occurs soon after the exception is reported.

◆ did_all_elements_terminate()

template<typename Metavariables >
void Parallel::Main< Metavariables >::did_all_elements_terminate ( bool  all_elements_terminated)

A reduction target used to determine if all the elements of the array, group, nodegroup, or singleton parallel components terminated successfully.

This allows detecting deadlocks in iterable actions, but not simple or reduction action.

◆ phase_change_reduction()

template<typename Metavariables >
template<typename InvokeCombine , typename... Tags>
void Parallel::Main< Metavariables >::phase_change_reduction ( ReductionData< ReductionDatum< tuples::TaggedTuple< Tags... >, InvokeCombine, funcl::Identity, std::index_sequence<> > >  reduction_data)

Reduction target for data used in phase change decisions.

It is required that the Parallel::ReductionData holds a single tuples::TaggedTuple.

◆ start_load_balance()

template<typename Metavariables >
void Parallel::Main< Metavariables >::start_load_balance

Place the Charm++ call that starts load balancing.

Details

This call is wrapped within an entry method so that it may be used as the callback after a quiescence detection.

◆ start_write_checkpoint()

template<typename Metavariables >
void Parallel::Main< Metavariables >::start_write_checkpoint

Place the Charm++ call that starts writing a checkpoint Reset the checkpoint counter to zero if the checkpoints directory does not exist (this happens when the simulation continues in a new segment).

Details

This call is wrapped within an entry method so that it may be used as the callback after a quiescence detection.


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