QUDA  0.9.0
Macros | Functions | Variables
test_util.cpp File Reference
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <short.h>
#include <wilson_dslash_reference.h>
#include <test_util.h>
#include <dslash_quda.h>
#include "misc.h"
Include dependency graph for test_util.cpp:

Go to the source code of this file.

Macros

#define XUP   0
 
#define YUP   1
 
#define ZUP   2
 
#define TUP   3
 

Functions

static int lex_rank_from_coords_t (const int *coords, void *fdata)
 
static int lex_rank_from_coords_x (const int *coords, void *fdata)
 
void initComms (int argc, char **argv, const int *commDims)
 
void finalizeComms ()
 
void initRand ()
 
void setDims (int *X)
 
void dw_setDims (int *X, const int L5)
 
void setSpinorSiteSize (int n)
 
template<typename Float >
static void printVector (Float *v)
 
void printSpinorElement (void *spinor, int X, QudaPrecision precision)
 
void printGaugeElement (void *gauge, int X, QudaPrecision precision)
 
int getOddBit (int Y)
 
template<typename Float >
void complexAddTo (Float *a, Float *b)
 
template<typename Float >
void complexProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void complexConjugateProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void complexDotProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void accumulateComplexProduct (Float *a, Float *b, Float *c, Float sign)
 
template<typename Float >
void accumulateComplexDotProduct (Float *a, Float *b, Float *c)
 
template<typename Float >
void accumulateConjugateProduct (Float *a, Float *b, Float *c, int sign)
 
template<typename Float >
void su3Construct12 (Float *mat)
 
template<typename Float >
void su3Construct8 (Float *mat)
 
void su3_construct (void *mat, QudaReconstructType reconstruct, QudaPrecision precision)
 
template<typename Float >
static void su3Reconstruct12 (Float *mat, int dir, int ga_idx, QudaGaugeParam *param)
 
template<typename Float >
static void su3Reconstruct8 (Float *mat, int dir, int ga_idx, QudaGaugeParam *param)
 
void su3_reconstruct (void *mat, int dir, int ga_idx, QudaReconstructType reconstruct, QudaPrecision precision, QudaGaugeParam *param)
 
template<typename Float >
static int compareFloats (Float *a, Float *b, int len, double epsilon)
 
int compare_floats (void *a, void *b, int len, double epsilon, QudaPrecision precision)
 
int fullLatticeIndex (int dim[4], int index, int oddBit)
 
int fullLatticeIndex (int i, int oddBit)
 
int neighborIndex (int i, int oddBit, int dx4, int dx3, int dx2, int dx1)
 
int neighborIndex (int dim[4], int index, int oddBit, int dx[4])
 
int neighborIndex_mg (int i, int oddBit, int dx4, int dx3, int dx2, int dx1)
 
int neighborIndexFullLattice (int i, int dx4, int dx3, int dx2, int dx1)
 
int neighborIndexFullLattice (int dim[4], int index, int dx[4])
 
int neighborIndexFullLattice_mg (int i, int dx4, int dx3, int dx2, int dx1)
 
int fullLatticeIndex_4d (int i, int oddBit)
 
int fullLatticeIndex_5d (int i, int oddBit)
 
int fullLatticeIndex_5d_4dpc (int i, int oddBit)
 
int x4_from_full_index (int i)
 
template<typename Float >
static void applyGaugeFieldScaling (Float **gauge, int Vh, QudaGaugeParam *param)
 
template<typename Float >
void applyGaugeFieldScaling_long (Float **gauge, int Vh, QudaGaugeParam *param, QudaDslashType dslash_type)
 
template<typename Float >
static void constructUnitGaugeField (Float **res, QudaGaugeParam *param)
 
template<typename Float >
static void normalize (complex< Float > *a, int len)
 
template<typename Float >
static void orthogonalize (complex< Float > *a, complex< Float > *b, int len)
 
template<typename Float >
static void constructGaugeField (Float **res, QudaGaugeParam *param, QudaDslashType dslash_type=QUDA_WILSON_DSLASH)
 
template<typename Float >
void constructUnitaryGaugeField (Float **res)
 
