vtkDistributedGraphHelper Class Reference

#include <vtkDistributedGraphHelper.h>

Inheritance diagram for vtkDistributedGraphHelper:

Inheritance graph
[legend]
Collaboration diagram for vtkDistributedGraphHelper:

Collaboration graph
[legend]

List of all members.


Detailed Description

helper for the vtkGraph class that allows the graph to be distributed across multiple memory spaces.

A distributed graph helper can be attached to an empty vtkGraph object to turn the vtkGraph into a distributed graph, whose vertices and edges are distributed across several different processors. vtkDistributedGraphHelper is an abstract class. Use a subclass of vtkDistributedGraphHelper, such as vtkPBGLDistributedGraphHelper, to build distributed graphs.

The distributed graph helper provides facilities used by vtkGraph to communicate with other processors that store other parts of the same distributed graph. The only user-level functionality provided by vtkDistributedGraphHelper involves this communication among processors and the ability to map between "distributed" vertex and edge IDs and their component parts (processor and local index). For example, the Synchronize() method provides a barrier that allows all processors to catch up to the same point in the code before any processor can leave that Synchronize() call. For example, one would call Synchronize() after adding many edges to a distributed graph, so that all processors can handle the addition of inter-processor edges and continue, after the Synchronize() call, with a consistent view of the distributed graph. For more information about manipulating (distributed) graphs, see the vtkGraph documentation.

See also:
vtkGraph
Tests:
vtkDistributedGraphHelper (Tests)

Definition at line 78 of file vtkDistributedGraphHelper.h.


Public Types

typedef vtkObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
vtkIdType GetVertexOwner (vtkIdType v) const
vtkIdType GetVertexIndex (vtkIdType v) const
vtkIdType GetEdgeOwner (vtkIdType e_id) const
vtkIdType GetEdgeIndex (vtkIdType e_id) const
vtkIdType MakeDistributedId (int owner, vtkIdType local)
virtual void Synchronize ()=0
virtual vtkDistributedGraphHelperClone ()=0
void SetVertexPedigreeIdDistribution (vtkVertexPedigreeIdDistribution Func, void *userData)
vtkIdType GetVertexOwnerByPedigreeId (const vtkVariant &pedigreeId)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkDistributedGraphHelperSafeDownCast (vtkObject *o)
static vtkInformationIntegerKeyDISTRIBUTEDVERTEXIDS ()
static vtkInformationIntegerKeyDISTRIBUTEDEDGEIDS ()

Protected Member Functions

 vtkDistributedGraphHelper ()
