SpECTRE  v2024.09.29
Parallel Namespace Reference

Functionality for parallelization. More...

Namespaces

namespace  InboxInserters
 Structs that have insert_into_inbox methods for commonly used cases.
 

Classes

class  ArrayComponentId
 An ID type that identifies both the parallel component and the index in the parallel component. More...
 
struct  ArrayIndex
 The array index used for indexing Chare Arrays, mostly an implementation detail. More...
 
class  Callback
 An abstract base class, whose derived class holds a function that can be invoked at a later time. The function is intended to be invoked only once. More...
 
class  DgElementArrayMember
 An element or multiple elements stored contiguously on a group or nodegroup. More...
 
class  DgElementArrayMember< Dim, Metavariables, tmpl::list< PhaseDepActionListsPack... >, SimpleTagsFromOptions >
 
class  DgElementArrayMemberBase
 The base class of a member of an DG element array/map on a nodegroup. More...
 
struct  DgElementCollection
 A collection of DG elements on a node. More...
 
class  DistributedObject< ParallelComponent, tmpl::list< PhaseDepActionListsPack... > >
 A distributed object (Charm++ Chare) that executes a series of Actions and is capable of sending and receiving data. Acts as an interface to Charm++. More...
 
struct  get_action_list_from_phase_dep_action_list
 (Lazy) metafunction to get the action list from a PhaseActions More...
 
struct  get_mutable_cache_tag
 
struct  get_parallel_component_from_proxy
 Retrieve a parallel component from its proxy. More...
 
struct  get_parallel_component_from_proxy< Proxy< ParallelComponent, Ts... > >
 
class  GlobalCache
 A Charm++ chare that caches global data once per Charm++ node. More...
 
struct  has_pup_member
 Check if T has a pup member function. More...
 
struct  is_array
 Check if T is a SpECTRE Array. More...
 
struct  is_array_element_proxy
 Check if T is a Charm++ proxy for an array chare element (from indexing into the array chare) More...
 
struct  is_array_proxy
 Check if T is a Charm++ proxy for an array chare (the entire array) More...
 
struct  is_bound_array
 Check if T is a ParallelComponent for a Charm++ bound array. More...
 
struct  is_bound_array< T, std::void_t< typename T::bind_to > >
 
struct  is_dg_element_array_member
 Is std::true_type if T is a Parallel::DgElementArrayMember or Parallel::DgElementArrayMemberBase, else is std::false_type. More...
 
struct  is_dg_element_collection
 Is std::true_type if T is a Parallel::DgElementCollection, else is std::false_type. More...
 
struct  is_group
 Check if T is a SpECTRE Group. More...
 
struct  is_group_proxy
 Check if T is a Charm++ proxy for a group chare. More...
 
struct  is_node_group_proxy
 Check if T is a Charm++ proxy for a node group chare. More...
 
struct  is_nodegroup
 Check if T is a SpECTRE Nodegroup. More...
 
struct  is_pupable
 Check if type T has operator| defined for Charm++ serialization. More...
 
struct  is_singleton
 Check if T is a SpECTRE Singleton. More...
 
class  Main
 The main function of a Charm++ executable. See the Parallelization documentation for an overview of Metavariables, Phases, and parallel components. More...
 
struct  MutableCacheTag
 
struct  MutexTag
 
class  NodeLock
 A typesafe wrapper for a lock for synchronization of shared resources on a given node, with safe creation, destruction, and serialization. More...
 
struct  NoSection
 Can be used instead of a Parallel::Section when no section is desired. More...
 
class  PerformAlgorithmCallback
 Wraps a call to perform_algorithm. More...
 
struct  PhaseActions
 List of all the actions to be executed in the specified phase. More...
 
class  PrinterChare
 Chare outputting all Parallel::printf results. More...
 
struct  ReductionData< ReductionDatum< Ts, InvokeCombines, InvokeFinals, InvokeFinalExtraArgsIndices >... >
 Used for reducing a possibly heterogeneous collection of types in a single reduction call. More...
 
struct  ReductionDatum
 The data to be reduced, and invokables to be called whenever two reduction messages are combined and after the reduction has been completed. More...
 
struct  ResourceInfo
 Holds resource info for all singletons and for avoiding placing array elements/singletons on the global proc 0. More...
 
struct  Section
 A subset of chares in a parallel component. More...
 
