QUDA  0.9.0
multigrid_evolve_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 
24 #include <gauge_field.h>
25 #include <gauge_tools.h>
26 #include <pgauge_monte.h>
27 #include <random_quda.h>
28 #include <unitarization_links.h>
29 
30 
31 #define MAX(a,b) ((a)>(b)?(a):(b))
32 
33 // In a typical application, quda.h is the only QUDA header required.
34 #include <quda.h>
35 
36 // Wilson, clover-improved Wilson, twisted mass, and domain wall are supported.
38 extern bool tune;
39 extern int device;
40 extern int xdim;
41 extern int ydim;
42 extern int zdim;
43 extern int tdim;
44 extern int Lsdim;
45 extern int gridsize_from_cmdline[];
47 extern QudaPrecision prec;
52 extern double mass;
53 extern double mu;
54 extern double anisotropy;
55 extern double tol; // tolerance for inverter
56 extern double tol_hq; // heavy-quark tolerance for inverter
57 extern char latfile[];
58 extern int niter;
59 extern int nvec[];
60 extern int mg_levels;
61 
62 extern bool generate_nullspace;
63 extern bool generate_all_levels;
64 extern int nu_pre;
65 extern int nu_post;
67 
69 
72 
73 extern char vec_infile[];
74 extern char vec_outfile[];
75 
76 //Twisted mass flavor type
78 
79 extern void usage(char** );
80 
81 extern double clover_coeff;
82 extern bool compute_clover;
83 
84 namespace quda {
85  extern void setTransferGPU(bool);
86 }
87 
88 void
90 {
91  printfQuda("running the following test:\n");
92 
93  printfQuda("prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension Ls_dimension\n");
94  printfQuda("%s %s %s %s %d/%d/%d %d %d\n",
98 
99  printfQuda("MG parameters\n");
100  printfQuda(" - number of levels %d\n", mg_levels);
101  for (int i=0; i<mg_levels-1; i++) printfQuda(" - level %d number of null-space vectors %d\n", i+1, nvec[i]);
102  printfQuda(" - number of pre-smoother applications %d\n", nu_pre);
103  printfQuda(" - number of post-smoother applications %d\n", nu_post);
104 
105  printfQuda("Grid partition info: X Y Z T\n");
106  printfQuda(" %d %d %d %d\n",
107  dimPartitioned(0),
108  dimPartitioned(1),
109  dimPartitioned(2),
110  dimPartitioned(3));
111 
112  return ;
113 
114 }
115 
120 
122  gauge_param.X[0] = xdim;
123  gauge_param.X[1] = ydim;
124  gauge_param.X[2] = zdim;
125  gauge_param.X[3] = tdim;
126 
131 
133 
136 
139 
142 
144 
145  gauge_param.ga_pad = 0;
146  // For multi-GPU, ga_pad must be large enough to store a time-slice
147 #ifdef MULTI_GPU
148  int x_face_size = gauge_param.X[1]*gauge_param.X[2]*gauge_param.X[3]/2;
149  int y_face_size = gauge_param.X[0]*gauge_param.X[2]*gauge_param.X[3]/2;
150  int z_face_size = gauge_param.X[0]*gauge_param.X[1]*gauge_param.X[3]/2;
151  int t_face_size = gauge_param.X[0]*gauge_param.X[1]*gauge_param.X[2]/2;
152  int pad_size =MAX(x_face_size, y_face_size);
153  pad_size = MAX(pad_size, z_face_size);
154  pad_size = MAX(pad_size, t_face_size);
155  gauge_param.ga_pad = pad_size;
156 #endif
157 }
158 
161 
162  inv_param.Ls = 1;
163 
164  inv_param.sp_pad = 0;
165  inv_param.cl_pad = 0;
166 
174 
182  }
183 
186 
188 
189  //Free field!
190  inv_param.mass = mass;
191  inv_param.kappa = 1.0 / (2.0 * (1 + 3/anisotropy + mass));
192 
194  inv_param.mu = mu;
197 
199  printfQuda("Twisted-mass doublet non supported (yet)\n");
200  exit(0);
201  }
202  }
203 
206 
209 
211 
212  mg_param.invert_param = &inv_param;
213  mg_param.n_level = mg_levels;
214  for (int i=0; i<mg_param.n_level; i++) {
215  for (int j=0; j<QUDA_MAX_DIM; j++) {
216  // if not defined use 4
217  mg_param.geo_block_size[i][j] = geo_block_size[i][j] ? geo_block_size[i][j] : 4;
218  }
219  mg_param.spin_block_size[i] = 1;
220  mg_param.n_vec[i] = nvec[i] == 0 ? 24 : nvec[i]; // default to 24 vectors if not set
221  mg_param.nu_pre[i] = nu_pre;
222  mg_param.nu_post[i] = nu_post;
223 
225 
226  mg_param.smoother[i] = smoother_type;
227 
228  // set the smoother / bottom solver tolerance (for MR smoothing this will be ignored)
229  mg_param.smoother_tol[i] = tol_hq; // repurpose heavy-quark tolerance for now
230 
231  mg_param.global_reduction[i] = QUDA_BOOLEAN_YES;
232 
233  // set to QUDA_DIRECT_SOLVE for no even/odd preconditioning on the smoother
234  // set to QUDA_DIRECT_PC_SOLVE for to enable even/odd preconditioning on the smoother
235  mg_param.smoother_solve_type[i] = QUDA_DIRECT_PC_SOLVE; // EVEN-ODD
236 
237  // set to QUDA_MAT_SOLUTION to inject a full field into coarse grid
238  // set to QUDA_MATPC_SOLUTION to inject single parity field into coarse grid
239 
240  // if we are using an outer even-odd preconditioned solve, then we
241  // use single parity injection into the coarse grid
243 
244  mg_param.omega[i] = 0.85; // over/under relaxation factor
245 
246  mg_param.location[i] = QUDA_CUDA_FIELD_LOCATION;
247  }
248 
249  // only coarsen the spin on the first restriction
250  mg_param.spin_block_size[0] = 2;
251 
252  // coarse grid solver is GCR
253  mg_param.smoother[mg_levels-1] = QUDA_GCR_INVERTER;
254 
257 
259 
260  mg_param.run_verify = QUDA_BOOLEAN_YES;
261 
262  // set file i/o parameters
263  strcpy(mg_param.vec_infile, vec_infile);
264  strcpy(mg_param.vec_outfile, vec_outfile);
265 
266  // these need to tbe set for now but are actually ignored by the MG setup
267  // needed to make it pass the initialization test
269  inv_param.tol = 1e-10;
270  inv_param.maxiter = 1000;
271  inv_param.reliable_delta = 1e-10;
272  inv_param.gcrNkrylov = 10;
273 
276 }
277 
279  inv_param.Ls = 1;
280 
281  inv_param.sp_pad = 0;
282  inv_param.cl_pad = 0;
283 
287 
292 
299  }
300 
303 
305 
306  //Free field!
307  inv_param.mass = mass;
308  inv_param.kappa = 1.0 / (2.0 * (1 + 3/anisotropy + mass));
309 
311  inv_param.mu = mu;
314 
316  printfQuda("Twisted-mass doublet non supported (yet)\n");
317  exit(0);
318  }
319  }
320 
322 
325 
326  // do we want full solution or single-parity solution
328 
329  // do we want to use an even-odd preconditioned solve or not
332 
334 
337 
338 
340  inv_param.gcrNkrylov = 20;
341  inv_param.tol = tol;
342 
343  // require both L2 relative and heavy quark residual to determine convergence
345  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
346 
347  // these can be set individually
348  for (int i=0; i<inv_param.num_offset; i++) {
351  }
354 
355  // domain decomposition preconditioner parameters
360  inv_param.omega = 1.0;
361 }
362 
364  using namespace quda;
365  const double unitarize_eps = 1e-14;
366  const double max_error = 1e-10;
367  const int reunit_allow_svd = 1;
368  const int reunit_svd_only = 0;
369  const double svd_rel_error = 1e-6;
370  const double svd_abs_error = 1e-6;
374 
375  }
376 
378  using namespace quda;
379  int *num_failures_dev = (int*)device_malloc(sizeof(int));
380  int num_failures;
381  cudaMemset(num_failures_dev, 0, sizeof(int));
382  unitarizeLinks(*cudaInGauge, num_failures_dev);
383 
384  cudaMemcpy(&num_failures, num_failures_dev, sizeof(int), cudaMemcpyDeviceToHost);
385  if(num_failures>0) errorQuda("Error in the unitarization\n");
387  }
388 
389 int main(int argc, char **argv)
390 {
391 
392  for (int i = 1; i < argc; i++){
393  if(process_command_line_option(argc, argv, &i) == 0){
394  continue;
395  }
396  printf("ERROR: Invalid option:%s\n", argv[i]);
397  usage(argv);
398  }
399 
404 
405  // initialize QMP/MPI, QUDA comms grid and RNG (test_util.cpp)
406  initComms(argc, argv, gridsize_from_cmdline);
407 
408  // call srand() with a rank-dependent seed
409  initRand();
410 
412 
413  // *** QUDA parameters begin here.
414 
419  printfQuda("dslash_type %d not supported\n", dslash_type);
420  exit(0);
421  }
422 
425 
426  QudaInvertParam mg_inv_param = newQudaInvertParam();
428  mg_param.invert_param = &mg_inv_param;
429 
430  setMultigridParam(mg_param);
431 
432 
435 
436  // *** Everything between here and the call to initQuda() is
437  // *** application-specific.
438 
440 
441  setSpinorSiteSize(24);
442 
443  size_t gSize = (gauge_param.cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
444  size_t sSize = (inv_param.cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
445 
446  void *gauge[4], *clover=0, *clover_inv=0;
447 
448  for (int dir = 0; dir < 4; dir++) {
449  gauge[dir] = malloc(V*gaugeSiteSize*gSize);
450  }
451 
452  if (strcmp(latfile,"")) { // load in the command line supplied gauge field
455  } else { // else generate a random SU(3) field
456  //generate a random SU(3) field
457  //construct_gauge_field(gauge, 1, gauge_param.cpu_prec, &gauge_param);
458  //generate a unit SU(3) field
460 
461  }
462 
464  double norm = 0.1; // clover components are random numbers in the range (-norm, norm)
465  double diag = 1.0; // constant added to the diagonal
466 
467  size_t cSize = inv_param.clover_cpu_prec;
468  clover = malloc(V*cloverSiteSize*cSize);
469  clover_inv = malloc(V*cloverSiteSize*cSize);
471 
476  }
477 
478  void *spinorIn = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
479  void *spinorCheck = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
480 
481  void *spinorOut = NULL;
483 
484  // start the timer
485  double time0 = -((double)clock());
486 
487  // initialize the QUDA library
488  initQuda(device);
489 
490  {
491  using namespace quda;
493  gParam.pad = 0;
500  cudaGaugeField *gauge = new cudaGaugeField(gParam);
501 
502  int pad = 0;
503  int y[4];
504  int R[4] = {0,0,0,0};
505  for(int dir=0; dir<4; ++dir) if(comm_dim_partitioned(dir)) R[dir] = 2;
506  for(int dir=0; dir<4; ++dir) y[dir] = gauge_param.X[dir] + 2 * R[dir];
507  GaugeFieldParam gParamEx(y, prec, link_recon,
509  gParamEx.create = QUDA_ZERO_FIELD_CREATE;
510  gParamEx.order = gParam.order;
511  gParamEx.siteSubset = QUDA_FULL_SITE_SUBSET;
512  gParamEx.t_boundary = gParam.t_boundary;
513  gParamEx.nFace = 1;
514  for(int dir=0; dir<4; ++dir) gParamEx.r[dir] = R[dir];
515  cudaGaugeField *gaugeEx = new cudaGaugeField(gParamEx);
516  int halfvolume = xdim*ydim*zdim*tdim >> 1;
517  // CURAND random generator initialization
518  RNG *randstates = new RNG(halfvolume, 1234, gauge_param.X);
519  randstates->Init();
520 
521  int nsteps = 100;
522  int nhbsteps = 1;
523  int novrsteps = 1;
524  bool coldstart = false;
525  double beta_value = 6.2;
526 
527  if(link_recon != QUDA_RECONSTRUCT_8 && coldstart) InitGaugeField( *gaugeEx);
528  else{
529  InitGaugeField( *gaugeEx, *randstates );
530  }
531  // Reunitarization setup
533  plaquette( *gaugeEx, QUDA_CUDA_FIELD_LOCATION) ;
534 
535  Monte( *gaugeEx, *randstates, beta_value, 100*nhbsteps, 100*novrsteps);
536 
537  // copy into regular field
538  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
539 
540  // load the gauge field from gauge
544 
545  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
546 
547  // setup the multigrid solver
548  void *mg_preconditioner = newMultigridQuda(&mg_param);
549  inv_param.preconditioner = mg_preconditioner;
550 
551  // create a point source at 0 (in each subvolume... FIXME)
552  memset(spinorIn, 0, inv_param.Ls*V*spinorSiteSize*sSize);
553  memset(spinorCheck, 0, inv_param.Ls*V*spinorSiteSize*sSize);
555 
557  for (int i=0; i<inv_param.Ls*V*spinorSiteSize; i++) ((float*)spinorIn)[i] = rand() / (float)RAND_MAX;
558  } else {
559  for (int i=0; i<inv_param.Ls*V*spinorSiteSize; i++) ((double*)spinorIn)[i] = rand() / (double)RAND_MAX;
560  }
561 
562  invertQuda(spinorOut, spinorIn, &inv_param);
563 
564  freeGaugeQuda();
565 
566  for(int step=1; step<=nsteps; ++step){
567  Monte( *gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
568 
569  //Reunitarize gauge links...
570  CallUnitarizeLinks(gaugeEx);
571  double3 plaq = plaquette( *gaugeEx, QUDA_CUDA_FIELD_LOCATION) ;
572  printfQuda("step=%d plaquette = %e\n", step, plaq.x);
573 
574  // copy into regular field
575  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
576 
577  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
578 
579  updateMultigridQuda(mg_preconditioner, &mg_param); // update the multigrid operator for and new gauge and clover fields
580 
581  invertQuda(spinorOut, spinorIn, &inv_param);
582 
583  freeGaugeQuda();
584  }
585 
586  // free the multigrid solver
587  destroyMultigridQuda(mg_preconditioner);
588 
589  delete gauge;
590  delete gaugeEx;
591  //Release all temporary memory used for data exchange between GPUs in multi-GPU mode
593 
594  randstates->Release();
595  delete randstates;
596  }
597 
598  // stop the timer
599  time0 += clock();
600  time0 /= CLOCKS_PER_SEC;
601 
602  printfQuda("Device memory used:\n Spinor: %f GiB\n Gauge: %f GiB\n",
605  //printfQuda("\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n",
606  //inv_param.iter, inv_param.secs, inv_param.gflops/inv_param.secs, time0);
607  printfQuda("\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n",
609 
610  freeGaugeQuda();
612 
613  // finalize the QUDA library
614  endQuda();
615 
616  // finalize the communications layer
617  finalizeComms();
618 
620  if (clover) free(clover);
621  if (clover_inv) free(clover_inv);
622  }
623 
624  for (int dir = 0; dir<4; dir++) free(gauge[dir]);
625 
626  return 0;
627 }
int maxiter_precondition
Definition: quda.h:267
double mass
Definition: test_util.cpp:1642
double tol
Definition: test_util.cpp:1647
double secs
Definition: quda.h:228
QudaTboundary t_boundary
Definition: gauge_field.h:18
int dimPartitioned(int dim)
Definition: test_util.cpp:1686
QudaMatPCType matpc_type
Definition: test_util.cpp:1652
QudaDiracFieldOrder dirac_order
Definition: quda.h:195
QudaMassNormalization mass_normalization
Definition: quda.h:185
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:159
QudaReconstructType reconstruct_sloppy
Definition: quda.h:46
double anisotropy
Definition: quda.h:31
void freeCloverQuda(void)
void Init()
Initialize CURAND RNG states.
Definition: random.cu:146
QudaSolveType solve_type
Definition: test_util.cpp:1653
QudaGhostExchange ghostExchange
Definition: lattice_field.h:60
void endQuda(void)
void free(void *)
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
Definition: test_util.cpp:1054
double3 plaquette(const GaugeField &U, QudaFieldLocation location)
Definition: gauge_plaq.cu:138
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
QudaMultigridParam newQudaMultigridParam(void)
int nu_post
Definition: test_util.cpp:1658
double mu
Definition: quda.h:105
int nu_pre
Definition: test_util.cpp:1657
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
QudaPrecision prec_sloppy
Definition: test_util.cpp:1616
enum QudaResidualType_s QudaResidualType
QudaInverterType inv_type_precondition
Definition: quda.h:248
bool compute_clover
Definition: test_util.cpp:1646
QudaLinkType type
Definition: quda.h:35
double kappa
Definition: quda.h:97
double clover_coeff
Definition: test_util.cpp:1645
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
#define errorQuda(...)
Definition: util_quda.h:90
double tol
Definition: quda.h:110
void setUnitarizeLinksConstants(double unitarize_eps, double max_error, bool allow_svd, bool svd_only, double svd_rel_error, double svd_abs_error)
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
#define cloverSiteSize
Definition: test_util.h:8
int return_clover_inverse
Definition: quda.h:217
int * num_failures_dev
QudaSolveType smoother_solve_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:426
enum QudaSolveType_s QudaSolveType
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
#define MAX(a, b)
QudaTwistFlavorType twist_flavor
Definition: test_util.cpp:1649
QudaPrecision cpu_prec
Definition: quda.h:190
int process_command_line_option(int argc, char **argv, int *idx)
Definition: test_util.cpp:1795
QudaPrecision & cuda_prec
void CallUnitarizeLinks(quda::cudaGaugeField *cudaInGauge)
void destroyMultigridQuda(void *mg_instance)
Free resources allocated by the multigrid solver.
char * strcpy(char *__dst, const char *__src)
double anisotropy
Definition: test_util.cpp:1644
bool generate_all_levels
Definition: test_util.cpp:1666
static int R[4]
QudaDagType dagger
Definition: quda.h:184
void finalizeComms()
Definition: test_util.cpp:107
QudaGaugeParam gauge_param
QudaGaugeFieldOrder gauge_order
Definition: quda.h:36
int tdim
Definition: test_util.cpp:1623
const char * get_prec_str(QudaPrecision prec)
Definition: misc.cpp:704
int return_clover
Definition: quda.h:216
#define spinorSiteSize
int num_failures
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
QudaPrecision & cuda_prec_precondition
void freeGaugeQuda(void)
double reliable_delta
Definition: quda.h:118
static size_t gSize
Definition: llfat_test.cpp:36
int niter
Definition: test_util.cpp:1630
int n_vec[QUDA_MAX_MG_LEVEL]
Definition: quda.h:407
QudaPrecision prec_precondition
Definition: test_util.cpp:1617
QudaDslashType dslash_type
Definition: test_util.cpp:1626
QudaSolutionType solution_type
Definition: quda.h:181
else return(__swbuf(_c, _p))
bool generate_nullspace
Definition: test_util.cpp:1665
int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
Definition: test_util.cpp:1668
int strcmp(const char *__s1, const char *__s2)
QudaPrecision clover_cuda_prec
Definition: quda.h:201
int precondition_cycle
Definition: quda.h:273
void * preconditioner
Definition: quda.h:251
double tol_hq
Definition: test_util.cpp:1648
bool tune
double mu
Definition: test_util.cpp:1643
QudaBoolean global_reduction[QUDA_MAX_MG_LEVEL]
Definition: quda.h:444
void usage(char **)
Definition: test_util.cpp:1693
void initQuda(int device)
double spinorGiB
Definition: quda.h:225
QudaFieldLocation output_location
Definition: quda.h:91
void unitarizeLinks(cudaGaugeField &outfield, const cudaGaugeField &infield, int *fails)
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
int printf(const char *,...) __attribute__((__format__(__printf__
char latfile[]
Definition: test_util.cpp:1627
QudaMultigridCycleType cycle_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:429
void PGaugeExchangeFree()
Release all allocated memory used to exchange data between nodes.
QudaPrecision prec
Definition: test_util.cpp:1615
void setTransferGPU(bool)
QudaPrecision cuda_prec_sloppy
Definition: quda.h:192
void Release()
Release Device memory for CURAND RNG states.
Definition: random.cu:168
QudaReconstructType link_recon
Definition: test_util.cpp:1612
QudaVerbosity verbosity
Definition: quda.h:219
int Lsdim
Definition: test_util.cpp:1624
void setSpinorSiteSize(int n)
Definition: test_util.cpp:192
double tol_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:156
int ydim
Definition: test_util.cpp:1621
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
Class declaration to initialize and hold CURAND RNG states.
Definition: random_quda.h:23
double omega[QUDA_MAX_MG_LEVEL]
Definition: quda.h:441
int V
Definition: test_util.cpp:28
double tol_hq
Definition: quda.h:112
enum QudaMatPCType_s QudaMatPCType
cpuColorSpinorField * spinorOut
Definition: covdev_test.cpp:41
#define gaugeSiteSize
Definition: test_util.h:6
void * newMultigridQuda(QudaMultigridParam *param)
QudaGaugeFieldOrder order
Definition: gauge_field.h:15
double smoother_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:438
QudaGammaBasis gamma_basis
Definition: quda.h:197
QudaInverterType smoother_type
Definition: test_util.cpp:1664
QudaPrecision cuda_prec_sloppy
Definition: quda.h:45
QudaReconstructType link_recon_precondition
Definition: test_util.cpp:1614
void setMultigridParam(QudaMultigridParam &mg_param)
void InitGaugeField(cudaGaugeField &data)
Perform a cold start to the gauge field, identity SU(3) matrix, also fills the ghost links in multi-G...
double tol_precondition
Definition: quda.h:264
char vec_outfile[]
Definition: test_util.cpp:1637
QudaBoolean run_verify
Definition: quda.h:456
QudaReconstructType reconstruct
Definition: quda.h:43
QudaPrecision cuda_prec
Definition: quda.h:42
int X[4]
Definition: quda.h:29
void updateMultigridQuda(void *mg_instance, QudaMultigridParam *param)
Updates the multigrid preconditioner for the new gauge / clover field.
double mass
Definition: quda.h:96
char vec_outfile[256]
Definition: quda.h:462
int gcrNkrylov
Definition: quda.h:237
int rand(void) __attribute__((__availability__(swift
int compute_clover_inverse
Definition: quda.h:215
QudaFieldLocation location[QUDA_MAX_MG_LEVEL]
Definition: quda.h:447
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 nvec[]
Definition: test_util.cpp:1635
QudaFieldLocation location
Definition: quda.h:27
int spin_block_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:404
double gaugeGiB
Definition: quda.h:60
QudaPrecision cuda_prec_precondition
Definition: quda.h:193
QudaSolutionType coarse_grid_solution_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:423
GaugeFieldParam gParam
int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
Definition: quda.h:401
void setInvertParam(QudaInvertParam &inv_param)
QudaBoolean generate_all_levels
Definition: quda.h:453
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
void initRand()
Definition: test_util.cpp:117
int nu_pre[QUDA_MAX_MG_LEVEL]
Definition: quda.h:432
#define QUDA_MAX_MG_LEVEL
Maximum number of multi-grid levels. This number may be increased if needed.
QudaLinkType link_type
Definition: gauge_field.h:17
#define printfQuda(...)
Definition: util_quda.h:84
QudaTboundary t_boundary
Definition: quda.h:38
QudaTwistFlavorType twist_flavor
Definition: quda.h:108
int xdim
Definition: test_util.cpp:1620
QudaPrecision & cuda_prec_sloppy
#define device_malloc(size)
Definition: malloc_quda.h:52
enum QudaDslashType_s QudaDslashType
int gridsize_from_cmdline[]
Definition: test_util.cpp:50
int main(int argc, char **argv)
QudaReconstructType reconstruct
Definition: gauge_field.h:14
QudaFieldCreate create
Definition: gauge_field.h:25
QudaResidualType residual_type
Definition: quda.h:286
int num_offset
Definition: quda.h:146
double cloverGiB
Definition: quda.h:226
clock_t clock(void) __asm("_" "clock")
int compute_clover
Definition: quda.h:214
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
int nu_post[QUDA_MAX_MG_LEVEL]
Definition: quda.h:435
double omega
Definition: quda.h:270
QudaComputeNullVector compute_null_vector
Definition: quda.h:450
void Monte(cudaGaugeField &data, RNG &rngstate, double Beta, int nhb, int nover)
Perform heatbath and overrelaxation. Performs nhb heatbath steps followed by nover overrelaxation ste...
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
Definition: qio_field.h:12
char vec_infile[]
Definition: test_util.cpp:1636
void display_test_info()
void setReunitarizationConsts()
QudaPrecision clover_cpu_prec
Definition: quda.h:200
char vec_infile[256]
Definition: quda.h:459
void initComms(int argc, char **argv, const int *commDims)
Definition: test_util.cpp:72
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
QudaInverterType smoother[QUDA_MAX_MG_LEVEL]
Definition: quda.h:419
QudaMatPCType matpc_type
Definition: quda.h:183
void setGaugeParam(QudaGaugeParam &gauge_param)
enum QudaInverterType_s QudaInverterType
QudaReconstructType link_recon_sloppy
Definition: test_util.cpp:1613
QudaPrecision cpu_prec
Definition: quda.h:40
int comm_dim_partitioned(int dim)
QudaPrecision & cpu_prec
int mg_levels
Definition: test_util.cpp:1655
QudaGaugeParam newQudaGaugeParam(void)
QudaPreserveSource preserve_source
Definition: quda.h:188
QudaInvertParam * invert_param
Definition: quda.h:395
#define device_free(ptr)
Definition: malloc_quda.h:57
double clover_coeff
Definition: quda.h:208
enum QudaTwistFlavorType_s QudaTwistFlavorType