QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
quda::MG Class Reference

#include <multigrid.h>

Inheritance diagram for quda::MG:
Inheritance graph
[legend]
Collaboration diagram for quda::MG:
Collaboration graph
[legend]

Public Member Functions

 MG (MGParam &param, TimeProfile &profile)
 
virtual ~MG ()
 
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 ()
 
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 (SolverParam &param, TimeProfile &profile)
 
virtual ~Solver ()
 
virtual void blocksolve (ColorSpinorField &out, ColorSpinorField &in)
 
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...
 
void constructDeflationSpace (const ColorSpinorField &meta, const DiracMatrix &mat, bool svd)
 Constructs the deflation space. More...
 

Private Member Functions

void pushLevel (int level) const
 Helper function called on entry to each MG function. More...
 
void popLevel (int level) const
 Helper function called on exit to each MG member function. More...
 

Private Attributes

MGParamparam
 
Transfertransfer
 
bool resetTransfer
 
Solverpresmoother
 
Solverpostsmoother
 
TimeProfileprofile_global
 
TimeProfile profile
 
char prefix [128]
 
char coarse_prefix [128]
 
MGcoarse
 
Solvercoarse_solver
 
MGParamparam_coarse
 
SolverParamparam_presmooth
 
SolverParamparam_postsmooth
 
SolverParamparam_coarse_solver
 
std::vector< ColorSpinorField * > * B_coarse
 
ColorSpinorFieldr
 
ColorSpinorFieldb_tilde
 
ColorSpinorFieldr_coarse
 
ColorSpinorFieldx_coarse
 
ColorSpinorFieldtmp_coarse
 
ColorSpinorFieldtmp2_coarse
 
const DiracdiracResidual
 
const DiracdiracSmoother
 
const DiracdiracSmootherSloppy
 
DiracdiracCoarseResidual
 
DiracdiracCoarseSmoother
 
DiracdiracCoarseSmootherSloppy
 
DiracMatrixmatCoarseResidual
 
DiracMatrixmatCoarseSmoother
 
DiracMatrixmatCoarseSmootherSloppy
 
RNGrng
 

Additional Inherited Members

- Static Public Member Functions inherited from quda::Solver
static Solvercreate (SolverParam &param, DiracMatrix &mat, DiracMatrix &matSloppy, DiracMatrix &matPrecon, TimeProfile &profile)
 
static double stopping (double tol, double b2, QudaResidualType residual_type)
 Set the solver L2 stopping condition. More...
 
- Public Attributes inherited from quda::Solver
EigenSolvereig_solve
 
bool deflate_init = false
 
std::vector< ColorSpinorField * > defl_tmp1
 
std::vector< ColorSpinorField * > defl_tmp2
 
- Protected Attributes inherited from quda::Solver
SolverParamparam
 
TimeProfileprofile
 
int node_parity
 

Detailed Description

Adaptive Multigrid solver

Definition at line 177 of file multigrid.h.

Constructor & Destructor Documentation

◆ MG()

quda::MG::MG ( MGParam param,
TimeProfile profile 
)

Constructor for MG class

Parameters
paramMGParam struct that defines all meta data
profileTimeprofile instance used to profile

Definition at line 14 of file multigrid.cpp.

References quda::MGParam::B, b_tilde, buildFreeVectors(), quda::MGParam::coarse_grid_solution_type, QudaMultigridParam_s::compute_null_vector, quda::ColorSpinorParam::create, quda::ColorSpinorField::Create(), csParam, QudaInvertParam_s::cuda_prec_sloppy, errorQuda, quda::MGParam::evals, quda::ColorSpinorParam::gammaBasis, QudaMultigridParam_s::generate_all_levels, generateEigenVectors(), generateNullVectors(), quda::RNG::Init(), QudaMultigridParam_s::invert_param, quda::MGParam::level, loadVectors(), quda::ColorSpinorParam::location, quda::MGParam::location, quda::MGParam::mg_global, quda::MGParam::Nlevel, QudaMultigridParam_s::num_setup_iter, popLevel(), prefix, pushLevel(), QUDA_BOOLEAN_TRUE, QUDA_COMPUTE_NULL_VECTOR_YES, QUDA_CUDA_FIELD_LOCATION, QUDA_DEGRAND_ROSSI_GAMMA_BASIS, QUDA_DIRECT_PC_SOLVE, QUDA_INVALID_PRECISION, QUDA_MATPC_SOLUTION, QUDA_MAX_MG_LEVEL, QUDA_NOISE_UNIFORM, QUDA_NULL_FIELD_CREATE, QUDA_PARITY_SITE_SUBSET, QUDA_UKQCD_GAMMA_BASIS, r, reset(), rng, quda::ColorSpinorParam::setPrecision(), quda::LatticeFieldParam::siteSubset, quda::MGParam::smoother_solve_type, quda::spinorNoise(), transfer, QudaMultigridParam_s::use_eig_solver, QudaMultigridParam_s::vec_infile, QudaMultigridParam_s::vec_load, and quda::LatticeFieldParam::x.

