QUDA  0.9.0
Namespaces | Macros | Functions | Variables
multigrid_invert_test.cpp File Reference
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <util_quda.h>
#include <test_util.h>
#include <dslash_util.h>
#include <blas_reference.h>
#include <wilson_dslash_reference.h>
#include <domain_wall_dslash_reference.h>
#include "misc.h"
#include <qio_field.h>
#include <quda.h>
Include dependency graph for multigrid_invert_test.cpp:

Go to the source code of this file.

Namespaces

 quda
 

Macros

#define MAX(a, b)   ((a)>(b)?(a):(b))
 

Functions

void usage (char **)
 
void quda::setTransferGPU (bool)
 
void display_test_info ()
 
void setGaugeParam (QudaGaugeParam &gauge_param)
 
void setMultigridParam (QudaMultigridParam &mg_param)
 
void setInvertParam (QudaInvertParam &inv_param)
 
int main (int argc, char **argv)
 

Variables

QudaDslashType dslash_type
 
int device
 
int xdim
 
int ydim
 
int zdim
 
int tdim
 
int Lsdim
 
int gridsize_from_cmdline []
 
QudaReconstructType link_recon
 
QudaPrecision prec
 
QudaPrecision prec_sloppy
 
QudaPrecision prec_precondition
 
QudaReconstructType link_recon_sloppy
 
QudaReconstructType link_recon_precondition
 
double mass
 
double mu
 
double anisotropy
 
double tol
 
double tol_hq
 
char latfile []
 
int niter
 
int gcrNkrylov
 
int pipeline
 
int nvec []
 
int mg_levels
 
bool generate_nullspace
 
bool generate_all_levels
 
int nu_pre
 
int nu_post
 
int geo_block_size [QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
 
double mu_factor [QUDA_MAX_MG_LEVEL]
 
QudaVerbosity mg_verbosity [QUDA_MAX_MG_LEVEL]
 
QudaInverterType setup_inv [QUDA_MAX_MG_LEVEL]
 
double setup_tol
 
double omega
 
QudaInverterType smoother_type
 
QudaMatPCType matpc_type
 
QudaSolveType solve_type
 
char vec_infile []
 
char vec_outfile []
 
QudaTwistFlavorType twist_flavor
 
double clover_coeff
 
bool compute_clover
 
QudaPrecisioncpu_prec = prec
 
QudaPrecisioncuda_prec = prec
 
QudaPrecisioncuda_prec_sloppy = prec_sloppy
 
QudaPrecisioncuda_prec_precondition = prec_precondition
 

Macro Definition Documentation

◆ MAX

#define MAX (   a,
  b 
)    ((a)>(b)?(a):(b))

Definition at line 23 of file multigrid_invert_test.cpp.

Referenced by setGaugeParam().

Function Documentation

◆ display_test_info()

void display_test_info ( )

Definition at line 88 of file multigrid_invert_test.cpp.

