MADNESS
version 0.9
|
Base class for parallel algorithms that employ a systolic loop to generate all row pairs in parallel. More...
#include <systolic.h>
Public Member Functions | |
SystolicMatrixAlgorithm (DistributedMatrix< T > &A, int tag, int nthread=ThreadPool::size()+1) | |
A must be a column distributed matrix with an even column tile >= 2. More... | |
virtual | ~SystolicMatrixAlgorithm () |
virtual void | kernel (int i, int j, T *rowi, T *rowj)=0 |
Threadsafe routine to apply the operation to rows i and j of the matrix. More... | |
virtual bool | converged (const TaskThreadEnv &env) const =0 |
Invoked simultaneously by all threads after each sweep to test for convergence. More... | |
virtual void | start_iteration_hook (const TaskThreadEnv &env) |
Invoked by all threads at the start of each iteration. More... | |
virtual void | end_iteration_hook (const TaskThreadEnv &env) |
Invoked by all threads at the end of each iteration. More... | |
void | run (World &world, const TaskThreadEnv &env) |
Invoked by the task queue to run the algorithm with multiple threads. More... | |
void | solve () |
Invoked by the user to run the algorithm with one thread. More... | |
int | get_rowdim () const |
Returns length of row. More... | |
int | get_coldim () const |
Returns length of column. More... | |
World & | get_world () const |
Returns a reference to the world. More... | |
ProcessID | get_rank () const |
Returns rank of this process in the world. More... | |
SystolicMatrixAlgorithm (DistributedMatrix< T > &A, int tag, int nthread=ThreadPool::size()+1) | |
A must be a column distributed matrix with an even column tile >= 2. More... | |
virtual | ~SystolicMatrixAlgorithm () |
virtual void | kernel (int i, int j, T *rowi, T *rowj)=0 |
Threadsafe routine to apply the operation to rows i and j of the matrix. More... | |
virtual bool | converged (const TaskThreadEnv &env) const =0 |
Invoked simultaneously by all threads after each sweep to test for convergence. More... | |
virtual void | start_iteration_hook (const TaskThreadEnv &env) |
Invoked by all threads at the start of each iteration. More... | |
virtual void | end_iteration_hook (const TaskThreadEnv &env) |
Invoked by all threads at the end of each iteration before convergence test. More... | |
void | run (World &world, const TaskThreadEnv &env) |
Invoked by the task queue to run the algorithm with multiple threads. More... | |
void | solve_sequential () |
Invoked by the user to run the algorithm with one thread mostly for debugging. More... | |
int64_t | get_rowdim () const |
Returns length of row. More... | |
int64_t | get_coldim () const |
Returns length of column. More... | |
World & | get_world () const |
Returns a reference to the world. More... | |
ProcessID | get_rank () const |
Returns rank of this process in the world. More... | |
Public Member Functions inherited from madness::TaskInterface | |
TaskInterface (int ndepend=0, const TaskAttributes attr=TaskAttributes()) | |
Create a new task with ndepend dependencies (default 0) and given attributes. More... | |
TaskInterface (const TaskAttributes &attr) | |
Create a new task with zero dependencies and given attributes. More... | |
virtual void | run (World &) |
Runs a single-threaded task ... derived classes must implement this. More... | |
World * | get_world () const |
virtual | ~TaskInterface () |
Public Member Functions inherited from madness::PoolTaskInterface | |
PoolTaskInterface () | |
PoolTaskInterface (const TaskAttributes &attr) | |
void | set_nthread (int nthread) |
Call this to reset the number of threads before the task is submitted. More... | |
virtual | ~PoolTaskInterface () |
Public Member Functions inherited from madness::TaskAttributes | |
TaskAttributes (unsigned long flags=0) | |
TaskAttributes (const TaskAttributes &attr) | |
virtual | ~TaskAttributes () |
bool | is_generator () const |
bool | is_stealable () const |
bool | is_high_priority () const |
void | set_generator (bool generator_hint) |
void | set_stealable (bool stealable) |
void | set_highpriority (bool hipri) |
void | set_nthread (int nthread) |
Are you sure this is what you want to call? More... | |
int | get_nthread () const |
template<typename Archive > | |
void | serialize (Archive &ar) |
Public Member Functions inherited from madness::DependencyInterface | |
DependencyInterface (int ndep=0) | |
int | ndep () const |
Returns the number of unsatisfied dependencies. More... | |
bool | probe () const |
Returns true if ndepend == 0. More... | |
void | notify () |
Invoked by callbacks to notifiy of dependencies being satisfied. More... | |
void | register_callback (CallbackInterface *callback) |
Registers a callback for when ndepend==0 , immediately invoked if ndepend==0 . More... | |
void | inc () |
Increment the number of dependencies. More... | |
void | dec () |
Decrement the number of dependencies and invoke callback if ndepend=0. More... | |
virtual | ~DependencyInterface () |
Public Member Functions inherited from madness::CallbackInterface | |
virtual | ~CallbackInterface () |
Additional Inherited Members | |
Static Public Member Functions inherited from madness::PoolTaskInterface | |
static void | operator delete (void *p, std::size_t size) throw () |
Destroy task object. More... | |
Static Public Member Functions inherited from madness::TaskAttributes | |
static TaskAttributes | generator () |
static TaskAttributes | hipri () |
static TaskAttributes | multi_threaded (int nthread) |
Static Public Attributes inherited from madness::TaskInterface | |
static bool | debug = false |
Static Public Attributes inherited from madness::TaskAttributes | |
static const unsigned long | NTHREAD = 0xff |
static const unsigned long | GENERATOR = 1ul<<8 |
static const unsigned long | STEALABLE = GENERATOR<<1 |
static const unsigned long | HIGHPRIORITY = GENERATOR<<2 |
Protected Member Functions inherited from madness::TaskInterface | |
virtual void | run (const TaskThreadEnv &env) |
Override this method to implement a multi-threaded task. More... | |
Static Protected Member Functions inherited from madness::PoolTaskInterface | |
template<typename fnT > | |
static enable_if_c < detail::function_traits< fnT > ::value||detail::memfunc_traits < fnT >::value >::type | make_id (std::pair< void *, unsigned short > &id, fnT fn) |
template<typename fnobjT > | |
static disable_if_c < detail::function_traits < fnobjT >::value||detail::memfunc_traits < fnobjT >::value >::type | make_id (std::pair< void *, unsigned short > &id, const fnobjT &) |
Base class for parallel algorithms that employ a systolic loop to generate all row pairs in parallel.
|
inline |
A must be a column distributed matrix with an even column tile >= 2.
|
inlinevirtual |
|
inline |
A must be a column distributed matrix with an even column tile >= 2.
It is assumed that it is the main thread invoking this.
[in,out] | A | The matrix on which the algorithm is performed and modified in-place |
[in] | tag | The MPI tag used for communication (obtain from world.mpi.comm() .unique_tag() ) |
[in] | nthread | The number of local threads to use (default is main thread all threads in the pool) |
|
inlinevirtual |
|
pure virtual |
Invoked simultaneously by all threads after each sweep to test for convergence.
There is a thread barrier before and after the invocation of this routine
[in] | env | The madness thread environment in case synchronization between threads is needed during computation of the convergence condition. |
Implemented in madness::LocalizeBoys< T >.
|
pure virtual |
Invoked simultaneously by all threads after each sweep to test for convergence.
There is a thread barrier before and after the invocation of this routine
Implemented in madness::LocalizeBoys< T >.
Referenced by madness::SystolicMatrixAlgorithm< double >::run().
|
inlinevirtual |
Invoked by all threads at the end of each iteration before convergence test.
There is a thread barrier before and after the invocation of this routine. Note that the converged()
method is const
whereas this can modify the class.
[in] | env | The madness thread environment in case synchronization between threads is needed during startup. |
Reimplemented in madness::LocalizeBoys< T >.
|
inlinevirtual |
Invoked by all threads at the end of each iteration.
There is a thread barrier before and after the invocation of this routine
Reimplemented in madness::LocalizeBoys< T >.
|
inline |
Returns length of column.
|
inline |
Returns length of column.
|
inline |
Returns rank of this process in the world.
|
inline |
Returns rank of this process in the world.
|
inline |
Returns length of row.
|
inline |
Returns length of row.
|
inline |
Returns a reference to the world.
|
inline |
Returns a reference to the world.
|
pure virtual |
Threadsafe routine to apply the operation to rows i and j of the matrix.
[in] | i | First row index in the matrix |
[in] | j | Second row index in the matrix |
[in] | rowi | Pointer to row i of the matrix (to be modified by kernel in-place) |
[in] | rowj | Pointer to row j of the matrix (to be modified by kernel in-place) |
Implemented in madness::LocalizeBoys< T >.
|
pure virtual |
Threadsafe routine to apply the operation to rows i and j of the matrix.
Implemented in madness::LocalizeBoys< T >.
|
inlinevirtual |
Invoked by the task queue to run the algorithm with multiple threads.
This is a collective call ... all processes in world should submit this task
Reimplemented from madness::TaskInterface.
|
inlinevirtual |
Invoked by the task queue to run the algorithm with multiple threads.
Reimplemented from madness::TaskInterface.
Referenced by madness::SystolicMatrixAlgorithm< double >::solve(), and madness::SystolicMatrixAlgorithm< double >::solve_sequential().
|
inline |
Invoked by the user to run the algorithm with one thread.
This is a collective call ... all processes in world should call this routine, though processes without data will immediately return without any synchronization.
Referenced by plocalize_boys().
|
inline |
Invoked by the user to run the algorithm with one thread mostly for debugging.
This is a collective call ... all processes in world should call this routine.
|
inlinevirtual |
Invoked by all threads at the start of each iteration.
There is a thread barrier before and after the invocation of this routine
[in] | env | The madness thread environment in case synchronization between threads is needed during startup. |
Reimplemented in madness::LocalizeBoys< T >.
|
inlinevirtual |
Invoked by all threads at the start of each iteration.
There is a thread barrier before and after the invocation of this routine
Reimplemented in madness::LocalizeBoys< T >.