class  SimpleActionCallback
 Wraps a call to a simple action and its arguments. Can be invoked only once. More...
 
class  SimpleActionCallback< SimpleAction, Proxy >
 Wraps a call to a simple action without arguments. More...
 
struct  SingletonInfoHolder
 Holds resource info for a single singleton component. More...
 
struct  SingletonPack
 
struct  SingletonPack< tmpl::list< ParallelComponents... > >
 Holds options for a group of singleton components. More...
 
class  Spinlock
 A simple spinlock implemented in std::atomics. More...
 
class  StaticSpscQueue
 A static capacity runtime-sized single-producer single-consumer lockfree queue. More...
 
class  ThreadedActionCallback
 Wraps a call to a threaded action and its arguments. Can be invoked only once. More...
 
class  ThreadedActionCallback< ThreadedAction, Proxy >
 Wraps a call to a threaded action without arguments. More...
 

Typedefs

using iterable_action_return_t = std::tuple< AlgorithmExecution, std::optional< size_t > >
 Return type for iterable actions. The std::optional can be used to specify the index of the action to be called next in the phase dependent action list. Passing std::nullopt will execute the next action in the list.
 
template<typename PhaseDepActionList >
using TransformPhaseDependentActionListForNodegroup = tmpl::flatten< tmpl::transform< PhaseDepActionList, detail::TransformPdalForNodegroup< tmpl::_1 > > >
 Transforms the PhaseDepActionList (phase dependent action list/PDAL) from one used for a evolution::DgElementArray to that for Parallel::DgElementCollection
 
using ArrayIndex1D = ArrayIndex< CkIndex1D >
 
using ArrayIndex2D = ArrayIndex< CkIndex2D >
 
using ArrayIndex3D = ArrayIndex< CkIndex3D >
 
using ArrayIndex4D = ArrayIndex< CkIndex4D >
 
using ArrayIndex5D = ArrayIndex< CkIndex5D >
 
using ArrayIndex6D = ArrayIndex< CkIndex6D >
 
template<class ActionsList >
using get_inbox_tags = tmpl::remove_duplicates< tmpl::join< tmpl::transform< ActionsList, detail::get_inbox_tags_from_action< tmpl::_1 > > > >
 Given a list of Actions, get a list of the unique inbox tags.
 
template<class ActionsList >
using get_const_global_cache_tags_from_actions = tmpl::remove_duplicates< tmpl::join< tmpl::transform< ActionsList, detail::get_const_global_cache_tags_from_parallel_struct< tmpl::_1 > > > >
 Given a list of Actions, get a list of the unique tags specified in the actions' const_global_cache_tags aliases.
 
template<class ActionsList >
using get_mutable_global_cache_tags_from_actions = tmpl::remove_duplicates< tmpl::join< tmpl::transform< ActionsList, detail::get_mutable_global_cache_tags_from_parallel_struct< tmpl::_1 > > > >
 Given a list of Actions, get a list of the unique tags specified in the actions' mutable_global_cache_tags aliases.
 
template<typename Metavariables >
using get_const_global_cache_tags = tmpl::remove_duplicates< tmpl::flatten< tmpl::list< typename detail::get_const_global_cache_tags_from_parallel_struct< Metavariables >::type, tmpl::transform< typename Metavariables::component_list, detail::get_const_global_cache_tags_from_parallel_struct< tmpl::_1 > >, tmpl::transform< typename Metavariables::component_list, detail::get_const_global_cache_tags_from_component< tmpl::_1 > > > > >
 Given the metavariables, get a list of the unique tags that will specify the items in the GlobalCache.
 
template<typename Metavariables >
using get_mutable_global_cache_tags = 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 > > > > >
 Given the metavariables, get a list of the unique tags that will specify the mutable items in the GlobalCache.
 
template<typename Metavariables >
using get_mutable_global_cache_tag_storage = tmpl::transform< get_mutable_global_cache_tags< Metavariables >, get_mutable_cache_tag< tmpl::_1 > >
 
template<typename PhaseDepActionList >
using get_initialization_actions_list = tmpl::flatten< tmpl::transform< PhaseDepActionList, detail::get_initialization_actions_list< tmpl::_1 > > >
 Given the phase dependent action list, return the list of actions in the Initialization phase (or an empty list if the Initialization phase is absent from the phase dependent action list)
 
