// (C) Copyright Jeremy Siek 1999-2001. // Copyright (C) 2006 Trustees of Indiana University // Authors: Douglas Gregor and Jeremy Siek // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/property_map for documentation. #ifndef BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP #define BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP // Parallel property maps moved over from // as part of refactoring out all parallel code from sequential property map // library. #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { /** Distributed iterator property map. * * This specialization of @ref iterator_property_map builds a * distributed iterator property map given the local index maps * generated by distributed graph types that automatically have index * properties. * * This specialization is useful when creating external distributed * property maps via the same syntax used to create external * sequential property maps. */ template class iterator_property_map , ValueType, Reference> : public parallel::distributed_property_map > { typedef iterator_property_map local_iterator_map; typedef parallel::distributed_property_map inherited; typedef local_property_map index_map_type; typedef iterator_property_map self_type; public: iterator_property_map() { } iterator_property_map(RandomAccessIterator cc, const index_map_type& id) : inherited(id.process_group(), id.global(), local_iterator_map(cc, id.base())) { } }; /** Distributed iterator property map. * * This specialization of @ref iterator_property_map builds a * distributed iterator property map given a distributed index * map. Only the local portion of the distributed index property map * is utilized. * * This specialization is useful when creating external distributed * property maps via the same syntax used to create external * sequential property maps. */ template class iterator_property_map< RandomAccessIterator, parallel::distributed_property_map, ValueType, Reference > : public parallel::distributed_property_map > { typedef iterator_property_map local_iterator_map; typedef parallel::distributed_property_map inherited; typedef parallel::distributed_property_map index_map_type; public: iterator_property_map() { } iterator_property_map(RandomAccessIterator cc, const index_map_type& id) : inherited(id.process_group(), id.global(), local_iterator_map(cc, id.base())) { } }; namespace parallel { // Generate an iterator property map with a specific kind of ghost // cells template distributed_property_map > make_iterator_property_map(RandomAccessIterator cc, local_property_map index_map) { typedef distributed_property_map< ProcessGroup, GlobalMap, iterator_property_map > result_type; return result_type(index_map.process_group(), index_map.global(), make_iterator_property_map(cc, index_map.base())); } } // end namespace parallel /** Distributed safe iterator property map. * * This specialization of @ref safe_iterator_property_map builds a * distributed iterator property map given the local index maps * generated by distributed graph types that automatically have index * properties. * * This specialization is useful when creating external distributed * property maps via the same syntax used to create external * sequential property maps. */ template class safe_iterator_property_map , ValueType, Reference> : public parallel::distributed_property_map > { typedef safe_iterator_property_map local_iterator_map; typedef parallel::distributed_property_map inherited; typedef local_property_map index_map_type; public: safe_iterator_property_map() { } safe_iterator_property_map(RandomAccessIterator cc, std::size_t n, const index_map_type& id) : inherited(id.process_group(), id.global(), local_iterator_map(cc, n, id.base())) { } }; /** Distributed safe iterator property map. * * This specialization of @ref safe_iterator_property_map builds a * distributed iterator property map given a distributed index * map. Only the local portion of the distributed index property map * is utilized. * * This specialization is useful when creating external distributed * property maps via the same syntax used to create external * sequential property maps. */ template class safe_iterator_property_map< RandomAccessIterator, parallel::distributed_property_map, ValueType, Reference> : public parallel::distributed_property_map > { typedef safe_iterator_property_map local_iterator_map; typedef parallel::distributed_property_map inherited; typedef parallel::distributed_property_map index_map_type; public: safe_iterator_property_map() { } safe_iterator_property_map(RandomAccessIterator cc, std::size_t n, const index_map_type& id) : inherited(id.process_group(), id.global(), local_iterator_map(cc, n, id.base())) { } }; } #include #include #endif /* BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP */