QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Functions | Variables
staggered_dslash_ctest.cpp File Reference
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <quda.h>
#include <quda_internal.h>
#include <dirac_quda.h>
#include <dslash_quda.h>
#include <invert_quda.h>
#include <util_quda.h>
#include <blas_quda.h>
#include <misc.h>
#include <test_util.h>
#include <dslash_util.h>
#include <staggered_dslash_reference.h>
#include <staggered_gauge_utils.h>
#include "llfat_reference.h"
#include <gauge_field.h>
#include <unitarization_links.h>
#include <qio_field.h>
#include <assert.h>
#include <gtest/gtest.h>
Include dependency graph for staggered_dslash_ctest.cpp:

Go to the source code of this file.

Classes

struct  DslashTime
 
class  StaggeredDslashTest
 

Macros

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

Functions

void usage (char **argv)
 
double getTolerance (QudaPrecision prec)
 
void init (int precision, QudaReconstructType link_recon, int partition)
 
void end (void)
 
DslashTime dslashCUDA (int niter)
 
void staggeredDslashRef ()
 
void display_test_info (int precision, QudaReconstructType link_recon)
 
void usage_extra (char **argv)
 
 TEST_P (StaggeredDslashTest, verify)
 
 TEST_P (StaggeredDslashTest, benchmark)
 
int main (int argc, char **argv)
 
std::string getstaggereddslashtestname (testing::TestParamInfo<::testing::tuple< int, int, int >> param)
 
 INSTANTIATE_TEST_SUITE_P (QUDA, StaggeredDslashTest, Combine(Range(0, 4), ::testing::Values(QUDA_RECONSTRUCT_NO, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_8), ::testing::Values(0)), getstaggereddslashtestname)
 

Variables

int test_type
 
bool gauge_loaded = false
 
void * qdp_inlink [4] = { nullptr, nullptr, nullptr, nullptr }
 
QudaGaugeParam gauge_param
 
QudaInvertParam inv_param
 
cpuGaugeFieldcpuFat = NULL
 
cpuGaugeFieldcpuLong = NULL
 
cpuColorSpinorFieldspinor
 
cpuColorSpinorFieldspinorOut
 
cpuColorSpinorFieldspinorRef
 
cpuColorSpinorFieldtmpCpu
 
cudaColorSpinorFieldcudaSpinor
 
cudaColorSpinorFieldcudaSpinorOut
 
cudaColorSpinorFieldtmp
 
void * qdp_fatlink_cpu [4]
 
void * qdp_longlink_cpu [4]
 
void ** ghost_fatlink_cpu
 
void ** ghost_longlink_cpu
 
void * qdp_fatlink_cpu_backup [1][4]
 
void * qdp_longlink_cpu_backup [1][4]
 
void * qdp_inlink_backup [1][4]
 
bool global_skip = true
 
QudaParity parity = QUDA_EVEN_PARITY
 
QudaDagType dagger
 
int xdim
 
int ydim
 
int zdim
 
int tdim
 
int gridsize_from_cmdline []
 
int device
 
bool verify_results
 
int niter
 
double mass
 
double kappa
 
bool compute_fatlong
 
QudaDslashType dslash_type
 
double eps_naik
 
static int n_naiks = 1
 
char latfile []
 
int X [4]
 
int Nsrc
 
Diracdirac
 
const char * prec_str [] = {"quarter", "half", "single", "double"}
 
const char * recon_str [] = {"r18", "r13", "r9"}
 
int argc_copy
 
char ** argv_copy
 

Macro Definition Documentation

◆ MAX

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

Definition at line 36 of file staggered_dslash_ctest.cpp.

Referenced by init().

◆ staggeredSpinorSiteSize

#define staggeredSpinorSiteSize   6

Definition at line 37 of file staggered_dslash_ctest.cpp.

Function Documentation

◆ display_test_info()

void display_test_info ( int  precision,
QudaReconstructType  link_recon 
)

Definition at line 533 of file staggered_dslash_ctest.cpp.

References dagger, get_prec_str(), get_recon_str(), prec, printfQuda, QUDA_DOUBLE_PRECISION, QUDA_HALF_PRECISION, QUDA_SINGLE_PRECISION, tdim, test_type, xdim, ydim, and zdim.

Referenced by StaggeredDslashTest::SetUp().

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

◆ dslashCUDA()

DslashTime dslashCUDA ( int  niter)

Definition at line 443 of file staggered_dslash_ctest.cpp.