template<typename InitializationActionsList >
using get_simple_tags_from_options = tmpl::remove_duplicates< tmpl::flatten< tmpl::transform< InitializationActionsList, detail::get_simple_tags_from_options_from_action< tmpl::_1 > > > >
 Given a list of initialization actions, returns a list of the unique simple_tags_from_options for all the actions.
 
template<typename SimpleTagsList , typename Metavariables >
using get_option_tags = tmpl::remove_duplicates< tmpl::flatten< tmpl::transform< SimpleTagsList, tmpl::bind< detail::get_option_tags_from_simple_tag< Metavariables >::template f, tmpl::_1 > > > >
 Given a list of simple tags, returns a list of the unique option tags required to construct them.
 

Enumerations

enum class  AlgorithmExecution { Continue , Retry , Pause , Halt }
 The possible options for altering the current execution of the algorithm, used in the return type of iterable actions. More...
 
enum class  ExitCode : int { Complete = 0 , Abort = 1 , ContinueFromCheckpoint = 2 }
 Exit code of an executable. More...
 
enum class  Phase {
  Phase::AdjustDomain , Phase::BuildMatrix , Phase::CheckDomain , Phase::Cleanup ,
  Phase::EvaluateAmrCriteria , Phase::Evolve , Phase::Execute , Phase::Exit ,
  Phase::ImportInitialData , Phase::Initialization , Phase::InitializeInitialDataDependentQuantities , Phase::InitializeTimeStepperHistory ,
  Phase::LoadBalancing , Phase::PostFailureCleanup , Phase::Register , Phase::RegisterWithElementDataReader ,
  Phase::Solve , Phase::Testing , Phase::WriteCheckpoint
}
 The possible phases of an executable. More...
 

Functions

bool operator== (const ArrayComponentId &lhs, const ArrayComponentId &rhs)
 
bool operator!= (const ArrayComponentId &lhs, const ArrayComponentId &rhs)
 
std::ostreamoperator<< (std::ostream &os, const ArrayComponentId &array_component_id)
 
template<typename ParallelComponent , typename ArrayIndexType >
ArrayComponentId make_array_component_id (const ArrayIndexType &array_index)
 A convenience function that will make an ArrayComponentId from the templated ParallelComponent and the passed in array_index.
 
template<typename F , size_t Dim, typename Metavariables >
void create_elements_using_distribution (const F &func, const std::optional< domain::ElementWeight > &element_weight, const std::vector< Block< Dim > > &blocks, const std::vector< std::array< size_t, Dim > > &initial_extents, const std::vector< std::array< size_t, Dim > > &initial_refinement_levels, const Spectral::Quadrature quadrature, const std::unordered_set< size_t > &procs_to_ignore, const size_t number_of_procs, const size_t number_of_nodes, const size_t num_of_procs_to_use, const Parallel::GlobalCache< Metavariables > &local_cache, const bool print_diagnostics)
 Creates elements using a chosen distribution. More...
 
template<typename Metavariables , typename... Tags, typename... OptionTags>
tuples::TaggedTuple< Tags... > create_from_options (const tuples::TaggedTuple< OptionTags... > &options, tmpl::list< Tags... >)
 Given a list of tags and a tagged tuple containing items created from input options, return a tagged tuple of items constructed by calls to create_from_options for each tag in the list.
 
template<typename ParallelComponent , typename PhaseDepActionLists >
std::ostreamoperator<< (std::ostream &os, const DistributedObject< ParallelComponent, PhaseDepActionLists > &algorithm_impl)
 
template<typename ParallelComponent , typename SectionIdTag , typename DbTagsList >
auto & get_section (const gsl::not_null< db::DataBox< DbTagsList > * > box)
 Retrieve the section that the element belongs to, or Parallel::no_section() if SectionIdTag is void. More...
 
template<typename T , typename DistribObject >
number_of_procs (const DistribObject &distributed_object)
 Number of processing elements.
 
template<typename T , typename DistribObject >
my_proc (const DistribObject &distributed_object)
 Index of my processing element.
 
template<typename T , typename DistribObject >
number_of_nodes (const DistribObject &distributed_object)
 Number of nodes.
 
template<typename T , typename DistribObject >
my_node (const DistribObject &distributed_object)
 Index of my node.
 
