HMLP: High-performance Machine Learning Primitives
hmlp::mpitree::Node< SETUP, NODEDATA > Class Template Reference

#include <tree_mpi.hpp>

Inheritance diagram for hmlp::mpitree::Node< SETUP, NODEDATA >:
hmlp::tree::Node< SETUP, NODEDATA > hmlp::ReadWrite

Public Types

typedef SETUP::T T
 
- Public Types inherited from hmlp::tree::Node< SETUP, NODEDATA >
typedef SETUP::T T
 

Public Member Functions

 Node (SETUP *setup, size_t n, size_t l, Node *parent, unordered_map< size_t, tree::Node< SETUP, NODEDATA > * > *morton2node, Lock *treelock, mpi::Comm comm)
 
 Node (SETUP *setup, size_t n, size_t l, vector< size_t > &gids, Node *parent, unordered_map< size_t, tree::Node< SETUP, NODEDATA > * > *morton2node, Lock *treelock, mpi::Comm comm)
 
 Node (size_t morton)
 
void Split ()
 
void DependOnChildren (Task *task)
 Support dependency analysis. More...
 
void DependOnParent (Task *task)
 
void Print ()
 
mpi::Comm GetComm ()
 
int GetCommSize ()
 
int GetCommRank ()
 
- Public Member Functions inherited from hmlp::tree::Node< SETUP, NODEDATA >
 Node (SETUP *setup, size_t n, size_t l, Node *parent, unordered_map< size_t, Node * > *morton2node, Lock *treelock)
 
 Node (SETUP *setup, int n, int l, vector< size_t > gids, Node *parent, unordered_map< size_t, Node * > *morton2node, Lock *treelock)
 
 Node (size_t morton)
 
 ~Node ()
 
void Resize (int n)
 
void Split ()
 
bool ContainAny (vector< size_t > &queries)
 Check if this node contain any query using morton. Notice that queries[] contains gids; thus, morton[] needs to be accessed using gids. More...
 
bool ContainAny (set< Node * > &querys)
 
void Print ()
 
void DependOnChildren (Task *task)
 
void DependOnParent (Task *task)
 
void DependOnNoOne (Task *task)
 
- Public Member Functions inherited from hmlp::ReadWrite
 ReadWrite ()
 
void DependencyAnalysis (ReadWriteType type, Task *task)
 This is the key function that encode the dependency. More...
 
void DependencyCleanUp ()
 

Public Attributes

Nodechild = NULL
 
- Public Attributes inherited from hmlp::tree::Node< SETUP, NODEDATA >
SETUP * setup = NULL
 
NODEDATA data
 
size_t n
 
size_t l
 
size_t morton = 0
 
size_t offset = 0
 
size_t treelist_id
 
vector< size_t > gids
 
set< size_t > FarIDs
 
set< Node * > FarNodes
 
set< size_t > FarNodeMortonIDs
 
set< size_t > NearIDs
 
set< Node * > NearNodes
 
set< size_t > NearNodeMortonIDs
 
set< size_t > NNFarIDs
 
set< Node * > NNFarNodes
 
set< Node * > ProposedNNFarNodes
 
set< size_t > NNFarNodeMortonIDs
 
set< size_t > NNNearIDs
 
set< Node * > NNNearNodes
 
set< Node * > ProposedNNNearNodes
 
set< size_t > NNNearNodeMortonIDs
 
vector< map< size_t, Data< T > > > DistFar
 
vector< map< size_t, Data< T > > > DistNear
 
Locktreelock = NULL
 
Nodekids [N_CHILDREN]
 
Nodelchild = NULL
 
Noderchild = NULL
 
Nodesibling = NULL
 
Nodeparent = NULL
 
unordered_map< size_t, Node * > * morton2node = NULL
 
bool isleaf
 
- Public Attributes inherited from hmlp::ReadWrite
deque< Task * > read
 
deque< Task * > write
 

Static Public Attributes

static const int N_CHILDREN = 2
 
