distributed_property_map.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. .. Copyright (C) 2004-2008 The Trustees of Indiana University.
  2. Use, modification and distribution is subject to the Boost Software
  3. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. http://www.boost.org/LICENSE_1_0.txt)
  5. ===============================
  6. |Logo| Distributed Property Map
  7. ===============================
  8. A distributed property map adaptor is a property map whose stored
  9. values are distributed across multiple non-overlapping memory spaces
  10. on different processes. Values local to the current process are stored
  11. within a local property map and may be immediately accessed via
  12. ``get`` and ``put``. Values stored on remote processes may also be
  13. accessed via ``get`` and ``put``, but the behavior differs slightly:
  14. - ``put`` operations update a local ghost cell and send a "put"
  15. message to the process that owns the value. The owner is free to
  16. update its own "official" value or may ignore the put request.
  17. - ``get`` operations returns the contents of the local ghost
  18. cell. If no ghost cell is available, one is created using a
  19. (customizable) default value.
  20. Using distributed property maps requires a bit more care than using
  21. local, sequential property maps. While the syntax and semantics are
  22. similar, distributed property maps may contain out-of-date
  23. information that can only be guaranteed to be synchronized by
  24. calling the ``synchronize`` function in all processes.
  25. To address the issue of out-of-date values, distributed property
  26. maps support multiple `consistency models`_ and may be supplied with a
  27. `reduction operation`_.
  28. Distributed property maps meet the requirements of the `Readable
  29. Property Map`_ and, potentially, the `Writable Property Map`_ and
  30. `Read/Write Property Map`_ concepts. Distributed property maps do
  31. *not*, however, meet the requirements of the `Lvalue Property Map`_
  32. concept, because elements residing in another process are not
  33. directly addressible. There are several forms of distributed property
  34. maps:
  35. - `Distributed property map adaptor`_
  36. - `Distributed iterator property map`_
  37. - `Distributed safe iterator property map`_
  38. - `Local property map`_
  39. ------------------
  40. Consistency models
  41. ------------------
  42. Distributed property maps offer many consistency models, which affect
  43. how the values read from and written to remote keys relate to the
  44. "official" value for that key stored in the owning process. The
  45. consistency model of a distributed property map can be set with the
  46. member function ``set_consistency_model`` to a bitwise-OR of the
  47. flags in the ``boost::parallel::consistency_model`` enumeration. The
  48. individual flags are:
  49. - ``cm_forward``: The default consistency model, which propagates
  50. values forward from ``put`` operations on remote processors to
  51. the owner of the value being changed.
  52. - ``cm_backward``: After all values have been forwarded or flushed
  53. to the owning processes, each process receives updates values for
  54. each of its ghost cells. After synchronization, the values in
  55. ghost cells are guaranteed to match the values stored on the
  56. owning processor.
  57. - ``cm_bidirectional``: A combination of both ``cm_forward`` and
  58. ``cm_backward``.
  59. - ``cm_flush``: At the beginning of synchronization, all of the
  60. values stored locally in ghost cells are sent to their owning
  61. processors.
  62. - ``cm_reset``: Executes a ``reset()`` operation after
  63. synchronization, setting the values in each ghost cell to their
  64. default value.
  65. - ``cm_clear``: Executes a ``clear()`` operation after
  66. synchronizing, eliminating all ghost cells.
  67. There are several common combinations of flags that result in
  68. interesting consistency models. Some of these combinations are:
  69. - ``cm_forward``: By itself, the forward consistency model enables
  70. algorithms such as `Dijkstra's shortest paths`_ and
  71. `Breadth-First Search`_ to operate correctly.
  72. - ``cm_flush & cm_reset``: All updates values are queued locally,
  73. then flushed during the synchronization step. Once the flush has
  74. occurred, the ghost cells are restored to their default
  75. values. This consistency model is used by the PageRank_
  76. implementation to locally accumulate rank for each node.
  77. -------------------
  78. Reduction operation
  79. -------------------
  80. The reduction operation maintains consistency by determining how
  81. multiple writes to a property map are resolved and what the property
  82. map should do if unknown values are requested. More specifically, a
  83. reduction operation is used in two cases:
  84. 1. When a value is needed for a remote key but no value is
  85. immediately available, the reduction operation provides a
  86. suitable default. For instance, a distributed property map
  87. storing distances may have a reduction operation that returns
  88. an infinite value as the default, whereas a distributed
  89. property map for vertex colors may return white as the
  90. default.
  91. 2. When a value is received from a remote process, the process
  92. owning the key associated with that value must determine which
  93. value---the locally stored value, the value received from a
  94. remote process, or some combination of the two---will be
  95. stored as the "official" value in the property map. The
  96. reduction operation transforms the local and remote values
  97. into the "official" value to be stored.
  98. The reduction operation of a distributed property map can be set with
  99. the ``set_reduce`` method of ``distributed_property_map``. The reduce
  100. operation is a function object with two signatures. The first
  101. signature takes a (remote) key and returns a default value for it,
  102. whereas the second signatures takes a key and two values (local first,
  103. then remote) and will return the combined value that will be stored in
  104. the local property map. Reduction operations must also contain a
  105. static constant ``non_default_resolver", which states whether the
  106. reduction operation's default value actually acts like a default
  107. value. It should be ``true`` when the default is meaningful (e.g.,
  108. infinity for a distance) and ``false`` when the default should not be
  109. used.
  110. The following reduction operation is used by the distributed PageRank
  111. algorithm. The default rank for a remote node is 0. Rank is
  112. accumulated locally, and then the reduction operation combines local
  113. and remote values by adding them. Combined with a consistency model
  114. that flushes all values to the owner and then resets the values
  115. locally in each step, the resulting property map will compute partial
  116. sums on each processor and then accumulate the results on the owning
  117. processor. The PageRank reduction operation is defined as follows.
  118. ::
  119. template<typename T>
  120. struct rank_accumulate_reducer {
  121. static const bool non_default_resolver = true;
  122. // The default rank of an unknown node
  123. template<typename K>
  124. T operator()(const K&) const { return T(0); }
  125. template<typename K>
  126. T operator()(const K&, const T& x, const T& y) const { return x + y; }
  127. };
  128. --------------------------------
  129. Distributed property map adaptor
  130. --------------------------------
  131. The distributed property map adaptor creates a distributed property
  132. map from a local property map, a `process group`_ over which
  133. distribution should occur, and a `global descriptor`_ type that
  134. indexes the distributed property map.
  135. Synopsis
  136. ~~~~~~~~
  137. ::
  138. template<typename ProcessGroup, typename LocalPropertyMap, typename Key,
  139. typename GhostCellS = gc_mapS>
  140. class distributed_property_map
  141. {
  142. public:
  143. typedef ... ghost_regions_type;
  144. distributed_property_map();
  145. distributed_property_map(const ProcessGroup& pg,
  146. const LocalPropertyMap& pm);
  147. template<typename Reduce>
  148. distributed_property_map(const ProcessGroup& pg,
  149. const LocalPropertyMap& pm,
  150. const Reduce& reduce);
  151. template<typename Reduce> void set_reduce(const Reduce& reduce);
  152. void set_consistency_model(int model);
  153. void flush();
  154. void reset();
  155. void clear();
  156. };
  157. reference get(distributed_property_map pm, const key_type& key);
  158. void
  159. put(distributed_property_map pm, const key_type& key, const value_type& value);
  160. local_put(distributed_property_map pm, const key_type& key, const value_type& value);
  161. void request(distributed_property_map pm, const key_type& key);
  162. void synchronize(distributed_property_map& pm);
  163. template<typename Key, typename ProcessGroup, typename LocalPropertyMap>
  164. distributed_property_map<ProcessGroup, LocalPropertyMap, Key>
  165. make_distributed_property_map(const ProcessGroup& pg, LocalPropertyMap pmap);
  166. template<typename Key, typename ProcessGroup, typename LocalPropertyMap,
  167. typename Reduce>
  168. distributed_property_map<ProcessGroup, LocalPropertyMap, Key>
  169. make_distributed_property_map(const ProcessGroup& pg, LocalPropertyMap pmap,
  170. Reduce reduce);
  171. Template parameters
  172. ~~~~~~~~~~~~~~~~~~~
  173. **ProcessGroup**:
  174. The type of the process group over which the
  175. property map is distributed and is also the medium for
  176. communication.
  177. **LocalPropertyMap**:
  178. The type of the property map that will store values
  179. for keys local to this processor. The ``value_type`` of this
  180. property map will become the ``value_type`` of the distributed
  181. property map. The distributed property map models the same property
  182. map concepts as the ``LocalPropertyMap``, with one exception: a
  183. distributed property map cannot be an `Lvalue Property Map`_
  184. (because remote values are not addressable), and is therefore
  185. limited to `Read/Write Property Map`_.
  186. **Key**:
  187. The ``key_type`` of the distributed property map, which
  188. must model the `Global Descriptor`_ concept. The process ID type of
  189. the ``Key`` parameter must match the process ID type of the
  190. ``ProcessGroup``, and the local descriptor type of the ``Key`` must
  191. be convertible to the ``key_type`` of the ``LocalPropertyMap``.
  192. **GhostCellS**:
  193. A selector type that indicates how ghost cells should be stored in
  194. the distributed property map. There are either two or three
  195. options, depending on your compiler:
  196. - ``boost::parallel::gc_mapS`` (default): Uses an STL ``map`` to
  197. store the ghost cells for each process.
  198. - ``boost::parallel::gc_vector_mapS``: Uses a sorted STL
  199. ``vector`` to store the ghost cells for each process. This
  200. option works well when there are likely to be few insertions
  201. into the ghost cells; for instance, if the only ghost cells used
  202. are for neighboring vertices, the property map can be
  203. initialized with cells for each neighboring vertex, providing
  204. faster lookups than a ``map`` and using less space.
  205. - ``boost::parallel::gc_hash_mapS``: Uses the GCC ``hash_map`` to
  206. store ghost cells. This option may improve performance over
  207. ``map`` for large problems sizes, where the set of ghost cells
  208. cannot be predetermined.
  209. Member functions
  210. ~~~~~~~~~~~~~~~~
  211. ::
  212. distributed_property_map();
  213. Default-construct a distributed property map. The property map is in
  214. an invalid state, and may only be used if it is reassigned to a valid
  215. property map.
  216. ------------------------------------------------------------------------------
  217. ::
  218. distributed_property_map(const ProcessGroup& pg,
  219. const LocalPropertyMap& pm);
  220. template<typename Reduce>
  221. distributed_property_map(const ProcessGroup& pg,
  222. const LocalPropertyMap& pm,
  223. const Reduce& reduce);
  224. Construct a property map from a process group and a local property
  225. map. If a ``reduce`` operation is not supplied, a default of
  226. ``basic_reduce<value_type>`` will be used.
  227. ------------------------------------------------------------------------------
  228. ::
  229. template<typename Reduce> void set_reduce(const Reduce& reduce);
  230. Replace the current reduction operation with the new operation
  231. ``reduce``.
  232. ------------------------------------------------------------------------------
  233. ::
  234. void set_consistency_model(int model);
  235. Sets the consistency model of the distributed property map, which will
  236. take effect on the next synchronization step. See the section
  237. `Consistency models`_ for a description of the effect of various
  238. consistency model flags.
  239. ------------------------------------------------------------------------------
  240. ::
  241. void flush();
  242. Emits a message sending the contents of all local ghost cells to the
  243. owners of those cells.
  244. ------------------------------------------------------------------------------
  245. ::
  246. void reset();
  247. Replaces the values stored in each of the ghost cells with the default
  248. value generated by the reduction operation.
  249. ------------------------------------------------------------------------------
  250. ::
  251. void clear();
  252. Removes all ghost cells from the property map.
  253. Free functions
  254. ~~~~~~~~~~~~~~
  255. ::
  256. reference get(distributed_property_map pm, const key_type& key);
  257. Retrieves the element in ``pm`` associated with the given ``key``. If
  258. the key refers to data stored locally, returns the actual value
  259. associated with the key. If the key refers to nonlocal data, returns
  260. the value of the ghost cell. If no ghost cell exists, the behavior
  261. depends on the current reduction operation: if a reduction operation
  262. has been set and has ``non_default_resolver`` set ``true``, then a
  263. ghost cell will be created according to the default value provided by
  264. the reduction operation. Otherwise, the call to ``get`` will abort
  265. because no value exists for this remote cell. To avoid this problem,
  266. either set a reduction operation that generates default values,
  267. ``request()`` the value and then perform a synchronization step, or
  268. ``put`` a value into the cell before reading it.
  269. ------------------------------------------------------------------------------
  270. ::
  271. void
  272. put(distributed_property_map pm, const key_type& key, const value_type& value);
  273. Places the given ``value`` associated with ``key`` into property map
  274. ``pm``. If the key refers to data stored locally, the value is
  275. immediately updates. If the key refers to data stored in a remote
  276. process, updates (or creates) a local ghost cell containing this
  277. value for the key and sends the new value to the owning process. Note
  278. that the owning process may reject this value based on the reduction
  279. operation, but this will not be detected until the next
  280. synchronization step.
  281. ------------------------------------------------------------------------------
  282. ::
  283. void
  284. local_put(distributed_property_map pm, const key_type& key, const value_type& value);
  285. Equivalent to ``put(pm, key, value)``, except that no message is sent
  286. to the owning process when the value is changed for a nonlocal key.
  287. ------------------------------------------------------------------------------
  288. ::
  289. void synchronize(distributed_property_map& pm);
  290. Synchronize the values stored in the distributed property maps. Each
  291. process much execute ``synchronize`` at the same time, after which
  292. the ghost cells in every process will reflect the actual value stored
  293. in the owning process.
  294. ------------------------------------------------------------------------------
  295. ::
  296. void request(distributed_property_map pm, const key_type& key);
  297. Request that the element "key" be available after the next
  298. synchronization step. For a non-local key, this means establishing a
  299. ghost cell and requesting.
  300. ------------------------------------------------------------------------------
  301. ::
  302. template<typename Key, typename ProcessGroup, typename LocalPropertyMap>
  303. distributed_property_map<ProcessGroup, LocalPropertyMap, Key>
  304. make_distributed_property_map(const ProcessGroup& pg, LocalPropertyMap pmap);
  305. template<typename Key, typename ProcessGroup, typename LocalPropertyMap,
  306. typename Reduce>
  307. distributed_property_map<ProcessGroup, LocalPropertyMap, Key>
  308. make_distributed_property_map(const ProcessGroup& pg, LocalPropertyMap pmap,
  309. Reduce reduce);
  310. Create a distributed property map over process group ``pg`` and local
  311. property map ``pmap``. A default reduction operation will be generated
  312. if it is not provided.
  313. ---------------------------------
  314. Distributed iterator property map
  315. ---------------------------------
  316. The distributed iterator property map adaptor permits the creation of
  317. distributed property maps from random access iterators using the same
  318. syntax as non-distributed iterator property maps. The specialization
  319. is based on a `local property map`_, which contains the
  320. indices for local descriptors and is typically returned to describe
  321. the vertex indices of a distributed graph.
  322. Synopsis
  323. ~~~~~~~~
  324. ::
  325. template<typename RandomAccessIterator, typename ProcessGroup,
  326. typename GlobalKey, typename LocalMap, typename ValueType,
  327. typename Reference>
  328. class iterator_property_map<RandomAccessIterator,
  329. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  330. ValueType, Reference>
  331. {
  332. public:
  333. typedef local_property_map<ProcessGroup, GlobalKey, LocalMap> index_map_type;
  334. iterator_property_map();
  335. iterator_property_map(RandomAccessIterator iter, const index_map_type& id);
  336. };
  337. reference get(iterator_property_map pm, const key_type& key);
  338. void put(iterator_property_map pm, const key_type& key, const value_type& value);
  339. template<typename RandomAccessIterator, typename ProcessGroup,
  340. typename GlobalKey, typename LocalMap>
  341. iterator_property_map<RandomAccessIterator,
  342. local_property_map<ProcessGroup, GlobalKey, LocalMap> >
  343. make_iterator_property_map(RandomAccessIterator iter,
  344. local_property_map<ProcessGroup, GlobalKey, LocalMap> id);
  345. Member functions
  346. ~~~~~~~~~~~~~~~~
  347. ::
  348. iterator_property_map();
  349. Default-constructs a distributed iterator property map. The property
  350. map is in an invalid state, and must be reassigned before it may be
  351. used.
  352. ------------------------------------------------------------------------------
  353. ::
  354. iterator_property_map(RandomAccessIterator iter, const index_map_type& id);
  355. Constructs a distributed iterator property map using the property map
  356. ``id`` to map global descriptors to local indices. The random access
  357. iterator sequence ``[iter, iter + n)`` must be a valid range, where
  358. ``[0, n)`` is the range of local indices.
  359. Free functions
  360. ~~~~~~~~~~~~~~
  361. ::
  362. reference get(iterator_property_map pm, const key_type& key);
  363. Returns the value associated with the given ``key`` from the
  364. distributed property map.
  365. ------------------------------------------------------------------------------
  366. ::
  367. void put(iterator_property_map pm, const key_type& key, const value_type& value);
  368. Associates the value with the given key in the distributed property map.
  369. ------------------------------------------------------------------------------
  370. ::
  371. template<typename RandomAccessIterator, typename ProcessGroup,
  372. typename GlobalKey, typename LocalMap, typename ValueType,
  373. typename Reference>
  374. iterator_property_map<RandomAccessIterator,
  375. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  376. ValueType, Reference>
  377. make_iterator_property_map(RandomAccessIterator iter,
  378. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  379. ValueType, Reference> id);
  380. Creates a distributed iterator property map using the given iterator
  381. ``iter`` and local index property map ``id``.
  382. --------------------------------------
  383. Distributed safe iterator property map
  384. --------------------------------------
  385. The distributed safe iterator property map adaptor permits the
  386. creation of distributed property maps from random access iterators
  387. using the same syntax as non-distributed safe iterator property
  388. maps. The specialization is based on a `local property map`_, which
  389. contains the indices for local descriptors and is typically returned
  390. to describe the vertex indices of a distributed graph. Safe iterator
  391. property maps check the indices of accesses to ensure that they are
  392. not out-of-bounds before attempting to access an value.
  393. Synopsis
  394. ~~~~~~~~
  395. ::
  396. template<typename RandomAccessIterator, typename ProcessGroup,
  397. typename GlobalKey, typename LocalMap, typename ValueType,
  398. typename Reference>
  399. class safe_iterator_property_map<RandomAccessIterator,
  400. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  401. ValueType, Reference>
  402. {
  403. public:
  404. typedef local_property_map<ProcessGroup, GlobalKey, LocalMap> index_map_type;
  405. safe_iterator_property_map();
  406. safe_iterator_property_map(RandomAccessIterator iter, std::size_t n,
  407. const index_map_type& id);
  408. };
  409. reference get(safe_iterator_property_map pm, const key_type& key);
  410. void put(safe_iterator_property_map pm, const key_type& key, const value_type& value);
  411. template<typename RandomAccessIterator, typename ProcessGroup,
  412. typename GlobalKey, typename LocalMap, typename ValueType,
  413. typename Reference>
  414. safe_iterator_property_map<RandomAccessIterator,
  415. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  416. ValueType, Reference>
  417. make_safe_iterator_property_map(RandomAccessIterator iter,
  418. std::size_t n,
  419. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  420. ValueType, Reference> id);
  421. Member functions
  422. ~~~~~~~~~~~~~~~~
  423. ::
  424. safe_iterator_property_map();
  425. Default-constructs a distributed safe iterator property map. The property
  426. map is in an invalid state, and must be reassigned before it may be
  427. used.
  428. ------------------------------------------------------------------------------
  429. ::
  430. safe_iterator_property_map(RandomAccessIterator iter, std::size_t n,
  431. const index_map_type& id);
  432. Constructs a distributed safe iterator property map using the property map
  433. ``id`` to map global descriptors to local indices. The random access
  434. iterator sequence ``[iter, iter + n)``.
  435. Free functions
  436. ~~~~~~~~~~~~~~
  437. ::
  438. reference get(safe_iterator_property_map pm, const key_type& key);
  439. Returns the value associated with the given ``key`` from the
  440. distributed property map.
  441. ------------------------------------------------------------------------------
  442. ::
  443. void put(safe_iterator_property_map pm, const key_type& key, const value_type& value);
  444. Associates the value with the given key in the distributed property map.
  445. ------------------------------------------------------------------------------
  446. ::
  447. template<typename RandomAccessIterator, typename ProcessGroup,
  448. typename GlobalKey, typename LocalMap, typename ValueType,
  449. typename Reference>
  450. safe_iterator_property_map<RandomAccessIterator,
  451. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  452. ValueType, Reference>
  453. make_safe_iterator_property_map(RandomAccessIterator iter,
  454. std::size_t n,
  455. local_property_map<ProcessGroup, GlobalKey, LocalMap>,
  456. ValueType, Reference> id);
  457. Creates a distributed safe iterator property map using the given iterator
  458. ``iter`` and local index property map ``id``. The indices in ``id`` must
  459. ------------------
  460. Local property map
  461. ------------------
  462. A property map adaptor that accesses an underlying property map whose
  463. key type is the local part of the ``Key`` type for the local subset
  464. of keys. Local property maps are typically used by distributed graph
  465. types for vertex index properties.
  466. Synopsis
  467. ~~~~~~~~
  468. ::
  469. template<typename ProcessGroup, typename GlobalKey, typename LocalMap>
  470. class local_property_map
  471. {
  472. public:
  473. typedef typename property_traits<LocalMap>::value_type value_type;
  474. typedef GlobalKey key_type;
  475. typedef typename property_traits<LocalMap>::reference reference;
  476. typedef typename property_traits<LocalMap>::category category;
  477. explicit
  478. local_property_map(const ProcessGroup& process_group = ProcessGroup(),
  479. const LocalMap& local_map = LocalMap());
  480. reference operator[](const key_type& key);
  481. };
  482. reference get(const local_property_map& pm, key_type key);
  483. void put(local_property_map pm, const key_type& key, const value_type& value);
  484. Template parameters
  485. ~~~~~~~~~~~~~~~~~~~
  486. :ProcessGroup: the type of the process group over which the global
  487. keys are distributed.
  488. :GlobalKey: The ``key_type`` of the local property map, which
  489. must model the `Global Descriptor`_ concept. The process ID type of
  490. the ``GlobalKey`` parameter must match the process ID type of the
  491. ``ProcessGroup``, and the local descriptor type of the ``GlobalKey``
  492. must be convertible to the ``key_type`` of the ``LocalMap``.
  493. :LocalMap: the type of the property map that will store values
  494. for keys local to this processor. The ``value_type`` of this
  495. property map will become the ``value_type`` of the local
  496. property map. The local property map models the same property
  497. map concepts as the ``LocalMap``.
  498. Member functions
  499. ~~~~~~~~~~~~~~~~
  500. ::
  501. explicit
  502. local_property_map(const ProcessGroup& process_group = ProcessGroup(),
  503. const LocalMap& local_map = LocalMap());
  504. Constructs a local property map whose keys are distributed across the
  505. given process group and which accesses the given local map.
  506. ------------------------------------------------------------------------------
  507. ::
  508. reference operator[](const key_type& key);
  509. Access the value associated with the given key, which must be local
  510. to this process.
  511. Free functions
  512. ~~~~~~~~~~~~~~
  513. ::
  514. reference get(const local_property_map& pm, key_type key);
  515. Return the value associated with the given key, which must be local
  516. to this process.
  517. ------------------------------------------------------------------------------
  518. ::
  519. void put(local_property_map pm, const key_type& key, const value_type& value);
  520. Set the value associated with the given key, which must be local to
  521. this process.
  522. -----------------------------------------------------------------------------
  523. Copyright (C) 2004, 2005 The Trustees of Indiana University.
  524. Authors: Douglas Gregor and Andrew Lumsdaine
  525. .. |Logo| image:: pbgl-logo.png
  526. :align: middle
  527. :alt: Parallel BGL
  528. :target: http://www.osl.iu.edu/research/pbgl
  529. .. _Readable Property Map: http://www.boost.org/libs/property_map/ReadablePropertyMap.html
  530. .. _Writable Property Map: http://www.boost.org/libs/property_map/WritablePropertyMap.html
  531. .. _Read/Write Property Map: http://www.boost.org/libs/property_map/ReadWritePropertyMap.html
  532. .. _Lvalue Property Map: http://www.boost.org/libs/property_map/LvaluePropertyMap.html
  533. .. _Process Group: process_group.html
  534. .. _Global Descriptor: GlobalDescriptor.html
  535. .. _Dijkstra's shortest paths: dijkstra_shortest_paths.html
  536. .. _Breadth-First Search: breadth_first_search.html
  537. .. _PageRank: page_rank.html