void construct_gauge_field (void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
 
void construct_fat_long_gauge_field (void **fatlink, void **longlink, int type, QudaPrecision precision, QudaGaugeParam *param, QudaDslashType dslash_type)
 
template<typename Float >
static void constructCloverField (Float *res, double norm, double diag)
 
void construct_clover_field (void *clover, double norm, double diag, QudaPrecision precision)
 
template<typename Float >
static void checkGauge (Float **oldG, Float **newG, double epsilon)
 
void check_gauge (void **oldG, void **newG, double epsilon, QudaPrecision precision)
 
void createSiteLinkCPU (void **link, QudaPrecision precision, int phase)
 
template<typename Float >
int compareLink (Float **linkA, Float **linkB, int len)
 
static int compare_link (void **linkA, void **linkB, int len, QudaPrecision precision)
 
static void printLinkElement (void *link, int X, QudaPrecision precision)
 
int strong_check_link (void **linkA, const char *msgA, void **linkB, const char *msgB, int len, QudaPrecision prec)
 
void createMomCPU (void *mom, QudaPrecision precision)
 
void createHwCPU (void *hw, QudaPrecision precision)
 
template<typename Float >
int compare_mom (Float *momA, Float *momB, int len)
 
static void printMomElement (void *mom, int X, QudaPrecision precision)
 
int strong_check_mom (void *momA, void *momB, int len, QudaPrecision prec)
 
int dimPartitioned (int dim)
 
void __attribute__ ((weak)) usage_extra(char **argv)
 
void usage (char **argv)
 
int process_command_line_option (int argc, char **argv, int *idx)
 
void stopwatchStart ()
 
double stopwatchReadSeconds ()
 

Variables

int Z [4]
 
int V
 
int Vh
 
int Vs_x
 
int Vs_y
 
int Vs_z
 
int Vs_t
 
int Vsh_x
 
int Vsh_y
 
int Vsh_z
 
int Vsh_t
 
int faceVolume [4]
 
int E1
 
int E1h
 
int E2
 
int E3
 
int E4
 
int E [4]
 
int V_ex
 
int Vh_ex
 
int Ls
 
int V5
 
int V5h
 
int mySpinorSiteSize
 
float fat_link_max
 
int gridsize_from_cmdline [4] = {1,1,1,1}
 
static int rank_order = 0
 
int device = 0
 
QudaReconstructType link_recon = QUDA_RECONSTRUCT_NO
 
QudaReconstructType link_recon_sloppy = QUDA_RECONSTRUCT_INVALID
 
QudaReconstructType link_recon_precondition = QUDA_RECONSTRUCT_INVALID
 
QudaPrecision prec = QUDA_SINGLE_PRECISION
 
QudaPrecision prec_sloppy = QUDA_INVALID_PRECISION
 
QudaPrecision prec_precondition = QUDA_INVALID_PRECISION
 
QudaPrecision prec_ritz = QUDA_INVALID_PRECISION
 
int xdim = 24
 
int ydim = 24
 
int zdim = 24
 
int tdim = 24
 
int Lsdim = 16
 
QudaDagType dagger = QUDA_DAG_NO
 
QudaDslashType dslash_type = QUDA_WILSON_DSLASH
 
char latfile [256] = ""
 
int Nsrc = 1
 
int Msrc = 1
 
int niter = 100
 
int gcrNkrylov = 10
 
int pipeline = 0
 
int solution_accumulator_pipeline = 0
 
int test_type = 0
 
int nvec [QUDA_MAX_MG_LEVEL] = { }
 
char vec_infile [256] = ""
 
char vec_outfile [256] = ""
 
QudaInverterType inv_type
 
QudaInverterType precon_type = QUDA_INVALID_INVERTER
 
int multishift = 0
 
bool verify_results = true
 
double mass = 0.1
 
double mu = 0.1
 
double anisotropy = 1.0
 
double clover_coeff = 0.1
 
bool compute_clover = false
 
double tol = 1e-7
 
double tol_hq = 0.
 
QudaTwistFlavorType twist_flavor = QUDA_TWIST_SINGLET
 
bool kernel_pack_t = false
 
QudaMassNormalization normalization = QUDA_KAPPA_NORMALIZATION
 
QudaMatPCType matpc_type = QUDA_MATPC_EVEN_EVEN
 
QudaSolveType solve_type = QUDA_DIRECT_PC_SOLVE
 
int mg_levels = 2
 
int nu_pre = 2
 
int nu_post = 2
 
double mu_factor [QUDA_MAX_MG_LEVEL] = { }
 
QudaVerbosity mg_verbosity [QUDA_MAX_MG_LEVEL] = { }
 
QudaInverterType setup_inv [QUDA_MAX_MG_LEVEL] = { }
 
double setup_tol = 5e-6
 
double omega = 0.85
 
QudaInverterType smoother_type = QUDA_MR_INVERTER
 
bool generate_nullspace = true
 
bool generate_all_levels = true
 
int geo_block_size [QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM] = { }
 
int nev = 8
 
int max_search_dim = 64
 
int deflation_grid = 16
 
double tol_restart = 5e+3*tol
 
int eigcg_max_restarts = 3
 
int max_restart_num = 3
 
double inc_tol = 1e-2
 
double eigenval_tol = 1e-1
 
QudaExtLibType solver_ext_lib = QUDA_EIGEN_EXTLIB
 
QudaExtLibType deflation_ext_lib = QUDA_EIGEN_EXTLIB
 
QudaFieldLocation location_ritz = QUDA_CUDA_FIELD_LOCATION
 
QudaMemoryType mem_type_ritz = QUDA_MEMORY_DEVICE
 
static int dim_partitioned [4] = {0,0,0,0}
 
static struct timeval startTime
 

Macro Definition Documentation

◆ TUP

#define TUP   3

Definition at line 24 of file test_util.cpp.

Referenced by createSiteLinkCPU().

◆ XUP

#define XUP   0

Definition at line 21 of file test_util.cpp.

Referenced by createSiteLinkCPU().

◆ YUP

#define YUP   1

Definition at line 22 of file test_util.cpp.

Referenced by createSiteLinkCPU().

◆ ZUP

#define ZUP   2

Definition at line 23 of file test_util.cpp.

Referenced by createSiteLinkCPU().

Function Documentation

◆ __attribute__()

void __attribute__ ( (weak)  )

Definition at line 1691 of file test_util.cpp.

◆ accumulateComplexDotProduct()

template<typename Float >
void accumulateComplexDotProduct ( Float *  a,
Float *  b,
Float *  c 
)
inline

Definition at line 273 of file test_util.cpp.

References a, b, and c.

◆ accumulateComplexProduct()

template<typename Float >
void accumulateComplexProduct ( Float *  a,
Float *  b,
Float *  c,
Float  sign 
)
inline

Definition at line 266 of file test_util.cpp.

References a, b, c, and deg_tm_dslash_cuda_gen::sign().

Referenced by su3Reconstruct8().

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

◆ accumulateConjugateProduct()

template<typename Float >
void accumulateConjugateProduct ( Float *  a,
Float *  b,
Float *  c,
int  sign 
)
inline

Definition at line 279 of file test_util.cpp.

References a, b, c, and deg_tm_dslash_cuda_gen::sign().

Referenced by constructGaugeField(), constructUnitaryGaugeField(), and su3Reconstruct12().

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

◆ applyGaugeFieldScaling()

template<typename Float >
static void applyGaugeFieldScaling ( Float **  gauge,
int  Vh,
QudaGaugeParam param 
)
static

Definition at line 719 of file test_util.cpp.

References QudaGaugeParam_s::anisotropy, commCoords(), commDim(), d, QudaGaugeParam_s::gauge_fix, gaugeSiteSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, n, param, QUDA_ANTI_PERIODIC_T, QudaGaugeParam_s::t_boundary, Vh, and Z.

Referenced by construct_gauge_field(), constructGaugeField(), and constructUnitGaugeField().

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

◆ applyGaugeFieldScaling_long()

template<typename Float >
void applyGaugeFieldScaling_long ( Float **  gauge,
int  Vh,
QudaGaugeParam param,
QudaDslashType  dslash_type 
)

◆ check_gauge()

void check_gauge ( void **  oldG,
void **  newG,
double  epsilon,
QudaPrecision  precision 
)

Definition at line 1219 of file test_util.cpp.

References checkGauge(), and QUDA_DOUBLE_PRECISION.

Referenced by SU3test().

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

◆ checkGauge()

template<typename Float >
static void checkGauge ( Float **  oldG,
Float **  newG,
double  epsilon 
)
static

fabs(oldG[d][ga_idx*18+j]);

Definition at line 1185 of file test_util.cpp.

References d, f, fabs(), ga_idx, fused_exterior_ndeg_tm_dslash_cuda_gen::i, pow(), printf(), V, and Vh.

Referenced by check_gauge().

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

◆ compare_floats()

int compare_floats ( void *  a,
void *  b,
int  len,
double  epsilon,
QudaPrecision  precision 
)

Definition at line 437 of file test_util.cpp.

References a, b, compareFloats(), len, and QUDA_DOUBLE_PRECISION.

Referenced by gauge_force_test(), hisq_force_test(), llfat_test(), and TEST().

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

◆ compare_link()

static int compare_link ( void **  linkA,
void **  linkB,
int  len,
QudaPrecision  precision 
)
static

Definition at line 1397 of file test_util.cpp.

References compareLink(), len, QUDA_DOUBLE_PRECISION, and ret.

Referenced by strong_check_link().

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

◆ compare_mom()

template<typename Float >
int compare_mom ( Float *  momA,
Float *  momB,
int  len 
)

Definition at line 1517 of file test_util.cpp.

References e, f, fabs(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, len, momSiteSize, pow(), and printfQuda.

Referenced by strong_check_mom().

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

◆ compareFloats()

template<typename Float >
static int compareFloats ( Float *  a,
Float *  b,
int  len,
double  epsilon 
)
static

Definition at line 426 of file test_util.cpp.

References a, b, fabs(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, len, and printfQuda.

Referenced by compare_floats().

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

◆ compareLink()

template<typename Float >
int compareLink ( Float **  linkA,
Float **  linkB,
int  len 
)

Definition at line 1359 of file test_util.cpp.

References e, f, fabs(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, len, pow(), and printfQuda.

Referenced by compare_link().

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

◆ complexAddTo()

template<typename Float >
void complexAddTo ( Float *  a,
Float *  b 
)
inline

Definition at line 238 of file test_util.cpp.

References a, and b.

◆ complexConjugateProduct()

template<typename Float >
void complexConjugateProduct ( Float *  a,
Float *  b,
Float *  c 
)
inline

Definition at line 252 of file test_util.cpp.

References a, b, and c.

Referenced by su3Reconstruct8().

Here is the caller graph for this function:

◆ complexDotProduct()

template<typename Float >
void complexDotProduct ( Float *  a,
Float *  b,
Float *  c 
)
inline

Definition at line 259 of file test_util.cpp.

References a, b, and c.

Referenced by su3Reconstruct8().

Here is the caller graph for this function:

◆ complexProduct()

template<typename Float >
void complexProduct ( Float *  a,
Float *  b,
Float *  c 
)
inline

Definition at line 245 of file test_util.cpp.

References a, b, and c.

◆ construct_clover_field()

void construct_clover_field ( void *  clover,
double  norm,
double  diag,
QudaPrecision  precision 
)

Definition at line 1166 of file test_util.cpp.

References dslash_cuda_gen::clover, constructCloverField(), quda::norm(), and QUDA_DOUBLE_PRECISION.

Referenced by init(), and main().

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

◆ construct_fat_long_gauge_field()

void construct_fat_long_gauge_field ( void **  fatlink,
void **  longlink,
int  type,
QudaPrecision  precision,
QudaGaugeParam param,
QudaDslashType  dslash_type 
)

◆ construct_gauge_field()

void construct_gauge_field ( void **  gauge,
int  type,
QudaPrecision  precision,
QudaGaugeParam param 
)

Definition at line 1054 of file test_util.cpp.

References applyGaugeFieldScaling(), constructGaugeField(), constructUnitGaugeField(), param, QUDA_DOUBLE_PRECISION, and Vh.

Referenced by init(), invert_test(), main(), and SU3test().

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

◆ constructCloverField()

template<typename Float >
static void constructCloverField ( Float *  res,
double  norm,
double  diag 
)
static

Definition at line 1137 of file test_util.cpp.

References c, fused_exterior_ndeg_tm_dslash_cuda_gen::i, quda::norm(), rand(), and V.

Referenced by construct_clover_field().

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

◆ constructGaugeField()

template<typename Float >
static void constructGaugeField ( Float **  res,
QudaGaugeParam param,
QudaDslashType  dslash_type = QUDA_WILSON_DSLASH 
)
static

◆ constructUnitaryGaugeField()

template<typename Float >
void constructUnitaryGaugeField ( Float **  res)

Definition at line 995 of file test_util.cpp.

References accumulateConjugateProduct(), gaugeSiteSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, n, normalize(), orthogonalize(), rand(), Vh, and w.

Referenced by createSiteLinkCPU().

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

◆ constructUnitGaugeField()

template<typename Float >
static void constructUnitGaugeField ( Float **  res,
QudaGaugeParam param 
)
static

Definition at line 876 of file test_util.cpp.

References applyGaugeFieldScaling(), gaugeSiteSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, n, param, and Vh.

Referenced by construct_fat_long_gauge_field(), and construct_gauge_field().

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

◆ createHwCPU()

void createHwCPU ( void *  hw,
QudaPrecision  precision 
)

Definition at line 1492 of file test_util.cpp.

References hw, hwSiteSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, QUDA_DOUBLE_PRECISION, rand(), and V.

Referenced by hisq_force_init().

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

◆ createMomCPU()

void createMomCPU ( void *  mom,
QudaPrecision  precision 
)

Definition at line 1454 of file test_util.cpp.

References exit(), float, fprintf(), free(), gaugeSiteSize, gSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, malloc(), momSiteSize, QUDA_DOUBLE_PRECISION, rand(), and V.

Referenced by gauge_force_test().

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

◆ createSiteLinkCPU()

void createSiteLinkCPU ( void **  link,
QudaPrecision  precision,
int  phase 
)

◆ dimPartitioned()

int dimPartitioned ( int  dim)

Definition at line 1686 of file test_util.cpp.

References dim, dim_partitioned, and gridsize_from_cmdline.

Referenced by display_test_info().

Here is the caller graph for this function:

◆ dw_setDims()

void dw_setDims ( int X,
const int  L5 
)

Definition at line 167 of file test_util.cpp.

References d, faceVolume, fused_exterior_ndeg_tm_dslash_cuda_gen::i, Ls, V, V5, V5h, Vh, Vs_t, Vsh_t, X, and Z.

Referenced by init(), invert_test(), and main().

Here is the caller graph for this function:

◆ finalizeComms()

void finalizeComms ( )

Definition at line 107 of file test_util.cpp.

Referenced by main(), and SU3test().

Here is the caller graph for this function:

◆ fullLatticeIndex() [1/2]

int fullLatticeIndex ( int  dim[4],
int  index,
int  oddBit 
)

◆ fullLatticeIndex() [2/2]

int fullLatticeIndex ( int  i,
int  oddBit 
)

Definition at line 455 of file test_util.cpp.

References fused_exterior_ndeg_tm_dslash_cuda_gen::i, sid, X, Z, za, and zb.

◆ fullLatticeIndex_4d()

int fullLatticeIndex_4d ( int  i,
int  oddBit 
)

Definition at line 658 of file test_util.cpp.

References exit(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, printf(), sid, Vh, X, Z, za, and zb.

Referenced by neighborIndex_4d().

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

◆ fullLatticeIndex_5d()

int fullLatticeIndex_5d ( int  i,
int  oddBit 
)

Definition at line 692 of file test_util.cpp.

References fused_exterior_ndeg_tm_dslash_cuda_gen::i, and Z.

Referenced by dslashReference_5th(), and neighborIndex_5d().

Here is the caller graph for this function:

◆ fullLatticeIndex_5d_4dpc()

int fullLatticeIndex_5d_4dpc ( int  i,
int  oddBit 
)

Definition at line 697 of file test_util.cpp.

References fused_exterior_ndeg_tm_dslash_cuda_gen::i, and Z.

Referenced by dslashReference_5th(), and neighborIndex_5d().

Here is the caller graph for this function:

◆ getOddBit()

int getOddBit ( int  Y)

Definition at line 228 of file test_util.cpp.

References Z.

Referenced by printGaugeElement().

Here is the caller graph for this function:

◆ initComms()

void initComms ( int  argc,
char **  argv,
const int commDims 
)

Definition at line 72 of file test_util.cpp.

References errorQuda, func, fused_exterior_ndeg_tm_dslash_cuda_gen::i, initCommsGridQuda(), initRand(), lex_rank_from_coords_t(), lex_rank_from_coords_x(), MPI_Init(), printfQuda, and rank_order.

Referenced by main(), and SU3test().

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

◆ initRand()

void initRand ( )

Definition at line 117 of file test_util.cpp.

References rank, and srand().

Referenced by initComms(), main(), and SU3test().

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

◆ lex_rank_from_coords_t()

static int lex_rank_from_coords_t ( const int coords,
void *  fdata 
)
static

Definition at line 52 of file test_util.cpp.

References gridsize_from_cmdline, fused_exterior_ndeg_tm_dslash_cuda_gen::i, and rank.

Referenced by initComms().

Here is the caller graph for this function:

◆ lex_rank_from_coords_x()

static int lex_rank_from_coords_x ( const int coords,
void *  fdata 
)
static

Definition at line 61 of file test_util.cpp.

References gridsize_from_cmdline, fused_exterior_ndeg_tm_dslash_cuda_gen::i, and rank.

Referenced by initComms().

Here is the caller graph for this function:

◆ neighborIndex() [1/2]

int neighborIndex ( int  i,
int  oddBit,
int  dx4,
int  dx3,
int  dx2,
int  dx1 
)

Definition at line 492 of file test_util.cpp.

References fullLatticeIndex(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, and Z.

Referenced by neighborIndexFullLattice().

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

◆ neighborIndex() [2/2]

int neighborIndex ( int  dim[4],
int  index,
int  oddBit,
int  dx[4] 
)

Definition at line 510 of file test_util.cpp.

References dim, fullLatticeIndex(), index(), and x.

Here is the call graph for this function:

◆ neighborIndex_mg()

int neighborIndex_mg ( int  i,
int  oddBit,
int  dx4,
int  dx3,
int  dx2,
int  dx1 
)

Definition at line 527 of file test_util.cpp.

References comm_dim_partitioned(), fullLatticeIndex(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, ret, and Z.

Here is the call graph for this function:

◆ neighborIndexFullLattice() [1/2]

int neighborIndexFullLattice ( int  i,
int  dx4,
int  dx3,
int  dx2,
int  dx1 
)

Definition at line 563 of file test_util.cpp.

References half_idx, fused_exterior_ndeg_tm_dslash_cuda_gen::i, neighborIndex(), ret, and Vh.

Referenced by computeLinkOrderedOuterProduct(), computeLongLinkCPU(), forward_shifted_outer_prod(), llfat_compute_gen_staple_field(), shifted_outer_prod(), u_shift_hw(), and u_shift_mat().

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

◆ neighborIndexFullLattice() [2/2]

int neighborIndexFullLattice ( int  dim[4],
int  index,
int  dx[4] 
)

Definition at line 586 of file test_util.cpp.

References dim, index(), and neighborIndex().

Here is the call graph for this function:

◆ neighborIndexFullLattice_mg()

int neighborIndexFullLattice_mg ( int  i,
int  dx4,
int  dx3,
int  dx2,
int  dx1 
)

Definition at line 611 of file test_util.cpp.

References fullLatticeIndex(), half_idx, fused_exterior_ndeg_tm_dslash_cuda_gen::i, ret, Vh, and Z.

Here is the call graph for this function:

◆ normalize()

template<typename Float >
static void normalize ( complex< Float > *  a,
int  len 
)
static

Definition at line 901 of file test_util.cpp.

References a, fused_exterior_ndeg_tm_dslash_cuda_gen::i, len, quda::norm(), sqrt(), and sum().

Referenced by constructGaugeField(), and constructUnitaryGaugeField().

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

◆ orthogonalize()

template<typename Float >
static void orthogonalize ( complex< Float > *  a,
complex< Float > *  b,
int  len 
)
static

Definition at line 909 of file test_util.cpp.

References a, b, conj(), dot(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, and len.

Referenced by constructGaugeField(), and constructUnitaryGaugeField().

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

◆ printGaugeElement()

void printGaugeElement ( void *  gauge,
int  X,
QudaPrecision  precision 
)

Definition at line 212 of file test_util.cpp.

References gaugeSiteSize, getOddBit(), printVector(), QUDA_DOUBLE_PRECISION, Vh, and X.

Here is the call graph for this function:

◆ printLinkElement()

static void printLinkElement ( void *  link,
int  X,
QudaPrecision  precision 
)
static

Definition at line 1413 of file test_util.cpp.

References gaugeSiteSize, fused_exterior_ndeg_tm_dslash_cuda_gen::i, printVector(), QUDA_DOUBLE_PRECISION, and X.

Referenced by strong_check_link().

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

◆ printMomElement()

static void printMomElement ( void *  mom,
int  X,
QudaPrecision  precision 
)
static

Definition at line 1553 of file test_util.cpp.

References momSiteSize, printfQuda, printVector(), QUDA_DOUBLE_PRECISION, and X.

Referenced by strong_check_mom().

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

◆ printSpinorElement()

void printSpinorElement ( void *  spinor,
int  X,
QudaPrecision  precision 
)

Definition at line 204 of file test_util.cpp.

References printVector(), QUDA_DOUBLE_PRECISION, s, spinor, and X.

Referenced by dslashReference_4d_sgpu().

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

◆ printVector()

template<typename Float >
static void printVector ( Float *  v)
static

Definition at line 199 of file test_util.cpp.

References printfQuda.

Referenced by printGaugeElement(), printLinkElement(), printMomElement(), and printSpinorElement().

Here is the caller graph for this function:

◆ process_command_line_option()

int process_command_line_option ( int  argc,
char **  argv,
int idx 
)

Definition at line 1795 of file test_util.cpp.

References anisotropy, atof(), atoi(), clover_coeff, commDimPartitionedSet(), compute_clover, dagger, deflation_ext_lib, deflation_grid, device, dim_partitioned, dslash_type, eigcg_max_restarts, eigenval_tol, exit(), fprintf(), gcrNkrylov, generate_all_levels, generate_nullspace, geo_block_size, get_df_location_ritz(), get_df_mem_type_ritz(), get_dslash_type(), get_flavor_type(), get_mass_normalization_type(), get_matpc_type(), get_prec(), get_quda_ver_str(), get_rank_order(), get_recon(), get_solve_ext_lib_type(), get_solve_type(), get_solver_type(), get_verbosity_type(), gridsize_from_cmdline, fused_exterior_ndeg_tm_dslash_cuda_gen::i, idx, inc_tol, inv_type, kernel_pack_t, latfile, level, link_recon, link_recon_precondition, link_recon_sloppy, location_ritz, Ls, Lsdim, mass, matpc_type, max_restart_num, max_search_dim, mem_type_ritz, mg_levels, mg_verbosity, Msrc, mu, mu_factor, multishift, nev, niter, normalization, Nsrc, nu_post, nu_pre, nvec, omega, out, pipeline, prec, prec_precondition, prec_ritz, prec_sloppy, precon_type, printf(), printfQuda, QUDA_DAG_YES, QUDA_MAX_MG_LEVEL, rank_order, ret, setup_inv, setup_tol, smoother_type, solution_accumulator_pipeline, solve_type, solver_ext_lib, strcmp(), strcpy(), tdim, test_type, tol, tol_hq, tol_restart, twist_flavor, usage(), value, vec_infile, vec_outfile, verify_results, xdim, xsize, ydim, ysize, and zdim.

Referenced by main(), and SU3test().

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

◆ setDims()

void setDims ( int X)

Definition at line 130 of file test_util.cpp.

References d, E, E1, E1h, E2, E3, E4, faceVolume, fused_exterior_ndeg_tm_dslash_cuda_gen::i, V, V_ex, Vh, Vh_ex, Vs_t, Vs_x, Vs_y, Vs_z, Vsh_t, Vsh_x, Vsh_y, Vsh_z, X, and Z.

Referenced by gauge_force_test(), hisq_force_init(), init(), invert_test(), llfat_test(), main(), GaugeAlgTest::SetUp(), SU3test(), and unitarize_link_test().

Here is the caller graph for this function:

◆ setSpinorSiteSize()

void setSpinorSiteSize ( int  n)

Definition at line 192 of file test_util.cpp.

References mySpinorSiteSize, and n.

Referenced by init(), invert_test(), and main().

Here is the caller graph for this function:

◆ stopwatchReadSeconds()

double stopwatchReadSeconds ( )

Definition at line 2873 of file test_util.cpp.

References startTime, timeval::tv_sec, and timeval::tv_usec.

Referenced by packTest().

Here is the caller graph for this function:

◆ stopwatchStart()

void stopwatchStart ( )

Definition at line 2869 of file test_util.cpp.

References startTime.

Referenced by packTest().

Here is the caller graph for this function:

◆ strong_check_link()

int strong_check_link ( void **  linkA,
const char *  msgA,
void **  linkB,
const char *  msgB,
int  len,
QudaPrecision  prec 
)

Definition at line 1428 of file test_util.cpp.

References compare_link(), len, prec, printfQuda, printLinkElement(), and ret.

Referenced by llfat_test().

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

◆ strong_check_mom()

int strong_check_mom ( void *  momA,
void *  momB,
int  len,
QudaPrecision  prec 
)

Definition at line 1565 of file test_util.cpp.

References compare_mom(), len, prec, printfQuda, printMomElement(), QUDA_DOUBLE_PRECISION, and ret.

Referenced by gauge_force_test(), and hisq_force_test().

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

◆ su3_construct()

void su3_construct ( void *  mat,
QudaReconstructType  reconstruct,
QudaPrecision  precision 
)

Definition at line 303 of file test_util.cpp.

References mat(), QUDA_DOUBLE_PRECISION, QUDA_RECONSTRUCT_12, su3Construct12(), and su3Construct8().

Here is the call graph for this function:

◆ su3_reconstruct()

void su3_reconstruct ( void *  mat,
int  dir,
int  ga_idx,
QudaReconstructType  reconstruct,
QudaPrecision  precision,
QudaGaugeParam param 
)

Definition at line 393 of file test_util.cpp.

References ga_idx, mat(), param, QUDA_DOUBLE_PRECISION, QUDA_RECONSTRUCT_12, su3Reconstruct12(), and su3Reconstruct8().

Here is the call graph for this function:

◆ su3Construct12()

template<typename Float >
void su3Construct12 ( Float *  mat)
inline

Definition at line 285 of file test_util.cpp.

References mat(), and w.

Referenced by su3_construct().

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

◆ su3Construct8()

template<typename Float >
void su3Construct8 ( Float *  mat)
inline

Definition at line 297 of file test_util.cpp.

References atan2(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, and mat().

Referenced by su3_construct().

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

◆ su3Reconstruct12()

template<typename Float >
static void su3Reconstruct12 ( Float *  mat,
int  dir,
int  ga_idx,
QudaGaugeParam param 
)
static

Definition at line 318 of file test_util.cpp.

References accumulateConjugateProduct(), QudaGaugeParam_s::anisotropy, ga_idx, mat(), param, QudaGaugeParam_s::t_boundary, w, and Z.

Referenced by su3_reconstruct().

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

◆ su3Reconstruct8()

template<typename Float >
static void su3Reconstruct8 ( Float *  mat,
int  dir,
int  ga_idx,
QudaGaugeParam param 
)
static

Definition at line 335 of file test_util.cpp.

References accumulateComplexProduct(), QudaGaugeParam_s::anisotropy, complexConjugateProduct(), complexDotProduct(), cos(), f, ga_idx, fused_exterior_ndeg_tm_dslash_cuda_gen::i, mat(), param, sin(), sqrt(), QudaGaugeParam_s::t_boundary, and Z.

Referenced by su3_reconstruct().

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

◆ usage()

void usage ( char **  argv)

Definition at line 1693 of file test_util.cpp.

References exit(), printf(), return(), and usage_extra().

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

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

◆ x4_from_full_index()

int x4_from_full_index ( int  i)

Definition at line 703 of file test_util.cpp.

References fullLatticeIndex(), half_idx, fused_exterior_ndeg_tm_dslash_cuda_gen::i, Vh, and Z.

Here is the call graph for this function:

Variable Documentation

◆ anisotropy

double anisotropy = 1.0

◆ clover_coeff

double clover_coeff = 0.1

◆ compute_clover

bool compute_clover = false

Definition at line 1646 of file test_util.cpp.

Referenced by init(), main(), printQudaInvertParam(), and process_command_line_option().

◆ dagger

◆ deflation_ext_lib

QudaExtLibType deflation_ext_lib = QUDA_EIGEN_EXTLIB

Definition at line 1680 of file test_util.cpp.

Referenced by process_command_line_option(), and setDeflationParam().

◆ deflation_grid

int deflation_grid = 16

◆ device

int device = 0

◆ dim_partitioned

int dim_partitioned[4] = {0,0,0,0}
static

Definition at line 1684 of file test_util.cpp.

Referenced by dimPartitioned(), and process_command_line_option().

◆ dslash_type

◆ E

int E[4]

◆ E1

int E1

◆ E1h

int E1h

◆ E2

int E2

◆ E3

int E3

◆ E4

int E4

Definition at line 35 of file test_util.cpp.

Referenced by Locator< oddBit >::getNeighborFromFullIndex(), and setDims().

◆ eigcg_max_restarts

int eigcg_max_restarts = 3

◆ eigenval_tol

double eigenval_tol = 1e-1

◆ faceVolume

int faceVolume[4]

Definition at line 32 of file test_util.cpp.

Referenced by dw_setDims(), and setDims().

◆ fat_link_max

float fat_link_max

Referenced by DslashParam::print().

◆ gcrNkrylov

int gcrNkrylov = 10

◆ generate_all_levels

bool generate_all_levels = true

◆ generate_nullspace

bool generate_nullspace = true

Definition at line 1665 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ geo_block_size

int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM] = { }

◆ gridsize_from_cmdline

int gridsize_from_cmdline[4] = {1,1,1,1}

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

Definition at line 50 of file test_util.cpp.

Referenced by dimPartitioned(), lex_rank_from_coords_t(), lex_rank_from_coords_x(), main(), process_command_line_option(), and SU3test().

◆ inc_tol

double inc_tol = 1e-2

◆ inv_type

QudaInverterType inv_type

◆ kernel_pack_t

bool kernel_pack_t = false

Definition at line 1650 of file test_util.cpp.

Referenced by init(), and process_command_line_option().

◆ latfile

char latfile[256] = ""

Definition at line 1627 of file test_util.cpp.

Referenced by init(), main(), process_command_line_option(), and SU3test().

◆ link_recon

◆ link_recon_precondition

QudaReconstructType link_recon_precondition = QUDA_RECONSTRUCT_INVALID

Definition at line 1614 of file test_util.cpp.

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

◆ link_recon_sloppy

◆ location_ritz

Definition at line 1681 of file test_util.cpp.

Referenced by process_command_line_option(), and setDeflationParam().

◆ Ls

int Ls

◆ Lsdim

int Lsdim = 16

Definition at line 1624 of file test_util.cpp.

Referenced by display_test_info(), dslashRef(), init(), main(), and process_command_line_option().

◆ mass

double mass = 0.1

◆ matpc_type

◆ max_restart_num

int max_restart_num = 3

◆ max_search_dim

int max_search_dim = 64

◆ mem_type_ritz

◆ mg_levels

int mg_levels = 2

◆ mg_verbosity

QudaVerbosity mg_verbosity[QUDA_MAX_MG_LEVEL] = { }

◆ Msrc

int Msrc = 1

Definition at line 1629 of file test_util.cpp.

Referenced by benchmark(), freeFields(), initFields(), process_command_line_option(), and test().

◆ mu

double mu = 0.1

Definition at line 1643 of file test_util.cpp.

Referenced by quda::AddCoarseTmDiagonalCPU(), quda::AddCoarseTmDiagonalGPU(), quda::ApplyCovDev(), quda::ApplyTwistClover(), quda::ApplyTwistGamma(), quda::calculateY(), quda::CloverArg< Float, nSpin, nColor, dynamic_clover_ >::CloverArg(), quda::CoarseCoarseOp(), quda::CoarseOp(), computeAllLinkField(), computeAllLinkSite(), computeMiddleLinkField(), computeMiddleLinkSite(), computeSideLinkField(), computeSideLinkSite(), quda::computeStapleRectangle(), quda::computeTMCAV(), covdev_dslash(), covdevRef(), covdevReference(), quda::DiracWilson::createCoarseOp(), quda::DiracClover::createCoarseOp(), quda::DiracCloverPC::createCoarseOp(), do_color_matrix_hisq_force_reference(), do_halfwilson_hisq_force_reference(), doHisqStaplesForceCPU(), quda::DiracTwistedCloverPC::Dslash(), quda::GaugeCovDev::DslashCD(), dslashCUDA(), dslashTest(), quda::DiracTwistedCloverPC::DslashXpay(), quda::GammaArg< Float, nColor >::GammaArg(), init(), quda::linkIndexM1(), quda::linkIndexP1(), quda::linkNormalIndexP1(), llfat_compute_gen_staple_field(), llfat_test(), main(), mat(), Mat(), matdagmat(), Matdagmat(), quda::GaugeCovDev::MCD(), quda::GaugeCovDev::MdagMCD(), ndeg_twist_gamma5(), quda::ndegTwistedMassDslashCuda(), ndegTwistGamma5(), quda::MPCG::operator()(), printQudaInvertParam(), process_command_line_option(), quda::ProjectSU3kernel(), setInvertParam(), setMultigridParam(), side_link_3f_force(), side_link_force(), quda::ColorSpinor< Float, Nc, 4 >::sigma(), tm_dslash(), tm_mat(), tm_matpc(), tm_ndeg_dslash(), tm_ndeg_mat(), tm_ndeg_matpc(), tmc_dslash(), tmc_mat(), tmc_matpc(), twist_gamma5(), twistCloverGamma5(), quda::twistedCloverDslashCuda(), quda::twistedMassDslashCuda(), and twistGamma5().

◆ mu_factor

double mu_factor[QUDA_MAX_MG_LEVEL] = { }

◆ multishift

int multishift = 0

Definition at line 1640 of file test_util.cpp.

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

◆ mySpinorSiteSize

int mySpinorSiteSize

Definition at line 43 of file test_util.cpp.

Referenced by setSpinorSiteSize().

◆ nev

int nev = 8

◆ niter

int niter = 100

◆ normalization

Definition at line 1651 of file test_util.cpp.

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

◆ Nsrc

int Nsrc = 1

◆ nu_post

int nu_post = 2

◆ nu_pre

int nu_pre = 2

◆ nvec

int nvec[QUDA_MAX_MG_LEVEL] = { }

◆ omega

double omega = 0.85

◆ pipeline

int pipeline = 0

◆ prec

◆ prec_precondition

◆ prec_ritz

Definition at line 1618 of file test_util.cpp.

Referenced by process_command_line_option(), and setDeflationParam().

◆ prec_sloppy

◆ precon_type

Definition at line 1639 of file test_util.cpp.

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

◆ rank_order

int rank_order = 0
static

Definition at line 70 of file test_util.cpp.

Referenced by initComms(), and process_command_line_option().

◆ 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 = 5e-6

◆ smoother_type

Definition at line 1664 of file test_util.cpp.

Referenced by process_command_line_option(), and setMultigridParam().

◆ solution_accumulator_pipeline

int solution_accumulator_pipeline = 0

◆ solve_type

◆ solver_ext_lib

Definition at line 1679 of file test_util.cpp.

Referenced by process_command_line_option(), and setInvertParam().

◆ startTime

struct timeval startTime
static

Definition at line 2867 of file test_util.cpp.

Referenced by stopwatchReadSeconds(), and stopwatchStart().

◆ tdim

int tdim = 24

◆ test_type

int test_type = 0

◆ tol

double tol = 1e-7

Definition at line 1647 of file test_util.cpp.

Referenced by process_command_line_option().

◆ tol_hq

double tol_hq = 0.

◆ tol_restart

double tol_restart = 5e+3*tol

◆ twist_flavor

◆ V

int V

◆ V5

int V5

Definition at line 40 of file test_util.cpp.

Referenced by dw_4d_mat(), dw_mat(), dw_matdagmat(), and dw_setDims().

◆ V5h

int V5h

◆ V_ex

int V_ex

Definition at line 37 of file test_util.cpp.

Referenced by gauge_force_test(), llfat_test(), and setDims().

◆ vec_infile

char vec_infile[256] = ""

◆ vec_outfile

char vec_outfile[256] = ""

◆ verify_results

bool verify_results = true

◆ Vh

int Vh

◆ Vh_ex

int Vh_ex

◆ Vs_t

int Vs_t

Definition at line 30 of file test_util.cpp.

Referenced by dw_setDims(), llfat_reference(), llfat_test(), and setDims().

◆ Vs_x

int Vs_x

Definition at line 30 of file test_util.cpp.

Referenced by llfat_reference(), llfat_test(), and setDims().

◆ Vs_y

int Vs_y

Definition at line 30 of file test_util.cpp.

Referenced by llfat_reference(), llfat_test(), and setDims().

◆ Vs_z

int Vs_z

Definition at line 30 of file test_util.cpp.

Referenced by llfat_reference(), llfat_test(), and setDims().

◆ Vsh_t

int Vsh_t

Definition at line 31 of file test_util.cpp.

Referenced by dw_setDims(), llfat_reference(), and setDims().

◆ Vsh_x

int Vsh_x

Definition at line 31 of file test_util.cpp.

Referenced by llfat_reference(), and setDims().

◆ Vsh_y

int Vsh_y

Definition at line 31 of file test_util.cpp.

Referenced by llfat_reference(), and setDims().

◆ Vsh_z

int Vsh_z

Definition at line 31 of file test_util.cpp.

Referenced by llfat_reference(), and setDims().

◆ xdim

int xdim = 24

◆ ydim

int ydim = 24

◆ Z

int Z[4]

◆ zdim

int zdim = 24