template<typename T , typename R , typename DistribObject >
procs_on_node (const R node_index, const DistribObject &distributed_object)
 Number of processing elements on the given node.
 
template<typename T , typename DistribObject >
my_local_rank (const DistribObject &distributed_object)
 The local index of my processing element on my node. This is in the interval 0, ..., procs_on_node(my_node()) - 1.
 
template<typename T , typename R , typename DistribObject >
first_proc_on_node (const R node_index, const DistribObject &distributed_object)
 Index of first processing element on the given node.
 
template<typename T , typename R , typename DistribObject >
node_of (const R proc_index, const DistribObject &distributed_object)
 Index of the node for the given processing element.
 
template<typename T , typename R , typename DistribObject >
local_rank_of (const R proc_index, const DistribObject &distributed_object)
 The local index for the given processing element on its node.
 
template<typename ReceiveTag , typename Proxy , typename ReceiveDataType >
void receive_data (Proxy &&proxy, typename ReceiveTag::temporal_id temporal_id, ReceiveDataType &&receive_data, const bool enable_if_disabled=false)
 Send the data args... to the algorithm running on proxy, and tag the message with the identifier temporal_id. More...
 
template<typename ReceiveTag , typename Proxy , typename MessageType >
void receive_data (Proxy &&proxy, MessageType *message)
 Send a pointer message to the algorithm running on proxy. More...
 
template<typename Action , typename Proxy , typename... Args>
decltype(auto) local_synchronous_action (Proxy &&proxy, Args &&... args)
 Invoke a local synchronous action on proxy
 
template<typename Proxy >
auto * local (Proxy &&proxy)
 Wrapper for calling Charm++'s .ckLocal() on a proxy. More...
 
template<typename Proxy >
auto * local_branch (Proxy &&proxy)
 Wrapper for calling Charm++'s .ckLocalBranch() on a proxy. More...
 
template<typename InboxTag , typename... InboxTypes>
std::string output_inbox (const tuples::TaggedTuple< InboxTypes... > &inboxes, const size_t indent_pad)
 Returns a string of the contents of the inbox. More...
 
std::vector< Phaseknown_phases ()
 
std::ostreamoperator<< (std::ostream &os, const Phase &phase)
 Output operator for a Phase.
 
template<typename... Args>
void printf (const std::string &format, Args &&... args)
 Print an atomic message to stdout with C printf usage. More...
 
template<typename... Args>
void printf_error (const std::string &format, Args &&... args)
 Print an atomic message to stderr with C printf usage. More...
 
template<typename... Args>
void fprintf (const std::string &file, const std::string &format, Args &&... args)
 Print an atomic message to a file with C printf usage. More...
 
template<class Action , class SenderProxy , class TargetProxy , class... Ts, class SectionType = NoSection>
void contribute_to_reduction (ReductionData< Ts... > reduction_data, const SenderProxy &sender_component, const TargetProxy &target_component, const gsl::not_null< SectionType * > section=&no_section())
 Perform a reduction from the sender_component (typically your own parallel component) to the target_component, performing the Action upon receiving the reduction. More...
 
template<typename ParallelComponent >
bool operator== (const SingletonInfoHolder< ParallelComponent > &lhs, const SingletonInfoHolder< ParallelComponent > &rhs)
 
template<typename ParallelComponent >
bool operator!= (const SingletonInfoHolder< ParallelComponent > &lhs, const SingletonInfoHolder< ParallelComponent > &rhs)
 
template<typename... Components>
bool operator== (const SingletonPack< tmpl::list< Components... > > &lhs, const SingletonPack< tmpl::list< Components... > > &rhs)
 
template<typename... Components>
bool operator!= (const SingletonPack< tmpl::list< Components... > > &lhs, const SingletonPack< tmpl::list< Components... > > &rhs)
 
template<typename Metavars >
bool operator== (const ResourceInfo< Metavars > &lhs, const ResourceInfo< Metavars > &rhs)
 
template<typename Metavars >
bool operator!= (const ResourceInfo< Metavars > &lhs, const ResourceInfo< Metavars > &rhs)
 
template<typename ParallelComponent , typename DbTagList , typename Metavariables , typename ArrayIndex >
void deregister_element (db::DataBox< DbTagList > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index)
 (De)register an array element for specified actions More...
 