References comm_barrier(), DslashTime::cpu_max, DslashTime::cpu_min, DslashTime::cpu_time, quda::Dirac::Dslash(), end(), errorQuda, DslashTime::event_time, quda::Dirac::M(), niter, parity, and test_type.

Referenced by TEST_P().

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

◆ end()

void end ( void  )

Definition at line 398 of file staggered_dslash_ctest.cpp.

References commDimPartitionedReset(), cpuFat, cpuLong, cudaSpinor, cudaSpinorOut, dirac, freeGaugeQuda(), qdp_fatlink_cpu, qdp_longlink_cpu, spinor, spinorOut, spinorRef, tmp, and tmpCpu.

Referenced by dslashCUDA(), and StaggeredDslashTest::TearDown().

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

◆ getstaggereddslashtestname()

std::string getstaggereddslashtestname ( testing::TestParamInfo<::testing::tuple< int, int, int >>  param)

Definition at line 814 of file staggered_dslash_ctest.cpp.

References INSTANTIATE_TEST_SUITE_P(), param, prec, prec_str, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_8, and QUDA_RECONSTRUCT_NO.

Here is the call graph for this function:

◆ getTolerance()

double getTolerance ( QudaPrecision  prec)

Definition at line 108 of file staggered_dslash_ctest.cpp.

References QUDA_DOUBLE_PRECISION, QUDA_HALF_PRECISION, QUDA_INVALID_PRECISION, QUDA_QUARTER_PRECISION, and QUDA_SINGLE_PRECISION.

Referenced by TEST_P().

Here is the caller graph for this function:

◆ init()

void init ( int  precision,
QudaReconstructType  link_recon,
int  partition 
)

Definition at line 120 of file staggered_dslash_ctest.cpp.

References QudaGaugeParam_s::anisotropy, applyGaugeFieldScaling_long(), argc_copy, argv_copy, checkCudaError, compute_fatlong, computeFatLongGPUandCPU(), construct_fat_long_gauge_field(), construct_gauge_field(), QudaGaugeParam_s::cpu_prec, QudaInvertParam_s::cpu_prec, quda::ColorSpinorParam::create, quda::Dirac::create(), csParam, QudaGaugeParam_s::cuda_prec, QudaInvertParam_s::cuda_prec, QudaGaugeParam_s::cuda_prec_sloppy, dagger, QudaInvertParam_s::dagger, QudaInvertParam_s::dirac_order, dslash_type, QudaInvertParam_s::dslash_type, dw_setDims(), eps_naik, errorQuda, quda::ColorSpinorParam::fieldOrder, QudaGaugeParam_s::ga_pad, QudaInvertParam_s::gamma_basis, quda::ColorSpinorParam::gammaBasis, QudaGaugeParam_s::gauge_fix, gauge_loaded, QudaGaugeParam_s::gauge_order, gaugeSiteSize, getPrecision(), quda::GaugeField::Ghost(), ghost_fatlink_cpu, ghost_longlink_cpu, quda::LatticeFieldParam::ghostExchange, gSize, QudaInvertParam_s::input_location, kappa, QudaInvertParam_s::kappa, latfile, link_recon, loadGaugeQuda(), mass, QudaInvertParam_s::mass, QudaInvertParam_s::mass_normalization, QudaInvertParam_s::matpc_type, MAX, memset(), n_naiks, quda::ColorSpinorParam::nColor, quda::LatticeFieldParam::nDim, newQudaGaugeParam(), newQudaInvertParam(), quda::ColorSpinorParam::nSpin, Nsrc, QudaInvertParam_s::output_location, quda::LatticeFieldParam::pad, prec, qdp_fatlink_cpu, qdp_inlink, qdp_longlink_cpu, QUDA_ANTI_PERIODIC_T, QUDA_ASQTAD_DSLASH, QUDA_ASQTAD_FAT_LINKS, QUDA_ASQTAD_LONG_LINKS, QUDA_CPU_FIELD_LOCATION, QUDA_DEGRAND_ROSSI_GAMMA_BASIS, QUDA_DIRAC_ORDER, QUDA_DOUBLE_PRECISION, QUDA_EVEN_ODD_SITE_ORDER, QUDA_FLOAT2_FIELD_ORDER, QUDA_FULL_SITE_SUBSET, QUDA_GAUGE_FIXED_NO, QUDA_GHOST_EXCHANGE_PAD, QUDA_LAPLACE_DSLASH, QUDA_MASS_NORMALIZATION, QUDA_MAT_SOLUTION, QUDA_MATPC_EVEN_EVEN, QUDA_MILC_GAUGE_ORDER, QUDA_PARITY_SITE_SUBSET, QUDA_RANDOM_SOURCE, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_13, QUDA_RECONSTRUCT_8, QUDA_RECONSTRUCT_9, QUDA_RECONSTRUCT_NO, QUDA_SPACE_SPIN_COLOR_FIELD_ORDER, QUDA_STAGGERED_DSLASH, QUDA_STAGGERED_PHASE_MILC, QUDA_STAGGERED_PHASE_NO, QUDA_SU3_LINKS, QUDA_SUMMARIZE, QUDA_WILSON_LINKS, QUDA_ZERO_FIELD_CREATE, read_gauge_field(), QudaGaugeParam_s::reconstruct, QudaGaugeParam_s::reconstruct_sloppy, reorderQDPtoMILC(), QudaGaugeParam_s::scale, setDims(), quda::setDiracParam(), quda::ColorSpinorParam::setPrecision(), setSpinorSiteSize(), setVerbosity(), quda::ColorSpinorParam::siteOrder, quda::LatticeFieldParam::siteSubset, QudaInvertParam_s::solution_type, quda::cpuColorSpinorField::Source(), QudaInvertParam_s::sp_pad, spinor, QudaGaugeParam_s::staggered_phase_type, QudaGaugeParam_s::t_boundary, QudaGaugeParam_s::tadpole_coeff, tdim, test_type, tmp, quda::DiracParam::tmp1, QudaGaugeParam_s::type, V, Vh, QudaGaugeParam_s::X, quda::LatticeFieldParam::x, X, xdim, ydim, and zdim.