References dimPartitioned(), get_prec_str(), get_recon_str(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, link_recon, link_recon_sloppy, Lsdim, mg_levels, nu_post, nu_pre, nvec, prec, prec_sloppy, printfQuda, return(), tdim, xdim, ydim, and zdim.

Referenced by main().

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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 367 of file multigrid_invert_test.cpp.

References quda::blas::ax(), clock(), dslash_cuda_gen::clover, QudaInvertParam_s::clover_cpu_prec, QudaInvertParam_s::cloverGiB, cloverSiteSize, compute_clover, QudaInvertParam_s::compute_clover, QudaInvertParam_s::compute_clover_inverse, construct_clover_field(), construct_gauge_field(), QudaGaugeParam_s::cpu_prec, QudaInvertParam_s::cpu_prec, destroyMultigridQuda(), device, display_test_info(), double, dslash_type, endQuda(), exit(), finalizeComms(), float, free(), freeCloverQuda(), freeGaugeQuda(), gauge_param, QudaGaugeParam_s::gaugeGiB, gaugeSiteSize, QudaInvertParam_s::gflops, gridsize_from_cmdline, gSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, initComms(), initQuda(), initRand(), inv_param, QudaMultigridParam_s::invert_param, invertQuda(), QudaInvertParam_s::iter, QudaInvertParam_s::kappa, latfile, link_recon, link_recon_precondition, link_recon_sloppy, loadCloverQuda(), loadGaugeQuda(), QudaInvertParam_s::Ls, malloc(), QudaInvertParam_s::mass_normalization, QudaInvertParam_s::matpc_type, memset(), mg_verbosity, QudaInvertParam_s::mu, mu_factor, quda::blas::mxpy(), newMultigridQuda(), newQudaGaugeParam(), newQudaInvertParam(), newQudaMultigridParam(), quda::norm(), norm_2(), prec, prec_precondition, prec_sloppy, QudaInvertParam_s::preconditioner, printf(), printfQuda, process_command_line_option(), QUDA_BICGSTAB_INVERTER, QUDA_CLOVER_WILSON_DSLASH, QUDA_DIRECT_PC_SOLVE, QUDA_DOUBLE_PRECISION, QUDA_INVALID_PRECISION, QUDA_MASS_NORMALIZATION, QUDA_MAT_SOLUTION, QUDA_MATPC_SOLUTION, QUDA_MAX_MG_LEVEL, QUDA_RECONSTRUCT_INVALID, QUDA_SILENT, QUDA_SINGLE_PRECISION, QUDA_TWIST_SINGLET, QUDA_TWISTED_CLOVER_DSLASH, QUDA_TWISTED_MASS_DSLASH, QUDA_WILSON_DSLASH, rand(), read_gauge_field(), QudaInvertParam_s::return_clover, QudaInvertParam_s::return_clover_inverse, QudaInvertParam_s::secs, setDims(), setGaugeParam(), setInvertParam(), setMultigridParam(), setSpinorSiteSize(), setup_inv, QudaMultigridParam_s::smoother_solve_type, QudaInvertParam_s::solution_type, solve_type, QudaInvertParam_s::solve_type, QudaInvertParam_s::spinorGiB, spinorOut, spinorSiteSize, sqrt(), strcmp(), tm_mat(), tm_matpc(), QudaInvertParam_s::tol, QudaInvertParam_s::tol_hq, QudaInvertParam_s::true_res, QudaInvertParam_s::true_res_hq, QudaInvertParam_s::twist_flavor, usage(), V, Vh, wil_mat(), wil_matpc(), and QudaGaugeParam_s::X.

Here is the call graph for this function:

◆ setGaugeParam()

void setGaugeParam ( QudaGaugeParam gauge_param)

◆ setInvertParam()

void setInvertParam ( QudaInvertParam inv_param)

Definition at line 281 of file multigrid_invert_test.cpp.

References anisotropy, QudaInvertParam_s::cl_pad, clover_coeff, QudaInvertParam_s::clover_coeff, QudaInvertParam_s::clover_cpu_prec, QudaInvertParam_s::clover_cuda_prec, QudaInvertParam_s::clover_cuda_prec_precondition, QudaInvertParam_s::clover_cuda_prec_sloppy, QudaInvertParam_s::clover_order, cpu_prec, QudaInvertParam_s::cpu_prec, cuda_prec, QudaInvertParam_s::cuda_prec, cuda_prec_precondition, QudaInvertParam_s::cuda_prec_precondition, cuda_prec_sloppy, QudaInvertParam_s::cuda_prec_sloppy, QudaInvertParam_s::dagger, QudaInvertParam_s::dirac_order, dslash_type, QudaInvertParam_s::dslash_type, e, exit(), QudaInvertParam_s::gamma_basis, gcrNkrylov, QudaInvertParam_s::gcrNkrylov, fused_exterior_ndeg_tm_dslash_cuda_gen::i, QudaInvertParam_s::input_location, inv_param, QudaInvertParam_s::inv_type, QudaInvertParam_s::inv_type_precondition, QudaInvertParam_s::kappa, QudaInvertParam_s::Ls, mass, QudaInvertParam_s::mass, QudaInvertParam_s::mass_normalization, matpc_type, QudaInvertParam_s::matpc_type, QudaInvertParam_s::maxiter, QudaInvertParam_s::maxiter_precondition, mg_verbosity, mu, QudaInvertParam_s::mu, niter, QudaInvertParam_s::num_offset, QudaInvertParam_s::omega, QudaInvertParam_s::output_location, pipeline, QudaInvertParam_s::pipeline, QudaInvertParam_s::precondition_cycle, QudaInvertParam_s::preserve_source, printfQuda, QUDA_ADDITIVE_SCHWARZ, QUDA_CLOVER_WILSON_DSLASH, QUDA_CPU_FIELD_LOCATION, QUDA_DAG_NO, QUDA_DEGRAND_ROSSI_GAMMA_BASIS, QUDA_DIRAC_ORDER, QUDA_GCR_INVERTER, QUDA_KAPPA_NORMALIZATION, QUDA_L2_RELATIVE_RESIDUAL, QUDA_MAT_SOLUTION, QUDA_MG_INVERTER, QUDA_PACKED_CLOVER_ORDER, QUDA_PRESERVE_SOURCE_NO, QUDA_TWIST_NONDEG_DOUBLET, QUDA_TWISTED_CLOVER_DSLASH, QUDA_TWISTED_MASS_DSLASH, QUDA_VERBOSE, QudaInvertParam_s::reliable_delta, QudaInvertParam_s::residual_type, QudaInvertParam_s::schwarz_type, QudaInvertParam_s::solution_type, solve_type, QudaInvertParam_s::solve_type, QudaInvertParam_s::sp_pad, tol, QudaInvertParam_s::tol, tol_hq, QudaInvertParam_s::tol_hq, QudaInvertParam_s::tol_hq_offset, QudaInvertParam_s::tol_offset, QudaInvertParam_s::tol_precondition, twist_flavor, QudaInvertParam_s::twist_flavor, QudaInvertParam_s::verbosity, and QudaInvertParam_s::verbosity_precondition.

Referenced by main().

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

◆ setMultigridParam()

void setMultigridParam ( QudaMultigridParam mg_param)

Definition at line 158 of file multigrid_invert_test.cpp.

References anisotropy, QudaInvertParam_s::cl_pad, clover_coeff, QudaInvertParam_s::clover_coeff, QudaInvertParam_s::clover_cpu_prec, QudaInvertParam_s::clover_cuda_prec, QudaInvertParam_s::clover_cuda_prec_precondition, QudaInvertParam_s::clover_cuda_prec_sloppy, QudaInvertParam_s::clover_order, QudaMultigridParam_s::coarse_grid_solution_type, QudaMultigridParam_s::compute_null_vector, cpu_prec, QudaInvertParam_s::cpu_prec, cuda_prec, QudaInvertParam_s::cuda_prec, cuda_prec_precondition, QudaInvertParam_s::cuda_prec_precondition, cuda_prec_sloppy, QudaInvertParam_s::cuda_prec_sloppy, QudaMultigridParam_s::cycle_type, QudaInvertParam_s::dagger, QudaInvertParam_s::dirac_order, dslash_type, QudaInvertParam_s::dslash_type, e, exit(), QudaInvertParam_s::gamma_basis, QudaInvertParam_s::gcrNkrylov, generate_all_levels, QudaMultigridParam_s::generate_all_levels, generate_nullspace, geo_block_size, QudaMultigridParam_s::geo_block_size, QudaMultigridParam_s::global_reduction, fused_exterior_ndeg_tm_dslash_cuda_gen::i, QudaInvertParam_s::input_location, inv_param, QudaInvertParam_s::inv_type, QudaMultigridParam_s::invert_param, QudaInvertParam_s::kappa, QudaMultigridParam_s::location, QudaInvertParam_s::Ls, mass, QudaInvertParam_s::mass, QudaInvertParam_s::mass_normalization, matpc_type, QudaInvertParam_s::matpc_type, QudaInvertParam_s::maxiter, mg_levels, mg_verbosity, mu, QudaInvertParam_s::mu, mu_factor, QudaMultigridParam_s::mu_factor, QudaMultigridParam_s::n_level, QudaMultigridParam_s::n_vec, nu_post, QudaMultigridParam_s::nu_post, nu_pre, QudaMultigridParam_s::nu_pre, nvec, omega, QudaMultigridParam_s::omega, QudaInvertParam_s::output_location, QudaInvertParam_s::preserve_source, printfQuda, QUDA_BOOLEAN_NO, QUDA_BOOLEAN_YES, QUDA_CLOVER_WILSON_DSLASH, QUDA_COMPUTE_NULL_VECTOR_NO, QUDA_COMPUTE_NULL_VECTOR_YES, QUDA_CPU_FIELD_LOCATION, QUDA_CUDA_FIELD_LOCATION, QUDA_DAG_NO, QUDA_DEGRAND_ROSSI_GAMMA_BASIS, QUDA_DIRAC_ORDER, QUDA_DIRECT_PC_SOLVE, QUDA_DIRECT_SOLVE, QUDA_GCR_INVERTER, QUDA_KAPPA_NORMALIZATION, QUDA_MAT_SOLUTION, QUDA_MATPC_SOLUTION, QUDA_MAX_DIM, QUDA_MG_CYCLE_RECURSIVE, QUDA_PACKED_CLOVER_ORDER, QUDA_PRESERVE_SOURCE_NO, QUDA_SUMMARIZE, QUDA_TWIST_NONDEG_DOUBLET, QUDA_TWISTED_CLOVER_DSLASH, QUDA_TWISTED_MASS_DSLASH, QudaInvertParam_s::reliable_delta, QudaMultigridParam_s::run_verify, setup_inv, QudaMultigridParam_s::setup_inv_type, setup_tol, QudaMultigridParam_s::setup_tol, QudaMultigridParam_s::smoother, QudaMultigridParam_s::smoother_solve_type, QudaMultigridParam_s::smoother_tol, smoother_type, QudaInvertParam_s::solution_type, solve_type, QudaInvertParam_s::solve_type, QudaInvertParam_s::sp_pad, QudaMultigridParam_s::spin_block_size, strcpy(), QudaInvertParam_s::tol, tol_hq, twist_flavor, QudaInvertParam_s::twist_flavor, vec_infile, QudaMultigridParam_s::vec_infile, vec_outfile, QudaMultigridParam_s::vec_outfile, QudaInvertParam_s::verbosity, QudaMultigridParam_s::verbosity, and QudaInvertParam_s::verbosity_precondition.

Referenced by main().

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

◆ usage()

void usage ( char **  )

Definition at line 1693 of file test_util.cpp.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

◆ anisotropy

double anisotropy

Definition at line 1644 of file test_util.cpp.

Referenced by setGaugeParam(), setInvertParam(), and setMultigridParam().

◆ clover_coeff

double clover_coeff

Definition at line 1645 of file test_util.cpp.

Referenced by process_command_line_option(), setInvertParam(), and setMultigridParam().

◆ compute_clover

bool compute_clover

Definition at line 1646 of file test_util.cpp.

Referenced by main(), and process_command_line_option().

◆ cpu_prec

QudaPrecision& cpu_prec = prec

Definition at line 115 of file multigrid_invert_test.cpp.

Referenced by setGaugeParam(), setInvertParam(), and setMultigridParam().

◆ cuda_prec

QudaPrecision& cuda_prec = prec

Definition at line 116 of file multigrid_invert_test.cpp.

Referenced by setGaugeParam(), setInvertParam(), and setMultigridParam().

◆ cuda_prec_precondition

QudaPrecision& cuda_prec_precondition = prec_precondition

Definition at line 118 of file multigrid_invert_test.cpp.

Referenced by setGaugeParam(), setInvertParam(), and setMultigridParam().

◆ cuda_prec_sloppy

QudaPrecision& cuda_prec_sloppy = prec_sloppy

Definition at line 117 of file multigrid_invert_test.cpp.

Referenced by setGaugeParam(), setInvertParam(), and setMultigridParam().

◆ device

int device

Definition at line 2238 of file CMakeCUDACompilerId.cpp1.ii.

Referenced by main().

◆ dslash_type

QudaDslashType dslash_type

Definition at line 1626 of file test_util.cpp.

Referenced by main(), setInvertParam(), and setMultigridParam().

◆ gcrNkrylov

int gcrNkrylov

Definition at line 1631 of file test_util.cpp.

Referenced by process_command_line_option(), and setInvertParam().

◆ generate_all_levels

bool generate_all_levels

Definition at line 1666 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ generate_nullspace

bool generate_nullspace

Definition at line 1665 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ geo_block_size

Definition at line 1668 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ gridsize_from_cmdline

int gridsize_from_cmdline[]

For MPI, the default node mapping is lexicographical with t varying fastest.

Definition at line 50 of file test_util.cpp.

Referenced by main().

◆ latfile

char latfile[]

Definition at line 1627 of file test_util.cpp.

Referenced by main().

◆ link_recon

QudaReconstructType link_recon

Definition at line 1612 of file test_util.cpp.

Referenced by display_test_info(), main(), and setGaugeParam().

◆ link_recon_precondition

QudaReconstructType link_recon_precondition

Definition at line 1614 of file test_util.cpp.

Referenced by main(), process_command_line_option(), and setGaugeParam().

◆ link_recon_sloppy

QudaReconstructType link_recon_sloppy

Definition at line 1613 of file test_util.cpp.

Referenced by display_test_info(), main(), and setGaugeParam().

◆ Lsdim

int Lsdim

Definition at line 1624 of file test_util.cpp.

Referenced by display_test_info(), and process_command_line_option().

◆ mass

double mass

Definition at line 1642 of file test_util.cpp.

Referenced by setInvertParam(), and setMultigridParam().

◆ matpc_type

QudaMatPCType matpc_type

Definition at line 1652 of file test_util.cpp.

Referenced by process_command_line_option(), setInvertParam(), and setMultigridParam().

◆ mg_levels

int mg_levels

◆ mg_verbosity

◆ mu

double mu

Definition at line 1643 of file test_util.cpp.

Referenced by process_command_line_option(), setInvertParam(), and setMultigridParam().

◆ mu_factor

◆ niter

int niter

Definition at line 1630 of file test_util.cpp.

Referenced by setInvertParam().

◆ nu_post

int nu_post

◆ nu_pre

int nu_pre

◆ nvec

int nvec[]

◆ omega

double omega

◆ pipeline

int pipeline

Definition at line 1632 of file test_util.cpp.

Referenced by setInvertParam().

◆ prec

Definition at line 1615 of file test_util.cpp.

Referenced by display_test_info(), and main().

◆ prec_precondition

QudaPrecision prec_precondition

Definition at line 1617 of file test_util.cpp.

Referenced by main(), and process_command_line_option().

◆ prec_sloppy

QudaPrecision prec_sloppy

Definition at line 1616 of file test_util.cpp.

Referenced by display_test_info(), and main().

◆ setup_inv

Definition at line 1661 of file test_util.cpp.

Referenced by main(), process_command_line_option(), and setMultigridParam().

◆ setup_tol

double setup_tol

◆ smoother_type

QudaInverterType smoother_type

Definition at line 1664 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ solve_type

QudaSolveType solve_type

Definition at line 1653 of file test_util.cpp.

Referenced by main(), setInvertParam(), and setMultigridParam().

◆ tdim

int tdim

Definition at line 1623 of file test_util.cpp.

Referenced by display_test_info(), and setGaugeParam().

◆ tol

double tol

Definition at line 1647 of file test_util.cpp.

Referenced by setInvertParam().

◆ tol_hq

double tol_hq

Definition at line 1648 of file test_util.cpp.

Referenced by setInvertParam(), and setMultigridParam().

◆ twist_flavor

QudaTwistFlavorType twist_flavor

Definition at line 1649 of file test_util.cpp.

Referenced by process_command_line_option(), setInvertParam(), and setMultigridParam().

◆ vec_infile

char vec_infile[]

Definition at line 1636 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ vec_outfile

char vec_outfile[]

Definition at line 1637 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ xdim

int xdim

Definition at line 1620 of file test_util.cpp.

Referenced by display_test_info(), and setGaugeParam().

◆ ydim

int ydim

Definition at line 1621 of file test_util.cpp.

Referenced by display_test_info(), and setGaugeParam().

◆ zdim

int zdim

Definition at line 1622 of file test_util.cpp.

Referenced by display_test_info(), and setGaugeParam().