Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap > Class Template Reference

Distributed property map adaptor. More...

#include <distributed_property_map.hpp>

Inheritance diagram for boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >:
Collaboration diagram for boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >:

Classes

struct  data_t
 

Public Types

typedef property_traits
< GlobalMap >::key_type 
key_type
 The key type of the property map. More...
 
typedef property_traits
< StorageMap >::value_type 
value_type
 The value type of the property map. More...
 
typedef property_traits
< StorageMap >::reference 
reference
 
typedef ProcessGroup process_group_type
 
typedef
multi_index::multi_index_container
< std::pair< key_type,
value_type >
, multi_index::indexed_by
< multi_index::sequenced
<>, multi_index::hashed_unique
< pair_first_extractor
< key_type, value_type > > > > 
ghost_cells_type
 The type of the ghost cells. More...
 
typedef ghost_cells_type::iterator iterator
 Iterator into the ghost cells. More...
 
typedef
ghost_cells_type::template
nth_index< 1 >::type 
ghost_cells_key_index_type
 Key-based index into the ghost cells. More...
 
typedef
ghost_cells_key_index_type::iterator 
key_iterator
 Iterator into the ghost cells (by key) More...
 
typedef
detail::make_nonlvalue_property_map
< (is_base_and_derived
< lvalue_property_map_tag,
local_category >::value||is_same
< lvalue_property_map_tag,
local_category >::value)>
::template apply
< local_category >::type 
category
 The property map category. More...
 

Public Member Functions

 distributed_property_map ()
 Default-construct a distributed property map. More...
 
 distributed_property_map (const ProcessGroup &pg, const GlobalMap &global, const StorageMap &pm)
 Construct a distributed property map. More...
 
template<typename Reduce >
 distributed_property_map (const ProcessGroup &pg, const GlobalMap &global, const StorageMap &pm, const Reduce &reduce)
 Construct a distributed property map. More...
 
 ~distributed_property_map ()
 
template<typename Reduce >
void set_reduce (const Reduce &reduce)
 Set the reduce operation of the distributed property map. More...
 
void set_consistency_model (int model)
 
int get_consistency_model () const
 
void set_max_ghost_cells (std::size_t max_ghost_cells)
 
void clear ()
 
void reset ()
 
void flush ()
 
reference operator[] (const key_type &key) const
 
process_group_type process_group () const
 
StorageMap & base ()
 
const StorageMap & base () const
 
void request_put (process_id_type p, const key_type &k, const value_type &v) const
 Sends a "put" request. More...
 
value_typecell (const key_type &k, bool request_if_missing=true) const
 Access the ghost cell for the given key. More...
 
void do_synchronize ()
 Perform synchronization. More...
 
const GlobalMap & global () const
 
GlobalMap & global ()
 

Public Attributes

shared_ptr< data_tdata
 

Friends

struct data_t
 

Detailed Description

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
class boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >

Distributed property map adaptor.

The distributed property map adaptor is a property map whose stored values are distributed across multiple non-overlapping memory spaces on different processes. Values local to the current process are stored within a local property map and may be immediately accessed via get and put. Values stored on remote processes may also be access via get and put, but the behavior differs slightly:

  • put operations update a local ghost cell and send a "put" message to the process that owns the value. The owner is free to update its own "official" value or may ignore the put request.
  • get operations returns the contents of the local ghost cell. If no ghost cell is available, one is created using the default value provided by the "reduce" operation. See, e.g., basic_reduce and property_reduce.

Using distributed property maps requires a bit more care than using local, sequential property maps. While the syntax and semantics are similar, distributed property maps may contain out-of-date information that can only be guaranteed to be synchronized by calling the synchronize function in all processes.

