SpECTRE  v2024.02.05
Parallelization

Functions, classes and documentation related to parallelization and Charm++. More...

Namespaces

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

Classes

class  AlgorithmArray< ParallelComponent, SpectreArrayIndex >
 A Spectre algorithm object that wraps a charm++ array chare. More...
 
struct  Parallel::Algorithms::Array
 A struct that stores the charm++ types relevant for a particular array component. More...
 
class  AlgorithmGroup< ParallelComponent, SpectreArrayIndex >
 A Spectre algorithm object that wraps a charm++ group chare. More...
 
struct  Parallel::Algorithms::Group
 A struct that stores the charm++ types relevant for a particular group component. More...
 
class  AlgorithmNodegroup< ParallelComponent, SpectreArrayIndex >
 A Spectre algorithm object that wraps a charm++ nodegroup chare. More...
 
struct  Parallel::Algorithms::Nodegroup
 A struct that stores the charm++ types relevant for a particular nodegroup component. More...
 
class  AlgorithmSingleton< ParallelComponent, SpectreArrayIndex >
 A Spectre algorithm object that wraps a single element charm++ array chare. More...
 
struct  Parallel::Algorithms::Singleton
 A struct that stores the charm++ types relevant for a particular singleton component. More...
 
struct  Parallel::ArrayIndex< Index >
 The array index used for indexing Chare Arrays, mostly an implementation detail. 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...
 
class  Parallel::GlobalCache< Metavariables >
 A Charm++ chare that caches global data once per Charm++ node. More...
 
struct  Parallel::Tags::GlobalCache
 Tag to retrieve the Parallel::GlobalCache from the DataBox. More...
 
struct  Parallel::Tags::FromGlobalCache< CacheTag >
 Tag used to retrieve data from the Parallel::GlobalCache. This is the recommended way for compute tags to retrieve data out of the global cache. More...
 
class  Parallel::Main< Metavariables >
 The main function of a Charm++ executable. See the Parallelization documentation for an overview of Metavariables, Phases, and parallel components. More...
 
class  Parallel::NodeLock
 A typesafe wrapper for a lock for synchronization of shared resources on a given node, with safe creation, destruction, and serialization. More...
 
struct  Parallel::PhaseActions< Phase, ActionsList >
 List of all the actions to be executed in the specified phase. More...
 
struct  Parallel::get_action_list_from_phase_dep_action_list< PhaseDepActionList >
 (Lazy) metafunction to get the action list from a PhaseActions More...
 
struct  Parallel::ReductionDatum< T, InvokeCombine, InvokeFinal, InvokeFinalExtraArgsIndices >
 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  Parallel::ReductionData< ReductionDatum< Ts, InvokeCombines, InvokeFinals, InvokeFinalExtraArgsIndices >... >
 Used for reducing a possibly heterogeneous collection of types in a single reduction call. More...
 
struct  Parallel::SingletonInfoHolder< Component >
 Holds resource info for a single singleton component. More...
 
struct  Parallel::SingletonPack< tmpl::list< ParallelComponents... > >
 Holds options for a group of singleton components. More...
 
struct  Parallel::ResourceInfo< Metavariables >
 Holds resource info for all singletons and for avoiding placing array elements/singletons on the global proc 0. More...
 
struct  Parallel::Tags::ArrayIndex
 Tag to retrieve the ArrayIndex from the DataBox. More...
 
struct  Parallel::Tags::Metavariables
 Tag to retrieve the Metavariables from the DataBox. More...
 
struct  Parallel::OptionTags::ResourceInfo< Metavariables >
 Options group for resource allocation. More...
 
struct  Parallel::Tags::ResourceInfo< Metavariables >
 Tag to retrieve the ResourceInfo. More...
 
struct  Parallel::is_array_proxy< T >
 Check if T is a Charm++ proxy for an array chare (the entire array) More...
 
struct  Parallel::is_array_element_proxy< T >
 Check if T is a Charm++ proxy for an array chare element (from indexing into the array chare) More...
 