Referenced by reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~MG()

quda::MG::~MG ( )
virtual

Member Function Documentation

◆ buildFreeVectors()

void quda::MG::buildFreeVectors ( std::vector< ColorSpinorField *> &  B)

◆ createCoarseDirac()

void quda::MG::createCoarseDirac ( )

Create the coarse dirac operator.

Definition at line 334 of file multigrid.cpp.

References quda::MGParam::coarse_grid_solution_type, QudaMultigridParam_s::coarse_grid_solution_type, quda::DiracParam::commDim, quda::DiracParam::dagger, quda::DiracParam::dirac, diracCoarseResidual, diracCoarseSmoother, diracCoarseSmootherSloppy, diracResidual, diracSmoother, quda::ColorSpinorField::Even(), quda::DiracMatrix::Expose(), getVerbosity(), quda::DiracParam::halo_precision, QudaMultigridParam_s::invert_param, quda::DiracParam::kappa, quda::Dirac::Kappa(), quda::MGParam::level, matCoarseResidual, matCoarseSmoother, matCoarseSmootherSloppy, matpc_type, QudaInvertParam_s::matpc_type, quda::DiracParam::matpcType, quda::MGParam::matSmooth, MAX_BLOCK_FLOAT_NC, quda::MGParam::mg_global, quda::DiracParam::mu, quda::Dirac::Mu(), quda::DiracParam::mu_factor, QudaMultigridParam_s::mu_factor, quda::DiracParam::need_bidirectional, quda::MGParam::Nvec, param, popLevel(), QudaMultigridParam_s::precision_null, printfQuda, pushLevel(), QUDA_BOOLEAN_FALSE, QUDA_BOOLEAN_TRUE, QUDA_COARSE_DIRAC, QUDA_COARSEPC_DIRAC, QUDA_CUDA_FIELD_LOCATION, QUDA_DAG_NO, QUDA_DIRECT_PC_SOLVE, QUDA_INVALID_SCHWARZ, QUDA_MATPC_SOLUTION, QUDA_SINGLE_PRECISION, QUDA_VERBOSE, quda::MGParam::setup_location, QudaMultigridParam_s::setup_minimize_memory, QudaMultigridParam_s::smoother_halo_precision, QudaMultigridParam_s::smoother_schwarz_type, quda::MGParam::smoother_solve_type, QudaMultigridParam_s::smoother_solve_type, quda::DiracParam::tmp1, quda::DiracParam::tmp2, tmp2_coarse, tmp_coarse, quda::DiracParam::transfer, transfer, and quda::DiracParam::type.

Referenced by reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCoarseSolver()

void quda::MG::createCoarseSolver ( )

Create the solver wrapper.

Definition at line 436 of file multigrid.cpp.