- Static Public Attributes inherited from hmlp::tree::Node< SETUP, NODEDATA >
static const int N_CHILDREN = 2
 

Detailed Description

template<typename SETUP, typename NODEDATA>
class hmlp::mpitree::Node< SETUP, NODEDATA >

end class IndexPermuteTask

Member Typedef Documentation

template<typename SETUP , typename NODEDATA >
typedef SETUP::T hmlp::mpitree::Node< SETUP, NODEDATA >::T

Deduce data type from SETUP.

Constructor & Destructor Documentation

template<typename SETUP , typename NODEDATA >
hmlp::mpitree::Node< SETUP, NODEDATA >::Node ( SETUP *  setup,
size_t  n,
size_t  l,
Node< SETUP, NODEDATA > *  parent,
unordered_map< size_t, tree::Node< SETUP, NODEDATA > * > *  morton2node,
Lock treelock,
mpi::Comm  comm 
)
inline

Inherit all parameters from tree::Node (Default) constructor for inner nodes (gids and n unassigned)

Local communicator

Get MPI size and rank.

template<typename SETUP , typename NODEDATA >
hmlp::mpitree::Node< SETUP, NODEDATA >::Node ( SETUP *  setup,
size_t  n,
size_t  l,
vector< size_t > &  gids,
Node< SETUP, NODEDATA > *  parent,
unordered_map< size_t, tree::Node< SETUP, NODEDATA > * > *  morton2node,
Lock treelock,
mpi::Comm  comm 
)
inline

(Default) constructor for root.

Notice that "gids.size() < n".

template<typename SETUP , typename NODEDATA >
hmlp::mpitree::Node< SETUP, NODEDATA >::Node ( size_t  morton)
inline

(Default) constructor for LET nodes.

Member Function Documentation

template<typename SETUP , typename NODEDATA >
void hmlp::mpitree::Node< SETUP, NODEDATA >::DependOnChildren ( Task task)
inline

Support dependency analysis.

end Split()

Try to enqueue if there is no dependency.

template<typename SETUP , typename NODEDATA >
void hmlp::mpitree::Node< SETUP, NODEDATA >::DependOnParent ( Task task)
inline

end DependOnChildren()

Try to enqueue if there is no dependency.

template<typename SETUP , typename NODEDATA >
mpi::Comm hmlp::mpitree::Node< SETUP, NODEDATA >::GetComm ( )
inline

Return local MPI communicator.

template<typename SETUP , typename NODEDATA >
int hmlp::mpitree::Node< SETUP, NODEDATA >::GetCommRank ( )
inline

Return local MPI rank.

template<typename SETUP , typename NODEDATA >
int hmlp::mpitree::Node< SETUP, NODEDATA >::GetCommSize ( )
inline

Return local MPI size.

template<typename SETUP , typename NODEDATA >
void hmlp::mpitree::Node< SETUP, NODEDATA >::Print ( )
inline

end DependOnParent() Preserve for debugging.

template<typename SETUP , typename NODEDATA >
void hmlp::mpitree::Node< SETUP, NODEDATA >::Split ( )
inline

Reduce to get the total size of gids.

n = sum( num_points_owned ) over all MPI processes in comm.

The local communicator of this node contains at least 2 processes.

Invoke distributed splitter.

Get partner MPI rank.

left child

MPI ranks 0:size/2-1 keep split[ 0 ]

MPI ranks 0:size/2-1 send split[ 1 ]

right child

MPI ranks size/2:size-1 keep split[ 1 ]

MPI ranks size/2:size-1 send split[ 0 ]

Exchange recv_gids.size().

resize recv_gids

Exchange recv_gids.size()

Exchange gids with my partner.

kept_gids += recv_gids.

Synchronize within local communicator

Member Data Documentation

template<typename SETUP , typename NODEDATA >
Node* hmlp::mpitree::Node< SETUP, NODEDATA >::child = NULL

Distributed tree nodes only have one child.


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