11 #define GPU_MULTIGRID_DOUBLE 57 std::vector<ColorSpinorField*> &
B;
113 Nlevel(param.n_level),
114 spinBlockSize(param.spin_block_size[level]),
115 Nvec(param.n_vec[level]),
118 nu_pre(param.nu_pre[level]),
119 nu_post(param.nu_post[level]),
120 smoother_tol(param.smoother_tol[level]),
121 cycle_type(param.cycle_type[level]),
122 global_reduction(param.global_reduction[level]),
123 matResidual(matResidual),
124 matSmooth(matSmooth),
125 matSmoothSloppy(matSmoothSloppy),
126 smoother(param.smoother[level]),
127 coarse_grid_solution_type(param.coarse_grid_solution_type[level]),
128 smoother_solve_type(param.smoother_solve_type[level]),
129 location(param.location[level]),
130 setup_location(param.setup_location[level])
142 mg_global(param.mg_global),
144 Nlevel(param.Nlevel),
145 spinBlockSize(param.mg_global.spin_block_size[level]),
146 Nvec(param.mg_global.n_vec[level]),
148 coarse(param.coarse),
152 nu_pre(param.mg_global.nu_pre[level]),
153 nu_post(param.mg_global.nu_post[level]),
154 smoother_tol(param.mg_global.smoother_tol[level]),
155 cycle_type(param.mg_global.cycle_type[level]),
156 global_reduction(param.mg_global.global_reduction[level]),
157 matResidual(matResidual),
158 matSmooth(matSmooth),
159 matSmoothSloppy(matSmoothSloppy),
160 smoother(param.mg_global.smoother[level]),
161 coarse_grid_solution_type(param.mg_global.coarse_grid_solution_type[level]),
162 smoother_solve_type(param.mg_global.smoother_solve_type[level]),
163 location(param.mg_global.location[level]),
164 setup_location(param.mg_global.setup_location[level])
202 char coarse_prefix[128];
277 void pushLevel(
int level)
const;
283 void popLevel(
int level)
const;
303 void reset(
bool refresh=
false);
308 void dumpNullVectors()
const;
313 void createSmoother();
318 void destroySmoother();
323 void createCoarseDirac();
328 void createCoarseSolver();
333 void destroyCoarseSolver();
354 void loadVectors(std::vector<ColorSpinorField *> &
B);
360 void saveVectors(
const std::vector<ColorSpinorField *> &
B)
const;
367 void generateNullVectors(std::vector<ColorSpinorField*> &
B,
bool refresh=
false);
372 void generateEigenVectors();
378 void buildFreeVectors(std::vector<ColorSpinorField*> &
B);
383 double flops()
const;
406 bool dslash=
true,
bool clover=
true,
bool dagger=
false,
const int *
commDim=0,
475 std::vector<ColorSpinorField*>
B;
490 if (mgParam)
delete mgParam;
492 for (
unsigned int i=0; i<B.size(); i++)
delete B[i];
495 if (mSmooth)
delete mSmooth;
496 if (mSmoothSloppy)
delete mSmoothSloppy;
499 if (dSmooth)
delete dSmooth;
500 if (dSmoothSloppy && dSmoothSloppy != dSmooth)
delete dSmoothSloppy;
DiracMatrix * matSmoothSloppy
QudaBoolean global_reduction
QudaMultigridParam & mg_global
void ApplyCoarse(ColorSpinorField &out, const ColorSpinorField &inA, const ColorSpinorField &inB, const GaugeField &Y, const GaugeField &X, double kappa, int parity=QUDA_INVALID_PARITY, bool dslash=true, bool clover=true, bool dagger=false, const int *commDim=0, QudaPrecision halo_precision=QUDA_INVALID_PRECISION)
Apply the coarse dslash stencil. This single driver accounts for all variations with and without the ...
SolverParam * param_coarse_solver
std::vector< ColorSpinorField * > & B
MGParam(const MGParam ¶m, std::vector< ColorSpinorField *> &B, std::vector< Complex > evals, DiracMatrix *matResidual, DiracMatrix *matSmooth, DiracMatrix *matSmoothSloppy, int level=0)
enum QudaPrecision_s QudaPrecision
void CoarseCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, const GaugeField &gauge, const GaugeField &clover, const GaugeField &cloverInv, double kappa, double mu, double mu_factor, QudaDiracType dirac, QudaMatPCType matpc, bool need_bidirectional)
Coarse operator construction from an intermediate-grid operator (Coarse)
QudaFieldLocation location
TimeProfile & profile_global
std::vector< Complex > evals
const Dirac * diracResidual
QudaFieldLocation setup_location
ColorSpinorField * b_tilde
enum QudaSolveType_s QudaSolveType
Dirac * diracCoarseSmoother
DiracMatrix * matCoarseSmootherSloppy
SolverParam * param_presmooth
void CoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, const cudaGaugeField &gauge, const cudaCloverField *clover, double kappa, double mu, double mu_factor, QudaDiracType dirac, QudaMatPCType matpc)
Coarse operator construction from a fine-grid operator (Wilson / Clover)
virtual ~multigrid_solver()
QudaSolveType smoother_solve_type
const Dirac * diracSmootherSloppy
void matpc(void *outEven, void **gauge, void *inEven, double kappa, QudaMatPCType matpc_type, int dagger_bit, QudaPrecision sPrecision, QudaPrecision gPrecision, double mferm)
DiracMatrix * matCoarseSmoother
ColorSpinorField * tmp_coarse
SolverParam * param_postsmooth
const Dirac * diracSmoother
std::vector< Complex > evals
QudaInverterType smoother
Class declaration to initialize and hold CURAND RNG states.
double omega[QUDA_MAX_MG_LEVEL]
enum QudaMatPCType_s QudaMatPCType
int geoBlockSize[QUDA_MAX_DIM]
Dirac * diracCoarseResidual
enum QudaSolutionType_s QudaSolutionType
std::vector< ColorSpinorField * > * B_coarse
ColorSpinorField * tmp2_coarse
ColorSpinorField * r_coarse
DiracMatrix * matCoarseResidual
void calculateYhat(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X)
Calculate preconditioned coarse links and coarse clover inverse field.
Dirac * diracCoarseSmootherSloppy
enum QudaBoolean_s QudaBoolean
MGParam(QudaMultigridParam ¶m, std::vector< ColorSpinorField *> &B, DiracMatrix *matResidual, DiracMatrix *matSmooth, DiracMatrix *matSmoothSloppy, int level=0)
enum QudaFieldLocation_s QudaFieldLocation
static int commDim[QUDA_MAX_DIM]
cpuColorSpinorField * out
int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
enum QudaMultigridCycleType_s QudaMultigridCycleType
std::vector< ColorSpinorField * > B
double mu_factor[QUDA_MAX_MG_LEVEL]
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
int n_block_ortho[QUDA_MAX_MG_LEVEL]
QudaSolutionType coarse_grid_solution_type
QudaMultigridCycleType cycle_type
enum QudaInverterType_s QudaInverterType
DiracMatrix * matResidual
ColorSpinorField * x_coarse
enum QudaDiracType_s QudaDiracType