References quda::SolverParam::ca_basis, quda::SolverParam::ca_lambda_max, quda::SolverParam::ca_lambda_min, coarse, QudaMultigridParam_s::coarse_grid_solution_type, QudaMultigridParam_s::coarse_guess, coarse_prefix, coarse_solver, QudaMultigridParam_s::coarse_solver, QudaMultigridParam_s::coarse_solver_ca_basis, QudaMultigridParam_s::coarse_solver_ca_basis_size, QudaMultigridParam_s::coarse_solver_ca_lambda_max, QudaMultigridParam_s::coarse_solver_ca_lambda_min, QudaMultigridParam_s::coarse_solver_maxiter, QudaMultigridParam_s::coarse_solver_tol, quda::SolverParam::compute_true_res, quda::Solver::create(), quda::MGParam::cycle_type, quda::SolverParam::deflate, quda::SolverParam::delta, destroyCoarseSolver(), quda::SolverParam::eig_param, QudaMultigridParam_s::eig_param, errorQuda, quda::DiracMatrix::Expose(), getVerbosity(), quda::SolverParam::global_reduction, quda::SolverParam::inv_type, quda::SolverParam::inv_type_precondition, quda::SolverParam::is_preconditioner, quda::MGParam::level, QudaMultigridParam_s::location, matCoarseResidual, matCoarseSmoother, quda::SolverParam::maxiter, quda::MGParam::mg_global, quda::SolverParam::mg_instance, QudaMultigridParam_s::n_vec, quda::SolverParam::Nkrylov, quda::MGParam::Nlevel, param, param_coarse_solver, quda::SolverParam::pipeline, popLevel(), quda::SolverParam::precision, quda::LatticeField::Precision(), quda::SolverParam::precision_precondition, quda::SolverParam::precision_sloppy, quda::SolverParam::preconditioner, quda::SolverParam::preserve_source, presmoother, printfQuda, profile, pushLevel(), QUDA_BOOLEAN_TRUE, QUDA_CA_CG_INVERTER, QUDA_CA_CGNE_INVERTER, QUDA_CA_CGNR_INVERTER, QUDA_CA_GCR_INVERTER, QUDA_CGNE_INVERTER, QUDA_CGNR_INVERTER, QUDA_CUDA_FIELD_LOCATION, QUDA_GCR_INVERTER, QUDA_INVALID_INVERTER, QUDA_MATPC_SOLUTION, QUDA_MG_CYCLE_RECURSIVE, QUDA_MG_CYCLE_VCYCLE, QUDA_MG_INVERTER, QUDA_PRESERVE_SOURCE_NO, QUDA_USE_INIT_GUESS_NO, QUDA_USE_INIT_GUESS_YES, QUDA_VERBOSE, r_coarse, quda::SolverParam::return_residual, quda::SolverParam::sloppy_converge, quda::SolverParam::tol, QudaMultigridParam_s::use_eig_solver, quda::SolverParam::use_init_guess, QudaEigParam_s::vec_infile, QudaMultigridParam_s::vec_infile, QudaMultigridParam_s::vec_load, QudaEigParam_s::vec_outfile, QudaMultigridParam_s::vec_outfile, QudaMultigridParam_s::vec_store, QudaMultigridParam_s::verbosity, and quda::SolverParam::verbosity_precondition.

Referenced by reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSmoother()

void quda::MG::createSmoother ( )

Create the smoothers.

Definition at line 276 of file multigrid.cpp.

References quda::SolverParam::compute_true_res, quda::Solver::create(), QudaInvertParam_s::cuda_prec_precondition, QudaInvertParam_s::cuda_prec_sloppy, destroySmoother(), getVerbosity(), quda::MGParam::global_reduction, quda::SolverParam::global_reduction, quda::SolverParam::inv_type, quda::SolverParam::inv_type_precondition, QudaMultigridParam_s::invert_param, quda::SolverParam::is_preconditioner, quda::MGParam::level, quda::MGParam::matSmooth, quda::MGParam::matSmoothSloppy, quda::SolverParam::maxiter, quda::MGParam::mg_global, quda::SolverParam::Nkrylov, quda::MGParam::Nlevel, quda::SolverParam::Nsteps, quda::MGParam::nu_post, quda::MGParam::nu_pre, param, param_postsmooth, param_presmooth, quda::SolverParam::pipeline, popLevel(), postsmoother, quda::SolverParam::precision, quda::SolverParam::precision_precondition, quda::SolverParam::precision_sloppy, quda::SolverParam::preserve_source, presmoother, printfQuda, profile, pushLevel(), QUDA_INVALID_INVERTER, QUDA_INVALID_RESIDUAL, QUDA_INVALID_SCHWARZ, QUDA_L2_RELATIVE_RESIDUAL, QUDA_MR_INVERTER, QUDA_PRESERVE_SOURCE_NO, QUDA_USE_INIT_GUESS_NO, QUDA_USE_INIT_GUESS_YES, QUDA_VERBOSE, quda::SolverParam::residual_type, quda::SolverParam::return_residual, quda::SolverParam::schwarz_type, quda::SolverParam::sloppy_converge, quda::MGParam::smoother, QudaMultigridParam_s::smoother_schwarz_cycle, QudaMultigridParam_s::smoother_schwarz_type, quda::MGParam::smoother_tol, quda::SolverParam::tol, and quda::SolverParam::use_init_guess.