template<typename ParallelComponent , typename DbTagList , typename Metavariables , typename ArrayIndex >
void register_element (db::DataBox< DbTagList > &box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index)
 (De)register an array element for specified actions More...
 
template<typename ParallelComponentTag , typename Metavariables >
auto get_parallel_component (GlobalCache< Metavariables > &cache) -> Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag > > &
 Access the Charm++ proxy associated with a ParallelComponent. More...
 
template<typename ParallelComponentTag , typename Metavariables >
auto get_parallel_component (const GlobalCache< Metavariables > &cache) -> const Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag > > &
 Access the Charm++ proxy associated with a ParallelComponent. More...
 
template<typename GlobalCacheTag , typename Metavariables >
auto get (const GlobalCache< Metavariables > &cache) -> const GlobalCache_detail::type_for_get< GlobalCacheTag, Metavariables > &
 Access data in the cache. More...
 
template<typename GlobalCacheTag , typename Function , typename Metavariables >
bool mutable_cache_item_is_ready (GlobalCache< Metavariables > &cache, const Parallel::ArrayComponentId &array_component_id, const Function &function)
 Returns whether the object identified by GlobalCacheTag is ready to be accessed by get. More...
 
template<typename GlobalCacheTag , typename Function , typename Metavariables , typename... Args>
void mutate (GlobalCache< Metavariables > &cache, Args &&... args)
 Mutates non-const data in the cache, by calling Function::apply() More...
 
template<typename Action , typename Proxy >
void simple_action (Proxy &&proxy)
 Invoke a simple action on proxy
 
template<typename Action , typename Proxy , typename Arg0 , typename... Args>
void simple_action (Proxy &&proxy, Arg0 &&arg0, Args &&... args)
 Invoke a simple action on proxy
 
template<typename Action , typename Proxy >
void threaded_action (Proxy &&proxy)
 Invoke a threaded action on proxy, where the proxy must be a nodegroup.
 
template<typename Action , typename Proxy , typename Arg0 , typename... Args>
void threaded_action (Proxy &&proxy, Arg0 &&arg0, Args &&... args)
 Invoke a threaded action on proxy, where the proxy must be a nodegroup.
 
template<typename SenderComponent , typename ArrayIndex , typename Metavariables , class... Ts>
void contribute_to_phase_change_reduction (tuples::TaggedTuple< Ts... > data_for_reduction, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index)
 Send data from a parallel component to the Main chare for making phase-change decisions. More...
 
template<typename SenderComponent , typename Metavariables , class... Ts>
void contribute_to_phase_change_reduction (tuples::TaggedTuple< Ts... > data_for_reduction, Parallel::GlobalCache< Metavariables > &cache)
 Send data from a parallel component to the Main chare for making phase-change decisions. More...
 
NoSectionno_section ()
 

Variables

template<class T >
constexpr bool is_dg_element_array_member_v
 Is true if T is a Parallel::DgElementArrayMember or Parallel::DgElementArrayMemberBase, else is false. More...
 
template<class T >
constexpr bool is_dg_element_collection_v = is_dg_element_collection<T>::value
 Is true if T is a Parallel::DgElementCollection, else is false.
 
template<typename Metavariables , typename Tag >
constexpr bool is_in_const_global_cache
 Check whether a tag is retrievable from the const portion of the global cache. More...
 
template<typename Metavariables , typename Tag >
constexpr bool is_in_mutable_global_cache
 Check whether a tag is retrievable from the mutable portion of the global cache. More...
 
template<typename Metavariables , typename Tag >
constexpr bool is_in_global_cache
 Check whether a tag is retrievable from the global cache. More...
 
CProxy_PrinterChare printer_chare
 
bool printer_chare_is_set
 
template<typename T >
constexpr bool is_array_v = is_array<T>::value
 
template<typename T >
constexpr bool is_singleton_v = is_singleton<T>::value
 
template<typename T >
constexpr bool is_group_v = is_group<T>::value
 
template<typename T >
constexpr bool is_nodegroup_v = is_nodegroup<T>::value
 
template<typename T >
using has_pup_member_t = typename has_pup_member< T >::type
 
template<typename T >
constexpr bool has_pup_member_v = has_pup_member<T>::value
 
template<typename T >
using is_pupable_t = typename is_pupable< T >::type
 
template<typename T >
constexpr bool is_pupable_v = is_pupable<T>::value
 