To address the issue of out-of-date values, distributed property maps are supplied with a reduction operation. The reduction operation has two roles:

  1. When a value is needed for a remote key but no value is immediately available, the reduction operation provides a suitable default. For instance, a distributed property map storing distances may have a reduction operation that returns an infinite value as the default, whereas a distributed property map for vertex colors may return white as the default.
  2. When a value is received from a remote process, the process owning the key associated with that value must determine which value—the locally stored value, the value received from a remote process, or some combination of the two—will be stored as the "official" value in the property map. The reduction operation transforms the local and remote values into the "official" value to be stored.
Template Parameters
ProcessGroupthe type of the process group over which the property map is distributed and is also the medium for communication.
StorageMapthe type of the property map that will store values for keys local to this processor. The value_type of this property map will become the value_type of the distributed property map. The distributed property map models the same property map concepts as the LocalPropertyMap, with one exception: a distributed property map cannot be an LvaluePropertyMap (because remote values are not addressable), and is therefore limited to ReadWritePropertyMap.

Member Typedef Documentation

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef detail::make_nonlvalue_property_map< (is_base_and_derived<lvalue_property_map_tag, local_category>::value || is_same<lvalue_property_map_tag, local_category>::value)>::template apply<local_category>::type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::category

The property map category.

A distributed property map cannot be an Lvalue Property Map, because values on remote processes cannot be addresses.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef ghost_cells_type::template nth_index<1>::type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::ghost_cells_key_index_type

Key-based index into the ghost cells.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef multi_index::multi_index_container< std::pair<key_type, value_type>, multi_index::indexed_by< multi_index::sequenced<>, multi_index::hashed_unique< pair_first_extractor<key_type, value_type> > > > boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::ghost_cells_type

The type of the ghost cells.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef ghost_cells_type::iterator boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::iterator

Iterator into the ghost cells.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef ghost_cells_key_index_type::iterator boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::key_iterator

Iterator into the ghost cells (by key)

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef property_traits<GlobalMap>::key_type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::key_type

The key type of the property map.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef ProcessGroup boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::process_group_type
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef property_traits<StorageMap>::reference boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::reference
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
typedef property_traits<StorageMap>::value_type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::value_type

The value type of the property map.

Constructor & Destructor Documentation

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::distributed_property_map ( )
inline

Default-construct a distributed property map.

This function creates an initialized property map that must be assigned to a valid value before being used. It is only provided here because property maps must be Default Constructible.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::distributed_property_map ( const ProcessGroup &  pg,
const GlobalMap &  global,
const StorageMap &  pm 
)
inline

Construct a distributed property map.

Builds a distributed property map communicating over the given process group and using the given local property map for storage. Since no reduction operation is provided, the default reduction operation basic_reduce<value_type> is used.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
template<typename Reduce >
boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::distributed_property_map ( const ProcessGroup &  pg,
const GlobalMap &  global,
const StorageMap &  pm,
const Reduce &  reduce 
)

Construct a distributed property map.

Builds a distributed property map communicating over the given process group and using the given local property map for storage. The given reduce parameter is used as the reduction operation.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::~distributed_property_map ( )

Member Function Documentation

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
StorageMap& boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::base ( )
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
const StorageMap& boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::base ( ) const
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
value_type& boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::cell ( const key_type k,
bool  request_if_missing = true 
) const
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::clear ( )
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::do_synchronize ( )

Perform synchronization.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::flush ( )
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
int boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::get_consistency_model ( ) const
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
const GlobalMap& boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::global ( ) const
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
GlobalMap& boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::global ( )
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
reference boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::operator[] ( const key_type key) const
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
process_group_type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::process_group ( ) const
inline
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::request_put ( process_id_type  p,
const key_type k,
const value_type v 
) const
inline

Sends a "put" request.

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::reset ( )
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::set_consistency_model ( int  model)
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::set_max_ghost_cells ( std::size_t  max_ghost_cells)
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
template<typename Reduce >
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::set_reduce ( const Reduce &  reduce)

Set the reduce operation of the distributed property map.

Friends And Related Function Documentation

template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
friend struct data_t
friend

Member Data Documentation


The documentation for this class was generated from the following file: