HMLP: High-performance Machine Learning Primitives
hmlp::DistVirtualMatrix< T, Allocator > Class Template Reference

DistVirtualMatrix is the abstract base class for matrix-free access and operations. Most of the public functions will be virtual. To inherit DistVirtualMatrix, you "must" implement the evaluation operator. Otherwise, the code won't compile. More...

#include <VirtualMatrix.hpp>

Inheritance diagram for hmlp::DistVirtualMatrix< T, Allocator >:
hmlp::VirtualMatrix< T, Allocator > hmlp::mpi::MPIObject hmlp::SPDMatrixMPISupport< T > hmlp::DistKernelMatrix< T, TP, Allocator >

Public Member Functions

 DistVirtualMatrix (size_t m, size_t n, mpi::Comm comm)
 
- Public Member Functions inherited from hmlp::VirtualMatrix< T, Allocator >
 VirtualMatrix (size_t m, size_t n)
 
virtual void resize (size_t m, size_t n)
 
size_t row ()
 
size_t col ()
 
virtual T operator() (size_t i, size_t j)=0
 
virtual Data< T > operator() (const vector< size_t > &I, const vector< size_t > &J)
 
Data< T > KernelDistances (const vector< size_t > &I, const vector< size_t > &J)
 
Data< T > AngleDistances (const vector< size_t > &I, const vector< size_t > &J)
 
virtual Data< T > UserDistances (const vector< size_t > &I, const vector< size_t > &J)
 
virtual Data< T > GeometryDistances (const vector< size_t > &I, const vector< size_t > &J)
 
Data< T > Distances (DistanceMetric metric, const vector< size_t > &I, const vector< size_t > &J)
 
virtual Data< pair< T, size_t > > NeighborSearch (DistanceMetric metric, size_t kappa, const vector< size_t > &Q, const vector< size_t > &R, pair< T, size_t > init)
 
virtual Data< T > Diagonal (const vector< size_t > &I)
 
virtual pair< T, size_t > ImportantSample (size_t j)
 
virtual pair< T, int > ImportantSample (int j)
 
- Public Member Functions inherited from hmlp::SPDMatrixMPISupport< T >
virtual void SendIndices (vector< size_t > ids, int dest, mpi::Comm comm)
 
virtual void RecvIndices (int src, mpi::Comm comm, mpi::Status *status)
 
virtual void BcastIndices (vector< size_t > ids, int root, mpi::Comm comm)
 
virtual void RequestIndices (const vector< vector< size_t >> &ids)
 
- Public Member Functions inherited from hmlp::mpi::MPIObject
 MPIObject (mpi::Comm comm)
 
void AssignCommunicator (mpi::Comm &comm)
 
mpi::Comm GetComm ()
 
mpi::Comm GetPrivateComm ()
 
int GetCommSize ()
 
int GetCommRank ()
 
int Comm_size ()
 
int Comm_rank ()
 
int Barrier ()
 
int PrivateBarrier ()
 

Additional Inherited Members

- Public Types inherited from hmlp::VirtualMatrix< T, Allocator >
typedef T T
 

Detailed Description

template<typename T, class Allocator = std::allocator<T>>
class hmlp::DistVirtualMatrix< T, Allocator >

DistVirtualMatrix is the abstract base class for matrix-free access and operations. Most of the public functions will be virtual. To inherit DistVirtualMatrix, you "must" implement the evaluation operator. Otherwise, the code won't compile.

end class VirtualMatrix Two virtual functions must be implemented:

T operator () ( size_t i, size_t j ), and Data<T> operator () ( vector<size_t> &I, vector<size_t> &J ).

These two functions can involve nonblocking MPI routines, but blocking collborative communication routines are not allowed.

DistVirtualMatrix inherits mpi::MPIObject, which is initalized with the provided comm. MPIObject duplicates comm into sendcomm and recvcomm, which allows concurrent multi-threaded nonblocking send/recv.

For example, RequestKIJ( I, J, p ) sends I and J to rank-p, requesting the submatrix. MPI process rank-p has at least one thread will execute BackGroundProcess( do_terminate ), waiting for incoming requests. Rank-p then invoke K( I, J ) locally, and send the submatrix back to the clients. Overall the pattern usually looks like

Data<T> operator () ( vector<size_t> &I, vector<size_t> &J ). { for each submatrix KAB entirely owned by p KAB = RequestKIJ( A, B ) pack KAB back to KIJ

return KIJ }

Constructor & Destructor Documentation

template<typename T, class Allocator = std::allocator<T>>
hmlp::DistVirtualMatrix< T, Allocator >::DistVirtualMatrix ( size_t  m,
size_t  n,
mpi::Comm  comm 
)
inline

(Default) constructor


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