Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | List of all members
shamrock::solvergraph::ExchangeGhostLayer Class Reference

Solver graph node for distributed ghost layer data exchange. More...

#include <shamrock/include/shamrock/solvergraph/ExchangeGhostLayer.hpp>

+ Inheritance diagram for shamrock::solvergraph::ExchangeGhostLayer:
+ Collaboration diagram for shamrock::solvergraph::ExchangeGhostLayer:

Public Member Functions

 ExchangeGhostLayer (std::shared_ptr< shamrock::patch::PatchDataLayerLayout > ghost_layer_layout)
 Constructs an ExchangeGhostLayer node with specified layout.
 
void _impl_evaluate_internal ()
 Performs the ghost layer data exchange computation.
 
virtual std::string _impl_get_label () const
 Returns the display label for this node.
 
virtual std::string _impl_get_tex () const
 Returns the TeX representation for this node.
 
- Public Member Functions inherited from shamrock::solvergraph::INode
 INode (const INode &)=delete
 
INodeoperator= (const INode &)=delete
 would violate shared_from_this() & unique UUID
 
 INode (INode &&) noexcept=default
 would violate shared_from_this() & unique UUID
 
INodeoperator= (INode &&) noexcept=default
 Move assignment - automatically delegates to base classes and members.
 
std::shared_ptr< INodegetptr_shared ()
 Get a shared pointer to this node.
 
std::weak_ptr< INodegetptr_weak ()
 Get a weak pointer to this node.
 
std::vector< std::shared_ptr< IEdge > > & get_ro_edges ()
 Get the read only edges.
 
std::vector< std::shared_ptr< IEdge > > & get_rw_edges ()
 Get the read write edges.
 
void __internal_set_ro_edges (std::vector< std::shared_ptr< IEdge > > new_ro_edges)
 Set the read only edges.
 
void __internal_set_rw_edges (std::vector< std::shared_ptr< IEdge > > new_rw_edges)
 Set the read write edges.
 
template<class Func >
void on_edge_ro_edges (Func &&f)
 Apply a function to the read only edges.
 
template<class Func >
void on_edge_rw_edges (Func &&f)
 Apply a function to the read write edges.
 
virtual ~INode ()
 Destructor (virtual) & reset the edges.
 
template<class T >
const T & get_ro_edge (int slot)
 Get a read only edge and cast it to the type T.
 
template<class T >
T & get_rw_edge (int slot)
 Get a read write edge and cast it to the type T.
 
const IEdgeget_ro_edge_base (int slot)
 Get a reference to a read only edge.
 
const IEdgeget_ro_edge_base (int slot) const
 
IEdgeget_rw_edge_base (int slot)
 Get a reference to a read write edge and cast it to the type IEdge.
 
const IEdgeget_rw_edge_base (int slot) const
 
void evaluate ()
 Evaluate the node.
 
std::string get_dot_graph ()
 Get the dot graph of the node (Currently only an alias to get_dot_graph_partial)
 
std::string get_dot_graph_partial ()
 Get the dot graph of the subgraph corresponding to the node.
 
std::string get_dot_graph_node_start ()
 Get the id of the node start in the dot graph.
 
std::string get_dot_graph_node_end ()
 Get the id of the node end in the dot graph.
 
std::string get_tex ()
 Get the TeX of the node.
 
std::string get_tex_partial ()
 Get the TeX of the node partial.
 
virtual std::string print_node_info () const
 print the node info
 
- Public Member Functions inherited from shambase::WithUUID< INode, u64 >
u64 get_uuid () const
 Get the uuid of the class.
 
 WithUUID ()
 Constructor of the class.
 

Additional Inherited Members

- Protected Member Functions inherited from shamrock::solvergraph::INode
virtual std::string _impl_get_dot_graph_partial () const
 get the dot graph of the node partial
 
virtual std::string _impl_get_dot_graph_node_start () const
 get the dot graph of the node start
 
virtual std::string _impl_get_dot_graph_node_end () const
 get the dot graph of the node end
 
- Protected Attributes inherited from shambase::WithUUID< INode, u64 >
u64 uuid
 The unique identifier of the class.
 

Detailed Description

Solver graph node for distributed ghost layer data exchange.

ExchangeGhostLayer is a computational node in the solver graph that handles the communication and synchronization of ghost layer data between distributed computational domains. This node is essential for maintaining data consistency at domain boundaries in parallel hydrodynamics simulations.

The node operates by taking ownership rank information and performing sparse communication to exchange patch data layers with appropriate neighboring processes. It uses serialization/deserialization for efficient data transfer and maintains shared distributed data structures for ghost zones.

// Create ghost layer layout
auto layout = std::make_shared<shamrock::patch::PatchDataLayerLayout>(layout_params);
// Create the exchange node
auto exchangeNode = std::make_shared<ExchangeGhostLayer>(layout);
// Set up edges with rank ownership and ghost layer data
auto rankEdge = std::make_shared<shamrock::solvergraph::ScalarsEdge<u32>>();
auto ghostEdge = std::make_shared<shamrock::solvergraph::PatchDataLayerDDShared>("ghost",
"G"); exchangeNode->set_edges(rankEdge, ghostEdge);
// Evaluate to perform the ghost layer exchange
exchangeNode->evaluate();

Definition at line 59 of file ExchangeGhostLayer.hpp.

Constructor & Destructor Documentation

◆ ExchangeGhostLayer()

shamrock::solvergraph::ExchangeGhostLayer::ExchangeGhostLayer ( std::shared_ptr< shamrock::patch::PatchDataLayerLayout ghost_layer_layout)
inline

Constructs an ExchangeGhostLayer node with specified layout.

Parameters
ghost_layer_layoutShared pointer to the patch data layer layout that defines the structure and organization of ghost layer data to be exchanged

Definition at line 71 of file ExchangeGhostLayer.hpp.

Member Function Documentation

◆ _impl_evaluate_internal()

void shamrock::solvergraph::ExchangeGhostLayer::_impl_evaluate_internal ( )
virtual

Performs the ghost layer data exchange computation.

This method implements the core functionality of the node by executing sparse communication to exchange ghost layer data between distributed processes. It serializes local ghost data, communicates with appropriate ranks based on ownership information, and deserializes received data.

Implements shamrock::solvergraph::INode.

Definition at line 26 of file ExchangeGhostLayer.cpp.

◆ _impl_get_label()

virtual std::string shamrock::solvergraph::ExchangeGhostLayer::_impl_get_label ( ) const
inlinevirtual

Returns the display label for this node.

Returns
String label "ExchangeGhostLayer" for graph visualization

Implements shamrock::solvergraph::INode.

Definition at line 98 of file ExchangeGhostLayer.hpp.

◆ _impl_get_tex()

std::string shamrock::solvergraph::ExchangeGhostLayer::_impl_get_tex ( ) const
virtual

Returns the TeX representation for this node.

Returns
TeX string for mathematical/graphical representation of the node

Implements shamrock::solvergraph::INode.

Definition at line 60 of file ExchangeGhostLayer.cpp.

+ Here is the call graph for this function:

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