Distributed property map adaptor. More...
#include <distributed_property_map.hpp>
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_type & | cell (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_t > | data |
Friends | |
struct | data_t |
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:
ProcessGroup | the type of the process group over which the property map is distributed and is also the medium for communication. |
StorageMap | the 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. |
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.
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.
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.
typedef ghost_cells_type::iterator boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::iterator |
Iterator into the ghost cells.
typedef ghost_cells_key_index_type::iterator boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::key_iterator |
Iterator into the ghost cells (by key)
typedef property_traits<GlobalMap>::key_type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::key_type |
The key type of the property map.
typedef ProcessGroup boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::process_group_type |
typedef property_traits<StorageMap>::reference boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::reference |
typedef property_traits<StorageMap>::value_type boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::value_type |
The value type of the 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.
|
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.
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.
boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::~distributed_property_map | ( | ) |
|
inline |
|
inline |
value_type& boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::cell | ( | const key_type & | k, |
bool | request_if_missing = true |
||
) | const |
Access the ghost cell for the given key.
Referenced by boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::operator[]().
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::clear | ( | ) |
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::do_synchronize | ( | ) |
Perform synchronization.
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::flush | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sends a "put" request.
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::reset | ( | ) |
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::set_consistency_model | ( | int | model | ) |
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::set_max_ghost_cells | ( | std::size_t | max_ghost_cells | ) |
void boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::set_reduce | ( | const Reduce & | reduce | ) |
Set the reduce operation of the distributed property map.
|
friend |
shared_ptr<data_t> boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap >::data |
Referenced by boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::base(), boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::distributed_property_map(), boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::get_consistency_model(), boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::global(), boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::operator[](), boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::process_group(), and boost::parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map< T, StorageMap > >::request_put().