Referenced by StaggeredDslashTest::SetUp().

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

◆ INSTANTIATE_TEST_SUITE_P()

INSTANTIATE_TEST_SUITE_P ( QUDA  ,
StaggeredDslashTest  ,
Combine(Range(0, 4), ::testing::Values(QUDA_RECONSTRUCT_NO, QUDA_RECONSTRUCT_12, QUDA_RECONSTRUCT_8), ::testing::Values(0))  ,
getstaggereddslashtestname   
)

Referenced by getstaggereddslashtestname().

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

◆ staggeredDslashRef()

void staggeredDslashRef ( )

◆ TEST_P() [1/2]

TEST_P ( StaggeredDslashTest  ,
verify   
)

◆ TEST_P() [2/2]

TEST_P ( StaggeredDslashTest  ,
benchmark   
)

◆ usage()

void usage ( char **  argv)

Definition at line 1783 of file test_util.cpp.

Referenced by main().

Here is the caller graph for this function:

◆ usage_extra()

void usage_extra ( char **  argv)

Definition at line 551 of file staggered_dslash_ctest.cpp.

References printfQuda.

Variable Documentation

◆ argc_copy

int argc_copy

Definition at line 105 of file staggered_dslash_ctest.cpp.

Referenced by init(), and main().

◆ argv_copy

char** argv_copy

Definition at line 106 of file staggered_dslash_ctest.cpp.

Referenced by init(), and main().

◆ compute_fatlong

bool compute_fatlong

Definition at line 1655 of file test_util.cpp.

Referenced by init(), main(), and StaggeredDslashTest::skip().

◆ cpuFat

cpuGaugeField* cpuFat = NULL

Definition at line 50 of file staggered_dslash_ctest.cpp.

Referenced by eigensolve_test(), end(), and invert_test().

◆ cpuLong

cpuGaugeField* cpuLong = NULL

Definition at line 51 of file staggered_dslash_ctest.cpp.

Referenced by eigensolve_test(), end(), and invert_test().

◆ cudaSpinor

cudaColorSpinorField* cudaSpinor

Definition at line 54 of file staggered_dslash_ctest.cpp.

Referenced by end().

◆ cudaSpinorOut

cudaColorSpinorField * cudaSpinorOut

Definition at line 54 of file staggered_dslash_ctest.cpp.

Referenced by end(), and TEST_P().

◆ dagger

QudaDagType dagger

Definition at line 1620 of file test_util.cpp.

Referenced by display_test_info(), init(), and staggeredDslashRef().

◆ device

int device

Definition at line 1602 of file test_util.cpp.

Referenced by StaggeredDslashTest::SetUpTestCase().

◆ dirac

Dirac* dirac

Definition at line 99 of file staggered_dslash_ctest.cpp.

Referenced by end().

◆ dslash_type

QudaDslashType dslash_type

Definition at line 1621 of file test_util.cpp.

Referenced by init(), main(), StaggeredDslashTest::skip(), and staggeredDslashRef().

◆ eps_naik

double eps_naik

Definition at line 1652 of file test_util.cpp.

Referenced by init(), and main().

