fpmas 1.6
Public Member Functions | List of all members
fpmas::api::graph::TemporaryNode< T > Class Template Referenceabstract

#include <distributed_edge.h>

Inheritance diagram for fpmas::api::graph::TemporaryNode< T >:
Inheritance graph
[legend]

Public Member Functions

virtual DistributedId getId () const =0
 
virtual int getLocation () const =0
 
virtual DistributedNode< T > * build ()=0
 

Detailed Description

template<typename T>
class fpmas::api::graph::TemporaryNode< T >

TemporaryNode API.

A temporary node can be used to optimize DistributedEdge deserialization. Indeed, when a node is imported in a DistributedGraph for example, at least the source or target DistributedNode should already be contained in the graph. In consequence, at least source or target node of the imported edge will not be used before being discarded and replaced by a local DistributedNode: deserializing and allocating such nodes can represent a huge waste of time and memory resources (what has been observed experimentally).

This can be solved storing temporary source and target nodes has TemporaryNodes in a deserialized DistributedEdge. If a temporary node is finally useless, there is no need to deserialize it or to allocate it, and the TemporaryNode is simply discarded without any useless memory usage. If the temporary node is required (for example, because it is not already contained in the graph), is can be deserialized and allocated only when required using the build() method.

See also
DistributedEdge::setTempSourceNode()
DistributedEdge::getTempSourceNode()
DistributedEdge::setTempTargetNode()
DistributedEdge::getTempTargetNode()
DistributedGraph::importEdge()
nlohmann::adl_serializer<DistributedEdge>
Template Parameters
Tnode data type

Member Function Documentation

◆ getId()

template<typename T >
virtual DistributedId fpmas::api::graph::TemporaryNode< T >::getId ( ) const
pure virtual

Gets the id of the node represented by the TemporaryNode.

This should not require the complete node deserialization and allocation.

Returns
temporary node id

Implemented in fpmas::graph::TemporaryNode< T, PackType >.

◆ getLocation()

template<typename T >
virtual int fpmas::api::graph::TemporaryNode< T >::getLocation ( ) const
pure virtual

Gets the processor rank where the node represented by the TemporaryNode is located.

Returns
node location

Implemented in fpmas::graph::TemporaryNode< T, PackType >.

◆ build()

template<typename T >
virtual DistributedNode< T > * fpmas::api::graph::TemporaryNode< T >::build ( )
pure virtual

Desesializes (if required) and allocates the DistributedNode represented by this temporary node and returns it.

The node ID must be the value of getId(), and its location must be initialized to getLocation().

Implemented in fpmas::graph::TemporaryNode< T, PackType >.


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