Referenced by generateNullVectors(), and reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroyCoarseSolver()

void quda::MG::destroyCoarseSolver ( )

Destroy the solver wrapper.

Definition at line 415 of file multigrid.cpp.

References coarse_solver, quda::MGParam::cycle_type, errorQuda, quda::MGParam::level, quda::MGParam::Nlevel, param, param_coarse_solver, popLevel(), pushLevel(), QUDA_MG_CYCLE_RECURSIVE, and QUDA_MG_CYCLE_VCYCLE.

Referenced by createCoarseSolver(), and reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroySmoother()

void quda::MG::destroySmoother ( )

Destroy the smoothers.

Definition at line 249 of file multigrid.cpp.

References quda::MGParam::level, param, param_postsmooth, param_presmooth, popLevel(), postsmoother, presmoother, and pushLevel().

Referenced by createSmoother(), and reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dumpNullVectors()

void quda::MG::dumpNullVectors ( ) const

Dump the null-space vectors to disk. Will recurse dumping all levels.

Definition at line 1045 of file multigrid.cpp.

References quda::MGParam::B, coarse, dumpNullVectors(), quda::MGParam::level, quda::MGParam::Nlevel, param, and saveVectors().

Referenced by dumpMultigridQuda(), and dumpNullVectors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flops()

double quda::MG::flops ( ) const
virtual

Return the total flops done on this and all coarser levels.

Reimplemented from quda::Solver.

Definition at line 597 of file multigrid.cpp.

References coarse, quda::Transfer::flops(), flops(), quda::SolverParam::gflops, quda::MGParam::level, quda::MGParam::Nlevel, param, param_coarse_solver, param_postsmooth, param_presmooth, and transfer.

Referenced by flops().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateEigenVectors()

void quda::MG::generateEigenVectors ( )

◆ generateNullVectors()

void quda::MG::generateNullVectors ( std::vector< ColorSpinorField *> &  B,
bool  refresh = false 
)

Generate the null-space vectors.

Parameters
BGenerated null-space vectors
refreshWhether we refreshing pre-exising vectors or starting afresh

Definition at line 1051 of file multigrid.cpp.

References quda::ax(), quda::MGParam::B, B_coarse, quda::SolverParam::ca_basis, quda::SolverParam::ca_lambda_max, quda::SolverParam::ca_lambda_min, quda::caxpy(), quda::blas::cDotProduct(), coarse, quda::commDim, quda::SolverParam::compute_null_vector, quda::SolverParam::compute_true_res, quda::ColorSpinorParam::create, quda::Solver::create(), createSmoother(), csParam, QudaInvertParam_s::cuda_prec_precondition, quda::SolverParam::delta, diracSmoother, diracSmootherSloppy, errorQuda, quda::ColorSpinorParam::gammaBasis, QudaMultigridParam_s::generate_all_levels, generateNullVectors(), getVerbosity(), quda::Dirac::HaloPrecision(), in, quda::SolverParam::inv_type, quda::SolverParam::inv_type_precondition, QudaMultigridParam_s::invert_param, quda::MGParam::level, quda::ColorSpinorParam::location, quda::MGParam::matSmooth, quda::MGParam::matSmoothSloppy, quda::SolverParam::maxiter, quda::SolverParam::maxiter_precondition, quda::MGParam::mg_global, quda::SolverParam::Nkrylov, quda::MGParam::Nlevel, quda::norm2(), QudaMultigridParam_s::num_setup_iter, quda::MGParam::Nvec, quda::SolverParam::omega, out, param, quda::SolverParam::pipeline, popLevel(), QudaMultigridParam_s::post_orthonormalize, QudaMultigridParam_s::pre_orthonormalize, quda::SolverParam::precision, quda::LatticeField::Precision(), quda::SolverParam::precision_precondition, quda::SolverParam::precision_sloppy, quda::SolverParam::precondition_cycle, quda::SolverParam::preconditioner, quda::Dirac::prepare(), printfQuda, profile, pushLevel(), QUDA_ADDITIVE_SCHWARZ, QUDA_BICGSTAB_INVERTER, QUDA_BOOLEAN_TRUE, QUDA_CA_CG_INVERTER, QUDA_CA_CGNE_INVERTER, QUDA_CA_CGNR_INVERTER, QUDA_CA_GCR_INVERTER, QUDA_CG_INVERTER, QUDA_COMPUTE_NULL_VECTOR_YES, QUDA_CUDA_FIELD_LOCATION, QUDA_GCR_INVERTER, QUDA_HALF_PRECISION, QUDA_INVALID_SCHWARZ, QUDA_L2_RELATIVE_RESIDUAL, QUDA_MAT_SOLUTION, QUDA_MAX_DIM, QUDA_MG_INVERTER, QUDA_NULL_FIELD_CREATE, QUDA_QUARTER_PRECISION, QUDA_TEST_VECTOR_SETUP, QUDA_UKQCD_GAMMA_BASIS, QUDA_USE_INIT_GUESS_YES, QUDA_VERBOSE, QUDA_ZERO_FIELD_CREATE, quda::Transfer::R(), r, quda::Dirac::reconstruct(), reset(), resetTransfer, quda::SolverParam::residual_type, saveVectors(), quda::SolverParam::schwarz_type, quda::Dirac::setCommDim(), quda::Dirac::setHaloPrecision(), quda::ColorSpinorParam::setPrecision(), QudaMultigridParam_s::setup_ca_basis, QudaMultigridParam_s::setup_ca_basis_size, QudaMultigridParam_s::setup_ca_lambda_max, QudaMultigridParam_s::setup_ca_lambda_min, QudaMultigridParam_s::setup_inv_type, QudaMultigridParam_s::setup_maxiter, QudaMultigridParam_s::setup_maxiter_refresh, QudaMultigridParam_s::setup_tol, QudaMultigridParam_s::setup_type, QudaMultigridParam_s::smoother_schwarz_type, quda::sqrt(), quda::SolverParam::tol, quda::SolverParam::tol_precondition, transfer, quda::SolverParam::use_init_guess, QudaMultigridParam_s::vec_store, QudaMultigridParam_s::verbosity, quda::SolverParam::verbosity_precondition, and quda::zero().

