QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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;
53 extern double mass;
54 extern double kappa; // kappa of Dirac operator
55 extern double mu;
56 extern double epsilon;
57 extern double anisotropy;
58 extern double tol; // tolerance for inverter
59 extern double tol_hq; // heavy-quark tolerance for inverter
60 extern double reliable_delta;
61 extern char latfile[];
62 extern int Nsrc; // number of spinors to apply to simultaneously
63 extern int niter;
64 extern int gcrNkrylov; // number of inner iterations for GCR, or l for BiCGstab-l
65 extern int pipeline; // length of pipeline for fused operations in GCR or BiCGstab-l
66 extern int nvec[];
67 extern int mg_levels;
68 
69 extern bool generate_nullspace;
70 extern bool generate_all_levels;
71 extern int nu_pre[QUDA_MAX_MG_LEVEL];
72 extern int nu_post[QUDA_MAX_MG_LEVEL];
74 extern QudaSolveType coarse_solve_type[QUDA_MAX_MG_LEVEL]; // type of solve to use in the smoothing on each level
75 extern QudaSolveType smoother_solve_type[QUDA_MAX_MG_LEVEL]; // type of solve to use in the smoothing on each level
77 extern double mu_factor[QUDA_MAX_MG_LEVEL];
78 
81 
84 
87 extern double setup_tol[QUDA_MAX_MG_LEVEL];
93 
96 extern bool pre_orthonormalize;
97 extern bool post_orthonormalize;
98 extern double omega;
101 
102 extern double coarse_solver_tol[QUDA_MAX_MG_LEVEL];
107 
108 
109 extern double smoother_tol[QUDA_MAX_MG_LEVEL];
111 
114 extern int schwarz_cycle[QUDA_MAX_MG_LEVEL];
115 
118 
119 extern char mg_vec_infile[QUDA_MAX_MG_LEVEL][256];
120 extern char mg_vec_outfile[QUDA_MAX_MG_LEVEL][256];
121 
122 //Twisted mass flavor type
124 
125 extern void usage(char** );
126 
127 extern double clover_coeff;
128 extern bool compute_clover;
129 
130 extern bool verify_results;
131 
132 namespace quda {
133  extern void setTransferGPU(bool);
134 }
135 
136 void
138 {
139  printfQuda("running the following test:\n");
140 
141  printfQuda("prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension Ls_dimension\n");
142  printfQuda("%s %s %s %s %d/%d/%d %d %d\n",
146 
147  printfQuda("MG parameters\n");
148  printfQuda(" - number of levels %d\n", mg_levels);
149  for (int i=0; i<mg_levels-1; i++) {
150  printfQuda(" - level %d number of null-space vectors %d\n", i+1, nvec[i]);
151  printfQuda(" - level %d number of pre-smoother applications %d\n", i+1, nu_pre[i]);
152  printfQuda(" - level %d number of post-smoother applications %d\n", i+1, nu_post[i]);
153  }
154 
155  printfQuda("Outer solver paramers\n");
156  printfQuda(" - pipeline = %d\n", pipeline);
157 
158  printfQuda("Grid partition info: X Y Z T\n");
159  printfQuda(" %d %d %d %d\n",
160  dimPartitioned(0),
161  dimPartitioned(1),
162  dimPartitioned(2),
163  dimPartitioned(3));
164 
165  return ;
166 
167 }
168 
173 
175  gauge_param.X[0] = xdim;
176  gauge_param.X[1] = ydim;
177  gauge_param.X[2] = zdim;
178  gauge_param.X[3] = tdim;
179 
180  gauge_param.anisotropy = anisotropy;
181  gauge_param.type = QUDA_WILSON_LINKS;
182  gauge_param.gauge_order = QUDA_QDP_GAUGE_ORDER;
183  gauge_param.t_boundary = QUDA_PERIODIC_T;
184 
185  gauge_param.cpu_prec = cpu_prec;
186 
187  gauge_param.cuda_prec = cuda_prec;
188  gauge_param.reconstruct = link_recon;
189 
190  gauge_param.cuda_prec_sloppy = cuda_prec_sloppy;
192 
195 
196  gauge_param.gauge_fix = QUDA_GAUGE_FIXED_NO;
197 
198  gauge_param.ga_pad = 0;
199  // For multi-GPU, ga_pad must be large enough to store a time-slice
200 #ifdef MULTI_GPU
201  int x_face_size = gauge_param.X[1]*gauge_param.X[2]*gauge_param.X[3]/2;
202  int y_face_size = gauge_param.X[0]*gauge_param.X[2]*gauge_param.X[3]/2;
203  int z_face_size = gauge_param.X[0]*gauge_param.X[1]*gauge_param.X[3]/2;
204  int t_face_size = gauge_param.X[0]*gauge_param.X[1]*gauge_param.X[2]/2;
205  int pad_size =MAX(x_face_size, y_face_size);
206  pad_size = MAX(pad_size, z_face_size);
207  pad_size = MAX(pad_size, t_face_size);
208  gauge_param.ga_pad = pad_size;
209 #endif
210 }
211 
214 
215  inv_param.Ls = 1;
216 
217  inv_param.sp_pad = 0;
218  inv_param.cl_pad = 0;
219 
220  inv_param.cpu_prec = cpu_prec;
221  inv_param.cuda_prec = cuda_prec;
226  inv_param.dirac_order = QUDA_DIRAC_ORDER;
227 
229  inv_param.clover_cpu_prec = cpu_prec;
230  inv_param.clover_cuda_prec = cuda_prec;
234  inv_param.clover_coeff = clover_coeff;
235  }
236 
239 
240  inv_param.dslash_type = dslash_type;
241 
242  if (kappa == -1.0) {
243  inv_param.mass = mass;
244  inv_param.kappa = 1.0 / (2.0 * (1 + 3/anisotropy + mass));
245  } else {
246  inv_param.kappa = kappa;
247  inv_param.mass = 0.5/kappa - (1 + 3/anisotropy);
248  }
249 
251  inv_param.mu = mu;
252  inv_param.epsilon = epsilon;
253  inv_param.twist_flavor = twist_flavor;
254  inv_param.Ls = (inv_param.twist_flavor == QUDA_TWIST_NONDEG_DOUBLET) ? 2 : 1;
255 
257  printfQuda("Twisted-mass doublet non supported (yet)\n");
258  exit(0);
259  }
260  }
261 
262  inv_param.dagger = QUDA_DAG_NO;
264 
265  inv_param.matpc_type = matpc_type;
266  inv_param.solution_type = QUDA_MAT_SOLUTION;
267 
268  inv_param.solve_type = QUDA_DIRECT_SOLVE;
269 
270  mg_param.invert_param = &inv_param;
271  mg_param.n_level = mg_levels;
272  for (int i=0; i<mg_param.n_level; i++) {
273  for (int j=0; j<QUDA_MAX_DIM; j++) {
274  // if not defined use 4
275  mg_param.geo_block_size[i][j] = geo_block_size[i][j] ? geo_block_size[i][j] : 4;
276  }
277  mg_param.spin_block_size[i] = 1;
278  mg_param.verbosity[i] = mg_verbosity[i];
279  mg_param.setup_inv_type[i] = setup_inv[i];
280  mg_param.num_setup_iter[i] = num_setup_iter[i];
281  mg_param.setup_tol[i] = setup_tol[i];
282  mg_param.setup_maxiter[i] = setup_maxiter[i];
283 
284  // Basis to use for CA-CGN(E/R) setup
285  mg_param.setup_ca_basis[i] = setup_ca_basis[i];
286 
287  // Basis size for CACG setup
288  mg_param.setup_ca_basis_size[i] = setup_ca_basis_size[i];
289 
290  // Minimum and maximum eigenvalue for Chebyshev CA basis setup
291  mg_param.setup_ca_lambda_min[i] = setup_ca_lambda_min[i];
292  mg_param.setup_ca_lambda_max[i] = setup_ca_lambda_max[i];
293 
295  mg_param.n_vec[i] = nvec[i] == 0 ? 24 : nvec[i]; // default to 24 vectors if not set
296  mg_param.n_block_ortho[i] = n_block_ortho[i]; // number of times to Gram-Schmidt
297  mg_param.precision_null[i] = prec_null; // precision to store the null-space basis
298  mg_param.smoother_halo_precision[i] = smoother_halo_prec; // precision of the halo exchange in the smoother
299  mg_param.nu_pre[i] = nu_pre[i];
300  mg_param.nu_post[i] = nu_post[i];
301  mg_param.mu_factor[i] = mu_factor[i];
302 
303  mg_param.cycle_type[i] = QUDA_MG_CYCLE_RECURSIVE;
304 
305  // set the coarse solver wrappers including bottom solver
306  mg_param.coarse_solver[i] = coarse_solver[i];
307  mg_param.coarse_solver_tol[i] = coarse_solver_tol[i];
309 
310  // Basis to use for CA-CGN(E/R) coarse solver
312 
313  // Basis size for CACG coarse solver/
315 
316  // Minimum and maximum eigenvalue for Chebyshev CA basis
319 
320  mg_param.smoother[i] = smoother_type[i];
321 
322  // set the smoother / bottom solver tolerance (for MR smoothing this will be ignored)
323  mg_param.smoother_tol[i] = smoother_tol[i];
324 
325  // set to QUDA_DIRECT_SOLVE for no even/odd preconditioning on the smoother
326  // set to QUDA_DIRECT_PC_SOLVE for to enable even/odd preconditioning on the smoother
327  mg_param.smoother_solve_type[i] = smoother_solve_type[i];
328 
329  // set to QUDA_ADDITIVE_SCHWARZ for Additive Schwarz precondioned smoother (presently only impelemented for MR)
330  mg_param.smoother_schwarz_type[i] = schwarz_type[i];
331 
332  // if using Schwarz preconditioning then use local reductions only
334 
335  // set number of Schwarz cycles to apply
336  mg_param.smoother_schwarz_cycle[i] = schwarz_cycle[i];
337 
338  // Set set coarse_grid_solution_type: this defines which linear
339  // system we are solving on a given level
340  // * QUDA_MAT_SOLUTION - we are solving the full system and inject
341  // a full field into coarse grid
342  // * QUDA_MATPC_SOLUTION - we are solving the e/o-preconditioned
343  // system, and only inject single parity field into coarse grid
344  //
345  // Multiple possible scenarios here
346  //
347  // 1. **Direct outer solver and direct smoother**: here we use
348  // full-field residual coarsening, and everything involves the
349  // full system so coarse_grid_solution_type = QUDA_MAT_SOLUTION
350  //
351  // 2. **Direct outer solver and preconditioned smoother**: here,
352  // only the smoothing uses e/o preconditioning, so
353  // coarse_grid_solution_type = QUDA_MAT_SOLUTION_TYPE.
354  // We reconstruct the full residual prior to coarsening after the
355  // pre-smoother, and then need to project the solution for post
356  // smoothing.
357  //
358  // 3. **Preconditioned outer solver and preconditioned smoother**:
359  // here we use single-parity residual coarsening throughout, so
360  // coarse_grid_solution_type = QUDA_MATPC_SOLUTION. This is a bit
361  // questionable from a theoretical point of view, since we don't
362  // coarsen the preconditioned operator directly, rather we coarsen
363  // the full operator and preconditioned that, but it just works.
364  // This is the optimal combination in general for Wilson-type
365  // operators: although there is an occasional increase in
366  // iteration or two), by working completely in the preconditioned
367  // space, we save the cost of reconstructing the full residual
368  // from the preconditioned smoother, and re-projecting for the
369  // subsequent smoother, as well as reducing the cost of the
370  // ancillary blas operations in the coarse-grid solve.
371  //
372  // Note, we cannot use preconditioned outer solve with direct
373  // smoother
374  //
375  // Finally, we have to treat the top level carefully: for all
376  // other levels the entry into and out of the grid will be a
377  // full-field, which we can then work in Schur complement space or
378  // not (e.g., freedom to choose coarse_grid_solution_type). For
379  // the top level, if the outer solver is for the preconditioned
380  // system, then we must use preconditoning, e.g., option 3.) above.
381 
382  if (i == 0) { // top-level treatment
383  if (coarse_solve_type[0] != solve_type)
384  errorQuda("Mismatch between top-level MG solve type %d and outer solve type %d", coarse_solve_type[0], solve_type);
385 
386  if (solve_type == QUDA_DIRECT_SOLVE) {
388  } else if (solve_type == QUDA_DIRECT_PC_SOLVE) {
390  } else {
391  errorQuda("Unexpected solve_type = %d\n", solve_type);
392  }
393 
394  } else {
395 
398  } else if (coarse_solve_type[i] == QUDA_DIRECT_PC_SOLVE) {
400  } else {
401  errorQuda("Unexpected solve_type = %d\n", coarse_solve_type[i]);
402  }
403 
404  }
405 
406  mg_param.omega[i] = 0.85; // over/under relaxation factor
407 
408  mg_param.location[i] = solver_location[i];
409  mg_param.setup_location[i] = setup_location[i];
410  }
411 
412  // only coarsen the spin on the first restriction
413  mg_param.spin_block_size[0] = 2;
414 
415  mg_param.setup_type = setup_type;
418 
421 
423 
425 
426  // set file i/o parameters
427  for (int i = 0; i < mg_param.n_level; i++) {
428  strcpy(mg_param.vec_infile[i], mg_vec_infile[i]);
429  strcpy(mg_param.vec_outfile[i], mg_vec_outfile[i]);
430  if (strcmp(mg_param.vec_infile[i], "") != 0) mg_param.vec_load[i] = QUDA_BOOLEAN_TRUE;
431  if (strcmp(mg_param.vec_outfile[i], "") != 0) mg_param.vec_store[i] = QUDA_BOOLEAN_TRUE;
432  }
433 
434  // these need to tbe set for now but are actually ignored by the MG setup
435  // needed to make it pass the initialization test
436  inv_param.inv_type = QUDA_GCR_INVERTER;
437  inv_param.tol = 1e-10;
438  inv_param.maxiter = 1000;
439  inv_param.reliable_delta = 1e-10;
440  inv_param.gcrNkrylov = 10;
441 
442  inv_param.verbosity = verbosity;
443  inv_param.verbosity_precondition = mg_verbosity[0];
444 }
445 
447  inv_param.Ls = 1;
448 
449  inv_param.sp_pad = 0;
450  inv_param.cl_pad = 0;
451 
452  inv_param.cpu_prec = cpu_prec;
453  inv_param.cuda_prec = cuda_prec;
455 
459  inv_param.dirac_order = QUDA_DIRAC_ORDER;
460 
462  inv_param.clover_cpu_prec = cpu_prec;
463  inv_param.clover_cuda_prec = cuda_prec;
467  }
468 
471 
472  inv_param.dslash_type = dslash_type;
473 
474  if (kappa == -1.0) {
475  inv_param.mass = mass;
476  inv_param.kappa = 1.0 / (2.0 * (1 + 3/anisotropy + mass));
477  } else {
478  inv_param.kappa = kappa;
479  inv_param.mass = 0.5/kappa - (1 + 3/anisotropy);
480  }
481 
483  inv_param.mu = mu;
484  inv_param.epsilon = epsilon;
485  inv_param.twist_flavor = twist_flavor;
486  inv_param.Ls = (inv_param.twist_flavor == QUDA_TWIST_NONDEG_DOUBLET) ? 2 : 1;
487 
489  printfQuda("Twisted-mass doublet non supported (yet)\n");
490  exit(0);
491  }
492  }
493 
494  inv_param.clover_coeff = clover_coeff;
495 
496  inv_param.dagger = QUDA_DAG_NO;
498 
499  // do we want full solution or single-parity solution
500  inv_param.solution_type = QUDA_MAT_SOLUTION;
501 
502  // do we want to use an even-odd preconditioned solve or not
503  inv_param.solve_type = solve_type;
504  inv_param.matpc_type = matpc_type;
505 
506  inv_param.inv_type = QUDA_GCR_INVERTER;
507 
508  inv_param.verbosity = verbosity;
509  inv_param.verbosity_precondition = mg_verbosity[0];
510 
511 
513  inv_param.pipeline = pipeline;
514  inv_param.gcrNkrylov = gcrNkrylov;
515  inv_param.tol = tol;
516 
517  // require both L2 relative and heavy quark residual to determine convergence
518  inv_param.residual_type = static_cast<QudaResidualType>(QUDA_L2_RELATIVE_RESIDUAL);
519  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
520 
521  // these can be set individually
522  for (int i=0; i<inv_param.num_offset; i++) {
523  inv_param.tol_offset[i] = inv_param.tol;
524  inv_param.tol_hq_offset[i] = inv_param.tol_hq;
525  }
526  inv_param.maxiter = niter;
527  inv_param.reliable_delta = reliable_delta;
528 
529  // domain decomposition preconditioner parameters
531  inv_param.precondition_cycle = 1;
532  inv_param.tol_precondition = 1e-1;
533  inv_param.maxiter_precondition = 1;
534  inv_param.omega = 1.0;
535 }
536 
538  using namespace quda;
539  const double unitarize_eps = 1e-14;
540  const double max_error = 1e-10;
541  const int reunit_allow_svd = 1;
542  const int reunit_svd_only = 0;
543  const double svd_rel_error = 1e-6;
544  const double svd_abs_error = 1e-6;
545  setUnitarizeLinksConstants(unitarize_eps, max_error,
546  reunit_allow_svd, reunit_svd_only,
547  svd_rel_error, svd_abs_error);
548 
549  }
550 
552  using namespace quda;
553  int *num_failures_dev = (int*)device_malloc(sizeof(int));
554  int num_failures;
555  cudaMemset(num_failures_dev, 0, sizeof(int));
556  unitarizeLinks(*cudaInGauge, num_failures_dev);
557 
558  cudaMemcpy(&num_failures, num_failures_dev, sizeof(int), cudaMemcpyDeviceToHost);
559  if(num_failures>0) errorQuda("Error in the unitarization\n");
560  device_free(num_failures_dev);
561  }
562 
563 int main(int argc, char **argv)
564 {
565  // We give here the default values to some of the array
566  for (int i =0; i<QUDA_MAX_MG_LEVEL; i++) {
569  num_setup_iter[i] = 1;
570  setup_tol[i] = 5e-6;
571  setup_maxiter[i] = 500;
572  setup_maxiter_refresh[i] = 100;
573  mu_factor[i] = 1.;
577  schwarz_cycle[i] = 1;
579  smoother_tol[i] = 0.25;
581  coarse_solver_tol[i] = 0.25;
582  coarse_solver_maxiter[i] = 10;
585  nu_pre[i] = 2;
586  nu_post[i] = 2;
587  n_block_ortho[i] = 1;
588 
590  setup_ca_basis_size[i] = 4;
591  setup_ca_lambda_min[i] = 0.0;
592  setup_ca_lambda_max[i] = -1.0; // use power iterations
593 
597  coarse_solver_ca_lambda_max[i] = -1.0;
598 
599  strcpy(mg_vec_infile[i], "");
600  strcpy(mg_vec_outfile[i], "");
601  }
602  reliable_delta = 1e-4;
603 
604  for (int i = 1; i < argc; i++){
605  if(process_command_line_option(argc, argv, &i) == 0){
606  continue;
607  }
608  printf("ERROR: Invalid option:%s\n", argv[i]);
609  usage(argv);
610  }
611 
618  for(int i =0; i<QUDA_MAX_MG_LEVEL; i++) {
621  }
622 
623  // initialize QMP/MPI, QUDA comms grid and RNG (test_util.cpp)
624  initComms(argc, argv, gridsize_from_cmdline);
625 
626  // call srand() with a rank-dependent seed
627  initRand();
628 
630 
631  // *** QUDA parameters begin here.
632 
637  printfQuda("dslash_type %d not supported\n", dslash_type);
638  exit(0);
639  }
640 
642  setGaugeParam(gauge_param);
643 
644  QudaInvertParam mg_inv_param = newQudaInvertParam();
646  mg_param.invert_param = &mg_inv_param;
647 
648  setMultigridParam(mg_param);
649 
650 
652  setInvertParam(inv_param);
653 
654  // *** Everything between here and the call to initQuda() is
655  // *** application-specific.
656 
657  setDims(gauge_param.X);
658 
659  setSpinorSiteSize(24);
660 
661  size_t gSize = (gauge_param.cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
662  size_t sSize = (inv_param.cpu_prec == QUDA_DOUBLE_PRECISION) ? sizeof(double) : sizeof(float);
663 
664  void *gauge[4], *clover=0, *clover_inv=0;
665 
666  for (int dir = 0; dir < 4; dir++) {
667  gauge[dir] = malloc(V*gaugeSiteSize*gSize);
668  }
669 
670  if (strcmp(latfile,"")) { // load in the command line supplied gauge field
671  read_gauge_field(latfile, gauge, gauge_param.cpu_prec, gauge_param.X, argc, argv);
672  construct_gauge_field(gauge, 2, gauge_param.cpu_prec, &gauge_param);
673  } else { // else generate a random SU(3) field
674  //generate a random SU(3) field
675  //construct_gauge_field(gauge, 1, gauge_param.cpu_prec, &gauge_param);
676  //generate a unit SU(3) field
677  construct_gauge_field(gauge, 0, gauge_param.cpu_prec, &gauge_param);
678 
679  }
680 
682  double norm = 0.1; // clover components are random numbers in the range (-norm, norm)
683  double diag = 1.0; // constant added to the diagonal
684 
685  size_t cSize = inv_param.clover_cpu_prec;
686  clover = malloc(V*cloverSiteSize*cSize);
687  clover_inv = malloc(V*cloverSiteSize*cSize);
688  if (!compute_clover) construct_clover_field(clover, norm, diag, inv_param.clover_cpu_prec);
689 
690  inv_param.compute_clover = compute_clover;
691  if (compute_clover) inv_param.return_clover = 1;
692  inv_param.compute_clover_inverse = 1;
693  inv_param.return_clover_inverse = 1;
694  }
695 
696  void *spinorIn = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
697  void *spinorCheck = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
698 
699  void *spinorOut = NULL;
700  spinorOut = malloc(V*spinorSiteSize*sSize*inv_param.Ls);
701 
702  // start the timer
703  double time0 = -((double)clock());
704 
705  // initialize the QUDA library
706  initQuda(device);
707 
708  {
709  using namespace quda;
710  GaugeFieldParam gParam(0, gauge_param);
711  gParam.pad = 0;
714  gParam.link_type = gauge_param.type;
715  gParam.reconstruct = gauge_param.reconstruct;
716  gParam.order = (gauge_param.cuda_prec == QUDA_DOUBLE_PRECISION || gauge_param.reconstruct == QUDA_RECONSTRUCT_NO )
718  cudaGaugeField *gauge = new cudaGaugeField(gParam);
719 
720  int pad = 0;
721  int y[4];
722  int R[4] = {0,0,0,0};
723  for(int dir=0; dir<4; ++dir) if(comm_dim_partitioned(dir)) R[dir] = 2;
724  for(int dir=0; dir<4; ++dir) y[dir] = gauge_param.X[dir] + 2 * R[dir];
725  GaugeFieldParam gParamEx(y, prec, link_recon,
727  gParamEx.create = QUDA_ZERO_FIELD_CREATE;
728  gParamEx.order = gParam.order;
729  gParamEx.siteSubset = QUDA_FULL_SITE_SUBSET;
730  gParamEx.t_boundary = gParam.t_boundary;
731  gParamEx.nFace = 1;
732  for(int dir=0; dir<4; ++dir) gParamEx.r[dir] = R[dir];
733  cudaGaugeField *gaugeEx = new cudaGaugeField(gParamEx);
734  // CURAND random generator initialization
735  RNG *randstates = new RNG(*gauge, 1234);
736  randstates->Init();
737 
738  int nsteps = 10;
739  int nhbsteps = 1;
740  int novrsteps = 1;
741  bool coldstart = false;
742  double beta_value = 6.2;
743 
744  if(link_recon != QUDA_RECONSTRUCT_8 && coldstart) InitGaugeField( *gaugeEx);
745  else{
746  InitGaugeField( *gaugeEx, *randstates );
747  }
748  // Reunitarization setup
750  plaquette(*gaugeEx);
751 
752  Monte(*gaugeEx, *randstates, beta_value, 100 * nhbsteps, 100 * novrsteps);
753 
754  // copy into regular field
755  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
756 
757  // load the gauge field from gauge
758  gauge_param.gauge_order = (gauge_param.cuda_prec == QUDA_DOUBLE_PRECISION || gauge_param.reconstruct == QUDA_RECONSTRUCT_NO )
760  gauge_param.location = QUDA_CUDA_FIELD_LOCATION;
761 
762  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
763  double3 plaq = plaquette(*gaugeEx);
764  double charge = qChargeQuda();
765  printfQuda("step=0 plaquette = %e topological charge = %e\n", plaq.x, charge);
766 
767  // create a point source at 0 (in each subvolume... FIXME)
768  memset(spinorIn, 0, inv_param.Ls*V*spinorSiteSize*sSize);
769  memset(spinorCheck, 0, inv_param.Ls*V*spinorSiteSize*sSize);
770  memset(spinorOut, 0, inv_param.Ls*V*spinorSiteSize*sSize);
771 
772  if (inv_param.cpu_prec == QUDA_SINGLE_PRECISION) {
773  for (int i=0; i<inv_param.Ls*V*spinorSiteSize; i++) ((float*)spinorIn)[i] = rand() / (float)RAND_MAX;
774  } else {
775  for (int i=0; i<inv_param.Ls*V*spinorSiteSize; i++) ((double*)spinorIn)[i] = rand() / (double)RAND_MAX;
776  }
777 
778  // do reference BiCGStab solve
779  QudaInvertParam inv_param2 = inv_param;
780  inv_param2.inv_type = QUDA_BICGSTABL_INVERTER;
781  inv_param2.gcrNkrylov = 4;
783  inv_param2.reliable_delta = 0.1;
784  inv_param2.maxiter = 10000;
785  inv_param2.chrono_use_resident = true;
786  inv_param2.chrono_make_resident = true;
787  inv_param2.chrono_index = 0 ;
788  inv_param2.chrono_max_dim = 7;
789  inv_param2.chrono_precision = inv_param2.cuda_prec_sloppy; // use sloppy precision for chrono basis
791 
792  invertQuda(spinorOut, spinorIn, &inv_param2);
793 
794  // setup the multigrid solver
795  void *mg_preconditioner = newMultigridQuda(&mg_param);
796  inv_param.preconditioner = mg_preconditioner;
797 
798  invertQuda(spinorOut, spinorIn, &inv_param);
799 
800  freeGaugeQuda();
801 
802  for(int step=1; step<=nsteps; ++step){
803  Monte( *gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
804 
805  //Reunitarize gauge links...
806  CallUnitarizeLinks(gaugeEx);
807 
808  // copy into regular field
809  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
810 
811  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
812  plaq = plaquette(*gaugeEx);
813  charge = qChargeQuda();
814  printfQuda("step=%d plaquette = %e topological charge = %e\n", step, plaq.x, charge);
815 
816  // reference BiCGStab for comparison
817  invertQuda(spinorOut, spinorIn, &inv_param2);
818 
819  if (1) {
820  updateMultigridQuda(mg_preconditioner, &mg_param); // update the multigrid operator for new gauge and clover fields
821  } else {
822  destroyMultigridQuda(mg_preconditioner);
823  mg_preconditioner = newMultigridQuda(&mg_param);
824  inv_param.preconditioner = mg_preconditioner;
825  }
826  invertQuda(spinorOut, spinorIn, &inv_param);
827 
828  if (inv_param.iter == inv_param.maxiter) {
829  char vec_outfile[QUDA_MAX_MG_LEVEL][256];
830  for (int i=0; i<mg_param.n_level; i++) {
831  strcpy(vec_outfile[i], mg_param.vec_outfile[i]);
832  sprintf(mg_param.vec_outfile[i], "dump_step_%d", step);
833  }
834  warningQuda("Solver failed to converge within max iteration count - dumping null vectors to %s",
835  mg_param.vec_outfile[0]);
836 
837  dumpMultigridQuda(mg_preconditioner, &mg_param);
838  for (int i=0; i<mg_param.n_level; i++) {
839  strcpy(mg_param.vec_outfile[i], vec_outfile[i]); // restore output file name
840  }
841  }
842 
843  freeGaugeQuda();
844  }
845 
846  // free the multigrid solver
847  destroyMultigridQuda(mg_preconditioner);
848 
849  delete gauge;
850  delete gaugeEx;
851  //Release all temporary memory used for data exchange between GPUs in multi-GPU mode
853 
854  randstates->Release();
855  delete randstates;
856  }
857 
858  // stop the timer
859  time0 += clock();
860  time0 /= CLOCKS_PER_SEC;
861 
862  //printfQuda("\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n",
863  //inv_param.iter, inv_param.secs, inv_param.gflops/inv_param.secs, time0);
864  printfQuda("\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n",
865  inv_param.iter, inv_param.secs, inv_param.gflops/inv_param.secs, 0.0);
866 
867  freeGaugeQuda();
869 
870  // finalize the QUDA library
871  endQuda();
872 
873  // finalize the communications layer
874  finalizeComms();
875 
877  if (clover) free(clover);
878  if (clover_inv) free(clover_inv);
879  }
880 
881  for (int dir = 0; dir<4; dir++) free(gauge[dir]);
882 
883  return 0;
884 }
int maxiter_precondition
Definition: quda.h:292
double mass
Definition: test_util.cpp:1646
double tol
Definition: test_util.cpp:1656
static bool reunit_allow_svd
static size_t gSize
double secs
Definition: quda.h:251
QudaTboundary t_boundary
Definition: gauge_field.h:20
int dimPartitioned(int dim)
Definition: test_util.cpp:1776
QudaMatPCType matpc_type
Definition: test_util.cpp:1662
QudaDiracFieldOrder dirac_order
Definition: quda.h:219
QudaMassNormalization mass_normalization
Definition: quda.h:208
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:182
QudaReconstructType reconstruct_sloppy
Definition: quda.h:53
double anisotropy
Definition: quda.h:38
void freeCloverQuda(void)
void Init()
Initialize CURAND RNG states.
Definition: random.cu:122
QudaSolveType solve_type
Definition: test_util.cpp:1663
QudaGhostExchange ghostExchange
Definition: lattice_field.h:76
void endQuda(void)
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
Definition: test_util.cpp:1047
QudaSolveType solve_type
Definition: quda.h:205
QudaVerbosity verbosity_precondition
Definition: quda.h:286
enum QudaPrecision_s QudaPrecision
int ga_pad
Definition: quda.h:63
double setup_ca_lambda_max[QUDA_MAX_MG_LEVEL]
Definition: quda.h:528
QudaMultigridParam newQudaMultigridParam(void)
int device
Definition: test_util.cpp:1602
double mu
Definition: quda.h:114
QudaGaugeFixed gauge_fix
Definition: quda.h:61
QudaSchwarzType schwarz_type
Definition: quda.h:310
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
QudaPrecision prec_sloppy
Definition: test_util.cpp:1609
enum QudaResidualType_s QudaResidualType
QudaInverterType inv_type_precondition
Definition: quda.h:270
bool compute_clover
Definition: test_util.cpp:1654
QudaLinkType type
Definition: quda.h:42
double kappa
Definition: quda.h:106
int pipeline
Definition: test_util.cpp:1634
double clover_coeff
Definition: test_util.cpp:1653
int setup_maxiter_refresh[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1682
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
#define errorQuda(...)
Definition: util_quda.h:121
double tol
Definition: quda.h:121
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:102
QudaReconstructType reconstruct_precondition
Definition: quda.h:59
QudaInverterType inv_type
Definition: quda.h:103
QudaPrecision cuda_prec
Definition: quda.h:214
#define cloverSiteSize
Definition: test_util.h:9
int return_clover_inverse
Definition: quda.h:242
int * num_failures_dev
QudaSolveType smoother_solve_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:589
QudaCABasis coarse_solver_ca_basis[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1697
QudaSetupType setup_type
Definition: quda.h:531
enum QudaSolveType_s QudaSolveType
double setup_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:510
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
#define MAX(a, b)
int num_setup_iter[QUDA_MAX_MG_LEVEL]
Definition: quda.h:507
QudaTwistFlavorType twist_flavor
Definition: test_util.cpp:1660
QudaPrecision cpu_prec
Definition: quda.h:213
int process_command_line_option(int argc, char **argv, int *idx)
Definition: test_util.cpp:2019
double coarse_solver_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:543
QudaPrecision & cuda_prec
QudaBoolean pre_orthonormalize
Definition: quda.h:534
QudaSchwarzType smoother_schwarz_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:579
void CallUnitarizeLinks(quda::cudaGaugeField *cudaInGauge)
void destroyMultigridQuda(void *mg_instance)
Free resources allocated by the multigrid solver.
double anisotropy
Definition: test_util.cpp:1650
QudaBoolean vec_load[QUDA_MAX_MG_LEVEL]
Definition: quda.h:627
bool generate_all_levels
Definition: test_util.cpp:1702
static int R[4]
QudaDagType dagger
Definition: quda.h:207
void finalizeComms()
Definition: test_util.cpp:128
double setup_ca_lambda_min[QUDA_MAX_MG_LEVEL]
Definition: quda.h:525
QudaGaugeParam gauge_param
int gcrNkrylov
Definition: test_util.cpp:1630
QudaPrecision smoother_halo_precision[QUDA_MAX_MG_LEVEL]
Definition: quda.h:576
QudaGaugeFieldOrder gauge_order
Definition: quda.h:43
int tdim
Definition: test_util.cpp:1618
const char * get_prec_str(QudaPrecision prec)
Definition: misc.cpp:701
int return_clover
Definition: quda.h:241
#define spinorSiteSize
double mu_factor[QUDA_MAX_MG_LEVEL]
Definition: quda.h:648
QudaSchwarzType schwarz_type[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1703
int num_failures
double kappa
Definition: test_util.cpp:1647
int chrono_index
Definition: quda.h:365
QudaPrecision clover_cuda_prec_sloppy
Definition: quda.h:226
void setDims(int *)
Definition: test_util.cpp:151
QudaPrecision chrono_precision
Definition: quda.h:368
QudaFieldLocation input_location
Definition: quda.h:99
QudaPrecision & cuda_prec_precondition
void freeGaugeQuda(void)
QudaCABasis setup_ca_basis[QUDA_MAX_MG_LEVEL]
Definition: quda.h:519
double reliable_delta
Definition: quda.h:129
QudaUseInitGuess use_init_guess
Definition: quda.h:231
int niter
Definition: test_util.cpp:1629
int n_vec[QUDA_MAX_MG_LEVEL]
Definition: quda.h:492
QudaPrecision prec_precondition
Definition: test_util.cpp:1611
QudaDslashType dslash_type
Definition: test_util.cpp:1621
int coarse_solver_maxiter[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1696
QudaSolutionType solution_type
Definition: quda.h:204
QudaFieldLocation setup_location[QUDA_MAX_MG_LEVEL]
Definition: quda.h:601
bool generate_nullspace
Definition: test_util.cpp:1701
int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
Definition: test_util.cpp:1706
static double svd_rel_error
QudaPrecision clover_cuda_prec
Definition: quda.h:225
int precondition_cycle
Definition: quda.h:307
void * preconditioner
Definition: quda.h:273
double tol_hq
Definition: test_util.cpp:1657
bool tune
double epsilon
Definition: test_util.cpp:1649
int num_setup_iter[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1679
int chrono_use_resident
Definition: quda.h:359
double mu
Definition: test_util.cpp:1648
QudaBoolean global_reduction[QUDA_MAX_MG_LEVEL]
Definition: quda.h:595
void usage(char **)
Definition: test_util.cpp:1783
int Nsrc
Definition: test_util.cpp:1627
void initQuda(int device)
int coarse_solver_maxiter[QUDA_MAX_MG_LEVEL]
Definition: quda.h:546
QudaFieldLocation output_location
Definition: quda.h:100
void unitarizeLinks(cudaGaugeField &outfield, const cudaGaugeField &infield, int *fails)
QudaPrecision clover_cuda_prec_precondition
Definition: quda.h:228
QudaFieldLocation solver_location[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1668
QudaInvertParam inv_param
Definition: covdev_test.cpp:37
char latfile[]
Definition: test_util.cpp:1623
QudaBoolean post_orthonormalize
Definition: quda.h:537
QudaMultigridCycleType cycle_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:592
void PGaugeExchangeFree()
Release all allocated memory used to exchange data between nodes.
QudaPrecision prec
Definition: test_util.cpp:1608
void setTransferGPU(bool)
int coarse_solver_ca_basis_size[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1698
QudaSolveType smoother_solve_type[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1678
QudaInverterType smoother_type[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1693
QudaPrecision prec_null
Definition: test_util.cpp:1612
QudaPrecision cuda_prec_sloppy
Definition: quda.h:215
void Release()
Release Device memory for CURAND RNG states.
Definition: random.cu:145
QudaReconstructType link_recon
Definition: test_util.cpp:1605
QudaVerbosity verbosity
Definition: quda.h:244
int Lsdim
Definition: test_util.cpp:1619
void setSpinorSiteSize(int n)
Definition: test_util.cpp:211
int setup_maxiter[QUDA_MAX_MG_LEVEL]
Definition: quda.h:513
static bool reunit_svd_only
void dumpMultigridQuda(void *mg_instance, QudaMultigridParam *param)
Dump the null-space vectors to disk.
double tol_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:179
int ydim
Definition: test_util.cpp:1616
QudaInvertParam newQudaInvertParam(void)
double gflops
Definition: quda.h:250
const char * get_recon_str(QudaReconstructType recon)
Definition: misc.cpp:768
QudaPrecision cuda_prec_precondition
Definition: quda.h:58
double coarse_solver_ca_lambda_max[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1700
QudaCloverFieldOrder clover_order
Definition: quda.h:230
Class declaration to initialize and hold CURAND RNG states.
Definition: random_quda.h:23
double omega[QUDA_MAX_MG_LEVEL]
Definition: quda.h:573
double tol_hq
Definition: quda.h:123
enum QudaMatPCType_s QudaMatPCType
cpuColorSpinorField * spinorOut
Definition: covdev_test.cpp:41
double setup_ca_lambda_min[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1685
void * newMultigridQuda(QudaMultigridParam *param)
QudaGaugeFieldOrder order
Definition: gauge_field.h:17
double omega
Definition: test_util.cpp:1690
#define warningQuda(...)
Definition: util_quda.h:133
double smoother_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:564
QudaGammaBasis gamma_basis
Definition: quda.h:221
double setup_ca_lambda_max[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1686
QudaPrecision precision_null[QUDA_MAX_MG_LEVEL]
Definition: quda.h:495
enum QudaSchwarzType_s QudaSchwarzType
QudaPrecision cuda_prec_sloppy
Definition: quda.h:52
QudaReconstructType link_recon_precondition
Definition: test_util.cpp:1607
int chrono_make_resident
Definition: quda.h:353
QudaVerbosity verbosity[QUDA_MAX_MG_LEVEL]
Definition: quda.h:501
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:289
static double svd_abs_error
QudaInverterType coarse_solver[QUDA_MAX_MG_LEVEL]
Definition: quda.h:540
QudaInverterType setup_inv[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1676
QudaBoolean run_verify
Definition: quda.h:618
QudaFieldLocation setup_location[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1669
QudaReconstructType reconstruct
Definition: quda.h:50
QudaPrecision cuda_prec
Definition: quda.h:49
int X[4]
Definition: quda.h:36
void updateMultigridQuda(void *mg_instance, QudaMultigridParam *param)
Updates the multigrid preconditioner for the new gauge / clover field.
double mass
Definition: quda.h:105
QudaInverterType coarse_solver[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1691
int gcrNkrylov
Definition: quda.h:259
double smoother_tol[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1695
QudaBoolean vec_store[QUDA_MAX_MG_LEVEL]
Definition: quda.h:633
char mg_vec_outfile[QUDA_MAX_MG_LEVEL][256]
Definition: test_util.cpp:1639
int V
Definition: test_util.cpp:27
int compute_clover_inverse
Definition: quda.h:240
void * memset(void *s, int c, size_t n)
double coarse_solver_tol[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1692
QudaFieldLocation location[QUDA_MAX_MG_LEVEL]
Definition: quda.h:598
int n_block_ortho[QUDA_MAX_MG_LEVEL]
Definition: quda.h:498
QudaSetupType setup_type
Definition: test_util.cpp:1687
int zdim
Definition: test_util.cpp:1617
void construct_clover_field(void *clover, double norm, double diag, QudaPrecision precision)
Definition: test_util.cpp:1167
int smoother_schwarz_cycle[QUDA_MAX_MG_LEVEL]
Definition: quda.h:582
char vec_outfile[QUDA_MAX_MG_LEVEL][256]
Definition: quda.h:636
int nvec[]
Definition: test_util.cpp:1637
enum QudaFieldLocation_s QudaFieldLocation
QudaFieldLocation location
Definition: quda.h:34
int spin_block_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:489
int nu_pre[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1671
QudaPrecision smoother_halo_prec
Definition: test_util.cpp:1694
double coarse_solver_ca_lambda_max[QUDA_MAX_MG_LEVEL]
Definition: quda.h:558
bool pre_orthonormalize
Definition: test_util.cpp:1688
QudaPrecision cuda_prec_precondition
Definition: quda.h:217
QudaSolutionType coarse_grid_solution_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:586
GaugeFieldParam gParam
bool verify_results
Definition: test_util.cpp:1643
int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
Definition: quda.h:486
void setInvertParam(QudaInvertParam &inv_param)
QudaBoolean generate_all_levels
Definition: quda.h:615
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
void initRand()
Definition: test_util.cpp:138
static double unitarize_eps
int nu_pre[QUDA_MAX_MG_LEVEL]
Definition: quda.h:567
enum QudaCABasis_s QudaCABasis
#define QUDA_MAX_MG_LEVEL
Maximum number of multi-grid levels. This number may be increased if needed.
enum QudaSetupType_s QudaSetupType
QudaLinkType link_type
Definition: gauge_field.h:19
bool post_orthonormalize
Definition: test_util.cpp:1689
int setup_ca_basis_size[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1684
double setup_tol[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1680
int coarse_solver_ca_basis_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:552
QudaCABasis coarse_solver_ca_basis[QUDA_MAX_MG_LEVEL]
Definition: quda.h:549
#define printfQuda(...)
Definition: util_quda.h:115
QudaTboundary t_boundary
Definition: quda.h:45
QudaTwistFlavorType twist_flavor
Definition: quda.h:117
char vec_infile[QUDA_MAX_MG_LEVEL][256]
Definition: quda.h:630
int schwarz_cycle[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1704
int xdim
Definition: test_util.cpp:1615
int chrono_max_dim
Definition: quda.h:362
QudaPrecision & cuda_prec_sloppy
double qChargeQuda()
double mu_factor[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1674
#define device_malloc(size)
Definition: malloc_quda.h:64
enum QudaDslashType_s QudaDslashType
int gridsize_from_cmdline[]
Definition: test_util.cpp:49
int main(int argc, char **argv)
QudaReconstructType reconstruct
Definition: gauge_field.h:16
QudaFieldCreate create
Definition: gauge_field.h:26
int setup_maxiter_refresh[QUDA_MAX_MG_LEVEL]
Definition: quda.h:516
int setup_maxiter[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1681
QudaResidualType residual_type
Definition: quda.h:320
int num_offset
Definition: quda.h:169
enum QudaVerbosity_s QudaVerbosity
int compute_clover
Definition: quda.h:239
double epsilon
Definition: quda.h:115
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
QudaVerbosity verbosity
Definition: test_util.cpp:1614
int nu_post[QUDA_MAX_MG_LEVEL]
Definition: quda.h:570
double omega
Definition: quda.h:295
char mg_vec_infile[QUDA_MAX_MG_LEVEL][256]
Definition: test_util.cpp:1638
QudaComputeNullVector compute_null_vector
Definition: quda.h:612
double coarse_solver_ca_lambda_min[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1699
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 initComms(int argc, char **argv, int *const commDims)
Definition: test_util.cpp:88
QudaCABasis setup_ca_basis[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1683
int n_block_ortho[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1673
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
Definition: qio_field.h:14
void display_test_info()
void setReunitarizationConsts()
double reliable_delta
Definition: test_util.cpp:1658
int setup_ca_basis_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:522
int nu_post[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1672
QudaPrecision clover_cpu_prec
Definition: quda.h:224
double coarse_solver_ca_lambda_min[QUDA_MAX_MG_LEVEL]
Definition: quda.h:555
QudaInverterType setup_inv_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:504
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
QudaInverterType smoother[QUDA_MAX_MG_LEVEL]
Definition: quda.h:561
QudaMatPCType matpc_type
Definition: quda.h:206
void setGaugeParam(QudaGaugeParam &gauge_param)
enum QudaInverterType_s QudaInverterType
QudaSolveType coarse_solve_type[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1677
QudaReconstructType link_recon_sloppy
Definition: test_util.cpp:1606
double3 plaquette(const GaugeField &U)
Compute the plaquette of the gauge field.
Definition: gauge_plaq.cu:65
QudaPrecision cpu_prec
Definition: quda.h:47
int comm_dim_partitioned(int dim)
QudaPrecision & cpu_prec
int mg_levels
Definition: test_util.cpp:1666
#define gaugeSiteSize
Definition: face_gauge.cpp:34
QudaGaugeParam newQudaGaugeParam(void)
QudaPreserveSource preserve_source
Definition: quda.h:211
QudaInvertParam * invert_param
Definition: quda.h:478
#define device_free(ptr)
Definition: malloc_quda.h:69
double clover_coeff
Definition: quda.h:233
enum QudaTwistFlavorType_s QudaTwistFlavorType
QudaVerbosity mg_verbosity[QUDA_MAX_MG_LEVEL]
Definition: test_util.cpp:1675