MADNESS 0.10.1
Public Member Functions | Private Attributes | List of all members
madness::CloudOwnerPmap< keyT, hashfunT > Class Template Reference

Process map for the cloud's batch container. More...

#include <cloud.h>

Inheritance diagram for madness::CloudOwnerPmap< keyT, hashfunT >:
Inheritance graph
[legend]
Collaboration diagram for madness::CloudOwnerPmap< keyT, hashfunT >:
Collaboration graph
[legend]

Public Member Functions

 CloudOwnerPmap (World &world, const hashfunT &hf=hashfunT())
 
ProcessID owner (const keyT &key) const override
 Maps key to processor.
 
void print_table (const std::string &tag="") const
 
void set_owner (const keyT &key, const ProcessID owner)
 collective: every rank must register the same (key, owner) pair
 
- Public Member Functions inherited from madness::WorldDCPmapInterface< keyT >
virtual ~WorldDCPmapInterface ()
 
void deregister_callback (ptrT ptr)
 Deregisters object for receipt of redistribute callbacks.
 
virtual DistributionType distribution_type () const
 by default the map is distributed
 
std::size_t global_size (World &world) const
 Counts global number of entries in all containers associated with this process map.
 
std::size_t local_size () const
 Counts local number of entries in all containers associated with this process map.
 
virtual void print () const
 
void print_data_sizes (World &world, const std::string msg="") const
 Prints size info to std::cout.
 
void redistribute (World &world, const std::shared_ptr< WorldDCPmapInterface< keyT > > &newpmap)
 Invoking this switches all registered objects from this process map to the new one.
 
void register_callback (ptrT ptr)
 Registers object for receipt of redistribute callbacks.
 

Private Attributes

hashfunT hashfun
 
const int nproc
 
std::shared_ptr< std::map< keyT, ProcessID > > table
 

Additional Inherited Members

- Public Types inherited from madness::WorldDCPmapInterface< keyT >
typedef WorldDCRedistributeInterface< keyT > * ptrT
 

Detailed Description

template<typename keyT, typename hashfunT = Hash<keyT>>
class madness::CloudOwnerPmap< keyT, hashfunT >

Process map for the cloud's batch container.

Routes a record to an explicitly assigned owner, falling back to a hash for any record that was never registered. set_owner is collective, so all ranks agree on routing without further communication. Unlike the default cloud container this map is never reset to local, which is what keeps owner pinning stable.

Constructor & Destructor Documentation

◆ CloudOwnerPmap()

template<typename keyT , typename hashfunT = Hash<keyT>>
madness::CloudOwnerPmap< keyT, hashfunT >::CloudOwnerPmap ( World world,
const hashfunT hf = hashfunT() 
)
inline

Member Function Documentation

◆ owner()

template<typename keyT , typename hashfunT = Hash<keyT>>
ProcessID madness::CloudOwnerPmap< keyT, hashfunT >::owner ( const keyT key) const
inlineoverridevirtual

◆ print_table()

template<typename keyT , typename hashfunT = Hash<keyT>>
void madness::CloudOwnerPmap< keyT, hashfunT >::print_table ( const std::string &  tag = "") const
inline

◆ set_owner()

template<typename keyT , typename hashfunT = Hash<keyT>>
void madness::CloudOwnerPmap< keyT, hashfunT >::set_owner ( const keyT key,
const ProcessID  owner 
)
inline

collective: every rank must register the same (key, owner) pair

References madness::CloudOwnerPmap< keyT, hashfunT >::owner().

Member Data Documentation

◆ hashfun

template<typename keyT , typename hashfunT = Hash<keyT>>
hashfunT madness::CloudOwnerPmap< keyT, hashfunT >::hashfun
private

◆ nproc

template<typename keyT , typename hashfunT = Hash<keyT>>
const int madness::CloudOwnerPmap< keyT, hashfunT >::nproc
private

◆ table

template<typename keyT , typename hashfunT = Hash<keyT>>
std::shared_ptr<std::map<keyT, ProcessID> > madness::CloudOwnerPmap< keyT, hashfunT >::table
private

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