Detailed Description

Functionality for parallelization.

The functions in namespace Parallel that return information on nodes and cores are templated on DistribObject. Actions should use these functions rather than the raw charm++ versions (in the sys namespace in Utilities/System/ParallelInfo.hpp) so that the mocking framework will see the mocked cores and nodes.

Typedef Documentation

◆ has_pup_member_t

template<typename T >
using Parallel::has_pup_member_t = typedef typename has_pup_member<T>::type
See also
has_pup_member

◆ is_pupable_t

template<typename T >
using Parallel::is_pupable_t = typedef typename is_pupable<T>::type
See also
is_pupable

Enumeration Type Documentation

◆ AlgorithmExecution

enum class Parallel::AlgorithmExecution
strong

The possible options for altering the current execution of the algorithm, used in the return type of iterable actions.

Enumerator
Continue 

Continue executing iterable actions.

Retry 

Temporarily stop executing iterable actions, but try the same action again after receiving data from other distributed objects.

Pause 

Stop the execution of iterable actions, but allow entry methods (communication) to explicitly request restarting the execution.

Halt 

Stop the execution of iterable actions and do not allow their execution until after a phase change. Simple actions will still execute.

◆ ExitCode

enum class Parallel::ExitCode : int
strong

Exit code of an executable.

Warning
Don't change the integer values of the enum cases unless you have a very good reason to do so. The integer values are used by external code, so this is a public interface that should remain stable.
Enumerator
Complete 

Program is complete.

Abort 

Program aborted because of an error.

ContinueFromCheckpoint 

Program is incomplete and should be continued from the last checkpoint.

Function Documentation

◆ contribute_to_phase_change_reduction() [1/2]

template<typename SenderComponent , typename Metavariables , class... Ts>
void Parallel::contribute_to_phase_change_reduction ( tuples::TaggedTuple< Ts... >  data_for_reduction,
Parallel::GlobalCache< Metavariables > &  cache 
)

Send data from a parallel component to the Main chare for making phase-change decisions.

This function is distinct from Parallel::contribute_to_reduction because this function contributes reduction data to the Main chare via the entry method phase_change_reduction. This must be done because the entry method must alter member data specific to the Main chare, and the Main chare cannot execute actions like most SpECTRE parallel components. For all cases other than sending phase-change decision data to the Main chare, you should use Parallel::contribute_to_reduction.

◆ contribute_to_phase_change_reduction() [2/2]

template<typename SenderComponent , typename ArrayIndex , typename Metavariables , class... Ts>
void Parallel::contribute_to_phase_change_reduction ( tuples::TaggedTuple< Ts... >  data_for_reduction,
Parallel::GlobalCache< Metavariables > &  cache,
const ArrayIndex array_index 
)

Send data from a parallel component to the Main chare for making phase-change decisions.

This function is distinct from Parallel::contribute_to_reduction because this function contributes reduction data to the Main chare via the entry method phase_change_reduction. This must be done because the entry method must alter member data specific to the Main chare, and the Main chare cannot execute actions like most SpECTRE parallel components. For all cases other than sending phase-change decision data to the Main chare, you should use Parallel::contribute_to_reduction.

◆ create_elements_using_distribution()

template<typename F , size_t Dim, typename Metavariables >
void Parallel::create_elements_using_distribution ( const F &  func,
const std::optional< domain::ElementWeight > &  element_weight,
const std::vector< Block< Dim > > &  blocks,
const std::vector< std::array< size_t, Dim > > &  initial_extents,
const std::vector< std::array< size_t, Dim > > &  initial_refinement_levels,
const Spectral::Quadrature  quadrature,
const std::unordered_set< size_t > &  procs_to_ignore,
const size_t  number_of_procs,
const size_t  number_of_nodes,
const size_t  num_of_procs_to_use,
const Parallel::GlobalCache< Metavariables > &  local_cache,
const bool  print_diagnostics 
)

Creates elements using a chosen distribution.

The func is called with (element_id, target_proc, target_node) allowing the func to insert the element with element_id on the target processor and node.

◆ deregister_element()

template<typename ParallelComponent , typename DbTagList , typename Metavariables , typename ArrayIndex >
void Parallel::deregister_element ( db::DataBox< DbTagList > &  box,
Parallel::GlobalCache< Metavariables > &  cache,
const ArrayIndex array_index 
)