virtual ~vtkDistributedGraphHelper ()
virtual void AddVertexInternal (const vtkVariant &pedigreeId, vtkIdType *vertex)=0
virtual vtkIdType FindVertex (const vtkVariant &pedigreeId)=0
virtual void AttachToGraph (vtkGraph *graph)
virtual void AddVertexInternal (vtkVariantArray *propertyArr, vtkIdType *vertex)=0
virtual void AddEdgeInternal (vtkIdType u, vtkIdType v, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
virtual void AddEdgeInternal (const vtkVariant &uPedigreeId, vtkIdType v, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
virtual void AddEdgeInternal (vtkIdType u, const vtkVariant &vPedigreeId, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
virtual void AddEdgeInternal (const vtkVariant &uPedigreeId, const vtkVariant &vPedigreeId, bool directed, vtkVariantArray *propertyArr, vtkEdgeType *edge)=0
virtual void FindEdgeSourceAndTarget (vtkIdType id, vtkIdType *source, vtkIdType *target)=0

Protected Attributes

vtkGraphGraph
vtkVertexPedigreeIdDistribution VertexDistribution
void * VertexDistributionUserData
vtkIdType signBitMask
vtkIdType highBitShiftMask
int procBits
int indexBits

Friends

class vtkGraph

Member Typedef Documentation

Reimplemented from vtkObject.

Reimplemented in vtkPBGLDistributedGraphHelper.

Definition at line 81 of file vtkDistributedGraphHelper.h.


Constructor & Destructor Documentation

vtkDistributedGraphHelper::vtkDistributedGraphHelper (  )  [protected]

virtual vtkDistributedGraphHelper::~vtkDistributedGraphHelper (  )  [protected, virtual]


Member Function Documentation

virtual const char* vtkDistributedGraphHelper::GetClassName (  )  [virtual]

Reimplemented from vtkObject.

Reimplemented in vtkPBGLDistributedGraphHelper.

static int vtkDistributedGraphHelper::IsTypeOf ( const char *  name  )  [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkPBGLDistributedGraphHelper.

virtual int vtkDistributedGraphHelper::IsA ( const char *  name  )  [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkPBGLDistributedGraphHelper.

static vtkDistributedGraphHelper* vtkDistributedGraphHelper::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkObject.

Reimplemented in vtkPBGLDistributedGraphHelper.

void vtkDistributedGraphHelper::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

vtkIdType vtkDistributedGraphHelper::GetVertexOwner ( vtkIdType  v  )  const

Returns owner of vertex v, by extracting top ceil(log2 P) bits of v.

vtkIdType vtkDistributedGraphHelper::GetVertexIndex ( vtkIdType  v  )  const

Returns local index of vertex v, by masking off top ceil(log2 P) bits of v.

vtkIdType vtkDistributedGraphHelper::GetEdgeOwner ( vtkIdType  e_id  )  const

Returns owner of edge with ID e_id, by extracting top ceil(log2 P) bits of e_id.

vtkIdType vtkDistributedGraphHelper::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.

vtkIdType vtkDistributedGraphHelper::MakeDistributedId ( int  owner,
vtkIdType  local 
)

Builds a distributed ID consisting of the given owner and the local ID.

void vtkDistributedGraphHelper::SetVertexPedigreeIdDistribution ( vtkVertexPedigreeIdDistribution  Func,
void *  userData 
)

Set the pedigreeId -> processor distribution function that determines how vertices are distributed when they are associated with pedigree ID, which must be a unique label such as a URL or IP address. If a NULL function pointer is provided, the default hashed distribution will be used.

vtkIdType vtkDistributedGraphHelper::GetVertexOwnerByPedigreeId ( const vtkVariant pedigreeId  ) 

Determine which processor owns the vertex with the given pedigree ID.

virtual void vtkDistributedGraphHelper::Synchronize (  )  [pure virtual]

Synchronizes all of the processors involved in this distributed graph, so that all processors have a consistent view of the distributed graph for the computation that follows. This routine should be invoked after adding new edges into the distributed graph, so that other processors will see those edges (or their corresponding back-edges).

Implemented in vtkPBGLDistributedGraphHelper.

virtual vtkDistributedGraphHelper* vtkDistributedGraphHelper::Clone (  )  [pure virtual]

Clones the distributed graph helper, returning another distributed graph helper of the same kind that can be used in another vtkGraph.

Implemented in vtkPBGLDistributedGraphHelper.

static vtkInformationIntegerKey* vtkDistributedGraphHelper::DISTRIBUTEDVERTEXIDS (  )  [static]

Information Keys that distributed graphs can append to attribute arrays to flag them as containing distributed IDs. These can be used to let routines that migrate vertices (either repartitioning or collecting graphs to single nodes) to also modify the ids contained in the attribute arrays to maintain consistency.

static vtkInformationIntegerKey* vtkDistributedGraphHelper::DISTRIBUTEDEDGEIDS (  )  [static]

Information Keys that distributed graphs can append to attribute arrays to flag them as containing distributed IDs. These can be used to let routines that migrate vertices (either repartitioning or collecting graphs to single nodes) to also modify the ids contained in the attribute arrays to maintain consistency.

virtual void vtkDistributedGraphHelper::AddVertexInternal ( vtkVariantArray propertyArr,
vtkIdType vertex 
) [protected, pure virtual]

Add a vertex, optionally with properties, to the distributed graph. If vertex is non-NULL, it will be set to the newly-added (or found) vertex. Note that if propertyArr is non-NULL and the vertex data contains pedigree IDs, a vertex will only be added if there is no vertex with that pedigree ID.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::AddVertexInternal ( const vtkVariant pedigreeId,
vtkIdType vertex 
) [protected, pure virtual]

Add a vertex with the given pedigreeId to the distributed graph. If vertex is non-NULL, it will receive the newly-created vertex.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::AddEdgeInternal ( vtkIdType  u,
vtkIdType  v,
bool  directed,
vtkVariantArray propertyArr,
vtkEdgeType edge 
) [protected, pure virtual]

Add an edge (u, v) to the distributed graph. The edge may be directed undirected. If edge is non-null, it will receive the newly-created edge. If propertyArr is non-null, it specifies the properties that will be attached to the newly-created edge.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::AddEdgeInternal ( const vtkVariant uPedigreeId,
vtkIdType  v,
bool  directed,
vtkVariantArray propertyArr,
vtkEdgeType edge 
) [protected, pure virtual]

Adds an edge (u, v) and returns the new edge. The graph edge may or may not be directed, depending on the given flag. If edge is non-null, it will receive the newly-created edge. uPedigreeId is the pedigree ID of vertex u, which will be added if no vertex by that pedigree ID exists. If propertyArr is non-null, it specifies the properties that will be attached to the newly-created edge.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::AddEdgeInternal ( vtkIdType  u,
const vtkVariant vPedigreeId,
bool  directed,
vtkVariantArray propertyArr,
vtkEdgeType edge 
) [protected, pure virtual]

Adds an edge (u, v) and returns the new edge. The graph edge may or may not be directed, depending on the given flag. If edge is non-null, it will receive the newly-created edge. vPedigreeId is the pedigree ID of vertex u, which will be added if no vertex with that pedigree ID exists. If propertyArr is non-null, it specifies the properties that will be attached to the newly-created edge.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::AddEdgeInternal ( const vtkVariant uPedigreeId,
const vtkVariant vPedigreeId,
bool  directed,
vtkVariantArray propertyArr,
vtkEdgeType edge 
) [protected, pure virtual]

Adds an edge (u, v) and returns the new edge. The graph edge may or may not be directed, depending on the given flag. If edge is non-null, it will receive the newly-created edge. uPedigreeId is the pedigree ID of vertex u and vPedigreeId is the pedigree ID of vertex u, each of which will be added if no vertex by that pedigree ID exists. If propertyArr is non-null, it specifies the properties that will be attached to the newly-created edge.

Implemented in vtkPBGLDistributedGraphHelper.

virtual vtkIdType vtkDistributedGraphHelper::FindVertex ( const vtkVariant pedigreeId  )  [protected, pure virtual]

Try to find the vertex with the given pedigree ID. Returns the vertex ID if the vertex is found, or -1 if there is no vertex with that pedigree ID.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::FindEdgeSourceAndTarget ( vtkIdType  id,
vtkIdType source,
vtkIdType target 
) [protected, pure virtual]

Determine the source and target of the edge with the given ID. Used internally by vtkGraph::GetSourceVertex and vtkGraph::GetTargetVertex.

Implemented in vtkPBGLDistributedGraphHelper.

virtual void vtkDistributedGraphHelper::AttachToGraph ( vtkGraph graph  )  [protected, virtual]

Attach this distributed graph helper to the given graph. This will be called as part of vtkGraph::SetDistributedGraphHelper.

Reimplemented in vtkPBGLDistributedGraphHelper.


Friends And Related Function Documentation

friend class vtkGraph [friend]

Definition at line 257 of file vtkDistributedGraphHelper.h.


Member Data Documentation

The graph to which this distributed graph helper is already attached.

Definition at line 227 of file vtkDistributedGraphHelper.h.

The distribution function used to map a pedigree ID to a processor.

Definition at line 231 of file vtkDistributedGraphHelper.h.

Extra, user-specified data to be passed into the distribution function.

Definition at line 235 of file vtkDistributedGraphHelper.h.

Bit mask to speed up decoding graph info {owner,index}

Definition at line 238 of file vtkDistributedGraphHelper.h.

Bit mask to speed up decoding graph info {owner,index}

Definition at line 241 of file vtkDistributedGraphHelper.h.

Number of bits required to represent # of processors (owner)

Definition at line 244 of file vtkDistributedGraphHelper.h.

Number of bits required to represent {vertex,edge} index

Definition at line 248 of file vtkDistributedGraphHelper.h.


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

Generated on Wed Jun 3 19:00:38 2009 for VTK by  doxygen 1.5.6