QUDA
v1.1.0
A library for QCD on GPUs
|
#include <multigrid.h>
Public Member Functions | |
MG (MGParam ¶m, TimeProfile &profile) | |
virtual | ~MG () |
bool | hermitian () |
void | reset (bool refresh=false) |
This method resets the solver, e.g., when a parameter has changed such as the mass. More... | |
void | dumpNullVectors () const |
Dump the null-space vectors to disk. Will recurse dumping all levels. More... | |
void | createSmoother () |
Create the smoothers. More... | |
void | destroySmoother () |
Destroy the smoothers. More... | |
void | createCoarseDirac () |
Create the coarse dirac operator. More... | |
void | createCoarseSolver () |
Create the solver wrapper. More... | |
void | destroyCoarseSolver () |
Destroy the solver wrapper. More... | |
void | verify (bool recursively=false) |
Verify the correctness of the MG method, optionally recursively starting from the top down. More... | |
void | operator() (ColorSpinorField &out, ColorSpinorField &in) |
void | loadVectors (std::vector< ColorSpinorField * > &B) |
Load the null space vectors in from file. More... | |
void | saveVectors (const std::vector< ColorSpinorField * > &B) const |
Save the null space vectors in from file. More... | |
void | generateNullVectors (std::vector< ColorSpinorField * > &B, bool refresh=false) |
Generate the null-space vectors. More... | |
void | generateEigenVectors () |
Generate lowest eigenvectors. More... | |
void | buildFreeVectors (std::vector< ColorSpinorField * > &B) |
Build free-field null-space vectors. More... | |
double | flops () const |
Return the total flops done on this and all coarser levels. More... | |
Public Member Functions inherited from quda::Solver | |
Solver (const DiracMatrix &mat, const DiracMatrix &matSloppy, const DiracMatrix &matPrecon, const DiracMatrix &matEig, SolverParam ¶m, TimeProfile &profile) | |
virtual | ~Solver () |
virtual void | blocksolve (ColorSpinorField &out, ColorSpinorField &in) |
const DiracMatrix & | M () |
const DiracMatrix & | Msloppy () |
const DiracMatrix & | Mprecon () |
const DiracMatrix & | Meig () |
bool | convergence (double r2, double hq2, double r2_tol, double hq_tol) |
bool | convergenceHQ (double r2, double hq2, double r2_tol, double hq_tol) |
Test for HQ solver convergence – ignore L2 residual. More... | |
bool | convergenceL2 (double r2, double hq2, double r2_tol, double hq_tol) |
Test for L2 solver convergence – ignore HQ residual. More... | |
void | PrintStats (const char *name, int k, double r2, double b2, double hq2) |
Prints out the running statistics of the solver (requires a verbosity of QUDA_VERBOSE) More... | |
void | PrintSummary (const char *name, int k, double r2, double b2, double r2_tol, double hq_tol) |
Prints out the summary of the solver convergence (requires a verbosity of QUDA_SUMMARIZE). Assumes SolverParam.true_res and SolverParam.true_res_hq has been set. More... | |
double | precisionEpsilon (QudaPrecision prec=QUDA_INVALID_PRECISION) const |
Returns the epsilon tolerance for a given precision, by default returns the solver precision. More... | |
void | constructDeflationSpace (const ColorSpinorField &meta, const DiracMatrix &mat) |
Constructs the deflation space and eigensolver. More... | |
void | destroyDeflationSpace () |
Destroy the allocated deflation space. More... | |
void | extendSVDDeflationSpace () |
Extends the deflation space to twice its size for SVD deflation. More... | |
void | injectDeflationSpace (std::vector< ColorSpinorField * > &defl_space) |
Injects a deflation space into the solver from the vector argument. Note the input space is reduced to zero size as a result of calling this function, with responsibility for the space transferred to the solver. More... | |
void | extractDeflationSpace (std::vector< ColorSpinorField * > &defl_space) |
Extracts the deflation space from the solver to the vector argument. Note the solver deflation space is reduced to zero size as a result of calling this function, with responsibility for the space transferred to the argument. More... | |
int | deflationSpaceSize () const |
Returns the size of deflation space. More... | |
void | setDeflateCompute (bool flag) |
Sets the deflation compute boolean. More... | |
void | setRecomputeEvals (bool flag) |
Sets the recompute evals boolean. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from quda::Solver | |
static Solver * | create (SolverParam ¶m, const DiracMatrix &mat, const DiracMatrix &matSloppy, const DiracMatrix &matPrecon, const DiracMatrix &matEig, TimeProfile &profile) |
Solver factory. More... | |
static double | stopping (double tol, double b2, QudaResidualType residual_type) |
Set the solver L2 stopping condition. More... | |
Protected Attributes inherited from quda::Solver | |
const DiracMatrix & | mat |
const DiracMatrix & | matSloppy |
const DiracMatrix & | matPrecon |
const DiracMatrix & | matEig |
SolverParam & | param |
TimeProfile & | profile |
int | node_parity |
EigenSolver * | eig_solve |
bool | deflate_init |
bool | deflate_compute |
bool | recompute_evals |
std::vector< ColorSpinorField * > | evecs |
std::vector< Complex > | evals |
Adaptive Multigrid solver
Definition at line 182 of file multigrid.h.
quda::MG::MG | ( | MGParam & | param, |
TimeProfile & | profile | ||
) |
Constructor for MG class
param | MGParam struct that defines all meta data |
profile | Timeprofile instance used to profile |
Definition at line 16 of file multigrid.cpp.
|
virtual |
Destructor for MG class. Frees any existing coarse grid MG instance
Definition at line 681 of file multigrid.cpp.
void quda::MG::buildFreeVectors | ( | std::vector< ColorSpinorField * > & | B | ) |
Build free-field null-space vectors.
B | Free-field null-space vectors |
Definition at line 1478 of file multigrid.cpp.
void quda::MG::createCoarseDirac | ( | ) |
Create the coarse dirac operator.
Definition at line 362 of file multigrid.cpp.
void quda::MG::createCoarseSolver | ( | ) |
Create the solver wrapper.
Definition at line 539 of file multigrid.cpp.
void quda::MG::createSmoother | ( | ) |
Create the smoothers.
Definition at line 301 of file multigrid.cpp.
void quda::MG::destroyCoarseSolver | ( | ) |
Destroy the solver wrapper.
Definition at line 510 of file multigrid.cpp.
void quda::MG::destroySmoother | ( | ) |
Destroy the smoothers.
Definition at line 274 of file multigrid.cpp.
void quda::MG::dumpNullVectors | ( | ) | const |
Dump the null-space vectors to disk. Will recurse dumping all levels.
Definition at line 1275 of file multigrid.cpp.
|
virtual |
Return the total flops done on this and all coarser levels.
Reimplemented from quda::Solver.
Definition at line 734 of file multigrid.cpp.
void quda::MG::generateEigenVectors | ( | ) |
Generate lowest eigenvectors.
Definition at line 1653 of file multigrid.cpp.
void quda::MG::generateNullVectors | ( | std::vector< ColorSpinorField * > & | B, |
bool | refresh = false |
||
) |
Generate the null-space vectors.
B | Generated null-space vectors |
refresh | Whether we refreshing pre-exising vectors or starting afresh |
Definition at line 1285 of file multigrid.cpp.
|
inlinevirtual |
Implements quda::Solver.
Definition at line 310 of file multigrid.h.
void quda::MG::loadVectors | ( | std::vector< ColorSpinorField * > & | B | ) |
Load the null space vectors in from file.
B | Loaded null-space vectors (pre-allocated) |
Definition at line 1231 of file multigrid.cpp.
|
virtual |
This applies the V-cycle to the residual vector returning the residual vector
out | The solution vector |
in | The residual vector (or equivalently the right hand side vector) |
Implements quda::Solver.
Definition at line 1095 of file multigrid.cpp.
void quda::MG::reset | ( | bool | refresh = false | ) |
This method resets the solver, e.g., when a parameter has changed such as the mass.
Whether | we are refreshing the null-space components or just updating the operators |
Definition at line 126 of file multigrid.cpp.
void quda::MG::saveVectors | ( | const std::vector< ColorSpinorField * > & | B | ) | const |
Save the null space vectors in from file.
B | Save null-space vectors from here |
Definition at line 1253 of file multigrid.cpp.
void quda::MG::verify | ( | bool | recursively = false | ) |
Verify the correctness of the MG method, optionally recursively starting from the top down.
This method verifies the correctness of the MG method. It checks:
recursively[in] | Whether or not to recursively verify coarser levels, default false |
Definition at line 764 of file multigrid.cpp.