Referenced by generateNullVectors(), MG(), and reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadVectors()

void quda::MG::loadVectors ( std::vector< ColorSpinorField *> &  B)

Load the null space vectors in from file.

Parameters
BLoaded null-space vectors (pre-allocated)

Definition at line 1013 of file multigrid.cpp.

References quda::MGParam::level, quda::EigenSolver::loadVectors(), quda::MGParam::mg_global, QudaMultigridParam_s::n_vec, param, popLevel(), profile_global, pushLevel(), quda::QUDA_PROFILE_INIT, quda::QUDA_PROFILE_IO, and QudaMultigridParam_s::vec_infile.

Referenced by MG().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()()

void quda::MG::operator() ( ColorSpinorField out,
ColorSpinorField in 
)
virtual

◆ popLevel()

void quda::MG::popLevel ( int  level) const
private

Helper function called on exit to each MG member function.

Parameters
[in]levelThe level we working on

Definition at line 242 of file multigrid.cpp.

References popOutputPrefix(), popVerbosity(), and postTrace.

Referenced by buildFreeVectors(), createCoarseDirac(), createCoarseSolver(), createSmoother(), destroyCoarseSolver(), destroySmoother(), generateEigenVectors(), generateNullVectors(), loadVectors(), MG(), reset(), saveVectors(), verify(), and ~MG().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pushLevel()

void quda::MG::pushLevel ( int  level) const
private

Helper function called on entry to each MG function.

Parameters
[in]levelThe level we working on

Definition at line 235 of file multigrid.cpp.

References quda::MGParam::mg_global, param, postTrace, prefix, pushOutputPrefix(), pushVerbosity(), and QudaMultigridParam_s::verbosity.

Referenced by buildFreeVectors(), createCoarseDirac(), createCoarseSolver(), createSmoother(), destroyCoarseSolver(), destroySmoother(), generateEigenVectors(), generateNullVectors(), loadVectors(), MG(), reset(), saveVectors(), verify(), and ~MG().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void quda::MG::reset ( bool  refresh = false)

This method resets the solver, e.g., when a parameter has changed such as the mass.

Parameters
Whetherwe are refreshing the null-space components or just updating the operators

Definition at line 117 of file multigrid.cpp.