◆ gauge_loaded

bool gauge_loaded = false

Definition at line 44 of file staggered_dslash_ctest.cpp.

Referenced by init().

◆ gauge_param

QudaGaugeParam gauge_param

Definition at line 47 of file staggered_dslash_ctest.cpp.

◆ ghost_fatlink_cpu

void** ghost_fatlink_cpu

Definition at line 60 of file staggered_dslash_ctest.cpp.

Referenced by init(), and staggeredDslashRef().

◆ ghost_longlink_cpu

void ** ghost_longlink_cpu

Definition at line 60 of file staggered_dslash_ctest.cpp.

Referenced by init(), and staggeredDslashRef().

◆ global_skip

bool global_skip = true

Definition at line 72 of file staggered_dslash_ctest.cpp.

◆ gridsize_from_cmdline

int gridsize_from_cmdline[]

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

Definition at line 49 of file test_util.cpp.

Referenced by main().

◆ inv_param

QudaInvertParam inv_param

Definition at line 48 of file staggered_dslash_ctest.cpp.

◆ kappa

double kappa

Definition at line 1647 of file test_util.cpp.

Referenced by init(), and staggeredDslashRef().

◆ latfile

char latfile[]

Definition at line 1623 of file test_util.cpp.

Referenced by init(), and main().

◆ mass

double mass

Definition at line 1646 of file test_util.cpp.

Referenced by init(), and staggeredDslashRef().

◆ n_naiks

int n_naiks = 1
static

Definition at line 92 of file staggered_dslash_ctest.cpp.

Referenced by init(), and main().

◆ niter

int niter

Definition at line 1629 of file test_util.cpp.

Referenced by dslashCUDA(), and TEST_P().

◆ Nsrc

int Nsrc

Definition at line 1627 of file test_util.cpp.

Referenced by init().

◆ parity

Definition at line 75 of file staggered_dslash_ctest.cpp.

Referenced by dslashCUDA(), and staggeredDslashRef().

◆ prec_str

const char* prec_str[] = {"quarter", "half", "single", "double"}

Definition at line 101 of file staggered_dslash_ctest.cpp.

Referenced by getstaggereddslashtestname().

◆ qdp_fatlink_cpu

void* qdp_fatlink_cpu[4]

◆ qdp_fatlink_cpu_backup

void* qdp_fatlink_cpu_backup[1][4]

Definition at line 68 of file staggered_dslash_ctest.cpp.

Referenced by main().

◆ qdp_inlink

void* qdp_inlink[4] = { nullptr, nullptr, nullptr, nullptr }

Definition at line 45 of file staggered_dslash_ctest.cpp.

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

◆ qdp_inlink_backup

void* qdp_inlink_backup[1][4]

Definition at line 70 of file staggered_dslash_ctest.cpp.

Referenced by main().

◆ qdp_longlink_cpu

void * qdp_longlink_cpu[4]

◆ qdp_longlink_cpu_backup

void* qdp_longlink_cpu_backup[1][4]

Definition at line 69 of file staggered_dslash_ctest.cpp.

Referenced by main().

◆ recon_str

const char* recon_str[] = {"r18", "r13", "r9"}

Definition at line 102 of file staggered_dslash_ctest.cpp.

◆ spinor

Definition at line 53 of file staggered_dslash_ctest.cpp.

Referenced by end(), and init().

◆ spinorOut

cpuColorSpinorField * spinorOut

Definition at line 53 of file staggered_dslash_ctest.cpp.

Referenced by end().

◆ spinorRef

cpuColorSpinorField * spinorRef

Definition at line 53 of file staggered_dslash_ctest.cpp.

Referenced by end().

◆ tdim

int tdim

Definition at line 1618 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ test_type

int test_type

Definition at line 1636 of file test_util.cpp.

Referenced by display_test_info(), dslashCUDA(), init(), main(), and staggeredDslashRef().

◆ tmp

Definition at line 56 of file staggered_dslash_ctest.cpp.

Referenced by end(), and init().

◆ tmpCpu

Definition at line 53 of file staggered_dslash_ctest.cpp.

Referenced by end().

◆ verify_results

bool verify_results

Definition at line 1643 of file test_util.cpp.

◆ X

int X[4]

Definition at line 96 of file staggered_dslash_ctest.cpp.

Referenced by init().

◆ xdim

int xdim

Definition at line 1615 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ ydim

int ydim

Definition at line 1616 of file test_util.cpp.

Referenced by display_test_info(), and init().

◆ zdim

int zdim

Definition at line 1617 of file test_util.cpp.

Referenced by display_test_info(), and init().