struct  Parallel::is_group_proxy< T >
 Check if T is a Charm++ proxy for a group chare. More...
 
struct  Parallel::is_node_group_proxy< T >
 Check if T is a Charm++ proxy for a node group chare. More...
 
struct  Parallel::is_bound_array< T, typename >
 Check if T is a ParallelComponent for a Charm++ bound array. More...
 
struct  Parallel::is_array< T >
 Check if T is a SpECTRE Array. More...
 
struct  Parallel::is_singleton< T >
 Check if T is a SpECTRE Singleton. More...
 
struct  Parallel::is_group< T >
 Check if T is a SpECTRE Group. More...
 
struct  Parallel::is_nodegroup< T >
 Check if T is a SpECTRE Nodegroup. More...
 
struct  Parallel::get_parallel_component_from_proxy< Proxy >
 Retrieve a parallel component from its proxy. More...
 
struct  Parallel::has_pup_member< T, typename >
 Check if T has a pup member function. More...
 
struct  Parallel::is_pupable< T, U >
 Check if type T has operator| defined for Charm++ serialization. More...
 

Macros

#define WRAPPED_PUPable_decl_template(className)    PUPable_decl_template(SINGLE_ARG(className))
 Mark derived classes as serializable. More...
 
#define WRAPPED_PUPable_decl_base_template(baseClassName, className)
 Mark derived template classes as serializable. More...
 

Typedefs

template<class ActionsList >
using Parallel::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 Parallel::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 Parallel::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 Parallel::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 Parallel::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 PhaseDepActionList >
using Parallel::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 Parallel::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 Parallel::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  Parallel::Phase {
  Parallel::Phase::AdjustDomain , Parallel::Phase::BuildMatrix , Parallel::Phase::CheckDomain , Parallel::Phase::Cleanup ,
  Parallel::Phase::EvaluateAmrCriteria , Parallel::Phase::Evolve , Parallel::Phase::Execute , Parallel::Phase::Exit ,
  Parallel::Phase::ImportInitialData , Parallel::Phase::Initialization , Parallel::Phase::InitializeInitialDataDependentQuantities , Parallel::Phase::InitializeTimeStepperHistory ,
  Parallel::Phase::LoadBalancing , Parallel::Phase::PostFailureCleanup , Parallel::Phase::Register , Parallel::Phase::RegisterWithElementDataReader ,
  Parallel::Phase::Solve , Parallel::Phase::Testing , Parallel::Phase::WriteCheckpoint
}
 The possible phases of an executable. More...
 

Functions

template<typename Metavariables , typename... Tags, typename... OptionTags>
tuples::TaggedTuple< Tags... > Parallel::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 T , typename DistribObject >
Parallel::number_of_procs (const DistribObject &distributed_object)
 Number of processing elements.
 
template<typename T , typename DistribObject >
Parallel::my_proc (const DistribObject &distributed_object)
 Index of my processing element.
 
template<typename T , typename DistribObject >
Parallel::number_of_nodes (const DistribObject &distributed_object)
 Number of nodes.
 
template<typename T , typename DistribObject >
Parallel::my_node (const DistribObject &distributed_object)
 Index of my node.
 
template<typename T , typename R , typename DistribObject >
Parallel::procs_on_node (const R node_index, const DistribObject &distributed_object)
 Number of processing elements on the given node.
 
template<typename T , typename DistribObject >
Parallel::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 >
Parallel::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 >
Parallel::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 >
Parallel::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 Parallel::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 Parallel::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) Parallel::local_synchronous_action (Proxy &&proxy, Args &&... args)
 Invoke a local synchronous action on proxy
 
template<typename... Args>
void Parallel::printf (const std::string &format, Args &&... args)
 Print an atomic message to stdout with C printf usage. More...
 
template<typename... Args>
void Parallel::printf_error (const std::string &format, Args &&... args)
 Print an atomic message to stderr with C printf usage. More...
 
template<class Action , class SenderProxy , class TargetProxy , class... Ts, class SectionType = NoSection>
void Parallel::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 K , typename T , typename C >
void pup_override (PUP::er &p, std::map< K, T, C > &m)
 Temporary serialization function for a std::map with a comparator to circumvent a charm bug.
 
