16 #if defined(QMP_COMMS) 18 #elif defined(MPI_COMMS) 22 #define MAX(a,b) ((a)>(b)?(a):(b)) 23 #define mySpinorSiteSize 6 25 extern void usage(
char** argv);
33 void** ghost_fatlink, **ghost_longlink;
75 template<
typename Float>
77 for(
int i = 0;
i <
Vh;
i++) {
78 for (
int s = 0;
s < 1;
s++) {
79 for (
int m = 0; m < 3; m++) {
80 res[
i*(1*3*2) +
s*(3*2) + m*(2) + 0] =
rand() / (Float)RAND_MAX;
81 res[
i*(1*3*2) +
s*(3*2) + m*(2) + 1] =
rand() / (Float)RAND_MAX;
90 int X1,
int X2,
int X3,
int X4,
93 double mass,
double tol,
int maxiter,
double reliable_delta,
136 errorQuda(
"qudaInvert: requesting zero residual\n");
202 for (
int dir = 0; dir < 4; dir++) {
212 for(
int dir=0; dir<4; ++dir){
213 for(
int i=0;
i<
V; ++
i){
258 int fat_pad = tmp_value;
259 int link_pad = 3*tmp_value;
327 spinorOutArray[0] =
out;
328 spinorInArray[0] =
in;
351 outArray[
i] = spinorOutArray[
i]->
V();
352 inArray[
i] = spinorInArray[
i]->
V();
358 time0 /= CLOCKS_PER_SEC;
390 time0 /= CLOCKS_PER_SEC;
406 errorQuda(
"full spinor not supported\n");
412 #define NUM_OFFSETS 12 415 double masses[
NUM_OFFSETS] ={0.06, 0.061, 0.064, 0.070, 0.077, 0.081, 0.1, 0.11, 0.12, 0.13, 0.14, 0.205};
426 spinorOutArray[0] =
out;
432 outArray[
i] = spinorOutArray[
i]->
V();
446 cudaDeviceSynchronize();
448 time0 /= CLOCKS_PER_SEC;
450 printfQuda(
"done: total time = %g secs, compute time = %g, %i iter / %g secs = %g gflops\n",
459 errorQuda(
"full parity not supported\n");
465 errorQuda(
"ERROR: invalid spinor parity \n");
482 double l2r =
sqrt(nrm2/src2);
484 printfQuda(
"Shift %d residuals: (L2 relative) tol %g, QUDA = %g, host = %g; (heavy-quark) tol %g, QUDA = %g, host = %g\n",
506 double l2r =
sqrt(nrm2/src2);
508 printfQuda(
"Residuals: (L2 relative) tol %g, QUDA = %g, host = %g; (heavy-quark) tol %g, QUDA = %g, host = %g\n",
511 printfQuda(
"done: total time = %g secs, compute time = %g secs, %i iter / %g secs = %g gflops, \n",
525 for(
int i=0;
i < 4;
i++){
550 printfQuda(
"prec sloppy_prec link_recon sloppy_link_recon test_type S_dimension T_dimension\n");
572 printfQuda(
" 0: Even even spinor CG inverter\n");
573 printfQuda(
" 1: Odd odd spinor CG inverter\n");
574 printfQuda(
" 3: Even even spinor multishift CG inverter\n");
575 printfQuda(
" 4: Odd odd spinor multishift CG inverter\n");
576 printfQuda(
" --cpu_prec <double/single/half> # Set CPU precision\n");
580 int main(
int argc,
char** argv)
582 for (
int i = 1;
i < argc;
i++) {
590 if(
strcmp(argv[
i],
"--cpu_prec") == 0){
599 printf(
"ERROR: Invalid option:%s\n", argv[
i]);
int dimPartitioned(int dim)
QudaDiracFieldOrder dirac_order
QudaMassNormalization mass_normalization
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
QudaReconstructType reconstruct_sloppy
QudaGhostExchange ghostExchange
QudaGaugeParam gaugeParam
void invertMultiShiftQuda(void **_hp_x, void *_hp_b, QudaInvertParam *param)
QudaVerbosity verbosity_precondition
cpuColorSpinorField * out
enum QudaPrecision_s QudaPrecision
QudaReconstructType link_recon
void dw_setDims(int *X, const int L5)
QudaInverterType inv_type_precondition
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
QudaDslashType dslash_type
QudaInverterType inv_type
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
int process_command_line_option(int argc, char **argv, int *idx)
QudaPrecision prec_sloppy
void matdagmat_mg4dir(cpuColorSpinorField *out, void **link, void **ghostLink, cpuColorSpinorField *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision, cpuColorSpinorField *tmp, QudaParity parity)
QudaGaugeFieldOrder gauge_order
const char * get_prec_str(QudaPrecision prec)
QudaSiteSubset siteSubset
const char * get_test_type(int t)
void exit(int) __attribute__((noreturn))
QudaFieldLocation input_location
double true_res_hq_offset[QUDA_MAX_MULTI_SHIFT]
cpuColorSpinorField * tmp
int gridsize_from_cmdline[]
QudaUseInitGuess use_init_guess
QudaSolutionType solution_type
else return(__swbuf(_c, _p))
int strcmp(const char *__s1, const char *__s2)
void initQuda(int device)
QudaFieldLocation output_location
void * malloc(size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(1)))
QudaInvertParam inv_param
int printf(const char *,...) __attribute__((__format__(__printf__
QudaFieldOrder fieldOrder
QudaPrecision cuda_prec_sloppy
void setSpinorSiteSize(int n)
double tol_offset[QUDA_MAX_MULTI_SHIFT]
double true_res_offset[QUDA_MAX_MULTI_SHIFT]
QudaInvertParam newQudaInvertParam(void)
const char * get_recon_str(QudaReconstructType recon)
int main(int argc, char **argv)
QudaPrecision cuda_prec_precondition
QudaGammaBasis gammaBasis
cpuColorSpinorField * ref
void matdagmat(void *out, void **link, void *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision, void *tmp, QudaParity parity)
QudaGammaBasis gamma_basis
QudaPrecision cuda_prec_sloppy
QudaReconstructType link_recon_sloppy
const void ** Ghost() const
double3 HeavyQuarkResidualNorm(ColorSpinorField &x, ColorSpinorField &r)
double offset[QUDA_MAX_MULTI_SHIFT]
int use_sloppy_partial_accumulator
enum QudaParity_s QudaParity
QudaInverterType inv_type
QudaReconstructType reconstruct
double norm_2(void *v, int len, QudaPrecision precision)
int rand(void) __attribute__((__availability__(swift
void construct_fat_long_gauge_field(void **fatlink, void **longlink, int type, QudaPrecision precision, QudaGaugeParam *param, QudaDslashType dslash_type)
static void set_params(QudaGaugeParam *gaugeParam, QudaInvertParam *inv_param, int X1, int X2, int X3, int X4, QudaPrecision cpu_prec, QudaPrecision prec, QudaPrecision prec_sloppy, QudaReconstructType link_recon, QudaReconstructType link_recon_sloppy, double mass, double tol, int maxiter, double reliable_delta, double tadpole_coeff)
QudaPrecision cuda_prec_precondition
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
void invertMultiSrcQuda(void **_hp_x, void **_hp_b, QudaInvertParam *param)
QudaDslashType dslash_type
void usage_extra(char **argv)
enum QudaDslashType_s QudaDslashType
void mxpy(ColorSpinorField &x, ColorSpinorField &y)
QudaResidualType residual_type
clock_t clock(void) __asm("_" "clock")
static __inline__ size_t size_t d
void initComms(int argc, char **argv, const int *commDims)
enum QudaInverterType_s QudaInverterType
QudaPrecision get_prec(QIO_Reader *infile)
void constructSpinorField(Float *res)
QudaGaugeParam newQudaGaugeParam(void)
QudaPreserveSource preserve_source