27 #ifndef __vtkPBGLGraphAdapter_h
28 #define __vtkPBGLGraphAdapter_h
33 #include <boost/graph/use_mpi.hpp>
34 #include <boost/graph/distributed/mpi_process_group.hpp>
35 #include <boost/graph/properties.hpp>
36 #include <boost/graph/parallel/container_traits.hpp>
37 #include <boost/property_map/parallel/local_property_map.hpp>
38 #include <boost/property_map/parallel/distributed_property_map.hpp>
39 #include <boost/serialization/base_object.hpp>
40 #include <boost/functional/hash.hpp>
51 #define SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS(Property) \
53 struct property_map<vtkDirectedGraph *, Property> \
54 : property_map<vtkGraph *, Property> { }; \
57 struct property_map<vtkUndirectedGraph *, Property> \
58 : property_map<vtkGraph *, Property> { }; \
61 struct property_map<vtkDirectedGraph * const, Property> \
62 : property_map<vtkGraph *, Property> { }; \
65 struct property_map<vtkUndirectedGraph * const, Property> \
66 : property_map<vtkGraph *, Property> { }
76 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
99 return owner_map.helper->GetVertexOwner(
key);
129 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
152 return local_map.helper->GetVertexIndex(
key);
179 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
198 return vtkstd::pair<int,vtkIdType>(global_map.helper->GetVertexOwner(
key),
199 global_map.helper->GetVertexIndex(
key));
224 :
helper(graph? graph->GetDistributedGraphHelper() : 0) { }
243 return vtkstd::pair<int, vtkIdType>
244 (global_map.helper->GetEdgeOwner(
key.Id),
key.Id);
263 #undef SUBCLASS_PROPERTY_MAP_SPECIALIZATIONS
272 return hash_value(edge.
Id);
282 namespace boost {
namespace graph {
namespace parallel {
286 typedef boost::graph::distributed::mpi_process_group
type;
308 inline boost::graph::distributed::mpi_process_group
314 inline boost::graph::distributed::mpi_process_group
325 template<
typename Archiver>
331 template<
typename Archiver>
334 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
338 template<
typename Archiver>
341 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
345 template<
typename Archiver>
348 ar & boost::serialization::base_object<vtkEdgeBase>(edge)
363 typedef boost::local_property_map<boost::graph::distributed::mpi_process_group,
377 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
386 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
398 template<
typename DataArray>
401 typedef boost::parallel::distributed_property_map<
402 boost::graph::distributed::mpi_process_group,
411 template<
typename DataArray>
421 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
429 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
441 template<
typename DataArray>
444 typedef boost::parallel::distributed_property_map<
445 boost::graph::distributed::mpi_process_group,
454 template<
typename DataArray>
464 vtkErrorWithObjectMacro(graph,
"A vtkGraph without a distributed graph helper is not a distributed graph");
472 vtkErrorWithObjectMacro(graph,
"A vtkGraph with a non-Parallel BGL distributed graph helper cannot be used with the Parallel BGL");
481 #endif // __vtkPBGLGraphAdapter_h