QUDA  0.9.0
invertmsrc_test.cpp
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <time.h>
4 #include <math.h>
5 #include <string.h>
6 
7 #include <util_quda.h>
8 #include <test_util.h>
9 #include <dslash_util.h>
10 #include <blas_reference.h>
13 #include "misc.h"
14 
15 #if defined(QMP_COMMS)
16 #include <qmp.h>
17 #elif defined(MPI_COMMS)
18 #include <mpi.h>
19 #endif
20 
21 #include <qio_field.h>
22 
23 #define MAX(a,b) ((a)>(b)?(a):(b))
24 
25 // In a typical application, quda.h is the only QUDA header required.
26 #include <quda.h>
27 
28 // Wilson, clover-improved Wilson, twisted mass, and domain wall are supported.
30 
31 // Twisted mass flavor type
33 
34 extern int device;
35 extern int xdim;
36 extern int ydim;
37 extern int zdim;
38 extern int tdim;
39 extern int Lsdim;
40 extern int gridsize_from_cmdline[];
42 extern QudaPrecision prec;
47 extern int multishift; // whether to test multi-shift or standard solver
48 extern double mass; // mass of Dirac operator
49 extern double anisotropy; // temporal anisotropy
50 extern double tol; // tolerance for inverter
51 extern double tol_hq; // heavy-quark tolerance for inverter
52 extern QudaMassNormalization normalization; // mass normalization of Dirac operators
53 extern QudaMatPCType matpc_type; // preconditioning type
54 
55 extern int niter; // max solver iterations
56 extern char latfile[];
57 
58 extern void usage(char** );
59 
60 
61 
62 void
64 {
65  printfQuda("running the following test:\n");
66 
67  printfQuda("prec prec_sloppy multishift matpc_type recon recon_sloppy S_dimension T_dimension Ls_dimension dslash_type normalization\n");
68  printfQuda("%6s %6s %d %12s %2s %2s %3d/%3d/%3d %3d %2d %14s %8s\n",
72  xdim, ydim, zdim, tdim, Lsdim,
75 
76  printfQuda("Grid partition info: X Y Z T\n");
77  printfQuda(" %d %d %d %d\n",
78  dimPartitioned(0),
79  dimPartitioned(1),
80  dimPartitioned(2),
81  dimPartitioned(3));
82 
83  return ;
84 
85 }
86 
87 
88 void
89 usage_extra(char** argv )
90 {
91 printfQuda("Extra options:\n");
92 printfQuda(" --num_src n # Numer of sources used\n");
93 
94 
95 return ;
96 }
97 
98 
99 int main(int argc, char **argv)
100 {
101 
102  int num_src=2;
103 
104  for (int i = 1; i < argc; i++){
105  if(process_command_line_option(argc, argv, &i) == 0){
106  continue;
107  }
108 
109 
110 
111 
112  if( strcmp(argv[i], "--num_src") == 0){
113  if (i+1 >= argc){
114  usage(argv);
115  }
116  num_src= atoi(argv[i+1]);
117  i++;
118  continue;
119  }
120 
121 
122  printfQuda("ERROR: Invalid option:%s\n", argv[i]);
123  usage(argv);
124  }
125 
127  prec_sloppy = prec;
128  }
131  }
132 
133  // initialize QMP/MPI, QUDA comms grid and RNG (test_util.cpp)
134  initComms(argc, argv, gridsize_from_cmdline);
135 
137 
138  // *** QUDA parameters begin here.
139 
147  printfQuda("dslash_type %d not supported\n", dslash_type);
148  exit(0);
149  }
150 
155 
158 
159  double kappa5;
160 
161  gauge_param.X[0] = xdim;
162  gauge_param.X[1] = ydim;
163  gauge_param.X[2] = zdim;
164  gauge_param.X[3] = tdim;
165  inv_param.Ls = 1;
166 
171 
180 
182 
183  inv_param.mass = mass;
184  inv_param.kappa = 1.0 / (2.0 * (1 + 3/gauge_param.anisotropy + mass));
185 
187  inv_param.mu = 0.12;
188  inv_param.epsilon = 0.1385;
191  } else if (dslash_type == QUDA_DOMAIN_WALL_DSLASH ||
193  inv_param.m5 = -1.8;
194  kappa5 = 0.5/(5 + inv_param.m5);
195  inv_param.Ls = Lsdim;
196  } else if (dslash_type == QUDA_MOBIUS_DWF_DSLASH) {
197  inv_param.m5 = -1.8;
198  kappa5 = 0.5/(5 + inv_param.m5);
199  inv_param.Ls = Lsdim;
200  for(int k = 0; k < Lsdim; k++)
201  {
202  // b5[k], c[k] values are chosen for arbitrary values,
203  // but the difference of them are same as 1.0
204  inv_param.b_5[k] = 1.452;
205  inv_param.c_5[k] = 0.452;
206  }
207  }
208 
209  // offsets used only by multi-shift solver
210  inv_param.num_offset = 12;
211  inv_param.num_src= num_src;
212  double offset[12] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12};
213  for (int i=0; i<inv_param.num_offset; i++) inv_param.offset[i] = offset[i];
214 
218  } else {
220  }
222 
226 
234  } else {
236  }
237 
238  inv_param.pipeline = 0;
239 
240  inv_param.Nsteps = 2;
241  inv_param.gcrNkrylov = 10;
242  inv_param.tol = tol;
243  inv_param.tol_restart = 1e-3; //now theoretical background for this parameter...
244  if(tol_hq == 0 && tol == 0){
245  errorQuda("qudaInvert: requesting zero residual\n");
246  exit(1);
247  }
248  // require both L2 relative and heavy quark residual to determine convergence
249  inv_param.residual_type = static_cast<QudaResidualType_s>(0);
250  inv_param.residual_type = (tol != 0) ? static_cast<QudaResidualType_s> ( inv_param.residual_type | QUDA_L2_RELATIVE_RESIDUAL) : inv_param.residual_type;
252 
253  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
254 
255  // these can be set individually
256  for (int i=0; i<inv_param.num_offset; i++) {
259  }
264 
265  // domain decomposition preconditioner parameters
267 
274  inv_param.omega = 1.0;
275 
282 
285 
286  gauge_param.ga_pad = 0; // 24*24*24/2;
287  inv_param.sp_pad = 0; // 24*24*24/2;
288  inv_param.cl_pad = 0; // 24*24*24/2;
289 
290  // For multi-GPU, ga_pad must be large enough to store a time-slice
291 #ifdef MULTI_GPU
292  int x_face_size = gauge_param.X[1]*gauge_param.X[2]*gauge_param.X[3]/2;
293  int y_face_size = gauge_param.X[0]*gauge_param.X[2]*gauge_param.X[3]/2;
294  int z_face_size = gauge_param.X[0]*gauge_param.X[1]*gauge_param.X[3]/2;
295  int t_face_size = gauge_param.X[0]*gauge_param.X[1]*gauge_param.X[2]/2;
296  int pad_size =MAX(x_face_size, y_face_size);
297  pad_size = MAX(pad_size, z_face_size);
298  pad_size = MAX(pad_size, t_face_size);
299  gauge_param.ga_pad = pad_size;
300 #endif
301 
309  }
310 
312 
313  // *** Everything between here and the call to initQuda() is
314  // *** application-specific.
315 
316  // set parameters for the reference Dslash, and prepare fields to be loaded
321  } else {
323  }
324 
325  setSpinorSiteSize(24);
326 
327  size_t gSize = (gauge_param.cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
328  size_t sSize = (inv_param.cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
329 
330  void *gauge[4], *clover_inv=0, *clover=0;
331 
332  for (int dir = 0; dir < 4; dir++) {
333  gauge[dir] = malloc(V*gaugeSiteSize*gSize);
334  }
335 
336  if (strcmp(latfile,"")) { // load in the command line supplied gauge field
339  } else { // else generate a random SU(3) field
341  }
342 
344  double norm = 0.0; // clover components are random numbers in the range (-norm, norm)
345  double diag = 1.0; // constant added to the diagonal
346 
347  size_t cSize = (inv_param.clover_cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
348  clover_inv = malloc(V*cloverSiteSize*cSize);
350 
351  // The uninverted clover term is only needed when solving the unpreconditioned
352  // system or when using "asymmetric" even/odd preconditioning.
353  int preconditioned = (inv_param.solve_type == QUDA_DIRECT_PC_SOLVE ||
355  int asymmetric = preconditioned &&
358  if (!preconditioned) {
359  clover = clover_inv;
360  clover_inv = NULL;
361  } else if (asymmetric) { // fake it by using the same random matrix
362  clover = clover_inv; // for both clover and clover_inv
363  } else {
364  clover = NULL;
365  }
366  }
367 
368 
369 
370  void **spinorIn = (void**)malloc(inv_param.num_src*sizeof(void *));
371  void **spinorCheck = (void**)malloc(inv_param.num_src*sizeof(void *));
372  for (int i=0; i<inv_param.num_src; i++) {
373  spinorIn[i] = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
374  spinorCheck[i] = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
375  }
376 
377  void **spinorOutMulti = NULL;
378 // if (multishift) {
379  spinorOutMulti = (void**)malloc(inv_param.num_src*sizeof(void *));
380  for (int i=0; i<inv_param.num_src; i++) {
381  spinorOutMulti[i] = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
382  }
383 // } else {
384 // spinorOut = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
385 // }
386 
387 
388 // if (multishift) {
389  for (int i=0; i<inv_param.num_src; i++) {
390  memset(spinorOutMulti[i], 0, inv_param.Ls*V*spinorSiteSize*sSize);
391  memset(spinorIn[i], 0, inv_param.Ls*V*spinorSiteSize*sSize);
392  memset(spinorCheck[i], 0, inv_param.Ls*V*spinorSiteSize*sSize);
393  }
394 // } else {
395 // memset(spinorOut, 0, inv_param.Ls*V*spinorSiteSize*sSize);
396 // }
397 
398  // create a point source at 0 (in each subvolume... FIXME)
399 
400  // create a point source at 0 (in each subvolume... FIXME)
401  for (int j=0; j<inv_param.num_src; j++) {
403  //((float*)spinorIn)[0] = 1.0;
404  for (int i=0; i<inv_param.Ls*V; i++) ((float*)spinorIn[j])[i*spinorSiteSize+j] = rand() / (float)RAND_MAX;
405  } else {
406  //((double*)spinorIn)[0] = 1.0;
407  for (int i=0; i<inv_param.Ls*V; i++) ((double*)spinorIn[j])[i*spinorSiteSize+j] = rand() / (double)RAND_MAX;
408  }
409  }
410  // start the timer
411  double time0 = -((double)clock());
412 
413  // initialize the QUDA library
414  initQuda(device);
415 
416  // load the gauge field
417  loadGaugeQuda((void*)gauge, &gauge_param);
418 
419  // load the clover term, if desired
421 
423 
424  // perform the inversion
425 // if (multishift) {
426 // invertMultiShiftQuda(spinorOutMulti, spinorIn, &inv_param);
427 // } else {
428  invertMultiSrcQuda(spinorOutMulti, spinorIn, &inv_param);
429 
430 
431  // stop the timer
432  time0 += clock();
433  time0 /= CLOCKS_PER_SEC;
434 
435  printfQuda("Device memory used:\n Spinor: %f GiB\n Gauge: %f GiB\n",
438  printfQuda(" Clover: %f GiB\n", inv_param.cloverGiB);
439  }
440  printfQuda("\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n",
442 
443  for(int i = 0; i < inv_param.num_src ; i++){
444  invertQuda(spinorOutMulti[i], spinorIn[i], &inv_param);
445  }
446 
447 // if (true) {
448 // if (inv_param.mass_normalization == QUDA_MASS_NORMALIZATION) {
449 // errorQuda("Mass normalization not supported for multi-shift solver in invert_test");
450 // }
451 //
452 // void *spinorTmp = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
453 //
454 // printfQuda("Host residuum checks: \n");
455 // for(int i=0; i < inv_param.num_src; i++) {
456 // ax(0, spinorCheck[i], V*spinorSiteSize, inv_param.cpu_prec);
457 //
458 // if (dslash_type == QUDA_TWISTED_MASS_DSLASH || dslash_type == QUDA_TWISTED_CLOVER_DSLASH) {
459 // if (inv_param.twist_flavor != QUDA_TWIST_SINGLET)
460 // errorQuda("Twisted mass solution type not supported");
461 // tm_matpc(spinorTmp, gauge, spinorOutMulti[i], inv_param.kappa, inv_param.mu, inv_param.twist_flavor,
462 // inv_param.matpc_type, 0, inv_param.cpu_prec, gauge_param);
463 // tm_matpc(spinorCheck[i], gauge, spinorTmp, inv_param.kappa, inv_param.mu, inv_param.twist_flavor,
464 // inv_param.matpc_type, 1, inv_param.cpu_prec, gauge_param);
465 // } else if (dslash_type == QUDA_WILSON_DSLASH || dslash_type == QUDA_CLOVER_WILSON_DSLASH) {
466 // wil_matpc(spinorTmp, gauge, spinorOutMulti[i], inv_param.kappa, inv_param.matpc_type, 0,
467 // inv_param.cpu_prec, gauge_param);
468 // wil_matpc(spinorCheck[i], gauge, spinorTmp, inv_param.kappa, inv_param.matpc_type, 1,
469 // inv_param.cpu_prec, gauge_param);
470 // } else {
471 // printfQuda("Domain wall not supported for multi-shift\n");
472 // exit(-1);
473 // }
474 //
475 // axpy(inv_param.offset[i], spinorOutMulti[i], spinorCheck, Vh*spinorSiteSize, inv_param.cpu_prec);
476 // mxpy(spinorIn, spinorCheck, Vh*spinorSiteSize, inv_param.cpu_prec);
477 // double nrm2 = norm_2(spinorCheck, Vh*spinorSiteSize, inv_param.cpu_prec);
478 // double src2 = norm_2(spinorIn, Vh*spinorSiteSize, inv_param.cpu_prec);
479 // double l2r = sqrt(nrm2 / src2);
480 //
481 // printfQuda("Shift %d residuals: (L2 relative) tol %g, QUDA = %g, host = %g; (heavy-quark) tol %g, QUDA = %g\n",
482 // i, inv_param.tol_offset[i], inv_param.true_res_offset[i], l2r,
483 // inv_param.tol_hq_offset[i], inv_param.true_res_hq_offset[i]);
484 // }
485 // free(spinorTmp);
486 // }
487 // #if 0
488 // else
489  for (int i=0; i <inv_param.num_src; i++){
490 
492 
495  tm_mat(spinorCheck[i], gauge, spinorOutMulti[i], inv_param.kappa, inv_param.mu, inv_param.twist_flavor, 0, inv_param.cpu_prec, gauge_param);
496  else
497  {
498  int tm_offset = V*spinorSiteSize; //12*spinorRef->Volume();
499  void *evenOut = spinorCheck[i];
500  void *oddOut = cpu_prec == sizeof(double) ? (void*)((double*)evenOut + tm_offset): (void*)((float*)evenOut + tm_offset);
501 
502  void *evenIn = spinorOutMulti[i];
503  void *oddIn = cpu_prec == sizeof(double) ? (void*)((double*)evenIn + tm_offset): (void*)((float*)evenIn + tm_offset);
504 
505  tm_ndeg_mat(evenOut, oddOut, gauge, evenIn, oddIn, inv_param.kappa, inv_param.mu, inv_param.epsilon, 0, inv_param.cpu_prec, gauge_param);
506  }
508  wil_mat(spinorCheck[i], gauge, spinorOutMulti[i], inv_param.kappa, 0, inv_param.cpu_prec, gauge_param);
509  } else if (dslash_type == QUDA_DOMAIN_WALL_DSLASH) {
510  dw_mat(spinorCheck[i], gauge, spinorOutMulti[i], kappa5, inv_param.dagger, inv_param.cpu_prec, gauge_param, inv_param.mass);
511 // } else if (dslash_type == QUDA_DOMAIN_WALL_4D_DSLASH) {
512 // dw_4d_mat(spinorCheck, gauge, spinorOut, kappa5, inv_param.dagger, inv_param.cpu_prec, gauge_param, inv_param.mass);
513 // } else if (dslash_type == QUDA_MOBIUS_DWF_DSLASH) {
514 // mdw_mat(spinorCheck, gauge, spinorOut, kappa5, inv_param.dagger, inv_param.cpu_prec, gauge_param, inv_param.mass);
515  } else {
516  printfQuda("Unsupported dslash_type\n");
517  exit(-1);
518  }
523  ax(0.5/kappa5, spinorCheck[i], V*spinorSiteSize*inv_param.Ls, inv_param.cpu_prec);
525  ax(0.5/inv_param.kappa, spinorCheck[i], 2*V*spinorSiteSize, inv_param.cpu_prec);
526  } else {
527  ax(0.5/inv_param.kappa, spinorCheck[i], V*spinorSiteSize, inv_param.cpu_prec);
528  }
529  }
530 
532 
535  errorQuda("Twisted mass solution type not supported");
536  tm_matpc(spinorCheck[i], gauge, spinorOutMulti[i], inv_param.kappa, inv_param.mu, inv_param.twist_flavor,
539  wil_matpc(spinorCheck[i], gauge, spinorOutMulti[i], inv_param.kappa, inv_param.matpc_type, 0,
541  } else if (dslash_type == QUDA_DOMAIN_WALL_DSLASH) {
542  dw_matpc(spinorCheck[i], gauge, spinorOutMulti[i], kappa5, inv_param.matpc_type, 0, inv_param.cpu_prec, gauge_param, inv_param.mass);
543  } else if (dslash_type == QUDA_DOMAIN_WALL_4D_DSLASH) {
544  dw_4d_matpc(spinorCheck[i], gauge, spinorOutMulti[i], kappa5, inv_param.matpc_type, 0, inv_param.cpu_prec, gauge_param, inv_param.mass);
545  } else if (dslash_type == QUDA_MOBIUS_DWF_DSLASH) {
546  double *kappa_b, *kappa_c;
547  kappa_b = (double*)malloc(Lsdim*sizeof(double));
548  kappa_c = (double*)malloc(Lsdim*sizeof(double));
549  for(int xs = 0 ; xs < Lsdim ; xs++)
550  {
551  kappa_b[xs] = 1.0/(2*(inv_param.b_5[xs]*(4.0 + inv_param.m5) + 1.0));
552  kappa_c[xs] = 1.0/(2*(inv_param.c_5[xs]*(4.0 + inv_param.m5) - 1.0));
553  }
554  mdw_matpc(spinorCheck[i], gauge, spinorOutMulti[i], kappa_b, kappa_c, inv_param.matpc_type, 0, inv_param.cpu_prec, gauge_param, inv_param.mass, inv_param.b_5, inv_param.c_5);
555  free(kappa_b);
556  free(kappa_c);
557  } else {
558  printfQuda("Unsupported dslash_type\n");
559  exit(-1);
560  }
561 
566  ax(0.25/(kappa5*kappa5), spinorCheck[i], V*spinorSiteSize*inv_param.Ls, inv_param.cpu_prec);
567  } else {
569 
570  }
571  }
572 
574 
575  void *spinorTmp = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
576 
577  ax(0, spinorCheck[i], V*spinorSiteSize, inv_param.cpu_prec);
578 
581  errorQuda("Twisted mass solution type not supported");
582  tm_matpc(spinorTmp, gauge, spinorOutMulti[i], inv_param.kappa, inv_param.mu, inv_param.twist_flavor,
587  wil_matpc(spinorTmp, gauge, spinorOutMulti[i], inv_param.kappa, inv_param.matpc_type, 0,
589  wil_matpc(spinorCheck[i], gauge, spinorTmp, inv_param.kappa, inv_param.matpc_type, 1,
591  } else {
592  printfQuda("Unsupported dslash_type\n");
593  exit(-1);
594  }
595 
597  errorQuda("Mass normalization not implemented");
598  }
599 
600  free(spinorTmp);
601  }
602 
603 
604  int vol = inv_param.solution_type == QUDA_MAT_SOLUTION ? V : Vh;
605  mxpy(spinorIn[i], spinorCheck[i], vol*spinorSiteSize*inv_param.Ls, inv_param.cpu_prec);
606  double nrm2 = norm_2(spinorCheck[i], vol*spinorSiteSize*inv_param.Ls, inv_param.cpu_prec);
607  double src2 = norm_2(spinorIn[i], vol*spinorSiteSize*inv_param.Ls, inv_param.cpu_prec);
608  double l2r = sqrt(nrm2 / src2);
609 
610 // printfQuda("Residuals: (L2 relative) tol %g, QUDA = %g, host = %g; (heavy-quark) tol %g, QUDA = %g\n",
611 // inv_param.tol, inv_param.true_res, l2r, inv_param.tol_hq, inv_param.true_res_hq);
612  printfQuda("rhs %d residuals: (L2 relative) tol %g, QUDA = %g, host = %g; (heavy-quark) tol %g, QUDA = %g\n",
615  }
616 
617  freeGaugeQuda();
619 
620  // finalize the QUDA library
621  endQuda();
622 
623  finalizeComms();
624 
625  return 0;
626 }
int maxiter_precondition
Definition: quda.h:267
double secs
Definition: quda.h:228
int dimPartitioned(int dim)
Definition: test_util.cpp:1686
QudaDiracFieldOrder dirac_order
Definition: quda.h:195
void usage_extra(char **argv)
QudaMassNormalization mass_normalization
Definition: quda.h:185
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:159
enum QudaMassNormalization_s QudaMassNormalization
QudaReconstructType reconstruct_sloppy
Definition: quda.h:46
double anisotropy
Definition: quda.h:31
void freeCloverQuda(void)
double b_5[QUDA_MAX_DWF_LS]
Definition: quda.h:102
void dw_4d_matpc(void *out, void **gauge, void *in, double kappa, QudaMatPCType matpc_type, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm)
void endQuda(void)
void free(void *)
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
Definition: test_util.cpp:1054
QudaDslashType dslash_type
Definition: test_util.cpp:1626
QudaSolveType solve_type
Definition: quda.h:182
QudaVerbosity verbosity_precondition
Definition: quda.h:261
enum QudaPrecision_s QudaPrecision
int ga_pad
Definition: quda.h:53
void dw_setDims(int *X, const int L5)
Definition: test_util.cpp:167
double mu
Definition: quda.h:105
QudaGaugeFixed gauge_fix
Definition: quda.h:51
QudaSchwarzType schwarz_type
Definition: quda.h:276
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
Definition: complex_quda.h:896
void tm_mat(void *out, void **gauge, void *in, double kappa, double mu, QudaTwistFlavorType flavor, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param)
QudaInverterType inv_type_precondition
Definition: quda.h:248
QudaLinkType type
Definition: quda.h:35
double kappa
Definition: quda.h:97
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
#define errorQuda(...)
Definition: util_quda.h:90
double tol
Definition: quda.h:110
QudaDslashType dslash_type
Definition: quda.h:93
QudaReconstructType reconstruct_precondition
Definition: quda.h:49
QudaInverterType inv_type
Definition: quda.h:94
QudaPrecision cuda_prec
Definition: quda.h:191
int tdim
Definition: test_util.cpp:1623
double c_5[QUDA_MAX_DWF_LS]
Definition: quda.h:103
#define cloverSiteSize
Definition: test_util.h:8
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
double tol_hq
Definition: test_util.cpp:1648
QudaPrecision cpu_prec
Definition: quda.h:190
int process_command_line_option(int argc, char **argv, int *idx)
Definition: test_util.cpp:1795
void tm_ndeg_mat(void *evenOut, void *oddOut, void **gauge, void *evenIn, void *oddIn, double kappa, double mu, double epsilon, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
QudaDagType dagger
Definition: quda.h:184
const char * get_matpc_str(QudaMatPCType type)
Definition: misc.cpp:987
void finalizeComms()
Definition: test_util.cpp:107
void ax(const double &a, ColorSpinorField &x)
Definition: blas_quda.cu:209
QudaGaugeParam gauge_param
QudaGaugeFieldOrder gauge_order
Definition: quda.h:36
void dw_mat(void *out, void **gauge, void *in, double kappa, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm)
void tm_matpc(void *outEven, void **gauge, void *inEven, double kappa, double mu, QudaTwistFlavorType flavor, QudaMatPCType matpc_type, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
const char * get_prec_str(QudaPrecision prec)
Definition: misc.cpp:704
void loadCloverQuda(void *h_clover, void *h_clovinv, QudaInvertParam *inv_param)
QudaPrecision & cuda_prec_precondition
#define spinorSiteSize
void usage(char **)
Definition: test_util.cpp:1693
void exit(int) __attribute__((noreturn))
QudaPrecision clover_cuda_prec_sloppy
Definition: quda.h:202
void setDims(int *)
Definition: test_util.cpp:130
QudaFieldLocation input_location
Definition: quda.h:90
void freeGaugeQuda(void)
double true_res_hq_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:168
double reliable_delta
Definition: quda.h:118
QudaPrecision cpu_prec
Definition: covdev_test.cpp:33
size_t size_t offset
static size_t gSize
Definition: llfat_test.cpp:36
int xdim
Definition: test_util.cpp:1620
double anisotropy
Definition: test_util.cpp:1644
QudaSolutionType solution_type
Definition: quda.h:181
else return(__swbuf(_c, _p))
QudaSolverNormalization solver_normalization
Definition: quda.h:186
int strcmp(const char *__s1, const char *__s2)
QudaPrecision clover_cuda_prec
Definition: quda.h:201
int precondition_cycle
Definition: quda.h:273
QudaInverterType precon_type
Definition: test_util.cpp:1639
void initQuda(int device)
void dw_matpc(void *out, void **gauge, void *in, double kappa, QudaMatPCType matpc_type, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm)
int Lsdim
Definition: test_util.cpp:1624
double spinorGiB
Definition: quda.h:225
QudaFieldLocation output_location
Definition: quda.h:91
void * malloc(size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(1)))
QudaPrecision clover_cuda_prec_precondition
Definition: quda.h:203
QudaInvertParam inv_param
Definition: covdev_test.cpp:37
QudaPrecision & cuda_prec_sloppy
double m5
Definition: quda.h:99
QudaPrecision cuda_prec
Definition: covdev_test.cpp:34
QudaPrecision cuda_prec_sloppy
Definition: quda.h:192
QudaVerbosity verbosity
Definition: quda.h:219
void setSpinorSiteSize(int n)
Definition: test_util.cpp:192
const char * get_mass_normalization_str(QudaMassNormalization type)
Definition: misc.cpp:943
double tol_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:156
double true_res_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:162
QudaInvertParam newQudaInvertParam(void)
double gflops
Definition: quda.h:227
const char * get_recon_str(QudaReconstructType recon)
Definition: misc.cpp:770
QudaPrecision cuda_prec_precondition
Definition: quda.h:48
QudaCloverFieldOrder clover_order
Definition: quda.h:205
int V
Definition: test_util.cpp:28
double tol_hq
Definition: quda.h:112
enum QudaMatPCType_s QudaMatPCType
#define gaugeSiteSize
Definition: test_util.h:6
double sqrt(double)
void mdw_matpc(void *out, void **gauge, void *in, double *kappa_b, double *kappa_c, QudaMatPCType matpc_type, int dagger, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm, double *b5, double *c5)
int multishift
Definition: test_util.cpp:1640
QudaGammaBasis gamma_basis
Definition: quda.h:197
QudaPrecision cuda_prec_sloppy
Definition: quda.h:45
const char * get_dslash_str(QudaDslashType type)
Definition: misc.cpp:878
double tol_precondition
Definition: quda.h:264
int niter
Definition: test_util.cpp:1630
double offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:153
int use_sloppy_partial_accumulator
Definition: quda.h:119
QudaReconstructType reconstruct
Definition: quda.h:43
QudaPrecision cuda_prec
Definition: quda.h:42
int X[4]
Definition: quda.h:29
double mass
Definition: quda.h:96
int gcrNkrylov
Definition: quda.h:237
char latfile[]
Definition: test_util.cpp:1627
double norm_2(void *v, int len, QudaPrecision precision)
QudaReconstructType link_recon_sloppy
Definition: test_util.cpp:1613
int rand(void) __attribute__((__availability__(swift
int ydim
Definition: test_util.cpp:1621
QudaMatPCType matpc_type
Definition: test_util.cpp:1652
int zdim
Definition: test_util.cpp:1622
void construct_clover_field(void *clover, double norm, double diag, QudaPrecision precision)
Definition: test_util.cpp:1166
void * memset(void *__b, int __c, size_t __len)
int max_res_increase
Definition: quda.h:134
QudaResidualType_s
Definition: enum_quda.h:165
QudaPrecision prec
Definition: test_util.cpp:1615
void wil_mat(void *out, void **gauge, void *in, double kappa, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param)
double gaugeGiB
Definition: quda.h:60
QudaPrecision cuda_prec_precondition
Definition: quda.h:193
double tol
Definition: test_util.cpp:1647
QudaInverterType inv_type
Definition: test_util.cpp:1638
double tol_restart
Definition: quda.h:111
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
void invertMultiSrcQuda(void **_hp_x, void **_hp_b, QudaInvertParam *param)
QudaTwistFlavorType twist_flavor
Definition: test_util.cpp:1649
if(err !=cudaSuccess)
#define printfQuda(...)
Definition: util_quda.h:84
QudaTboundary t_boundary
Definition: quda.h:38
QudaTwistFlavorType twist_flavor
Definition: quda.h:108
int atoi(const char *)
int Vh
Definition: test_util.cpp:29
enum QudaDslashType_s QudaDslashType
void mxpy(ColorSpinorField &x, ColorSpinorField &y)
Definition: blas_quda.cu:192
QudaResidualType residual_type
Definition: quda.h:286
void wil_matpc(void *outEven, void **gauge, void *inEven, double kappa, QudaMatPCType matpc_type, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
int num_offset
Definition: quda.h:146
int main(int argc, char **argv)
double cloverGiB
Definition: quda.h:226
clock_t clock(void) __asm("_" "clock")
QudaMassNormalization normalization
Definition: test_util.cpp:1651
QudaReconstructType link_recon
Definition: test_util.cpp:1612
double epsilon
Definition: quda.h:106
cpuColorSpinorField * spinorTmp
double omega
Definition: quda.h:270
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
Definition: qio_field.h:12
#define MAX(a, b)
QudaPrecision clover_cpu_prec
Definition: quda.h:200
int gridsize_from_cmdline[]
Definition: test_util.cpp:50
double mass
Definition: test_util.cpp:1642
void initComms(int argc, char **argv, const int *commDims)
Definition: test_util.cpp:72
QudaMatPCType matpc_type
Definition: quda.h:183
enum QudaInverterType_s QudaInverterType
double kappa5
QudaPrecision cpu_prec
Definition: quda.h:40
void display_test_info()
QudaPrecision prec_sloppy
Definition: test_util.cpp:1616
QudaGaugeParam newQudaGaugeParam(void)
QudaPreserveSource preserve_source
Definition: quda.h:188
double clover_coeff
Definition: quda.h:208
enum QudaTwistFlavorType_s QudaTwistFlavorType