SpECTRE
v2025.03.17
|
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 | |
DgElementArrayMemberBase & | operator= (const DgElementArrayMemberBase &)=default |
DgElementArrayMemberBase (DgElementArrayMemberBase &&)=default | |
DgElementArrayMemberBase & | operator= (DgElementArrayMemberBase &&)=default |
WRAPPED_PUPable_abstract (DgElementArrayMemberBase) | |
DgElementArrayMemberBase (CkMigrateMessage *msg) | |
virtual void | start_phase (Parallel::Phase next_phase, bool force=false)=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. More... | |
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. More... | |
virtual std::string | print_types () const =0 |
Print the expanded type aliases. More... | |
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. More... | |
virtual std::string | print_databox () const =0 |
Print the current contents of the DataBox. More... | |
Parallel::NodeLock & | inbox_lock () |
The inbox_lock() only locks the inbox, nothing else. The inbox is unsafe to access without this lock. More... | |
Parallel::NodeLock & | element_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. | |
const std::string & | deadlock_analysis_next_iterable_action () const |
Returns the name of the last "next iterable action" to be run before a deadlock occurred. | |
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()} |
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.
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
.
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
.
|
pure virtual |
Start evaluating the algorithm until it is stopped by an action.
Implemented in Parallel::DgElementArrayMember< Dim, Metavariables, tmpl::list< PhaseDepActionListsPack... >, SimpleTagsFromOptions >.
|
pure virtual |
Print the current contents of the DataBox.
Implemented in Parallel::DgElementArrayMember< Dim, Metavariables, tmpl::list< PhaseDepActionListsPack... >, SimpleTagsFromOptions >.
|
pure virtual |
Print the current contents of the inboxes.
Implemented in Parallel::DgElementArrayMember< Dim, Metavariables, tmpl::list< PhaseDepActionListsPack... >, SimpleTagsFromOptions >.
|
pure virtual |
Print the expanded type aliases.
Implemented in Parallel::DgElementArrayMember< Dim, Metavariables, tmpl::list< PhaseDepActionListsPack... >, SimpleTagsFromOptions >.
|
pure virtual |
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.
If force
is true, then regardless of how this component terminated (error or deadlock), it will resume.
force
to true unless you are absolutely sure you want to. This can have very unintended consequences if used incorrectly. Implemented in Parallel::DgElementArrayMember< Dim, Metavariables, tmpl::list< PhaseDepActionListsPack... >, SimpleTagsFromOptions >.