References quda::MGParam::B, B_coarse, coarse, QudaMultigridParam_s::coarse_solver_maxiter, createCoarseDirac(), createCoarseSolver(), createSmoother(), QudaInvertParam_s::cuda_prec_precondition, quda::SolverParam::delta, destroyCoarseSolver(), destroySmoother(), diracResidual, diracSmoother, diracSmootherSloppy, quda::MGParam::evals, quda::DiracMatrix::Expose(), quda::MGParam::fine, QudaMultigridParam_s::generate_all_levels, generateNullVectors(), QudaMultigridParam_s::geo_block_size, quda::MGParam::geoBlockSize, getVerbosity(), QudaMultigridParam_s::invert_param, quda::MGParam::level, QudaMultigridParam_s::location, matCoarseResidual, matCoarseSmoother, matCoarseSmootherSloppy, quda::MGParam::matResidual, quda::MGParam::matSmooth, quda::MGParam::matSmoothSloppy, quda::SolverParam::maxiter, MG(), quda::MGParam::mg_global, QudaMultigridParam_s::n_vec, quda::MGParam::NblockOrtho, quda::MGParam::Nlevel, quda::MGParam::Nvec, param, param_coarse, param_coarse_solver, popLevel(), quda::SolverParam::precision, quda::LatticeField::Precision(), QudaMultigridParam_s::precision_null, prefix, printfQuda, profile, profile_global, pushLevel(), QUDA_BOOLEAN_FALSE, QUDA_FULL_SITE_SUBSET, QUDA_INVALID_PARITY, QUDA_MAX_MG_LEVEL, QUDA_NOISE_UNIFORM, QUDA_SINGLE_PRECISION, QUDA_SUMMARIZE, QUDA_VERBOSE, quda::Transfer::R(), r, r_coarse, quda::Transfer::reset(), reset(), resetTransfer, rng, QudaMultigridParam_s::run_verify, setOutputPrefix(), quda::Transfer::setSiteSubset(), QudaMultigridParam_s::setup_location, QudaMultigridParam_s::setup_maxiter_refresh, quda::MGParam::spinBlockSize, quda::spinorNoise(), tmp2_coarse, tmp_coarse, transfer, quda::SolverParam::updateInvertParam(), QudaMultigridParam_s::use_eig_solver, verify(), x_coarse, and quda::zero().

Referenced by generateNullVectors(), MG(), reset(), and updateMultigridQuda().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveVectors()

void quda::MG::saveVectors ( const std::vector< ColorSpinorField *> &  B) const

Save the null space vectors in from file.

Parameters
BSave null-space vectors from here

Definition at line 1029 of file multigrid.cpp.

References quda::MGParam::level, quda::MGParam::mg_global, QudaMultigridParam_s::n_vec, param, popLevel(), profile_global, pushLevel(), quda::QUDA_PROFILE_INIT, quda::QUDA_PROFILE_IO, quda::EigenSolver::saveVectors(), and QudaMultigridParam_s::vec_outfile.

Referenced by dumpNullVectors(), generateEigenVectors(), and generateNullVectors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verify()

void quda::MG::verify ( )

This method verifies the correctness of the MG method. It checks:

  1. Null-space vectors are exactly preserved: v_k = P R v_k
  2. Any coarse vector is exactly preserved on the fine grid: eta_c = R P eta_c
  3. The emulated coarse Dirac operator matches the native one: D_c = R D P

Verification that the constructed multigrid operator is valid

Definition at line 627 of file multigrid.cpp.

