SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
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
using phase_change_tags_and_combines_list

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.
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).
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.
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.
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.
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.

Member Typedef Documentation

◆ mutable_global_cache_tags

template<typename Metavariables>
using Parallel::Main< Metavariables >::mutable_global_cache_tags
Initial value:
tmpl::remove_duplicates< tmpl::flatten< tmpl::list< typename detail::get_mutable_global_cache_tags_from_parallel_struct< Metavariables >::type, tmpl::transform< typename Metavariables::component_list, detail::get_mutable_global_cache_tags_from_parallel_struct< tmpl::_1 > >, tmpl::transform< typename Metavariables::component_list, detail::get_mutable_global_cache_tags_from_component< tmpl::_1 > > > > > get_mutable_global_cache_tags
Given the metavariables, get a list of the unique tags that will specify the mutable items in the Glo...
Definition ParallelComponentHelpers.hpp:144

◆ phase_change_tags_and_combines_list

template<typename Metavariables>
using Parallel::Main< Metavariables >::phase_change_tags_and_combines_list
Initial value:
tmpl::push_back< tmpl::flatten< tmpl::transform< typename detail::phase_change_derived_classes< Metavariables >::type, detail::get_phase_change_tags_and_combines< tmpl::_1 > > >, TagsAndCombines::UsePhaseChangeArbitration, Parallel::Tags::ExitCode > get_phase_change_tags
Metafunction for determining the merged collection of tags in phase_change_tags_and_combiness from al...
Definition PhaseControlTags.hpp:130

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:
  • src/Parallel/Main.hpp