|
MADNESS 0.10.1
|
Internal implementation of distributed container to facilitate shallow copy. More...
#include <worlddc.h>


Classes | |
| struct | P2Op |
Public Types | |
| typedef internal_containerT::accessor | accessor |
| typedef internal_containerT::const_accessor | const_accessor |
| typedef WorldContainerIterator< internal_const_iteratorT > | const_iterator |
| typedef WorldContainerIterator< internal_const_iteratorT > | const_iteratorT |
| typedef const pairT | const_pairT |
| typedef WorldContainerImpl< keyT, valueT, hashfunT > | implT |
| typedef internal_containerT::const_iterator | internal_const_iteratorT |
| typedef ConcurrentHashMap< keyT, valueT, hashfunT > | internal_containerT |
| typedef internal_containerT::iterator | internal_iteratorT |
| typedef WorldContainerIterator< internal_iteratorT > | iterator |
| typedef WorldContainerIterator< internal_iteratorT > | iteratorT |
| typedef std::pair< const keyT, valueT > | pairT |
| Public Types inherited from madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > > | |
| typedef WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > > | objT |
Public Member Functions | |
| WorldContainerImpl (World &world, const std::shared_ptr< WorldDCPmapInterface< keyT > > &pm, const hashfunT &hf) | |
| virtual | ~WorldContainerImpl () |
| iterator | begin () |
| const_iterator | begin () const |
| void | clear () |
| void | do_replicate (World &world) |
| iterator | end () |
| const_iterator | end () const |
| void | erase (const keyT &key) |
| template<typename InIter> | |
| void | erase (InIter first, InIter last) |
| template<typename InIter> | |
| void | erase (InIter it) |
| bool | find (accessor &acc, const keyT &key) |
| Future< iterator > | find (const keyT &key) |
| Future< const_iterator > | find (const keyT &key) const |
| bool | find (const_accessor &acc, const keyT &key) const |
| const hashfunT & | get_hash () const |
| std::shared_ptr< WorldDCPmapInterface< keyT > > & | get_pmap () |
| const std::shared_ptr< WorldDCPmapInterface< keyT > > & | get_pmap () const |
| void | insert (const pairT &datum) |
| bool | insert_acc (accessor &acc, const keyT &key) |
| void | insert_batch (const std::vector< pairT > &boxes) |
| bool | insert_const_acc (const_accessor &acc, const keyT &key) |
| bool | is_local (const keyT &key) const |
| template<typename memfunT> | |
| itemfun (const keyT &key, memfunT memfun) | |
| template<typename memfunT, typename arg1T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1) | |
| template<typename memfunT, typename arg1T, typename arg2T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2) | |
| template<typename memfunT, typename arg1T, typename arg2T, typename arg3T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3) | |
| template<typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4) | |
| template<typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5) | |
| template<typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6) | |
| template<typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T, typename arg7T> | |
| itemfun (const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const arg7T &arg7) | |
| ProcessID | owner (const keyT &key) const |
| bool | probe (const keyT &key) const |
| void | redistribute_coalesced_phase1 (const std::shared_ptr< WorldDCPmapInterface< keyT > > &newpmap) |
| void | redistribute_coalesced_phase2 (std::size_t cap_boxes, bool rotate) |
| void | redistribute_phase1 (const std::shared_ptr< WorldDCPmapInterface< keyT > > &newpmap) |
| void | redistribute_phase2 () |
| void | redistribute_phase3 () |
| void | replicate (bool fence) |
| void | replicate_on_hosts (bool fence) |
| void | reset_pmap_to_local () |
| std::size_t | size () const |
| Public Member Functions inherited from madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > > | |
| WorldObject (const WorldObject &other) | |
| virtual | ~WorldObject () |
| WorldObject & | operator= (const WorldObject &)=delete |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn) const |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const |
| Sends task to derived class method returnT (this->*memfn)(). | |
| Public Member Functions inherited from madness::WorldObjectBase | |
| virtual | ~WorldObjectBase () |
| World & | get_world () const |
| World & | get_world_noexcept () const noexcept |
| Get the world to which this object belongs, without risking a throw. | |
| const uniqueidT & | id () const |
| Returns the globally unique object ID. | |
| bool | world_is_alive () const noexcept |
| Reports whether the world to which this object belongs still exists. | |
| Public Member Functions inherited from madness::WorldDCRedistributeInterface< keyT > | |
| virtual | ~WorldDCRedistributeInterface () |
Private Member Functions | |
| WorldContainerImpl () | |
| void | find_const_failure_handler (const RemoteReference< FutureImpl< const_iterator > > &ref) |
| Handles unsuccessful const find response. | |
| void | find_const_handler (ProcessID requestor, const keyT &key, const RemoteReference< FutureImpl< const_iterator > > &ref) |
| Handles const find request. | |
| void | find_const_success_handler (const RemoteReference< FutureImpl< const_iterator > > &ref, const pairT &datum) |
| Handles successful const find response. | |
| void | find_failure_handler (const RemoteReference< FutureImpl< iterator > > &ref) |
| Handles unsuccessful find response. | |
| void | find_handler (ProcessID requestor, const keyT &key, const RemoteReference< FutureImpl< iterator > > &ref) |
| Handles find request. | |
| void | find_success_handler (const RemoteReference< FutureImpl< iterator > > &ref, const pairT &datum) |
| Handles successful find response. | |
Private Attributes | |
| std::map< ProcessID, std::vector< keyT > > | coalesced_move_ |
| Temporary: keys to move, bucketed by destination (coalesced redistribute). | |
| internal_containerT | local |
| Locally owned data. | |
| const ProcessID | me |
| My MPI rank. | |
| std::vector< keyT > * | move_list |
| Tempoary used to record data that needs redistributing. | |
| std::shared_ptr< WorldDCPmapInterface< keyT > > | pmap |
| Function/class to map from keys to owning process. | |
| bool | rank_replication_complete_ = false |
| True if the last replicate() completed and no reset followed. | |
Friends | |
| class | WorldContainer< keyT, valueT, hashfunT > |
Additional Inherited Members | |
| Protected Member Functions inherited from madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > > | |
| void | process_pending () |
| To be called from derived constructor to process pending messages. | |
| Protected Member Functions inherited from madness::WorldObjectBase | |
| WorldObjectBase (const WorldObjectBase &other) | |
| Copy constructor; produces an unregistered object. | |
| WorldObjectBase (World &w) | |
| Construct a new WorldObjectBase. | |
| World & | get_world_unchecked () const noexcept |
| Unchecked access to the memoized world reference. | |
| template<typename DerivedT> | |
| void | register_self (DerivedT *this_ptr) |
| Registers this object with its world, making it globally addressable. | |
Internal implementation of distributed container to facilitate shallow copy.
| typedef internal_containerT::accessor madness::WorldContainerImpl< keyT, valueT, hashfunT >::accessor |
| typedef internal_containerT::const_accessor madness::WorldContainerImpl< keyT, valueT, hashfunT >::const_accessor |
| typedef WorldContainerIterator<internal_const_iteratorT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::const_iterator |
| typedef WorldContainerIterator<internal_const_iteratorT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::const_iteratorT |
| typedef const pairT madness::WorldContainerImpl< keyT, valueT, hashfunT >::const_pairT |
| typedef WorldContainerImpl<keyT, valueT, hashfunT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::implT |
| typedef internal_containerT::const_iterator madness::WorldContainerImpl< keyT, valueT, hashfunT >::internal_const_iteratorT |
| typedef ConcurrentHashMap<keyT, valueT, hashfunT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::internal_containerT |
| typedef internal_containerT::iterator madness::WorldContainerImpl< keyT, valueT, hashfunT >::internal_iteratorT |
| typedef WorldContainerIterator<internal_iteratorT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::iterator |
| typedef WorldContainerIterator<internal_iteratorT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::iteratorT |
| typedef std::pair<const keyT, valueT> madness::WorldContainerImpl< keyT, valueT, hashfunT >::pairT |
|
private |
Referenced by WorldContainerImpl().
|
inline |
|
inlinevirtual |
References pmap.
|
inline |
References local.
Referenced by do_replicate(), and replicate_on_hosts().
|
inline |
References local.
|
inline |
References local, and rank_replication_complete_.
Referenced by replicate_on_hosts().
|
inline |
References begin(), end(), madness::Future< void >::value, insert(), size(), and madness::WorldObjectBase::world.
Referenced by replicate(), and replicate_on_hosts().
|
inline |
References local.
Referenced by do_replicate(), erase(), find_failure_handler(), and replicate_on_hosts().
|
inline |
References local.
|
inline |
|
inline |
References erase().
|
inline |
References end(), erase(), and MADNESS_ASSERT.
|
inline |
|
inline |
|
inline |
|
inlineprivate |
Handles unsuccessful const find response.
References madness::f, and local.
Referenced by find_const_handler().
|
inlineprivate |
Handles const find request.
References find_const_failure_handler(), find_const_success_handler(), local, and madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > >::send().
Referenced by find().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Handles find request.
References find_failure_handler(), find_success_handler(), local, and madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > >::send().
Referenced by find().
|
inlineprivate |
|
inline |
References local.
|
inline |
References pmap.
|
inline |
References pmap.
|
inline |
|
inline |
References local, MADNESS_ASSERT, me, and owner().
|
inline |
AM target of the coalesced redistribute: bulk-insert boxes this rank owns under the already-adopted new pmap. Keys are disjoint from those this rank is concurrently erasing (their new owner != me), so per-bucket locking suffices. See redistribute_coalesced_phase2.
References local.
Referenced by redistribute_coalesced_phase2().
|
inline |
References local, MADNESS_ASSERT, me, and owner().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References pmap.
Referenced by erase(), find(), find(), find(), find(), insert(), insert_acc(), insert_const_acc(), is_local(), probe(), redistribute_coalesced_phase1(), and redistribute_phase1().
|
inline |
|
inline |
phase1: adopt newpmap (callback swap as in replicate()) and bucket the keys to move by destination. Quiescent window required.
References coalesced_move_, d, local, me, owner(), pmap, and rank_replication_complete_.
|
inline |
phase2: per destination, chunk the key list (at most cap_boxes per chunk), erase each box after copying it into the batch, send one insert_batch AM per chunk.
References coalesced_move_, d, insert_batch(), local, and madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > >::task().
|
inlinevirtual |
Implements madness::WorldDCRedistributeInterface< keyT >.
References local, me, move_list, owner(), pmap, and rank_replication_complete_.
|
inlinevirtual |
|
inlinevirtual |
Implements madness::WorldDCRedistributeInterface< keyT >.
References move_list.
|
inline |
Replicates this WorldContainer on every ProcessID.
This call is collective, and every rank must call it in the same order. If no rank called clear(), reset the pmap, or redistributed after the last completed call, this call sends no data. A requested fence still occurs. This call does not reconcile replicas, so per-key changes must be the same on every rank.
A rank runs queued tasks while it waits in a broadcast. These tasks must not change this container until the call returns. If a task erases a key on the root, MADNESS_CHECK throws on that rank, and the other ranks wait.
References do_replicate(), madness::WorldObjectBase::get_world(), MADNESS_CHECK, pmap, rank_replication_complete_, madness::RankReplicated, and madness::WorldObjectBase::world.
|
inline |
Replicates this WorldContainer on all hosts, one ProcessID per host.
The new pmap is host-local, not rank-local. This call always fences. Queued tasks must not change this container until the call returns.
print in rank-order
References begin(), clear(), do_replicate(), end(), madness::WorldGopInterface::fence(), madness::Future< void >::value, madness::WorldObjectBase::get_world(), madness::World::gop, insert(), madness::lowest_rank_on_host_of_rank(), MADNESS_CHECK, pmap, madness::primary_ranks_per_host(), rank_replication_complete_, madness::ranks_per_host(), madness::WorldObject< WorldContainerImpl< keyT, valueT, hashfunT > >::send(), and madness::WorldObjectBase::world.
|
inline |
References madness::WorldObjectBase::get_world(), pmap, and rank_replication_complete_.
|
inlinevirtual |
Implements madness::WorldDCRedistributeInterface< keyT >.
References local.
Referenced by do_replicate().
|
friend |
|
private |
Temporary: keys to move, bucketed by destination (coalesced redistribute).
Referenced by redistribute_coalesced_phase1(), and redistribute_coalesced_phase2().
|
private |
Locally owned data.
Referenced by WorldContainerImpl(), begin(), begin(), clear(), end(), end(), erase(), find(), find(), find(), find(), find_const_failure_handler(), find_const_handler(), find_handler(), get_hash(), insert(), insert_acc(), insert_batch(), insert_const_acc(), itemfun(), itemfun(), itemfun(), itemfun(), itemfun(), itemfun(), itemfun(), itemfun(), probe(), redistribute_coalesced_phase1(), redistribute_coalesced_phase2(), redistribute_phase1(), and size().
|
private |
My MPI rank.
Referenced by WorldContainerImpl(), erase(), find(), find(), find(), find(), insert(), insert_acc(), insert_const_acc(), is_local(), probe(), redistribute_coalesced_phase1(), and redistribute_phase1().
|
private |
Tempoary used to record data that needs redistributing.
Referenced by redistribute_phase1(), redistribute_phase2(), and redistribute_phase3().
|
private |
Function/class to map from keys to owning process.
Referenced by WorldContainerImpl(), ~WorldContainerImpl(), get_pmap(), get_pmap(), owner(), redistribute_coalesced_phase1(), redistribute_phase1(), replicate(), replicate_on_hosts(), and reset_pmap_to_local().
|
private |
True if the last replicate() completed and no reset followed.
Referenced by clear(), redistribute_coalesced_phase1(), redistribute_phase1(), replicate(), replicate_on_hosts(), and reset_pmap_to_local().