References quda::MGParam::B, quda::blas::cDotProduct(), coarse, quda::MGParam::coarse_grid_solution_type, QudaMultigridParam_s::coarse_grid_solution_type, comm_barrier(), comm_rank(), quda::ColorSpinorParam::create, quda::ColorSpinorField::Create(), csParam, diracCoarseResidual, diracCoarseSmoother, diracResidual, diracSmoother, dot(), quda::Dirac::DslashXpay(), errorQuda, quda::ColorSpinorField::Even(), generateEigenVectors(), quda::MGParam::geoBlockSize, getVerbosity(), kappa, quda::Dirac::Kappa(), quda::MGParam::level, quda::MGParam::location, QudaMultigridParam_s::location, quda::MGParam::matResidual, quda::Dirac::MdagM(), quda::MGParam::mg_global, quda::Dirac::Mu(), QudaMultigridParam_s::mu_factor, quda::MGParam::Nlevel, quda::norm2(), quda::MGParam::Nvec, quda::ColorSpinorField::Odd(), quda::Transfer::P(), param, param_coarse, popLevel(), prec, quda::LatticeFieldParam::Precision(), quda::LatticeField::Precision(), QudaMultigridParam_s::precision_null, prefix, printfQuda, quda::ColorSpinorField::PrintVector(), pushLevel(), QUDA_CUDA_FIELD_LOCATION, QUDA_DIRECT_PC_SOLVE, QUDA_EVEN_PARITY, QUDA_HALF_PRECISION, QUDA_MATPC_SOLUTION, QUDA_NOISE_UNIFORM, QUDA_NULL_FIELD_CREATE, QUDA_ODD_PARITY, QUDA_QUARTER_PRECISION, QUDA_SINGLE_PRECISION, QUDA_SUMMARIZE, QUDA_VERBOSE, quda::Transfer::R(), r, r_coarse, rng, QudaMultigridParam_s::run_low_mode_check, QudaMultigridParam_s::run_oblique_proj_check, setOutputPrefix(), quda::MGParam::smoother_solve_type, QudaMultigridParam_s::smoother_solve_type, quda::MGParam::spinBlockSize, quda::spinorNoise(), quda::sqrt(), tmp1, tmp2, tmp_coarse, tol, transfer, quda::ColorSpinorField::TwistFlavor(), quda::Transfer::Vectors(), verify(), quda::ColorSpinorField::Volume(), x_coarse, quda::blas::xmyNorm(), and quda::zero().

Referenced by reset(), and verify().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ B_coarse

std::vector<ColorSpinorField*>* quda::MG::B_coarse
private

The coarse-grid representation of the null space vectors

Definition at line 223 of file multigrid.h.

Referenced by generateNullVectors(), reset(), and ~MG().

◆ b_tilde

ColorSpinorField* quda::MG::b_tilde
private

Projected source vector for preconditioned syste, else just points to source

Definition at line 229 of file multigrid.h.

Referenced by MG(), operator()(), and ~MG().

◆ coarse

MG* quda::MG::coarse
private

This is the next lower level

Definition at line 205 of file multigrid.h.

Referenced by createCoarseSolver(), dumpNullVectors(), flops(), generateNullVectors(), reset(), verify(), and ~MG().

◆ coarse_prefix

char quda::MG::coarse_prefix[128]
private

Prefix label used for printf on next coarse level

Definition at line 202 of file multigrid.h.

Referenced by createCoarseSolver().

◆ coarse_solver

Solver* quda::MG::coarse_solver
private

The coarse grid solver - this either points at "coarse" or a solver preconditioned by "coarse"

Definition at line 208 of file multigrid.h.

Referenced by createCoarseSolver(), destroyCoarseSolver(), and ~MG().

◆ diracCoarseResidual

Dirac* quda::MG::diracCoarseResidual
private

The coarse operator used for computing inter-grid residuals

Definition at line 253 of file multigrid.h.

Referenced by createCoarseDirac(), verify(), and ~MG().

◆ diracCoarseSmoother

Dirac* quda::MG::diracCoarseSmoother
private

The coarse operator used for doing smoothing

Definition at line 256 of file multigrid.h.

Referenced by createCoarseDirac(), verify(), and ~MG().

◆ diracCoarseSmootherSloppy

Dirac* quda::MG::diracCoarseSmootherSloppy
private

The coarse operator used for doing sloppy smoothing

Definition at line 259 of file multigrid.h.

Referenced by createCoarseDirac(), and ~MG().

◆ diracResidual

const Dirac* quda::MG::diracResidual
private

The fine operator used for computing inter-grid residuals

Definition at line 244 of file multigrid.h.

Referenced by createCoarseDirac(), generateEigenVectors(), reset(), and verify().

◆ diracSmoother

const Dirac* quda::MG::diracSmoother
private

The fine operator used for doing smoothing

Definition at line 247 of file multigrid.h.

Referenced by createCoarseDirac(), generateNullVectors(), operator()(), reset(), and verify().

◆ diracSmootherSloppy

const Dirac* quda::MG::diracSmootherSloppy
private

The fine operator used for doing sloppy smoothing

Definition at line 250 of file multigrid.h.

Referenced by generateNullVectors(), and reset().

◆ matCoarseResidual

DiracMatrix* quda::MG::matCoarseResidual
private

Wrapper for the residual coarse grid operator

Definition at line 262 of file multigrid.h.

Referenced by createCoarseDirac(), createCoarseSolver(), reset(), and ~MG().

◆ matCoarseSmoother