template<typename T >
std::vector< char > serialize (const T &obj)
 Serialize an object using PUP. More...
 
template<typename T >
deserialize (const void *const data)
 Deserialize an object using PUP. More...
 
template<typename T >
void deserialize (const gsl::not_null< T * > result, const void *const data)
 Deserialize an object using PUP. More...
 
template<typename T >
size_t size_of_object_in_bytes (const T &obj)
 Returns the size of an object in bytes.
 

Variables

template<typename Metavariables , typename Tag >
constexpr bool Parallel::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 Parallel::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 Parallel::is_in_global_cache
 Check whether a tag is retrievable from the global cache. More...
 
template<typename ParallelComponentTag , typename Metavariables >
auto Parallel::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 Parallel::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 Parallel::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 Parallel::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 Parallel::mutate (GlobalCache< Metavariables > &cache, Args &&... args)
 Mutates non-const data in the cache, by calling Function::apply() More...
 
template<typename Action , typename Proxy >
void Parallel::simple_action (Proxy &&proxy)
 Invoke a simple action on proxy
 
template<typename Action , typename Proxy , typename Arg0 , typename... Args>
void Parallel::simple_action (Proxy &&proxy, Arg0 &&arg0, Args &&... args)
 Invoke a simple action on proxy
 
template<typename Action , typename Proxy >
void Parallel::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 Parallel::threaded_action (Proxy &&proxy, Arg0 &&arg0, Args &&... args)
 Invoke a threaded action on proxy, where the proxy must be a nodegroup.
 

Detailed Description

Functions, classes and documentation related to parallelization and Charm++.

See Parallelization infrastructure for details.

Macro Definition Documentation

◆ WRAPPED_PUPable_decl_base_template

#define WRAPPED_PUPable_decl_base_template (   baseClassName,
  className 
)
Value:
PUPable_decl_base_template(SINGLE_ARG(baseClassName), /* NOLINT */ \
SINGLE_ARG(className))

Mark derived template classes as serializable.

Any class that inherits from an abstract base class where the base class is a template class must contain this macro if it is to be serialized.

◆ WRAPPED_PUPable_decl_template

#define WRAPPED_PUPable_decl_template (   className)     PUPable_decl_template(SINGLE_ARG(className))

Mark derived classes as serializable.

Any class that inherits from an abstract base class where the base class is not a template class must contain this macro if it is to be serialized.

Enumeration Type Documentation

◆ Phase

enum class Parallel::Phase
strong

The possible phases of an executable.

Details

Spectre executables are split into distinct phases separated by global synchronizations. Each executable will start with phase Initialization and end with phase Exit. The metavariables of each executable must define default_phase_order, an array of Parallel::Phase that must contain at least Initialization as the first element and Exit as the last element. Usually the next phase is determined from the default_phase_order provided by the metavariables. If more complex decision making is desired, use the PhaseControl infrastructure.

Warning
The phases are in alphabetical order. Do not use the values of the underlying integral type as they will change as new phases are added to the list!
See also
PhaseChange and Parallelization infrastructure for details.
Enumerator
AdjustDomain 

phase in which AMR adjusts the domain

BuildMatrix 

phase in which elliptic problems construct a matrix representation

CheckDomain 

phase in which sanity checks are done after AMR

Cleanup 

a cleanup phase

EvaluateAmrCriteria 

phase in which AMR criteria are evaluated

Evolve 

phase in which time steps are taken for an evolution executable

Execute 

generic execution phase of an executable

Exit 

final phase of an executable

ImportInitialData 

phase in which initial data is imported from volume files

Initialization 

initial phase of an executable

InitializeInitialDataDependentQuantities 

phase in which quantities dependent on imported initial data are initialized

InitializeTimeStepperHistory 

phase in which the time stepper executes a self-start procedure

LoadBalancing 

phase in which components are migrated

PostFailureCleanup 

