QUDA  0.9.0
Macros | Functions | Variables
test_util.h File Reference
#include <quda.h>
Include dependency graph for test_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define gaugeSiteSize   18
 
#define spinorSiteSize   24
 
#define cloverSiteSize   72
 
#define momSiteSize   10
 
#define hwSiteSize   12
 

Functions

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)
 
int dimPartitioned (int dim)
 
int neighborIndex (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 neighborIndex (int dim[], int index, int oddBit, int dx[])
 
int neighborIndexFullLattice (int dim[], int index, int dx[])
 
int neighborIndex_mg (int i, int oddBit, int dx4, int dx3, int dx2, int dx1)
 
int neighborIndexFullLattice_mg (int i, int dx4, int dx3, int dx2, int dx1)
 
void printSpinorElement (void *spinor, int X, QudaPrecision precision)
 
void printGaugeElement (void *gauge, int X, QudaPrecision precision)
 
int fullLatticeIndex (int i, int oddBit)
 
int fullLatticeIndex (int dim[], int index, int oddBit)
 
int getOddBit (int X)
 
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 *, QudaDslashType dslash_type)
 
void construct_clover_field (void *clover, double norm, double diag, QudaPrecision precision)
 
void construct_spinor_field (void *spinor, int type, int i0, int s0, int c0, QudaPrecision precision)
 
void createSiteLinkCPU (void **link, QudaPrecision precision, int phase)
 
void su3_construct (void *mat, QudaReconstructType reconstruct, QudaPrecision precision)
 
void su3_reconstruct (void *mat, int dir, int ga_idx, QudaReconstructType reconstruct, QudaPrecision precision, QudaGaugeParam *param)
 
void compare_spinor (void *spinor_cpu, void *spinor_gpu, int len, QudaPrecision precision)
 
void strong_check (void *spinor, void *spinorGPU, int len, QudaPrecision precision)
 
int compare_floats (void *a, void *b, int len, double epsilon, QudaPrecision precision)
 
void check_gauge (void **, void **, double epsilon, QudaPrecision precision)
 
int strong_check_link (void **linkA, const char *msgA, void **linkB, const char *msgB, int len, QudaPrecision prec)
 
int strong_check_mom (void *momA, void *momB, int len, QudaPrecision prec)
 
void createMomCPU (void *mom, QudaPrecision precision)
 
void createHwCPU (void *hw, QudaPrecision precision)
 
int x4_from_full_index (int i)
 
int fullLatticeIndex_4d (int i, int oddBit)
 
int fullLatticeIndex_5d (int i, int oddBit)
 
int fullLatticeIndex_5d_4dpc (int i, int oddBit)
 
int process_command_line_option (int argc, char **argv, int *idx)
 
void stopwatchStart ()
 
double stopwatchReadSeconds ()
 
void exchange_cpu_sitelink (int *X, void **sitelink, void **ghost_sitelink, void **ghost_sitelink_diag, QudaPrecision gPrecision, QudaGaugeParam *param, int optflag)
 
void exchange_cpu_sitelink_ex (int *X, int *R, void **sitelink, QudaGaugeFieldOrder cpu_order, QudaPrecision gPrecision, int optflag, int geometry)
 
void exchange_cpu_staple (int *X, void *staple, void **ghost_staple, QudaPrecision gPrecision)
 
void exchange_llfat_init (QudaPrecision prec)
 
void exchange_llfat_cleanup (void)
 

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
 

Macro Definition Documentation

◆ cloverSiteSize

#define cloverSiteSize   72

Definition at line 8 of file test_util.h.

Referenced by init(), and main().

◆ gaugeSiteSize

#define gaugeSiteSize   18

◆ hwSiteSize

#define hwSiteSize   12

Definition at line 10 of file test_util.h.

Referenced by createHwCPU(), and hisq_force_init().

◆ momSiteSize

#define momSiteSize   10

◆ spinorSiteSize

#define spinorSiteSize   24

Definition at line 7 of file test_util.h.

Function Documentation

◆ check_gauge()

void check_gauge ( void **  ,
void **  ,
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:

◆ 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_spinor()

void compare_spinor ( void *  spinor_cpu,
void *  spinor_gpu,
int  len,
QudaPrecision  precision 
)

◆ 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 ,
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:

◆ construct_spinor_field()

void construct_spinor_field ( void *  spinor,
int  type,
int  i0,
int  s0,
int  c0,
QudaPrecision  precision 
)

◆ 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:

◆ exchange_cpu_sitelink()

void exchange_cpu_sitelink ( int X,
void **  sitelink,
void **  ghost_sitelink,
void **  ghost_sitelink_diag,
QudaPrecision  gPrecision,
QudaGaugeParam param,
int  optflag 
)

Referenced by llfat_test().

Here is the caller graph for this function:

◆ exchange_cpu_sitelink_ex()

void exchange_cpu_sitelink_ex ( int X,
int R,
void **  sitelink,
QudaGaugeFieldOrder  cpu_order,
QudaPrecision  gPrecision,
int  optflag,
int  geometry 
)

Referenced by gauge_force_test(), and llfat_test().

Here is the caller graph for this function:

◆ exchange_cpu_staple()

void exchange_cpu_staple ( int X,
void *  staple,
void **  ghost_staple,
QudaPrecision  gPrecision 
)

◆ exchange_llfat_cleanup()

void exchange_llfat_cleanup ( void  )

Referenced by llfat_test(), and unitarize_link_test().

Here is the caller graph for this function:

◆ exchange_llfat_init()

void exchange_llfat_init ( QudaPrecision  prec)

◆ 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  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() [2/2]

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

◆ 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  X)

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:

◆ 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[],
int  index,
int  oddBit,
int  dx[] 
)

◆ 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.

Here is the call graph for this function:

◆ neighborIndexFullLattice() [2/2]

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

◆ 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:

◆ 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:

◆ 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:

◆ 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.

◆ 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()

void strong_check ( void *  spinor,
void *  spinorGPU,
int  len,
QudaPrecision  precision 
)

◆ 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:

◆ 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

◆ E

int E[4]

Definition at line 36 of file test_util.cpp.

Referenced by setDims().

◆ 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().

◆ faceVolume

int faceVolume[4]

Definition at line 32 of file test_util.cpp.

Referenced by dw_setDims(), and setDims().

◆ Ls

int Ls

◆ mySpinorSiteSize

int mySpinorSiteSize

Definition at line 43 of file test_util.cpp.

Referenced by setSpinorSiteSize().

◆ 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().

◆ Vh

int Vh

◆ Vh_ex

int Vh_ex

Definition at line 37 of file test_util.cpp.

Referenced by setDims().

◆ 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().

◆ Z

int Z[4]