MADNESS  0.10.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
madness::SystolicPMOrbitalLocalize Class Reference
Inheritance diagram for madness::SystolicPMOrbitalLocalize:
Inheritance graph
[legend]
Collaboration diagram for madness::SystolicPMOrbitalLocalize:
Collaboration graph
[legend]

Public Member Functions

 SystolicPMOrbitalLocalize (DistributedMatrix< double > &A, const std::vector< int > &set, const std::vector< int > &at_to_bf, const std::vector< int > &at_nbf, const std::vector< tensorT > &Svec, double thresh, double thetamax, int natom, int nao, int nmo, int tag=5555)
 
bool converged (const TaskThreadEnv &env) const
 Invoked simultaneously by all threads after each sweep to test for convergence. More...
 
void end_iteration_hook (const TaskThreadEnv &env)
 Invoked by all threads at the end of each iteration before convergence test. More...
 
void kernel (int i, int j, double *MADNESS_RESTRICT rowi, double *MADNESS_RESTRICT rowj)
 
void start_iteration_hook (const TaskThreadEnv &env)
 Invoked by all threads at the start of each iteration. More...
 
- Public Member Functions inherited from madness::SystolicMatrixAlgorithm< double >
 SystolicMatrixAlgorithm (DistributedMatrix< double > &A, int tag, int nthread=ThreadPool::size()+1)
 A must be a column distributed matrix with an even column tile >= 2. More...
 
virtual ~SystolicMatrixAlgorithm ()
 
int64_t get_coldim () const
 Returns length of column. More...
 
ProcessID get_rank () const
 Returns rank of this process in the world. More...
 
int64_t get_rowdim () const
 Returns length of row. More...
 
Worldget_world () const
 Returns a reference to the world. More...
 
virtual void kernel (int i, int j, double *rowi, double *rowj)=0
 Threadsafe routine to apply the operation to rows i and j of the matrix. 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...
 
- Public Member Functions inherited from madness::TaskInterface
 TaskInterface (const TaskAttributes &attr)
 Create a new task with zero dependencies and given attributes. More...
 
 TaskInterface (int ndepend, const char *caller, const TaskAttributes attr=TaskAttributes())
 
 TaskInterface (int ndepend=0, const TaskAttributes attr=TaskAttributes())
 Create a new task with ndepend dependencies (default 0) and given attributes. More...
 
virtual ~TaskInterface ()
 
Worldget_world () const
 
virtual void run (World &)
 Runs a single-threaded task ... derived classes must implement this. More...
 
- Public Member Functions inherited from madness::PoolTaskInterface
 PoolTaskInterface ()
 Default constructor. More...
 
 PoolTaskInterface (const TaskAttributes &attr)
 
virtual ~PoolTaskInterface ()=default
 Destructor. More...
 
void execute ()
 
void set_nthread (int nthread)
 Call this to reset the number of threads before the task is submitted. More...
 
- Public Member Functions inherited from madness::TaskAttributes
 TaskAttributes (const TaskAttributes &attr)
 Copy constructor. More...
 
 TaskAttributes (unsigned long flags=0)
 Sets the attributes to the desired values. More...
 
virtual ~TaskAttributes ()
 
int get_nthread () const
 Get the number of threads. More...
 
bool is_generator () const
 Test if the generator attribute is true. More...
 
bool is_high_priority () const
 Test if the high priority attribute is true. More...
 
bool is_stealable () const
 Test if the stealable attribute is true. More...
 
template<typename Archive >
void serialize (Archive &ar)
 Serializes the attributes for I/O. More...
 
TaskAttributesset_generator (bool generator_hint)
 Sets the generator attribute. More...
 
TaskAttributesset_highpriority (bool hipri)
 Sets the high priority attribute. More...
 
void set_nthread (int nthread)
 Set the number of threads. More...
 
TaskAttributesset_stealable (bool stealable)
 Sets the stealable attribute. More...
 
- Public Member Functions inherited from madness::DependencyInterface
 DependencyInterface (int ndep, const char *caller)
 
 DependencyInterface (int ndep=0)
 
virtual ~DependencyInterface ()
 Destructor. More...
 
void dec ()
 Decrement the number of dependencies and invoke the callback if ndepend==0. More...
 
void dec_debug (const char *caller)
 
void inc ()
 Increment the number of dependencies. More...
 
void inc_debug (const char *caller)
 Same as inc(), but keeps track of caller; calling dec_debug() will signal error if no matching inc_debug() had been invoked
More...
 
int ndep () const
 Returns the number of unsatisfied dependencies. More...
 
void notify ()
 Invoked by callbacks to notify of dependencies being satisfied. More...
 
void notify_debug (const char *caller)
 Overload of CallbackInterface::notify_debug(), updates dec() More...
 
bool probe () const
 Returns true if ndepend == 0 (no unsatisfied dependencies). More...
 
void register_callback (CallbackInterface *callback)
 Registers a callback that will be executed when ndepend==0; immediately invoked if ndepend==0. More...
 
void register_final_callback (CallbackInterface *callback)
 Registers the final callback to be executed when ndepend==0; immediately invoked if ndepend==0. More...
 
- Public Member Functions inherited from madness::CallbackInterface
virtual ~CallbackInterface ()
 

Private Member Functions

void localize_PM_ij (const int seti, const int setj, double *MADNESS_RESTRICT Ci, double *MADNESS_RESTRICT Cj, double *MADNESS_RESTRICT Ui, double *MADNESS_RESTRICT Uj)
 

Private Attributes