phase in which components know an error occurred and they need to do some sort of cleanup, such as dumping data to disk.

Register 

phase in which components register with other components

RegisterWithElementDataReader 

phase in which components register with the data importer components

Solve 

phase in which something is solved

Testing 

phase in which something is tested

WriteCheckpoint 

phase in which checkpoint files are written to disk

Function Documentation

◆ contribute_to_reduction()

template<class Action , class SenderProxy , class TargetProxy , class... Ts, class SectionType = NoSection>
void Parallel::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.

Section reductions
This function supports section reductions (see Parallel::Section). Pass the Parallel::Section as the section argument, or pass Parallel::no_section() to perform a reduction over the entire parallel component (default). Here's an example of a section reduction:
auto& array_section = db::get_mutable_reference<
make_not_null(&box));
if (array_section.has_value()) {
// We'll just count the elements in each section
Parallel::ReductionData<
reduction_data{section_id, 1};
// Reduce over the section and broadcast to the full array
auto& array_proxy =
Parallel::get_parallel_component<ParallelComponent>(cache);
Parallel::contribute_to_reduction<ReceiveCount<ArraySectionIdTag>>(
std::move(reduction_data), array_proxy[array_index], array_proxy,
make_not_null(&*array_section));
}
auto & get_mutable_reference(const gsl::not_null< DataBox< TagList > * > box)
Retrieve a mutable reference to the item with tag Tag from the DataBox.
Definition: DataBox.hpp:1374
The data to be reduced, and invokables to be called whenever two reduction messages are combined and ...
Definition: Reduction.hpp:66
The Parallel::Section<ParallelComponent, SectionIdTag> that this element belongs to.
Definition: Section.hpp:29
Warning
Section reductions currently don't support migrating elements, i.e. either load-balancing or restoring a checkpoint to a different number of PEs. Support for migrating elements may require updating the "section cookie". One possibility to update the section cookie is to broadcast a CkMulticast message to the section elements and invoke CkGetSectionInfo within the message.

◆ deserialize() [1/2]

template<typename T >
void deserialize ( const gsl::not_null< T * >  result,
const void *const  data 
)

Deserialize an object using PUP.

Template Parameters
Tthe type to deserialize to.

◆ deserialize() [2/2]

template<typename T >
T deserialize ( const void *const  data)

Deserialize an object using PUP.

Template Parameters
Tthe type to deserialize to

◆ get()

template<typename GlobalCacheTag , typename Metavariables >
auto Parallel::get ( const GlobalCache< Metavariables > &  cache) -> const GlobalCache_detail::type_for_get<GlobalCacheTag, Metavariables>&

Access data in the cache.

Requires: GlobalCacheTag is a tag in the mutable_global_cache_tags or const_global_cache_tags defined by the Metavariables and in Actions.

Returns: a constant reference to an object in the cache

◆ get_parallel_component() [1/2]

template<typename ParallelComponentTag , typename Metavariables >
auto Parallel::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.

Requires: ParallelComponentTag is a tag in component_list

Returns: a Charm++ proxy that can be used to call an entry method on the chare(s)

◆ get_parallel_component() [2/2]

template<typename ParallelComponentTag , typename Metavariables >
auto Parallel::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.

Requires: ParallelComponentTag is a tag in component_list

Returns: a Charm++ proxy that can be used to call an entry method on the chare(s)

◆ mutable_cache_item_is_ready()

template<typename GlobalCacheTag , typename Function , typename Metavariables >
bool Parallel::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.

Requires: GlobalCacheTag is a tag in mutable_global_cache_tags defined by the Metavariables and in Actions.

Requires: function is a user-defined invokable that takes one argument: a const reference to the object referred to by the GlobalCacheTag. function returns a std::unique_ptr<CallBack> that determines the readiness. To indicate that the item is ready, the std::unique_ptr returned by function must be nullptr; in this case mutable_cache_item_is_ready returns true. To indicate that the item is not ready, the std::unique_ptr returned by function must be valid; in this case, mutable_cache_item_is_ready appends the std::unique_ptr<Callback> to an internal list of callbacks to be called on mutate, and then returns false.