DiracMatrix* quda::MG::matCoarseSmoother
private

Wrapper for the smoothing coarse grid operator

Definition at line 265 of file multigrid.h.

Referenced by createCoarseDirac(), createCoarseSolver(), reset(), and ~MG().

◆ matCoarseSmootherSloppy

DiracMatrix* quda::MG::matCoarseSmootherSloppy
private

Wrapper for the sloppy smoothing coarse grid operator

Definition at line 268 of file multigrid.h.

Referenced by createCoarseDirac(), reset(), and ~MG().

◆ param

MGParam& quda::MG::param
private

◆ param_coarse

MGParam* quda::MG::param_coarse
private

Storage for the parameter struct for the coarse grid

Definition at line 211 of file multigrid.h.

Referenced by reset(), verify(), and ~MG().

◆ param_coarse_solver

SolverParam* quda::MG::param_coarse_solver
private

Storage for the parameter struct for the coarse solver

Definition at line 220 of file multigrid.h.

Referenced by createCoarseSolver(), destroyCoarseSolver(), flops(), reset(), and ~MG().

◆ param_postsmooth

SolverParam* quda::MG::param_postsmooth
private

Storage for the parameter struct for the post-smoother

Definition at line 217 of file multigrid.h.

Referenced by createSmoother(), destroySmoother(), flops(), and ~MG().

◆ param_presmooth

SolverParam* quda::MG::param_presmooth
private

Storage for the parameter struct for the pre-smoother

Definition at line 214 of file multigrid.h.

Referenced by createSmoother(), destroySmoother(), flops(), and ~MG().

◆ postsmoother

Solver * quda::MG::postsmoother
private

Definition at line 190 of file multigrid.h.

Referenced by createSmoother(), destroySmoother(), operator()(), and ~MG().

◆ prefix

char quda::MG::prefix[128]
private

Prefix label used for printf at this level

Definition at line 199 of file multigrid.h.

Referenced by MG(), operator()(), pushLevel(), reset(), and verify().

◆ presmoother

Solver* quda::MG::presmoother
private

This is the smoother used

Definition at line 190 of file multigrid.h.

Referenced by createCoarseSolver(), createSmoother(), destroySmoother(), operator()(), and ~MG().

◆ profile

TimeProfile quda::MG::profile
private

◆ profile_global

TimeProfile& quda::MG::profile_global
private

TimeProfile for all levels (refers to profile from parent solver)

Definition at line 193 of file multigrid.h.

Referenced by loadVectors(), reset(), and saveVectors().

◆ r

ColorSpinorField* quda::MG::r
private

Residual vector

Definition at line 226 of file multigrid.h.

Referenced by generateNullVectors(), MG(), operator()(), reset(), verify(), and ~MG().

◆ r_coarse

ColorSpinorField* quda::MG::r_coarse
private

Coarse residual vector

Definition at line 232 of file multigrid.h.

Referenced by createCoarseSolver(), operator()(), reset(), verify(), and ~MG().

◆ resetTransfer

bool quda::MG::resetTransfer
private

This tell to reset() if transfer needs to be rebuilt

Definition at line 187 of file multigrid.h.

Referenced by generateNullVectors(), and reset().

◆ rng

RNG* quda::MG::rng
private

Parallel hyper-cubic random number generator for generating null-space vectors

Definition at line 271 of file multigrid.h.

Referenced by MG(), reset(), verify(), and ~MG().

◆ tmp2_coarse

ColorSpinorField* quda::MG::tmp2_coarse
private

Coarse temporary vector

Definition at line 241 of file multigrid.h.

Referenced by createCoarseDirac(), reset(), and ~MG().

◆ tmp_coarse

ColorSpinorField* quda::MG::tmp_coarse
private

Coarse temporary vector

Definition at line 238 of file multigrid.h.

Referenced by createCoarseDirac(), reset(), verify(), and ~MG().

◆ transfer

Transfer* quda::MG::transfer
private

This is the transfer operator that defines the prolongation and restriction operators

Definition at line 184 of file multigrid.h.

Referenced by createCoarseDirac(), flops(), generateNullVectors(), MG(), operator()(), reset(), verify(), and ~MG().

◆ x_coarse

ColorSpinorField* quda::MG::x_coarse
private

Coarse solution vector

Definition at line 235 of file multigrid.h.

Referenced by operator()(), reset(), verify(), and ~MG().


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