annotate DEPENDENCIES/generic/include/boost/property_map/parallel/parallel_property_maps.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents f46d142149f5
children
rev   line source
Chris@102 1 // (C) Copyright Jeremy Siek 1999-2001.
Chris@102 2 // Copyright (C) 2006 Trustees of Indiana University
Chris@102 3 // Authors: Douglas Gregor and Jeremy Siek
Chris@102 4
Chris@102 5 // Distributed under the Boost Software License, Version 1.0. (See
Chris@102 6 // accompanying file LICENSE_1_0.txt or copy at
Chris@102 7 // http://www.boost.org/LICENSE_1_0.txt)
Chris@102 8
Chris@102 9 // See http://www.boost.org/libs/property_map for documentation.
Chris@102 10
Chris@102 11 #ifndef BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP
Chris@102 12 #define BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP
Chris@102 13
Chris@102 14 // Parallel property maps moved over from <boost/property_map/property_map.hpp>
Chris@102 15 // as part of refactoring out all parallel code from sequential property map
Chris@102 16 // library.
Chris@102 17
Chris@102 18 #include <boost/assert.hpp>
Chris@102 19 #include <boost/config.hpp>
Chris@102 20 #include <boost/static_assert.hpp>
Chris@102 21 #include <cstddef>
Chris@102 22 #include <boost/detail/iterator.hpp>
Chris@102 23 #include <boost/concept_check.hpp>
Chris@102 24 #include <boost/concept_archetype.hpp>
Chris@102 25 #include <boost/mpl/assert.hpp>
Chris@102 26 #include <boost/mpl/or.hpp>
Chris@102 27 #include <boost/mpl/and.hpp>
Chris@102 28 #include <boost/mpl/has_xxx.hpp>
Chris@102 29 #include <boost/type_traits/is_same.hpp>
Chris@102 30 #include <boost/property_map/property_map.hpp>
Chris@102 31
Chris@102 32 #include <boost/property_map/parallel/distributed_property_map.hpp>
Chris@102 33 #include <boost/property_map/parallel/local_property_map.hpp>
Chris@102 34
Chris@102 35 namespace boost {
Chris@102 36 /** Distributed iterator property map.
Chris@102 37 *
Chris@102 38 * This specialization of @ref iterator_property_map builds a
Chris@102 39 * distributed iterator property map given the local index maps
Chris@102 40 * generated by distributed graph types that automatically have index
Chris@102 41 * properties.
Chris@102 42 *
Chris@102 43 * This specialization is useful when creating external distributed
Chris@102 44 * property maps via the same syntax used to create external
Chris@102 45 * sequential property maps.
Chris@102 46 */
Chris@102 47 template<typename RandomAccessIterator, typename ProcessGroup,
Chris@102 48 typename GlobalMap, typename StorageMap,
Chris@102 49 typename ValueType, typename Reference>
Chris@102 50 class iterator_property_map
Chris@102 51 <RandomAccessIterator,
Chris@102 52 local_property_map<ProcessGroup, GlobalMap, StorageMap>,
Chris@102 53 ValueType, Reference>
Chris@102 54 : public parallel::distributed_property_map
Chris@102 55 <ProcessGroup,
Chris@102 56 GlobalMap,
Chris@102 57 iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 58 ValueType, Reference> >
Chris@102 59 {
Chris@102 60 typedef iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 61 ValueType, Reference> local_iterator_map;
Chris@102 62
Chris@102 63 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
Chris@102 64 local_iterator_map> inherited;
Chris@102 65
Chris@102 66 typedef local_property_map<ProcessGroup, GlobalMap, StorageMap>
Chris@102 67 index_map_type;
Chris@102 68 typedef iterator_property_map self_type;
Chris@102 69
Chris@102 70 public:
Chris@102 71 iterator_property_map() { }
Chris@102 72
Chris@102 73 iterator_property_map(RandomAccessIterator cc, const index_map_type& id)
Chris@102 74 : inherited(id.process_group(), id.global(),
Chris@102 75 local_iterator_map(cc, id.base())) { }
Chris@102 76 };
Chris@102 77
Chris@102 78 /** Distributed iterator property map.
Chris@102 79 *
Chris@102 80 * This specialization of @ref iterator_property_map builds a
Chris@102 81 * distributed iterator property map given a distributed index
Chris@102 82 * map. Only the local portion of the distributed index property map
Chris@102 83 * is utilized.
Chris@102 84 *
Chris@102 85 * This specialization is useful when creating external distributed
Chris@102 86 * property maps via the same syntax used to create external
Chris@102 87 * sequential property maps.
Chris@102 88 */
Chris@102 89 template<typename RandomAccessIterator, typename ProcessGroup,
Chris@102 90 typename GlobalMap, typename StorageMap,
Chris@102 91 typename ValueType, typename Reference>
Chris@102 92 class iterator_property_map<
Chris@102 93 RandomAccessIterator,
Chris@102 94 parallel::distributed_property_map<ProcessGroup,GlobalMap,StorageMap>,
Chris@102 95 ValueType, Reference
Chris@102 96 >
Chris@102 97 : public parallel::distributed_property_map
Chris@102 98 <ProcessGroup,
Chris@102 99 GlobalMap,
Chris@102 100 iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 101 ValueType, Reference> >
Chris@102 102 {
Chris@102 103 typedef iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 104 ValueType, Reference> local_iterator_map;
Chris@102 105
Chris@102 106 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
Chris@102 107 local_iterator_map> inherited;
Chris@102 108
Chris@102 109 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
Chris@102 110 StorageMap>
Chris@102 111 index_map_type;
Chris@102 112
Chris@102 113 public:
Chris@102 114 iterator_property_map() { }
Chris@102 115
Chris@102 116 iterator_property_map(RandomAccessIterator cc, const index_map_type& id)
Chris@102 117 : inherited(id.process_group(), id.global(),
Chris@102 118 local_iterator_map(cc, id.base())) { }
Chris@102 119 };
Chris@102 120
Chris@102 121 namespace parallel {
Chris@102 122 // Generate an iterator property map with a specific kind of ghost
Chris@102 123 // cells
Chris@102 124 template<typename RandomAccessIterator, typename ProcessGroup,
Chris@102 125 typename GlobalMap, typename StorageMap>
Chris@102 126 distributed_property_map<ProcessGroup,
Chris@102 127 GlobalMap,
Chris@102 128 iterator_property_map<RandomAccessIterator,
Chris@102 129 StorageMap> >
Chris@102 130 make_iterator_property_map(RandomAccessIterator cc,
Chris@102 131 local_property_map<ProcessGroup, GlobalMap,
Chris@102 132 StorageMap> index_map)
Chris@102 133 {
Chris@102 134 typedef distributed_property_map<
Chris@102 135 ProcessGroup, GlobalMap,
Chris@102 136 iterator_property_map<RandomAccessIterator, StorageMap> >
Chris@102 137 result_type;
Chris@102 138 return result_type(index_map.process_group(), index_map.global(),
Chris@102 139 make_iterator_property_map(cc, index_map.base()));
Chris@102 140 }
Chris@102 141
Chris@102 142 } // end namespace parallel
Chris@102 143
Chris@102 144 /** Distributed safe iterator property map.
Chris@102 145 *
Chris@102 146 * This specialization of @ref safe_iterator_property_map builds a
Chris@102 147 * distributed iterator property map given the local index maps
Chris@102 148 * generated by distributed graph types that automatically have index
Chris@102 149 * properties.
Chris@102 150 *
Chris@102 151 * This specialization is useful when creating external distributed
Chris@102 152 * property maps via the same syntax used to create external
Chris@102 153 * sequential property maps.
Chris@102 154 */
Chris@102 155 template<typename RandomAccessIterator, typename ProcessGroup,
Chris@102 156 typename GlobalMap, typename StorageMap, typename ValueType,
Chris@102 157 typename Reference>
Chris@102 158 class safe_iterator_property_map
Chris@102 159 <RandomAccessIterator,
Chris@102 160 local_property_map<ProcessGroup, GlobalMap, StorageMap>,
Chris@102 161 ValueType, Reference>
Chris@102 162 : public parallel::distributed_property_map
Chris@102 163 <ProcessGroup,
Chris@102 164 GlobalMap,
Chris@102 165 safe_iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 166 ValueType, Reference> >
Chris@102 167 {
Chris@102 168 typedef safe_iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 169 ValueType, Reference> local_iterator_map;
Chris@102 170
Chris@102 171 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
Chris@102 172 local_iterator_map> inherited;
Chris@102 173
Chris@102 174 typedef local_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type;
Chris@102 175
Chris@102 176 public:
Chris@102 177 safe_iterator_property_map() { }
Chris@102 178
Chris@102 179 safe_iterator_property_map(RandomAccessIterator cc, std::size_t n,
Chris@102 180 const index_map_type& id)
Chris@102 181 : inherited(id.process_group(), id.global(),
Chris@102 182 local_iterator_map(cc, n, id.base())) { }
Chris@102 183 };
Chris@102 184
Chris@102 185 /** Distributed safe iterator property map.
Chris@102 186 *
Chris@102 187 * This specialization of @ref safe_iterator_property_map builds a
Chris@102 188 * distributed iterator property map given a distributed index
Chris@102 189 * map. Only the local portion of the distributed index property map
Chris@102 190 * is utilized.
Chris@102 191 *
Chris@102 192 * This specialization is useful when creating external distributed
Chris@102 193 * property maps via the same syntax used to create external
Chris@102 194 * sequential property maps.
Chris@102 195 */
Chris@102 196 template<typename RandomAccessIterator, typename ProcessGroup,
Chris@102 197 typename GlobalMap, typename StorageMap,
Chris@102 198 typename ValueType, typename Reference>
Chris@102 199 class safe_iterator_property_map<
Chris@102 200 RandomAccessIterator,
Chris@102 201 parallel::distributed_property_map<ProcessGroup,GlobalMap,StorageMap>,
Chris@102 202 ValueType, Reference>
Chris@102 203 : public parallel::distributed_property_map
Chris@102 204 <ProcessGroup,
Chris@102 205 GlobalMap,
Chris@102 206 safe_iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 207 ValueType, Reference> >
Chris@102 208 {
Chris@102 209 typedef safe_iterator_property_map<RandomAccessIterator, StorageMap,
Chris@102 210 ValueType, Reference> local_iterator_map;
Chris@102 211
Chris@102 212 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
Chris@102 213 local_iterator_map> inherited;
Chris@102 214
Chris@102 215 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
Chris@102 216 StorageMap>
Chris@102 217 index_map_type;
Chris@102 218
Chris@102 219 public:
Chris@102 220 safe_iterator_property_map() { }
Chris@102 221
Chris@102 222 safe_iterator_property_map(RandomAccessIterator cc, std::size_t n,
Chris@102 223 const index_map_type& id)
Chris@102 224 : inherited(id.process_group(), id.global(),
Chris@102 225 local_iterator_map(cc, n, id.base())) { }
Chris@102 226 };
Chris@102 227
Chris@102 228 }
Chris@102 229
Chris@102 230 #include <boost/property_map/vector_property_map.hpp>
Chris@102 231
Chris@102 232 #endif /* BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP */
Chris@102 233