(De)register an array element for specified actions

Details

Array elements are (de)registered with actions on components that need to know which elements are contributing data before the action can be executed. If array elements are migrated (e.g. during load balancing), or are created/destroyed (e.g. during adaptive mesh refinement), these functions must be called in order to (un)register (old) new elements. The list of registration actions is obtained from Metavariables::registration::element_registrars.

See also
Parallel::protocols::RegistrationMetavariables
Parallel::protocols::ElementRegistrar

◆ get_section()

template<typename ParallelComponent , typename SectionIdTag , typename DbTagsList >
auto & Parallel::get_section ( const gsl::not_null< db::DataBox< DbTagsList > * >  box)

Retrieve the section that the element belongs to, or Parallel::no_section() if SectionIdTag is void.

This function is useful to support sections in parallel algorithms. Specify the SectionIdTag template parameter to retrieve the associated section, or set it to void when the parallel algorithm runs over all elements of the parallel component. See Parallel::Section for details on sections.

Only call this function on elements that are part of a section. In case not all elements are part of a section with the SectionIdTag, make sure to skip those elements before calling this function.

◆ local()

template<typename Proxy >
auto * Parallel::local ( Proxy &&  proxy)

Wrapper for calling Charm++'s .ckLocal() on a proxy.

The Proxy must be to a Charm++ array chare (implementing a singleton design pattern using a single-element array) or to a Charm++ array element chare (i.e., the proxy obtained by indexing into a Charm++ array chare).

The function returns a pointer to the chare if it exists on the local processor, and NULL if it does not. See the Charm++ documentation. It is the responsibility of the user to check the result pointer is valid.

◆ local_branch()

template<typename Proxy >
auto * Parallel::local_branch ( Proxy &&  proxy)

Wrapper for calling Charm++'s .ckLocalBranch() on a proxy.

The Proxy must be to a Charm++ group chare or nodegroup chare.

The function returns a pointer to the local group/nodegroup chare.

◆ output_inbox()

template<typename InboxTag , typename... InboxTypes>
std::string Parallel::output_inbox ( const tuples::TaggedTuple< InboxTypes... > &  inboxes,
const size_t  indent_pad 
)

Returns a string of the contents of the inbox.

Calls a static output_inbox member function of the InboxTag. If the inbox tag doesn't have the output_inbox function, then this function can't be called with that inbox (a static_assert will fail).

Note
It's up to the individual inbox what to include in the string. Data may or may not be included
Template Parameters
InboxTagInbox tag with an output_inbox member function
InboxTypesTypes of all inboxes (deduced)
Parameters
inboxesAll inboxes
indent_padNumber of empty spaces to pad the message with incase indenting is needed.

Returns: std::string The contents of the inbox

◆ register_element()

template<typename ParallelComponent , typename DbTagList , typename Metavariables , typename ArrayIndex >
void Parallel::register_element ( db::DataBox< DbTagList > &  box,
Parallel::GlobalCache< Metavariables > &  cache,
const ArrayIndex array_index 
)

(De)register an array element for specified actions

Details

Array elements are (de)registered with actions on components that need to know which elements are contributing data before the action can be executed. If array elements are migrated (e.g. during load balancing), or are created/destroyed (e.g. during adaptive mesh refinement), these functions must be called in order to (un)register (old) new elements. The list of registration actions is obtained from Metavariables::registration::element_registrars.

See also
Parallel::protocols::RegistrationMetavariables
Parallel::protocols::ElementRegistrar

Variable Documentation

◆ has_pup_member_v

template<typename T >
constexpr bool Parallel::has_pup_member_v = has_pup_member<T>::value
constexpr
See also
has_pup_member

◆ is_dg_element_array_member_v

template<class T >
constexpr bool Parallel::is_dg_element_array_member_v
constexpr
Initial value:
=
Is std::true_type if T is a Parallel::DgElementArrayMember or Parallel::DgElementArrayMemberBase,...
Definition: IsDgElementArrayMember.hpp:23

Is true if T is a Parallel::DgElementArrayMember or Parallel::DgElementArrayMemberBase, else is false.

◆ is_pupable_v

template<typename T >
constexpr bool Parallel::is_pupable_v = is_pupable<T>::value
constexpr
See also
is_pupable