29 #ifndef vtkPBGLGraphAdapter_h
30 #define vtkPBGLGraphAdapter_h
35 #include <boost/graph/use_mpi.hpp>
36 #include <boost/graph/distributed/mpi_process_group.hpp>
37 #include <boost/graph/properties.hpp>
38 #include <boost/graph/parallel/container_traits.hpp>
39 #include <boost/property_map/parallel/local_property_map.hpp>
40 #include <boost/property_map/parallel/distributed_property_map.hpp>
41 #include <boost/serialization/base_object.hpp>
42 #include <boost/functional/hash.hpp>
52 #define SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS(Property) \
54 struct property_map<vtkDirectedGraph *, Property> \
55 : property_map<vtkGraph *, Property> { }; \
58 struct property_map<vtkUndirectedGraph *, Property> \
59 : property_map<vtkGraph *, Property> { }; \
62 struct property_map<vtkDirectedGraph * const, Property> \
63 : property_map<vtkGraph *, Property> { }; \
66 struct property_map<vtkUndirectedGraph * const, Property> \
67 : property_map<vtkGraph *, Property> { }
77 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
130 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
180 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
225 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
244 return std::pair<int, vtkIdType>
264 #undef SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS
273 return hash_value(edge.
Id);
283 namespace boost {
namespace graph {
namespace parallel {
287 typedef boost::graph::distributed::mpi_process_group
type;
309 inline boost::graph::distributed::mpi_process_group
315 inline boost::graph::distributed::mpi_process_group
326 template<
typename Archiver>
332 template<
typename Archiver>
335 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
339 template<
typename Archiver>
342 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
346 template<
typename Archiver>
349 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
365 typedef boost::local_property_map<boost::graph::distributed::mpi_process_group,
380 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
389 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
403 template<
typename DataArray>
406 typedef boost::parallel::distributed_property_map<
407 boost::graph::distributed::mpi_process_group,
417 template<
typename DataArray>
426 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
434 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
448 template<
typename DataArray>
451 typedef boost::parallel::distributed_property_map<
452 boost::graph::distributed::mpi_process_group,
462 template<
typename DataArray>
471 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
479 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
488 #endif // vtkPBGLGraphAdapter_h
helper for the vtkGraph class that allows the graph to be distributed across multiple memory spaces...
SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS(vertex_owner_t)
Forward declaration required for Boost serialization.
boost::parallel::distributed_property_map< boost::graph::distributed::mpi_process_group, boost::vtkVertexGlobalMap, DataArray * > type
readable_property_map_tag category
readable_property_map_tag category
vtkIdType GetEdgeOwner(vtkIdType e_id) const
Returns owner of edge with ID e_id, by extracting top ceil(log2 P) bits of e_id.
vtkIdType GetVertexOwner(vtkIdType v) const
Returns owner of vertex v, by extracting top ceil(log2 P) bits of v.
boost::graph::distributed::mpi_process_group GetProcessGroup()
Return the process group associated with this distributed graph.
vtkVertexOwnerMap(vtkGraph *graph)
vtkVertexGlobalMap const_type
vtkGraphDistributedVertexIndexMap MakeDistributedVertexIndexMap(vtkGraph *graph)
Creates the distributed vertex index property map for a vtkGraph.
readable_property_map_tag category
vtkDistributedGraphHelper * helper
vtkDistributedGraphHelper * helper
std::pair< int, vtkIdType > value_type
Base class for graph data types.
vtkIdType GetVertexIndex(vtkIdType v) const
Returns local index of vertex v, by masking off top ceil(log2 P) bits of v.
static vtkPBGLDistributedGraphHelper * SafeDownCast(vtkObjectBase *o)
std::pair< int, vtkIdType > value_type
vtkEdgeGlobalMap const_type
Retrieves the type of the distributed property map indexed by the vertices of a distributed graph...
boost::parallel::distributed_property_map< boost::graph::distributed::mpi_process_group, boost::vtkEdgeGlobalMap, DataArray * > type
boost::local_property_map< boost::graph::distributed::mpi_process_group, boost::vtkVertexGlobalMap, boost::vtkGraphIndexMap > vtkGraphDistributedVertexIndexMap
A property map used as the vertex index map for distributed vtkGraphs.
vtkEdgeGlobalMap(vtkGraph *graph)
boost::graph::distributed::mpi_process_group process_group(vtkGraph *graph)
vtkVertexOwnerMap const_type
vtkDistributedEdgePropertyMapType< DataArray >::type MakeDistributedEdgePropertyMap(vtkGraph *graph, DataArray *array)
Build a distributed property map indexed by the edges of the given graph, using storage from the give...
vtkDistributedVertexPropertyMapType< DataArray >::type MakeDistributedVertexPropertyMap(vtkGraph *graph, DataArray *array)
Build a distributed property map indexed by the vertices of the given graph, using storage from the g...
vtkDistributedGraphHelper * GetDistributedGraphHelper()
Retrieves the distributed graph helper for this graph.
vtkDistributedGraphHelper * helper
vtkDistributedGraphHelper * helper
vtkVertexGlobalMap(vtkGraph *graph)
std::size_t operator()(const vtkEdgeType &edge) const
readable_property_map_tag category
boost::graph::distributed::mpi_process_group type
void serialize(Archiver &ar, vtkEdgeBase &edge, const unsigned int)
Retrieves the type of the distributed property map indexed by the edges of a distributed graph...
vtkVertexLocalMap(vtkGraph *graph)
vtkVertexLocalMap const_type
end namespace boost::graph::distributed