MADNESS 0.10.1
madness::MyPmap< D > Class Template Reference

Procmap implemented using Tree of TreeCoords. More...

#include <mypmap.h>

Inheritance diagram for madness::MyPmap< D >:
Collaboration diagram for madness::MyPmap< D >:

Public Member Functions

 MyPmap ()
 MyPmap (const MyPmap< D > &other)
 MyPmap (World &world)
 MyPmap (World &world, std::vector< TreeCoords< D > > v)
 MyPmap (World &world, unsigned int map_type, int n=100)
MyPmap< D > & operator= (const MyPmap< D > &other)
ProcessID owner (const KeyD &key) const
 Find the owner of a given key.
void print () const
Public Member Functions inherited from madness::WorldDCPmapInterface< Key< D > >
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.
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< Key< D > > > &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.
virtual ProcessID single_owner () const

Static Public Member Functions

static bool costmapcmp (const std::pair< KeyD, double > &a, const std::pair< KeyD, double > &b)

Private Types

typedef Key< D > KeyD

Private Member Functions

void build_tree_map (std::vector< TreeCoords< D > > v)
 private method that builds the Tree underlying the procmap
ProcessID not_so_simple_hash (const KeyD &key) const
void prepare_not_so_simple_map (World &world)
ProcessID simple_hash (const KeyD &key) const

Private Attributes

unsigned int map_type
const int n
const int nproc
Tensor< ProcessID > simple_key_map
std::shared_ptr< ProcMapImpl< D > > tree_map

Additional Inherited Members

Public Types inherited from madness::WorldDCPmapInterface< Key< D > >
typedef WorldDCRedistributeInterface< Key< D > > * ptrT

Detailed Description

template<int D>
class madness::MyPmap< D >

Procmap implemented using Tree of TreeCoords.

Member Typedef Documentation

◆ KeyD

template<int D>
typedef Key<D> madness::MyPmap< D >::KeyD
private

Constructor & Destructor Documentation

◆ MyPmap() [1/5]

template<int D>
madness::MyPmap< D >::MyPmap ( )
inline

References map_type.

Referenced by MyPmap(), and operator=().

◆ MyPmap() [2/5]

template<int D>
madness::MyPmap< D >::MyPmap ( World & world)
inline

◆ MyPmap() [3/5]

template<int D>
madness::MyPmap< D >::MyPmap ( World & world,
unsigned int map_type,
int n = 100 )
inline

◆ MyPmap() [4/5]

template<int D>
madness::MyPmap< D >::MyPmap ( World & world,
std::vector< TreeCoords< D > > v )
inline

References build_tree_map(), map_type, n, nproc, and v.

◆ MyPmap() [5/5]

template<int D>
madness::MyPmap< D >::MyPmap ( const MyPmap< D > & other)
inline

References MyPmap(), map_type, n, nproc, and tree_map.

Member Function Documentation

◆ build_tree_map()

template<int D>
void madness::MyPmap< D >::build_tree_map ( std::vector< TreeCoords< D > > v)
inlineprivate

private method that builds the Tree underlying the procmap

References tree_map, and v.

Referenced by MyPmap().

◆ costmapcmp()

template<int D>
bool madness::MyPmap< D >::costmapcmp ( const std::pair< KeyD, double > & a,
const std::pair< KeyD, double > & b )
inlinestatic

References a, and b.

Referenced by prepare_not_so_simple_map().

◆ not_so_simple_hash()

template<int D>
ProcessID madness::MyPmap< D >::not_so_simple_hash ( const KeyD & key) const
inlineprivate

◆ operator=()

template<int D>
MyPmap< D > & madness::MyPmap< D >::operator= ( const MyPmap< D > & other)
inline

◆ owner()

template<int D>
ProcessID madness::MyPmap< D >::owner ( const KeyD & key) const
inlinevirtual

Find the owner of a given key.

Implements madness::WorldDCPmapInterface< Key< D > >.

References map_type, not_so_simple_hash(), simple_hash(), and tree_map.

◆ prepare_not_so_simple_map()

template<int D>
void madness::MyPmap< D >::prepare_not_so_simple_map ( World & world)
inlineprivate

◆ print()

template<int D>
void madness::MyPmap< D >::print ( ) const
inlinevirtual

◆ simple_hash()

template<int D>
ProcessID madness::MyPmap< D >::simple_hash ( const KeyD & key) const
inlineprivate

Member Data Documentation

◆ map_type

template<int D>
unsigned int madness::MyPmap< D >::map_type
private

◆ n

◆ nproc

template<int D>
const int madness::MyPmap< D >::nproc
private

◆ simple_key_map

template<int D>
Tensor<ProcessID> madness::MyPmap< D >::simple_key_map
private

◆ tree_map

template<int D>
std::shared_ptr< ProcMapImpl<D> > madness::MyPmap< D >::tree_map
private

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