Note
If function is returning a valid callback, it should only return a Parallel::PerformAlgorithmCallback. Other types of callbacks are not supported at this time.

◆ mutate()

template<typename GlobalCacheTag , typename Function , typename Metavariables , typename... Args>
void Parallel::mutate ( GlobalCache< Metavariables > &  cache,
Args &&...  args 
)

Mutates non-const data in the cache, by calling Function::apply()

Requires: GlobalCacheTag is a tag in tag_list.

Requires: Function is a struct with a static void apply() function that mutates the object. Function::apply() takes as its first argument a gsl::not_null pointer to the object named by the GlobalCacheTag, and takes args as subsequent arguments.

◆ printf()

template<typename... Args>
void Parallel::printf ( const std::string format,
Args &&...  args 
)
inline

Print an atomic message to stdout with C printf usage.

Similar to Python, you can print any object that's streamable by passing it in as an argument and using the formatter "%s". For example,

std::vector<double> a{0.8, 73, 9.8};
Parallel::printf("%s\n", a);
void printf(const std::string &format, Args &&... args)
Print an atomic message to stdout with C printf usage.
Definition: Printf.hpp:103

◆ printf_error()

template<typename... Args>
void Parallel::printf_error ( const std::string format,
Args &&...  args 
)
inline

Print an atomic message to stderr with C printf usage.

See Parallel::printf for details.

◆ receive_data() [1/2]

template<typename ReceiveTag , typename Proxy , typename MessageType >
void Parallel::receive_data ( Proxy &&  proxy,
MessageType *  message 
)

Send a pointer message to the algorithm running on proxy.

Here, message should hold all the information you need as member variables of the object. This includes, temporal ID identifiers, the data itself, and any auxilary information that needs to be communicated. The ReceiveTag associated with this message should be able unpack the information that was sent.

If the component associated with the proxy you are calling this on is running on the same charm-node, the exact pointer message is sent to the receiving component. No copies of data are done. If the receiving component is on a different charm-node, then the data pointed to by message is copied, sent through charm, and unpacked on the receiving component. The pointer that is passed to the algorithm on the receiving component then points to the copied data on the receiving component.

Warning
You cannot use the message pointer after you call this function. Doing so will result in undefined behavior because something else may be controlling the pointer.

◆ receive_data() [2/2]

template<typename ReceiveTag , typename Proxy , typename ReceiveDataType >
void Parallel::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.

If the algorithm was previously disabled, set enable_if_disabled to true to enable the algorithm on the parallel component.

◆ serialize()

template<typename T >
std::vector< char > serialize ( const T &  obj)

Serialize an object using PUP.

The type to serialize as must be explicitly specified. We require this because a mismatch between the serialize and deserialize calls causes undefined behavior and we do not want this to depend on inferred types for safety.

Template Parameters
Ttype to serialize

Variable Documentation

◆ is_in_const_global_cache

template<typename Metavariables , typename Tag >
constexpr bool Parallel::is_in_const_global_cache
constexpr
Initial value:
=
tmpl::size<tmpl::filter<get_const_global_cache_tags<Metavariables>,
0
constexpr T & value(T &t)
Returns t.value() if t is a std::optional otherwise returns t.
Definition: OptionalHelpers.hpp:32

Check whether a tag is retrievable from the const portion of the global cache.

◆ is_in_global_cache

template<typename Metavariables , typename Tag >
constexpr bool Parallel::is_in_global_cache
constexpr
Initial value:
=
is_in_const_global_cache<Metavariables, Tag> or
is_in_mutable_global_cache<Metavariables, Tag>

Check whether a tag is retrievable from the global cache.

◆ is_in_mutable_global_cache

template<typename Metavariables , typename Tag >
constexpr bool Parallel::is_in_mutable_global_cache
constexpr
Initial value:
=
tmpl::size<tmpl::filter<get_mutable_global_cache_tags<Metavariables>,
0

Check whether a tag is retrievable from the mutable portion of the global cache.