const std::vector< int > & at_nbf
 
const std::vector< int > & at_to_bf
 
int iter
 
const int nao
 
const int natom
 
AtomicInt ndone_iter
 
const int nmo
 
const std::vector< int > & set
 
const std::vector< tensorT > & Svec
 
const double thetamax
 
const double thresh
 
double tol
 

Additional Inherited Members

- 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 GENERATOR = 1ul<<8
 Mask for generator bit. More...
 
static const unsigned long HIGHPRIORITY = GENERATOR<<2
 Mask for priority bit. More...
 
static const unsigned long NTHREAD = 0xff
 Mask for nthread byte. More...
 
static const unsigned long STEALABLE = GENERATOR<<1
 Mask for stealable bit. More...
 
- Protected Member Functions inherited from madness::TaskInterface
virtual void run (const TaskThreadEnv &env)
 Override this method to implement a multi-threaded task. More...
 
- Protected Member Functions inherited from madness::CallbackInterface
virtual void notify_debug_impl (const char *caller)
 
- Static Protected Member Functions inherited from madness::PoolTaskInterface
template<typename fnobjT >
static std::enable_if<!(detail::function_traits< fnobjT >::value||detail::memfunc_traits< fnobjT >::value) >::type make_id (std::pair< void *, unsigned short > &id, const fnobjT &)
 
template<typename fnT >
static std::enable_if< detail::function_traits< fnT >::value||detail::memfunc_traits< fnT >::value >::type make_id (std::pair< void *, unsigned short > &id, fnT fn)
 

Constructor & Destructor Documentation

◆ SystolicPMOrbitalLocalize()

madness::SystolicPMOrbitalLocalize::SystolicPMOrbitalLocalize ( DistributedMatrix< double > &  A,
const std::vector< int > &  set,
const std::vector< int > &  at_to_bf,
const std::vector< int > &  at_nbf,
const std::vector< tensorT > &  Svec,
double  thresh,
double  thetamax,
int  natom,
int  nao,
int  nmo,
int  tag = 5555 
)
inline

References MADNESS_ASSERT, nao, and nmo.

Member Function Documentation

◆ converged()

bool madness::SystolicPMOrbitalLocalize::converged ( const TaskThreadEnv env) const
inlinevirtual

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

Parameters
[in]envThe madness thread environment in case synchronization between threads is needed during computation of the convergence condition.

Implements madness::SystolicMatrixAlgorithm< double >.

References ndone_iter, thresh, and tol.

◆ end_iteration_hook()

void madness::SystolicPMOrbitalLocalize::end_iteration_hook ( const TaskThreadEnv env)
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.

Parameters
[in]envThe madness thread environment in case synchronization between threads is needed during startup.

Reimplemented from madness::SystolicMatrixAlgorithm< double >.

References madness::SystolicMatrixAlgorithm< T >::get_world(), madness::World::gop, madness::TaskThreadEnv::id(), ndone, ndone_iter, and madness::WorldGopInterface::sum().

◆ kernel()

void madness::SystolicPMOrbitalLocalize::kernel ( int  i,
int  j,
double *MADNESS_RESTRICT  rowi,
double *MADNESS_RESTRICT  rowj 
)
inline

References localize_PM_ij(), nao, and set.

◆ localize_PM_ij()

void madness::SystolicPMOrbitalLocalize::localize_PM_ij ( const int  seti,
const int  setj,
double *MADNESS_RESTRICT  Ci,
double *MADNESS_RESTRICT  Cj,
double *MADNESS_RESTRICT  Ui,
double *MADNESS_RESTRICT  Uj 
)
inlineprivate

◆ start_iteration_hook()

void madness::SystolicPMOrbitalLocalize::start_iteration_hook ( const TaskThreadEnv env)
inlinevirtual

Invoked by all threads at the start of each iteration.

There is a thread barrier before and after the invocation of this routine

Parameters
[in]envThe madness thread environment in case synchronization between threads is needed during startup.

Reimplemented from madness::SystolicMatrixAlgorithm< double >.

References madness::TaskThreadEnv::id(), iter, max, ndone_iter, thresh, and tol.

Member Data Documentation

◆ at_nbf

const std::vector<int>& madness::SystolicPMOrbitalLocalize::at_nbf
private

Referenced by localize_PM_ij().

◆ at_to_bf

const std::vector<int>& madness::SystolicPMOrbitalLocalize::at_to_bf
private

Referenced by localize_PM_ij().

◆ iter

int madness::SystolicPMOrbitalLocalize::iter
private

Referenced by start_iteration_hook().

◆ nao

const int madness::SystolicPMOrbitalLocalize::nao
private

◆ natom

const int madness::SystolicPMOrbitalLocalize::natom
private

Referenced by localize_PM_ij().

◆ ndone_iter

AtomicInt madness::SystolicPMOrbitalLocalize::ndone_iter
private

◆ nmo

const int madness::SystolicPMOrbitalLocalize::nmo
private

◆ set

const std::vector<int>& madness::SystolicPMOrbitalLocalize::set
private

Referenced by kernel().

◆ Svec

const std::vector<tensorT>& madness::SystolicPMOrbitalLocalize::Svec
private

Referenced by localize_PM_ij().

◆ thetamax

const double madness::SystolicPMOrbitalLocalize::thetamax
private

Referenced by localize_PM_ij().

◆ thresh

const double madness::SystolicPMOrbitalLocalize::thresh
private

Referenced by converged(), and start_iteration_hook().

◆ tol

double madness::SystolicPMOrbitalLocalize::tol
private

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