#ifndef BOOST_PARALLEL_DISTRIBUTED_PROPERTY_MAP_HPP
#define BOOST_PARALLEL_DISTRIBUTED_PROPERTY_MAP_HPP
-#ifndef BOOST_GRAPH_USE_MPI
-#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
-#endif
-
#include <boost/assert.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/optional.hpp>
-#include <boost/graph/parallel/process_group.hpp>
-#include <boost/graph/detail/edge.hpp>
+#include <boost/property_map/parallel/process_group.hpp>
#include <boost/function/function1.hpp>
#include <vector>
#include <set>
-#include <boost/graph/parallel/basic_reduce.hpp>
-#include <boost/graph/parallel/detail/untracked_pair.hpp>
+#include <boost/property_map/parallel/basic_reduce.hpp>
+#include <boost/property_map/parallel/detail/untracked_pair.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/property_map/parallel/local_property_map.hpp>
#include <map>
#include <boost/version.hpp>
-#include <boost/graph/distributed/unsafe_serialize.hpp>
+#include <boost/property_map/parallel/unsafe_serialize.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
namespace boost { namespace parallel {
-using boost::graph::parallel::trigger_receive_context;
-
namespace detail {
/**************************************************************************
* Metafunction that degrades an Lvalue Property Map category tag to
template<typename PropertyMap, typename Key, typename Value>
static inline void
do_put(PropertyMap pm, const Key& key, const Value& value)
- {
+ {
using boost::put;
- put(pm, key, value);
+ put(pm, key, value);
}
};
property_map_put,
/** A request to retrieve a particular value in a property
- * map. The message contains a key. The owner of that key will
+ * map. The message contains a key. The owner of that key will
* reply with a value.
*/
property_map_get,
reference operator[](const key_type& key) const
{
owner_local_pair p = get(data->global, key);
-
+
if (p.first == process_id(data->process_group)) {
return data->storage[p.second];
} else {
* \internal
*
*/
- void
+ void
request_put(process_id_type p, const key_type& k, const value_type& v) const
- {
- send(data->process_group, p, property_map_put,
- boost::parallel::detail::make_untracked_pair(k, v));
+ {
+ send(data->process_group, p, property_map_put,
+ boost::parallel::detail::make_untracked_pair(k, v));
}
/** Access the ghost cell for the given key.
struct data_t
{
- data_t(const ProcessGroup& pg, const GlobalMap& global,
+ data_t(const ProcessGroup& pg, const GlobalMap& global,
const StorageMap& pm, const function1<value_type, key_type>& dv,
bool has_default_resolver)
- : process_group(pg), global(global), storage(pm),
- ghost_cells(), max_ghost_cells(1000000), get_default_value(dv),
+ : process_group(pg), global(global), storage(pm),
+ ghost_cells(), max_ghost_cells(1000000), get_default_value(dv),
has_default_resolver(has_default_resolver), model(cm_forward) { }
/// The process group
void operator()(process_id_type source, int tag);
/// Individual message handlers
- void
- handle_put(int source, int tag,
- const boost::parallel::detail::untracked_pair<key_type, value_type>& data,
+ void
+ handle_put(int source, int tag,
+ const boost::parallel::detail::untracked_pair<key_type, value_type>& data,
trigger_receive_context);
value_type
- handle_get(int source, int tag, const key_type& data,
+ handle_get(int source, int tag, const key_type& data,
trigger_receive_context);
void
- handle_multiget(int source, int tag,
+ handle_multiget(int source, int tag,
const std::vector<key_type>& data,
trigger_receive_context);
void
handle_multiget_reply
- (int source, int tag,
+ (int source, int tag,
const std::vector<boost::parallel::detail::untracked_pair<key_type, value_type> >& msg,
trigger_receive_context);
void
handle_multiput
- (int source, int tag,
+ (int source, int tag,
const std::vector<unsafe_pair<local_key_type, value_type> >& data,
trigger_receive_context);
{
using boost::get;
- typename property_traits<GlobalMap>::value_type p =
+ typename property_traits<GlobalMap>::value_type p =
get(pm.data->global, key);
if (p.first == process_id(pm.data->process_group)) {
{
using boost::put;
- typename property_traits<GlobalMap>::value_type p =
+ typename property_traits<GlobalMap>::value_type p =
get(pm.data->global, key);
if (p.first == process_id(pm.data->process_group)) {
put(pm.data->storage, p.second, value);
} else {
- if (pm.data->model & cm_forward)
+ if (pm.data->model & cm_forward)
pm.request_put(p.first, key, value);
pm.cell(key, false) = value;
{
using boost::put;
- typename property_traits<GlobalMap>::value_type p =
+ typename property_traits<GlobalMap>::value_type p =
get(pm.data->global, key);
if (p.first == process_id(pm.data->process_group))
/// Create a distributed property map.
template<typename ProcessGroup, typename GlobalMap, typename StorageMap>
inline distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
-make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
+make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
StorageMap storage)
{
typedef distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
/**
* \overload
*/
-template<typename ProcessGroup, typename GlobalMap, typename StorageMap,
+template<typename ProcessGroup, typename GlobalMap, typename StorageMap,
typename Reduce>
inline distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
-make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
+make_distributed_property_map(const ProcessGroup& pg, GlobalMap global,
StorageMap storage, Reduce reduce)
{
typedef distributed_property_map<ProcessGroup, GlobalMap, StorageMap>
} } // end namespace boost::parallel
-// Boost's functional/hash
-namespace boost {
- template<typename D, typename V>
- struct hash<boost::detail::edge_desc_impl<D, V> >
- {
- std::size_t operator()(const boost::detail::edge_desc_impl<D, V> & x) const
- { return hash_value(x.get_property()); }
- };
-}
-
#include <boost/property_map/parallel/impl/distributed_property_map.ipp>
#undef PBGL_DISTRIB_PMAP