53#ifndef vtkDistributedGraphHelper_h
54#define vtkDistributedGraphHelper_h
56#include "vtkCommonDataModelModule.h"
59class vtkDistributedGraphHelperInternals;
helper for the vtkGraph class that allows the graph to be distributed across multiple memory spaces.
vtkIdType GetEdgeOwner(vtkIdType e_id) const
Returns owner of edge with ID e_id, by extracting top ceil(log2 P) bits of e_id.
virtual vtkDistributedGraphHelper * Clone()=0
Clones the distributed graph helper, returning another distributed graph helper of the same kind that...
virtual void FindEdgeSourceAndTarget(vtkIdType id, vtkIdType *source, vtkIdType *target)=0
Determine the source and target of the edge with the given ID.
vtkIdType MakeDistributedId(int owner, vtkIdType local)
Builds a distributed ID consisting of the given owner and the local ID.
vtkIdType GetVertexOwner(vtkIdType v) const
Returns owner of vertex v, by extracting top ceil(log2 P) bits of v.
virtual void AddVertexInternal(vtkVariantArray *propertyArr, vtkIdType *vertex)=0
Add a vertex, optionally with properties, to the distributed graph.
virtual void AddEdgeInternal(vtkIdType u, vtkIdType v, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
Add an edge (u, v) to the distributed graph.
static vtkInformationIntegerKey * DISTRIBUTEDEDGEIDS()
Information Keys that distributed graphs can append to attribute arrays to flag them as containing di...
vtkDistributedGraphHelper()
vtkIdType GetEdgeIndex(vtkIdType e_id) const
Returns local index of edge with ID e_id, by masking off top ceil(log2 P) bits of e_id.
static vtkInformationIntegerKey * DISTRIBUTEDVERTEXIDS()
Information Keys that distributed graphs can append to attribute arrays to flag them as containing di...
virtual void AddEdgeInternal(const vtkVariant &uPedigreeId, const vtkVariant &vPedigreeId, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
Adds an edge (u, v) and returns the new edge.
virtual void AddEdgeInternal(const vtkVariant &uPedigreeId, vtkIdType v, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
Adds an edge (u, v) and returns the new edge.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVertexPedigreeIdDistribution VertexDistribution
The distribution function used to map a pedigree ID to a processor.
void SetVertexPedigreeIdDistribution(vtkVertexPedigreeIdDistribution Func, void *userData)
Set the pedigreeId -> processor distribution function that determines how vertices are distributed wh...
virtual void AttachToGraph(vtkGraph *graph)
Attach this distributed graph helper to the given graph.
virtual void AddVertexInternal(const vtkVariant &pedigreeId, vtkIdType *vertex)=0
Add a vertex with the given pedigreeId to the distributed graph.
vtkIdType GetVertexOwnerByPedigreeId(const vtkVariant &pedigreeId)
Determine which processor owns the vertex with the given pedigree ID.
virtual void AddEdgeInternal(vtkIdType u, const vtkVariant &vPedigreeId, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
Adds an edge (u, v) and returns the new edge.
vtkIdType signBitMask
Bit mask to speed up decoding graph info {owner,index}.
vtkIdType GetVertexIndex(vtkIdType v) const
Returns local index of vertex v, by masking off top ceil(log2 P) bits of v.
int procBits
Number of bits required to represent # of processors (owner)
virtual vtkIdType FindVertex(const vtkVariant &pedigreeId)=0
Try to find the vertex with the given pedigree ID.
void * VertexDistributionUserData
Extra, user-specified data to be passed into the distribution function.
~vtkDistributedGraphHelper() override
vtkGraph * Graph
The graph to which this distributed graph helper is already attached.
vtkIdType highBitShiftMask
Bit mask to speed up decoding graph info {owner,index}.
int indexBits
Number of bits required to represent {vertex,edge} index.
virtual void Synchronize()=0
Synchronizes all of the processors involved in this distributed graph, so that all processors have a ...
Base class for graph data types.
a simple class to control print indentation
abstract base class for most VTK objects
An array holding vtkVariants.
A atomic type representing the union of many types.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkIdType(* vtkVertexPedigreeIdDistribution)(const vtkVariant &pedigreeId, void *userData)