SpECTRE  v2024.04.12
Parallel::DgElementArrayMemberBase< Dim > Class Template Referenceabstract

The base class of a member of an DG element array/map on a nodegroup. More...

#include <DgElementArrayMemberBase.hpp>

Public Member Functions

 DgElementArrayMemberBase (const DgElementArrayMemberBase &)=default
 
DgElementArrayMemberBaseoperator= (const DgElementArrayMemberBase &)=default
 
 DgElementArrayMemberBase (DgElementArrayMemberBase &&)=default
 
DgElementArrayMemberBaseoperator= (DgElementArrayMemberBase &&)=default
 
 WRAPPED_PUPable_abstract (DgElementArrayMemberBase)
 
 DgElementArrayMemberBase (CkMigrateMessage *msg)
 
virtual void start_phase (Parallel::Phase next_phase)=0
 Start execution of the phase-dependent action list in next_phase. If next_phase has already been visited, execution will resume at the point where the previous execution of the same phase left off.
 
Parallel::Phase phase () const
 Get the current phase.
 
void set_terminate (gsl::not_null< size_t * > number_of_elements_terminated, gsl::not_null< Parallel::NodeLock * > nodegroup_lock, bool terminate)
 Tell the Algorithm it should no longer execute the algorithm. This does not mean that the execution of the program is terminated, but only that the algorithm has terminated. An algorithm can be restarted by passing true as the second argument to the receive_data method or by calling perform_algorithm(true).
 
bool get_terminate () const
 Check if an algorithm should continue being evaluated.
 
size_t algorithm_step () const
 The zero-indexed step in the algorithm.
 
virtual void perform_algorithm ()=0
 Start evaluating the algorithm until it is stopped by an action.
 
virtual std::string print_types () const =0
 Print the expanded type aliases.
 
std::string print_state () const
 Print the current state of the algorithm.
 
virtual std::string print_inbox () const =0
 Print the current contents of the inboxes.
 
virtual std::string print_databox () const =0
 Print the current contents of the DataBox.
 
Parallel::NodeLockinbox_lock ()
 The inbox_lock() only locks the inbox, nothing else. The inbox is unsafe to access without this lock. More...
 
Parallel::NodeLockelement_lock ()
 Locks the element, except for the inbox, which is guarded by the inbox_lock(). More...
 
void set_core (size_t core)
 Set which core this element should pretend to be bound to.
 
size_t get_core () const
 Get which core this element should pretend to be bound to.
 
void pup (PUP::er &p) override
 

Protected Member Functions

 DgElementArrayMemberBase (ElementId< Dim > element_id, size_t node_number)
 

Protected Attributes

Parallel::NodeLock inbox_lock_ {}
 
Parallel::NodeLock element_lock_ {}
 
bool performing_action_ = false
 
Parallel::Phase phase_ {Parallel::Phase::Initialization}
 
std::unordered_map< Parallel::Phase, size_t > phase_bookmarks_ {}
 
std::size_t algorithm_step_ = 0
 
bool terminate_ {true}
 
bool halt_algorithm_until_next_phase_ {false}
 
std::string deadlock_analysis_next_iterable_action_ {}
 
ElementId< Dim > element_id_
 
size_t my_node_ {std::numeric_limits<size_t>::max()}
 
size_t my_core_ {std::numeric_limits<size_t>::max()}
 

Detailed Description

template<size_t Dim>
class Parallel::DgElementArrayMemberBase< Dim >

The base class of a member of an DG element array/map on a nodegroup.

The nodegroup DgElementCollection stores all the elements on a node. Each of those elements is a DgElementArrayMember and has this base class to make access easier so it can be used in a type-erased context since DgElementArrayMember depends on the metavariables, phase-dependent-action-list, and the simple tags needed from options.

This class essentially mimicks a lot of the functionality of Parallel::DistributedObject but does not involve Charm++ beyond serialization.

Member Function Documentation

◆ element_lock()

template<size_t Dim>
Parallel::NodeLock & Parallel::DgElementArrayMemberBase< Dim >::element_lock ( )

Locks the element, except for the inbox, which is guarded by the inbox_lock().

This should always be managed by std::unique_lock or std::lock_guard.

◆ inbox_lock()

template<size_t Dim>
Parallel::NodeLock & Parallel::DgElementArrayMemberBase< Dim >::inbox_lock ( )

The inbox_lock() only locks the inbox, nothing else. The inbox is unsafe to access without this lock.

Use element_lock() to lock the rest of the element.

This should always be managed by std::unique_lock or std::lock_guard.


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