28 #ifndef vtkPBGLGraphAdapter_h
29 #define vtkPBGLGraphAdapter_h
34 #include <vtksys/stl/map>
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>
53 #define SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS(Property) \
55 struct property_map<vtkDirectedGraph *, Property> \
56 : property_map<vtkGraph *, Property> { }; \
59 struct property_map<vtkUndirectedGraph *, Property> \
60 : property_map<vtkGraph *, Property> { }; \
63 struct property_map<vtkDirectedGraph * const, Property> \
64 : property_map<vtkGraph *, Property> { }; \
67 struct property_map<vtkUndirectedGraph * const, Property> \
68 : property_map<vtkGraph *, Property> { }
78 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
131 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
181 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
226 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
245 return std::pair<int, vtkIdType>
265 #undef SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS
274 return hash_value(edge.
Id);
284 namespace boost {
namespace graph {
namespace parallel {
288 typedef boost::graph::distributed::mpi_process_group
type;
310 inline boost::graph::distributed::mpi_process_group
316 inline boost::graph::distributed::mpi_process_group
327 template<
typename Archiver>
333 template<
typename Archiver>
336 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
340 template<
typename Archiver>
343 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
347 template<
typename Archiver>
350 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
365 typedef boost::local_property_map<boost::graph::distributed::mpi_process_group,
379 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
388 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
400 template<
typename DataArray>
403 typedef boost::parallel::distributed_property_map<
404 boost::graph::distributed::mpi_process_group,
413 template<
typename DataArray>
423 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
431 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
443 template<
typename DataArray>
446 typedef boost::parallel::distributed_property_map<
447 boost::graph::distributed::mpi_process_group,
456 template<
typename DataArray>
466 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
474 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
483 #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
vtkIdType GetVertexOwner(vtkIdType v) const
boost::graph::distributed::mpi_process_group GetProcessGroup()
vtkVertexOwnerMap(vtkGraph *graph)
vtkVertexGlobalMap const_type
vtkGraphDistributedVertexIndexMap MakeDistributedVertexIndexMap(vtkGraph *graph)
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
static vtkPBGLDistributedGraphHelper * SafeDownCast(vtkObjectBase *o)
std::pair< int, vtkIdType > value_type
vtkEdgeGlobalMap const_type
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
vtkEdgeGlobalMap(vtkGraph *graph)
boost::graph::distributed::mpi_process_group process_group(vtkGraph *graph)
vtkVertexOwnerMap const_type
vtkDistributedEdgePropertyMapType< DataArray >::type MakeDistributedEdgePropertyMap(vtkGraph *graph, DataArray *array)
vtkDistributedVertexPropertyMapType< DataArray >::type MakeDistributedVertexPropertyMap(vtkGraph *graph, DataArray *array)
vtkDistributedGraphHelper * GetDistributedGraphHelper()
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)
vtkVertexLocalMap(vtkGraph *graph)
vtkVertexLocalMap const_type
end namespace boost::graph::distributed