QUDA  v1.1.0
A library for QCD on GPUs
set_params.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 #include <command_line_params.h>
3 #include <host_utils.h>
4 #include "misc.h"
5 
7 {
9 
10  gauge_param.X[0] = xdim;
11  gauge_param.X[1] = ydim;
12  gauge_param.X[2] = zdim;
13  gauge_param.X[3] = tdim;
14 
20 
26 
27  gauge_param.anisotropy = 1.0;
29 
30  gauge_param.ga_pad = 0;
33 
35 }
36 
38 {
44 
49 
54 
55  int pad_size = 0;
56  // For multi-GPU, ga_pad must be large enough to store a time-slice
57 #ifdef MULTI_GPU
58  int x_face_size = gauge_param.X[1] * gauge_param.X[2] * gauge_param.X[3] / 2;
59  int y_face_size = gauge_param.X[0] * gauge_param.X[2] * gauge_param.X[3] / 2;
60  int z_face_size = gauge_param.X[0] * gauge_param.X[1] * gauge_param.X[3] / 2;
61  int t_face_size = gauge_param.X[0] * gauge_param.X[1] * gauge_param.X[2] / 2;
62  pad_size = std::max({x_face_size, y_face_size, z_face_size, t_face_size});
63 #endif
64  gauge_param.ga_pad = pad_size;
65 
67 }
68 
70 {
72 
81 
82  // For HISQ, this must always be set to 1.0, since the tadpole
83  // correction is baked into the coefficients for the first fattening.
84  // The tadpole doesn't mean anything for the second fattening
85  // since the input fields are unitarized.
87 
89  gauge_param.scale = -1.0 / 24.0;
90  if (eps_naik != 0) { gauge_param.scale *= (1.0 + eps_naik); }
91  } else {
92  gauge_param.scale = 1.0;
93  }
94 
99 
100  int pad_size = 0;
101 #ifdef MULTI_GPU
102  int x_face_size = gauge_param.X[1] * gauge_param.X[2] * gauge_param.X[3] / 2;
103  int y_face_size = gauge_param.X[0] * gauge_param.X[2] * gauge_param.X[3] / 2;
104  int z_face_size = gauge_param.X[0] * gauge_param.X[1] * gauge_param.X[3] / 2;
105  int t_face_size = gauge_param.X[0] * gauge_param.X[1] * gauge_param.X[2] / 2;
106  pad_size = std::max({x_face_size, y_face_size, z_face_size, t_face_size});
107 #endif
108  gauge_param.ga_pad = pad_size;
109 
111 }
112 
114 {
115  // Set dslash type
117 
118  // Use kappa or mass normalisation
119  if (kappa == -1.0) {
120  inv_param.mass = mass;
121  inv_param.kappa = 1.0 / (2.0 * (1 + 3 / anisotropy + mass));
122  if (dslash_type == QUDA_LAPLACE_DSLASH) inv_param.kappa = 1.0 / (8 + mass);
123  } else {
125  inv_param.mass = 0.5 / kappa - (1.0 + 3.0 / anisotropy);
126  if (dslash_type == QUDA_LAPLACE_DSLASH) inv_param.mass = 1.0 / kappa - 8.0;
127  }
128  printfQuda("Kappa = %.8f Mass = %.8f\n", inv_param.kappa, inv_param.mass);
129 
130  // Use 3D or 4D laplace
132 
133  // Some fermion specific parameters
135  inv_param.mu = mu;
141  inv_param.m5 = m5;
142  kappa5 = 0.5 / (5 + inv_param.m5);
143  inv_param.Ls = Lsdim;
144  for (int k = 0; k < Lsdim; k++) { // for mobius only
145  // b5[k], c[k] values are chosen for arbitrary values,
146  // but the difference of them are same as 1.0
147  inv_param.b_5[k] = b5;
148  inv_param.c_5[k] = c5;
149  }
155  } else {
156  inv_param.Ls = 1;
157  }
158 
159  // Set clover specific parameters
168  // Use kappa * csw or supplied clover_coeff
170  if (clover_coeff == 0.0) {
172  } else {
174  }
175  }
176 
177  // General parameter setup
186  inv_param.Nsteps = 2;
191  inv_param.tol = tol;
193  if (tol_hq == 0 && tol == 0) {
194  errorQuda("qudaInvert: requesting zero residual\n");
195  exit(1);
196  }
197 
198  // require both L2 relative and heavy quark residual to determine convergence
199  inv_param.residual_type = static_cast<QudaResidualType_s>(0);
200  inv_param.residual_type = (tol != 0) ?
203  inv_param.residual_type = (tol_hq != 0) ?
206 
207  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
208 
209  // Offsets used only by multi-shift solver
210  // These should be set in the application code. We set the them here by way of
211  // example
213  for (int i = 0; i < inv_param.num_offset; i++) inv_param.offset[i] = 0.06 + i * i * 0.1;
214  // these can be set individually
215  for (int i = 0; i < inv_param.num_offset; i++) {
218  }
225 
226  // domain decomposition preconditioner parameters
228 
236  inv_param.omega = 1.0;
237 
245 
248 
249  inv_param.sp_pad = 0;
250  inv_param.cl_pad = 0;
251 
253 
255 
256  // Whether or not to use native BLAS LAPACK
258 
259  inv_param.struct_size = sizeof(inv_param);
260 }
261 
262 // Parameters defining the eigensolver
263 void setEigParam(QudaEigParam &eig_param)
264 {
265  eig_param.eig_type = eig_type;
266  eig_param.spectrum = eig_spectrum;
269  errorQuda("Only real spectrum type (LR or SR) can be passed to Lanczos type solver.");
270  }
271 
272  // The solver will exit when n_conv extremal eigenpairs have converged
273  if (eig_n_conv < 0) {
274  eig_param.n_conv = eig_n_ev;
276  } else {
277  eig_param.n_conv = eig_n_conv;
278  }
279 
280  // Inverters will deflate only this number of vectors.
281  if (eig_n_ev_deflate < 0) {
282  eig_param.n_ev_deflate = eig_n_conv;
284  } else {
285  if (eig_n_ev_deflate > eig_n_conv) errorQuda("Can not deflate more that eig_n_conv eigenvectors.");
286  eig_param.n_ev_deflate = eig_n_ev_deflate;
287  }
288 
289  eig_param.block_size
290  = (eig_param.eig_type == QUDA_EIG_TR_LANCZOS || eig_param.eig_type == QUDA_EIG_IR_ARNOLDI) ? 1 : eig_block_size;
291  eig_param.n_ev = eig_n_ev;
292  eig_param.n_kr = eig_n_kr;
293  eig_param.tol = eig_tol;
294  eig_param.qr_tol = eig_qr_tol;
298  eig_param.max_restarts = eig_max_restarts;
299 
304  if (eig_compute_svd) {
305  eig_param.use_dagger = QUDA_BOOLEAN_FALSE;
306  eig_param.use_norm_op = QUDA_BOOLEAN_TRUE;
307  }
308 
311  eig_param.poly_deg = eig_poly_deg;
312  eig_param.a_min = eig_amin;
313  eig_param.a_max = eig_amax;
314 
316  strcpy(eig_param.arpack_logfile, eig_arpack_logfile);
317 
318  strcpy(eig_param.vec_infile, eig_vec_infile);
319  strcpy(eig_param.vec_outfile, eig_vec_outfile);
320  eig_param.save_prec = eig_save_prec;
322 
323  eig_param.struct_size = sizeof(eig_param);
324 }
325 
327 {
328  QudaInvertParam &inv_param = *mg_param.invert_param; // this will be used to setup SolverParam parent in MGParam class
329 
330  // Whether or not to use native BLAS LAPACK
332 
333  inv_param.Ls = 1;
334 
335  inv_param.sp_pad = 0;
336  inv_param.cl_pad = 0;
337 
346 
347  if (kappa == -1.0) {
348  inv_param.mass = mass;
349  inv_param.kappa = 1.0 / (2.0 * (1 + 3 / anisotropy + mass));
350  } else {
352  inv_param.mass = 0.5 / kappa - (1 + 3 / anisotropy);
353  }
354 
363  // Use kappa * csw or supplied clover_coeff
365  if (clover_coeff == 0.0) {
367  } else {
369  }
370  }
371 
374 
376 
378  inv_param.mu = mu;
382 
384  printfQuda("Twisted-mass doublet non supported (yet)\n");
385  exit(0);
386  }
387  }
388 
391 
394 
396 
397  mg_param.invert_param = &inv_param;
398  mg_param.n_level = mg_levels;
399  for (int i = 0; i < mg_param.n_level; i++) {
400  for (int j = 0; j < 4; j++) {
401  // if not defined use 4
402  mg_param.geo_block_size[i][j] = geo_block_size[i][j] ? geo_block_size[i][j] : 4;
403  }
404  for (int j = 4; j < QUDA_MAX_DIM; j++) mg_param.geo_block_size[i][j] = 1;
406  mg_param.verbosity[i] = mg_verbosity[i];
407  mg_param.setup_inv_type[i] = setup_inv[i];
408  mg_param.num_setup_iter[i] = num_setup_iter[i];
409  mg_param.setup_tol[i] = setup_tol[i];
410  mg_param.setup_maxiter[i] = setup_maxiter[i];
412 
413  // Basis to use for CA-CGN(E/R) setup
414  mg_param.setup_ca_basis[i] = setup_ca_basis[i];
415 
416  // Basis size for CACG setup
417  mg_param.setup_ca_basis_size[i] = setup_ca_basis_size[i];
418 
419  // Minimum and maximum eigenvalue for Chebyshev CA basis setup
420  mg_param.setup_ca_lambda_min[i] = setup_ca_lambda_min[i];
421  mg_param.setup_ca_lambda_max[i] = setup_ca_lambda_max[i];
422 
423  mg_param.spin_block_size[i] = 1;
424  mg_param.n_vec[i] = nvec[i] == 0 ? 24 : nvec[i]; // default to 24 vectors if not set
425  mg_param.n_block_ortho[i] = n_block_ortho[i]; // number of times to Gram-Schmidt
426  mg_param.precision_null[i] = prec_null; // precision to store the null-space basis
427  mg_param.smoother_halo_precision[i] = smoother_halo_prec; // precision of the halo exchange in the smoother
428  mg_param.nu_pre[i] = nu_pre[i];
429  mg_param.nu_post[i] = nu_post[i];
430  mg_param.mu_factor[i] = mu_factor[i];
431 
432  mg_param.cycle_type[i] = QUDA_MG_CYCLE_RECURSIVE;
433 
434  // Is not a staggered solve, always aggregate
436 
437  // set the coarse solver wrappers including bottom solver
438  mg_param.coarse_solver[i] = coarse_solver[i];
439  mg_param.coarse_solver_tol[i] = coarse_solver_tol[i];
441 
442  // Basis to use for CA-CGN(E/R) coarse solver
444 
445  // Basis size for CACG coarse solver/
447 
448  // Minimum and maximum eigenvalue for Chebyshev CA basis
451 
452  mg_param.smoother[i] = smoother_type[i];
453 
454  // set the smoother / bottom solver tolerance (for MR smoothing this will be ignored)
455  mg_param.smoother_tol[i] = smoother_tol[i];
456 
457  // set to QUDA_DIRECT_SOLVE for no even/odd preconditioning on the smoother
458  // set to QUDA_DIRECT_PC_SOLVE for to enable even/odd preconditioning on the smoother
459  mg_param.smoother_solve_type[i] = smoother_solve_type[i];
460 
461  // set to QUDA_ADDITIVE_SCHWARZ for Additive Schwarz precondioned smoother (presently only impelemented for MR)
462  mg_param.smoother_schwarz_type[i] = mg_schwarz_type[i];
463 
464  // if using Schwarz preconditioning then use local reductions only
466 
467  // set number of Schwarz cycles to apply
468  mg_param.smoother_schwarz_cycle[i] = mg_schwarz_cycle[i];
469 
470  // Set set coarse_grid_solution_type: this defines which linear
471  // system we are solving on a given level
472  // * QUDA_MAT_SOLUTION - we are solving the full system and inject
473  // a full field into coarse grid
474  // * QUDA_MATPC_SOLUTION - we are solving the e/o-preconditioned
475  // system, and only inject single parity field into coarse grid
476  //
477  // Multiple possible scenarios here
478  //
479  // 1. **Direct outer solver and direct smoother**: here we use
480  // full-field residual coarsening, and everything involves the
481  // full system so coarse_grid_solution_type = QUDA_MAT_SOLUTION
482  //
483  // 2. **Direct outer solver and preconditioned smoother**: here,
484  // only the smoothing uses e/o preconditioning, so
485  // coarse_grid_solution_type = QUDA_MAT_SOLUTION_TYPE.
486  // We reconstruct the full residual prior to coarsening after the
487  // pre-smoother, and then need to project the solution for post
488  // smoothing.
489  //
490  // 3. **Preconditioned outer solver and preconditioned smoother**:
491  // here we use single-parity residual coarsening throughout, so
492  // coarse_grid_solution_type = QUDA_MATPC_SOLUTION. This is a bit
493  // questionable from a theoretical point of view, since we don't
494  // coarsen the preconditioned operator directly, rather we coarsen
495  // the full operator and preconditioned that, but it just works.
496  // This is the optimal combination in general for Wilson-type
497  // operators: although there is an occasional increase in
498  // iteration or two), by working completely in the preconditioned
499  // space, we save the cost of reconstructing the full residual
500  // from the preconditioned smoother, and re-projecting for the
501  // subsequent smoother, as well as reducing the cost of the
502  // ancillary blas operations in the coarse-grid solve.
503  //
504  // Note, we cannot use preconditioned outer solve with direct
505  // smoother
506  //
507  // Finally, we have to treat the top level carefully: for all
508  // other levels the entry into and out of the grid will be a
509  // full-field, which we can then work in Schur complement space or
510  // not (e.g., freedom to choose coarse_grid_solution_type). For
511  // the top level, if the outer solver is for the preconditioned
512  // system, then we must use preconditoning, e.g., option 3.) above.
513 
514  if (i == 0) { // top-level treatment
515  if (coarse_solve_type[0] != solve_type)
516  errorQuda("Mismatch between top-level MG solve type %d and outer solve type %d", coarse_solve_type[0],
517  solve_type);
518 
519  if (solve_type == QUDA_DIRECT_SOLVE) {
521  } else if (solve_type == QUDA_DIRECT_PC_SOLVE) {
523  } else {
524  errorQuda("Unexpected solve_type = %d\n", solve_type);
525  }
526 
527  } else {
528 
531  } else if (coarse_solve_type[i] == QUDA_DIRECT_PC_SOLVE) {
533  } else {
534  errorQuda("Unexpected solve_type = %d\n", coarse_solve_type[i]);
535  }
536  }
537 
538  mg_param.omega[i] = omega; // over/under relaxation factor
539 
540  // CPU setup disabled in release/1.1.x
541  mg_param.location[i] = QUDA_CUDA_FIELD_LOCATION;
543  }
544 
545  // whether to run GPU setup but putting temporaries into mapped (slow CPU) memory
547 
548  // only coarsen the spin on the first restriction
549  mg_param.spin_block_size[0] = 2;
550 
551  mg_param.setup_type = setup_type;
554 
556 
558 
562 
564  // Whether or not to use thin restarts in the evolve tests
566 
567  // set file i/o parameters
568  for (int i = 0; i < mg_param.n_level; i++) {
569  strcpy(mg_param.vec_infile[i], mg_vec_infile[i]);
570  strcpy(mg_param.vec_outfile[i], mg_vec_outfile[i]);
571  if (strcmp(mg_param.vec_infile[i], "") != 0) mg_param.vec_load[i] = QUDA_BOOLEAN_TRUE;
572  if (strcmp(mg_param.vec_outfile[i], "") != 0) mg_param.vec_store[i] = QUDA_BOOLEAN_TRUE;
573  }
574 
576 
577  mg_param.struct_size = sizeof(mg_param);
578 
579  // these need to tbe set for now but are actually ignored by the MG setup
580  // needed to make it pass the initialization test
582  inv_param.tol = 1e-10;
583  inv_param.maxiter = 1000;
585  inv_param.gcrNkrylov = 10;
586 
589 
590  // Use kappa * csw or supplied clover_coeff
592  if (clover_coeff == 0.0) {
594  } else {
596  }
597 
598 }
599 
601 {
602  inv_param.Ls = 1;
603 
604  inv_param.sp_pad = 0;
605  inv_param.cl_pad = 0;
606 
610 
616 
617  if (kappa == -1.0) {
618  inv_param.mass = mass;
619  inv_param.kappa = 1.0 / (2.0 * (1 + 3 / anisotropy + mass));
620  } else {
622  inv_param.mass = 0.5 / kappa - (1 + 3 / anisotropy);
623  }
624 
633 
634  // Use kappa * csw or supplied clover_coeff
636  if (clover_coeff == 0.0) {
638  } else {
640  }
641  }
642 
645 
647 
649  inv_param.mu = mu;
653 
655  printfQuda("Twisted-mass doublet non supported (yet)\n");
656  exit(0);
657  }
658  }
659 
661 
664 
665  // do we want full solution or single-parity solution
667 
668  // do we want to use an even-odd preconditioned solve or not
671 
673 
676 
680  inv_param.tol = tol;
681 
682  // require both L2 relative and heavy quark residual to determine convergence
684  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
685 
686  // Offsets used only by multi-shift solver
687  // should be set in application
689  for (int i = 0; i < inv_param.num_offset; i++) inv_param.offset[i] = 0.06 + i * i * 0.1;
690  // these can be set individually
691  for (int i = 0; i < inv_param.num_offset; i++) {
694  }
697 
698  // domain decomposition preconditioner is disabled when using MG
703  inv_param.omega = 1.0;
704 
705  // Whether or not to use native BLAS LAPACK
707 
708  inv_param.struct_size = sizeof(inv_param);
709 }
710 
711 // Parameters defining the eigensolver
712 void setMultigridEigParam(QudaEigParam &mg_eig_param, int level)
713 {
714  mg_eig_param.eig_type = mg_eig_type[level];
715  mg_eig_param.spectrum = mg_eig_spectrum[level];
718  errorQuda("Only real spectrum type (LR or SR) can be passed to the a Lanczos type solver");
719  }
720 
721  mg_eig_param.block_size
722  = (mg_eig_param.eig_type == QUDA_EIG_TR_LANCZOS || mg_eig_param.eig_type == QUDA_EIG_IR_ARNOLDI) ?
723  1 :
724  mg_eig_block_size[level];
725  mg_eig_param.n_ev = mg_eig_n_ev[level];
726  mg_eig_param.n_kr = mg_eig_n_kr[level];
727  mg_eig_param.n_conv = nvec[level];
728 
729  // Inverters will deflate only this number of vectors.
730  if (mg_eig_n_ev_deflate[level] > 0 && mg_eig_n_ev_deflate[level] < mg_eig_param.n_conv)
731  mg_eig_param.n_ev_deflate = mg_eig_n_ev_deflate[level];
732  else if (mg_eig_n_ev_deflate[level] > mg_eig_param.n_conv)
733  errorQuda("Can not deflate more than nvec[%d] eigenvectors.", mg_eig_param.n_conv);
734  else {
735  mg_eig_param.n_ev_deflate = mg_eig_param.n_conv;
736  mg_eig_n_ev_deflate[level] = mg_eig_param.n_conv;
737  }
738 
739  mg_eig_param.batched_rotate = mg_eig_batched_rotate[level];
741 
742  mg_eig_param.tol = mg_eig_tol[level];
743  mg_eig_param.qr_tol = mg_eig_qr_tol[level];
744  mg_eig_param.check_interval = mg_eig_check_interval[level];
745  mg_eig_param.max_restarts = mg_eig_max_restarts[level];
746 
747  mg_eig_param.compute_svd = QUDA_BOOLEAN_FALSE;
748  mg_eig_param.compute_gamma5 = QUDA_BOOLEAN_FALSE;
751 
754  mg_eig_param.poly_deg = mg_eig_poly_deg[level];
755  mg_eig_param.a_min = mg_eig_amin[level];
756  mg_eig_param.a_max = mg_eig_amax[level];
757 
758  // set file i/o parameters
759  // Give empty strings, Multigrid will handle IO.
760  strcpy(mg_eig_param.vec_infile, "");
761  strcpy(mg_eig_param.vec_outfile, "");
762  mg_eig_param.save_prec = mg_eig_save_prec[level];
763  mg_eig_param.io_parity_inflate = QUDA_BOOLEAN_FALSE;
764 
765  mg_eig_param.struct_size = sizeof(mg_eig_param);
766 }
767 
769 {
770  inv_param.Ls = 1;
771  inv_param.sp_pad = 0;
772  inv_param.cl_pad = 0;
773 
779 
782  // Quda performs contractions in Degrand-Rossi gamma basis,
783  // but the user may suppy vectors in any supported order.
785 
788 
789  inv_param.struct_size = sizeof(inv_param);
790 }
791 
793 {
794  // Solver params
796  inv_param.mass = mass;
797 
798  // outer solver parameters
800  inv_param.tol = tol;
802  inv_param.reliable_delta = 1e-4;
804 
805  inv_param.Ls = 1;
806 
807  if (tol_hq == 0 && tol == 0) {
808  errorQuda("qudaInvert: requesting zero residual\n");
809  exit(1);
810  }
811 
812  // require both L2 relative and heavy quark residual to determine convergence
814  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
815 
816  /* ESW HACK: comment this out to do a non-MG solve. */
821 
822  // Specify Krylov sub-size for GCR, BICGSTAB(L)
824 
825  // do we want full solution or single-parity solution
827 
828  // do we want to use an even-odd preconditioned solve or not
833 
840 
842 
845 
846  inv_param.sp_pad = 0;
847  inv_param.cl_pad = 0;
848 
849  // these can be set individually
850  for (int i = 0; i < inv_param.num_offset; i++) {
853  }
854 
855  // domain decomposition preconditioner is disabled when using MG
860  inv_param.omega = 1.0;
861 
862  // Whether or not to use native BLAS LAPACK
864 
865  inv_param.struct_size = sizeof(inv_param);
866 }
867 
869 {
870  // Solver params
872  inv_param.mass = mass;
873  inv_param.kappa = kappa = 1.0 / (8.0 + mass); // for Laplace operator
874  inv_param.laplace3D = laplace3D; // for Laplace operator
875 
876  // outer solver parameters
878  inv_param.tol = tol;
886 
887  inv_param.Ls = 1; // Nsrc
888 
889  if (tol_hq == 0 && tol == 0) {
890  errorQuda("qudaInvert: requesting zero residual\n");
891  exit(1);
892  }
893  // require both L2 relative and heavy quark residual to determine convergence
894  inv_param.residual_type = static_cast<QudaResidualType_s>(0);
895  inv_param.residual_type = (tol != 0) ?
898  inv_param.residual_type = (tol_hq != 0) ?
902 
903  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
904 
905  inv_param.Nsteps = 2;
906 
907  // domain decomposition preconditioner parameters
914 
915  // Specify Krylov sub-size for GCR, BICGSTAB(L), basis size for CA-CG, CA-GCR
917 
918  // Specify basis for CA-CG, lambda min/max for Chebyshev basis
919  // lambda_max < lambda_max . use power iters to generate
923 
929 
935  inv_param.gamma_basis = QUDA_DEGRAND_ROSSI_GAMMA_BASIS; // this is meaningless, but must be thus set
937 
939 
942 
943  inv_param.sp_pad = 0;
944 
945  // Whether or not to use native BLAS LAPACK
947 
948  inv_param.struct_size = sizeof(inv_param);
949 }
950 
952 {
953  QudaInvertParam &inv_param = *mg_param.invert_param; // this will be used to setup SolverParam parent in MGParam class
954 
955  // Whether or not to use native BLAS LAPACK
957 
958  inv_param.Ls = 1;
959 
960  inv_param.sp_pad = 0;
961  inv_param.cl_pad = 0;
962 
971 
974 
976 
977  inv_param.mass = mass;
978  inv_param.kappa = 1.0 / (2.0 * (4.0 + inv_param.mass));
979 
982 
985 
987 
989 
990  mg_param.invert_param = &inv_param;
991  mg_param.n_level = mg_levels;
992  for (int i = 0; i < mg_param.n_level; i++) {
993  for (int j = 0; j < 4; j++) {
994  // if not defined use 4
995  mg_param.geo_block_size[i][j] = geo_block_size[i][j] ? geo_block_size[i][j] : 4;
996  }
998  mg_param.verbosity[i] = mg_verbosity[i];
999  mg_param.setup_inv_type[i] = setup_inv[i];
1000  mg_param.num_setup_iter[i] = num_setup_iter[i];
1001  mg_param.setup_tol[i] = setup_tol[i];
1002  mg_param.setup_maxiter[i] = setup_maxiter[i];
1003 
1004  // Basis to use for CA-CGN(E/R) setup
1005  mg_param.setup_ca_basis[i] = setup_ca_basis[i];
1006 
1007  // Basis size for CACG setup
1008  mg_param.setup_ca_basis_size[i] = setup_ca_basis_size[i];
1009 
1010  // Minimum and maximum eigenvalue for Chebyshev CA basis setup
1011  mg_param.setup_ca_lambda_min[i] = setup_ca_lambda_min[i];
1012  mg_param.setup_ca_lambda_max[i] = setup_ca_lambda_max[i];
1013 
1014  mg_param.spin_block_size[i] = 1;
1015  mg_param.n_vec[i] = nvec[i] == 0 ? 64 : nvec[i]; // default to 64 vectors if not set
1016  mg_param.n_block_ortho[i] = n_block_ortho[i]; // number of times to Gram-Schmidt
1017  mg_param.precision_null[i] = prec_null; // precision to store the null-space basis
1018  mg_param.smoother_halo_precision[i] = smoother_halo_prec; // precision of the halo exchange in the smoother
1019  mg_param.nu_pre[i] = nu_pre[i];
1020  mg_param.nu_post[i] = nu_post[i];
1021  mg_param.mu_factor[i] = mu_factor[i];
1022 
1024 
1025  mg_param.cycle_type[i] = QUDA_MG_CYCLE_RECURSIVE;
1026 
1027  // set the coarse solver wrappers including bottom solver
1028  mg_param.coarse_solver[i] = coarse_solver[i];
1029  mg_param.coarse_solver_tol[i] = coarse_solver_tol[i];
1031 
1032  // Basis to use for CA-CGN(E/R) coarse solver
1034 
1035  // Basis size for CACG coarse solver/
1037 
1038  // Minimum and maximum eigenvalue for Chebyshev CA basis
1041 
1042  mg_param.smoother[i] = smoother_type[i];
1043 
1044  // set the smoother / bottom solver tolerance (for MR smoothing this will be ignored)
1045  mg_param.smoother_tol[i] = smoother_tol[i];
1046 
1047  // set to QUDA_DIRECT_SOLVE for no even/odd preconditioning on the smoother
1048  // set to QUDA_DIRECT_PC_SOLVE for to enable even/odd preconditioning on the smoother
1049  mg_param.smoother_solve_type[i] = smoother_solve_type[i];
1050 
1051  // set to QUDA_ADDITIVE_SCHWARZ for Additive Schwarz precondioned smoother (presently only impelemented for MR)
1052  mg_param.smoother_schwarz_type[i] = mg_schwarz_type[i];
1053 
1054  // if using Schwarz preconditioning then use local reductions only
1056 
1057  // set number of Schwarz cycles to apply
1058  mg_param.smoother_schwarz_cycle[i] = mg_schwarz_cycle[i];
1059 
1060  // Set set coarse_grid_solution_type: this defines which linear
1061  // system we are solving on a given level
1062  // * QUDA_MAT_SOLUTION - we are solving the full system and inject
1063  // a full field into coarse grid
1064  // * QUDA_MATPC_SOLUTION - we are solving the e/o-preconditioned
1065  // system, and only inject single parity field into coarse grid
1066  //
1067  // Multiple possible scenarios here
1068  //
1069  // 1. **Direct outer solver and direct smoother**: here we use
1070  // full-field residual coarsening, and everything involves the
1071  // full system so coarse_grid_solution_type = QUDA_MAT_SOLUTION
1072  //
1073  // 2. **Direct outer solver and preconditioned smoother**: here,
1074  // only the smoothing uses e/o preconditioning, so
1075  // coarse_grid_solution_type = QUDA_MAT_SOLUTION_TYPE.
1076  // We reconstruct the full residual prior to coarsening after the
1077  // pre-smoother, and then need to project the solution for post
1078  // smoothing.
1079  //
1080  // 3. **Preconditioned outer solver and preconditioned smoother**:
1081  // here we use single-parity residual coarsening throughout, so
1082  // coarse_grid_solution_type = QUDA_MATPC_SOLUTION. This is a bit
1083  // questionable from a theoretical point of view, since we don't
1084  // coarsen the preconditioned operator directly, rather we coarsen
1085  // the full operator and preconditioned that, but it just works.
1086  // This is the optimal combination in general for Wilson-type
1087  // operators: although there is an occasional increase in
1088  // iteration or two), by working completely in the preconditioned
1089  // space, we save the cost of reconstructing the full residual
1090  // from the preconditioned smoother, and re-projecting for the
1091  // subsequent smoother, as well as reducing the cost of the
1092  // ancillary blas operations in the coarse-grid solve.
1093  //
1094  // Note, we cannot use preconditioned outer solve with direct
1095  // smoother
1096  //
1097  // Finally, we have to treat the top level carefully: for all
1098  // other levels the entry into and out of the grid will be a
1099  // full-field, which we can then work in Schur complement space or
1100  // not (e.g., freedom to choose coarse_grid_solution_type). For
1101  // the top level, if the outer solver is for the preconditioned
1102  // system, then we must use preconditoning, e.g., option 3.) above.
1103 
1104  if (i == 0) { // top-level treatment
1105  if (coarse_solve_type[0] != solve_type)
1106  errorQuda("Mismatch between top-level MG solve type %s and outer solve type %s",
1108 
1109  if (solve_type == QUDA_DIRECT_SOLVE) {
1111  } else if (solve_type == QUDA_DIRECT_PC_SOLVE) {
1113  } else {
1114  errorQuda("Unexpected solve_type = %s\n", get_solve_str(solve_type));
1115  }
1116 
1117  } else {
1118 
1121  } else if (coarse_solve_type[i] == QUDA_DIRECT_PC_SOLVE) {
1123  } else {
1124  errorQuda("Unexpected solve_type = %s\n", get_solve_str(coarse_solve_type[i]));
1125  }
1126  }
1127 
1128  mg_param.omega[i] = omega; // over/under relaxation factor
1129 
1130  // CPU setup disabled in release/1.1.x
1131  mg_param.location[i] = QUDA_CUDA_FIELD_LOCATION;
1133  nu_pre[i] = 2;
1134  nu_post[i] = 2;
1135  }
1136 
1137  // whether to run GPU setup but putting temporaries into mapped (slow CPU) memory
1139 
1140  // coarsening the spin on the first restriction is undefined for staggered fields.
1141  mg_param.spin_block_size[0] = 0;
1142 
1144  mg_param.spin_block_size[1] = 0; // we're coarsening the optimized KD op
1145  }
1146 
1147  mg_param.setup_type = setup_type;
1150 
1152 
1154 
1158 
1159  // set file i/o parameters
1160  for (int i = 0; i < mg_param.n_level; i++) {
1161  strcpy(mg_param.vec_infile[i], mg_vec_infile[i]);
1162  strcpy(mg_param.vec_outfile[i], mg_vec_outfile[i]);
1163  if (strcmp(mg_param.vec_infile[i], "") != 0) mg_param.vec_load[i] = QUDA_BOOLEAN_TRUE;
1164  if (strcmp(mg_param.vec_outfile[i], "") != 0) mg_param.vec_store[i] = QUDA_BOOLEAN_TRUE;
1165  }
1166 
1168 
1169  // these need to tbe set for now but are actually ignored by the MG setup
1170  // needed to make it pass the initialization test
1172  inv_param.tol = 1e-10;
1173  inv_param.maxiter = 1000;
1175  inv_param.gcrNkrylov = 10;
1176 
1179 
1180  inv_param.struct_size = sizeof(inv_param);
1181 }
1182 
1184 {
1185  inv_param.Ls = 1;
1186 
1187  inv_param.sp_pad = 0;
1188  inv_param.cl_pad = 0;
1189 
1194 
1200 
1207  }
1208 
1211 
1213 
1214  if (kappa == -1.0) {
1215  inv_param.mass = mass;
1216  inv_param.kappa = 1.0 / (2.0 * (1 + 3 / anisotropy + mass));
1217  } else {
1218  inv_param.kappa = kappa;
1219  inv_param.mass = 0.5 / kappa - (1 + 3 / anisotropy);
1220  }
1221 
1223  inv_param.mu = mu;
1226 
1228  printfQuda("Twisted-mass doublet non supported (yet)\n");
1229  exit(0);
1230  }
1231  }
1232 
1233  // Use kappa * csw or supplied clover_coeff
1235  if (clover_coeff == 0.0) {
1237  } else {
1239  }
1240 
1243 
1244  // do we want full solution or single-parity solution
1246  // inv_param.solution_type = QUDA_MATPC_SOLUTION;
1247 
1248  // do we want to use an even-odd preconditioned solve or not
1251 
1253  errorQuda("Requested solver %s is not a deflated solver type", get_solver_str(inv_type));
1254 
1257  inv_param.tol = tol;
1258  inv_param.tol_hq = tol_hq; // specify a tolerance for the residual for heavy quark residual
1259 
1260  inv_param.rhs_idx = 0;
1261 
1262  inv_param.n_ev = n_ev;
1270 
1273  } else if (inv_param.inv_type == QUDA_GMRESDR_INVERTER) {
1275  inv_param.tol_restart = 0.0; // restart is not requested...
1276  }
1277 
1280 
1282  inv_param.gcrNkrylov = 6;
1283 
1284  // require both L2 relative and heavy quark residual to determine convergence
1286  // Offsets used only by multi-shift solver
1287  // should be set in application
1289  for (int i = 0; i < inv_param.num_offset; i++) inv_param.offset[i] = 0.06 + i * i * 0.1;
1290  // these can be set individually
1291  for (int i = 0; i < inv_param.num_offset; i++) {
1294  }
1296  inv_param.reliable_delta = 1e-1;
1297 
1298  // domain decomposition preconditioner parameters
1303  inv_param.omega = 1.0;
1304 
1306 
1307  // Whether or not to use native BLAS LAPACK
1309 
1310  inv_param.struct_size = sizeof(inv_param);
1311 }
1312 
1314 {
1316  df_param.run_verify = QUDA_BOOLEAN_FALSE;
1317 
1318  df_param.nk = df_param.invert_param->n_ev;
1319  df_param.np = df_param.invert_param->n_ev * df_param.invert_param->deflation_grid;
1320  df_param.extlib_type = deflation_ext_lib;
1321 
1322  df_param.cuda_prec_ritz = prec_ritz;
1323  df_param.location = location_ritz;
1324  df_param.mem_type_ritz = mem_type_ritz;
1325 
1326  // set file i/o parameters
1327  strcpy(df_param.vec_infile, eig_vec_infile);
1328  strcpy(df_param.vec_outfile, eig_vec_outfile);
1330 }
1331 
1333 {
1335  if (test_type != 0) { errorQuda("Test type %d is not supported for the Laplace operator.\n", test_type); }
1336 
1339  matpc_type = QUDA_MATPC_EVEN_EVEN; // doesn't matter
1340 
1341  } else {
1342 
1345  warningQuda("The full spinor staggered operator (test 0) can't be inverted with (P)CG. Switching to BiCGstab.\n");
1347  }
1348 
1349  if (solve_type == QUDA_INVALID_SOLVE) {
1350  if (test_type == 0) {
1352  } else {
1354  }
1355  }
1356 
1357  if (test_type == 1 || test_type == 3 || test_type == 5) {
1359  } else if (test_type == 2 || test_type == 4 || test_type == 6) {
1361  } else if (test_type == 0) {
1362  matpc_type = QUDA_MATPC_EVEN_EVEN; // it doesn't matter
1363  }
1364 
1365  if (test_type == 0 || test_type == 1 || test_type == 2) {
1367  } else {
1369  }
1370  }
1371 
1373 
1376 
1377  if (inv_type != QUDA_CG_INVERTER && (test_type == 5 || test_type == 6)) {
1378  errorQuda("Preconditioning is currently not supported in multi-shift solver solvers");
1379  }
1380 
1381  // Set n_naiks to 2 if eps_naik != 0.0
1383  if (eps_naik != 0.0) {
1384  if (compute_fatlong) {
1385  n_naiks = 2;
1386  printfQuda("Note: epsilon-naik != 0, testing epsilon correction links.\n");
1387  } else {
1388  eps_naik = 0.0;
1389  printfQuda("Not computing fat-long, ignoring epsilon correction.\n");
1390  }
1391  } else {
1392  printfQuda("Note: epsilon-naik = 0, testing original HISQ links.\n");
1393  }
1394  }
1395 }
1396 
1398 {
1400  // LAPLACE operator path, only DIRECT solves feasible.
1401  if (test_type != 0) { errorQuda("Test type %d is not supported for the Laplace operator.\n", test_type); }
1404  } else {
1405  // STAGGERED operator path
1406  if (solve_type == QUDA_INVALID_SOLVE) {
1407  if (test_type == 0) {
1409  } else {
1411  }
1412  }
1413  // If test type is not 3, it is 4 or 0. If 0, the matpc type is irrelevant
1414  if (test_type == 3)
1416  else
1418 
1419  if (test_type == 0) {
1421  } else {
1423  }
1424  }
1425 
1426  // Set n_naiks to 2 if eps_naik != 0.0
1428  if (eps_naik != 0.0) {
1429  if (compute_fatlong) {
1430  n_naiks = 2;
1431  printfQuda("Note: epsilon-naik != 0, testing epsilon correction links.\n");
1432  } else {
1433  eps_naik = 0.0;
1434  printfQuda("Not computing fat-long, ignoring epsilon correction.\n");
1435  }
1436  } else {
1437  printfQuda("Note: epsilon-naik = 0, testing original HISQ links.\n");
1438  }
1439  }
1440 }
bool mg_use_mma
QudaTransferType staggered_transfer_type
bool generate_all_levels
double kappa
int eig_check_interval
int eig_batched_rotate
QudaInverterType precon_type
double reliable_delta
QudaSolveType solve_type
QudaPrecision prec_refinement_sloppy
int laplace3D
quda::mgarray< int > num_setup_iter
int eig_poly_deg
bool eig_io_parity_inflate
double inc_tol
double c5
QudaEigType eig_type
quda::mgarray< int > mg_eig_poly_deg
QudaInverterType inv_type
quda::mgarray< QudaEigType > mg_eig_type
QudaReconstructType link_recon_sloppy
int eig_n_ev
double clover_csw
quda::mgarray< int > mg_eig_check_interval
quda::mgarray< char[256]> mg_vec_outfile
double eigenval_tol
char eig_vec_infile[256]
bool eig_arpack_check
double eig_tol
double eofa_mq1
quda::mgarray< double > setup_ca_lambda_max
double mass
int precon_schwarz_cycle
QudaPrecision prec_null
double tol
QudaExtLibType solver_ext_lib
QudaReconstructType link_recon
int deflation_grid
int niter
int test_type
quda::mgarray< int > mg_eig_n_ev_deflate
quda::mgarray< bool > mg_eig
double anisotropy
bool eig_compute_svd
QudaPrecision eig_save_prec
QudaVerbosity verbosity
quda::mgarray< QudaInverterType > coarse_solver
QudaReconstructType link_recon_precondition
quda::mgarray< QudaCABasis > coarse_solver_ca_basis
quda::mgarray< int > n_block_ortho
double tol_hq
int & ydim
double eofa_shift
bool eig_use_poly_acc
QudaTwistFlavorType twist_flavor
int eig_n_ev_deflate
QudaPrecision prec_ritz
quda::mgarray< int > coarse_solver_maxiter
double epsilon
bool verify_results
quda::mgarray< char[256]> mg_vec_infile
quda::mgarray< int > nu_post
quda::mgarray< int > nu_pre
quda::mgarray< int > setup_ca_basis_size
bool pre_orthonormalize
quda::mgarray< int > mg_eig_n_kr
quda::mgarray< int > coarse_solver_ca_basis_size
char eig_vec_outfile[256]
quda::mgarray< double > mg_eig_amin
double eofa_mq2
bool post_orthonormalize
quda::mgarray< QudaVerbosity > mg_verbosity
quda::mgarray< double > setup_ca_lambda_min
int eig_block_size
double eig_amax
quda::mgarray< int > setup_maxiter
quda::mgarray< int > nvec
bool eig_use_dagger
quda::mgarray< QudaCABasis > setup_ca_basis
double mu
double eig_qr_tol
int max_search_dim
quda::mgarray< QudaSchwarzType > mg_schwarz_type
bool oblique_proj_check
int gcrNkrylov
QudaMemoryType mem_type_ritz
quda::mgarray< QudaEigSpectrumType > mg_eig_spectrum
quda::mgarray< int > mg_eig_max_restarts
int & zdim
double ca_lambda_min
QudaSolutionType solution_type
bool mg_eig_coarse_guess
double m5
bool eig_use_eigen_qr
double eps_naik
int max_restart_num
QudaDslashType dslash_type
double ca_lambda_max
QudaTboundary fermion_t_boundary
bool eig_use_normop
quda::mgarray< bool > mg_eig_use_dagger
quda::mgarray< double > mu_factor
QudaExtLibType deflation_ext_lib
bool generate_nullspace
quda::mgarray< double > coarse_solver_ca_lambda_max
bool alternative_reliable
int solution_accumulator_pipeline
bool low_mode_check
quda::mgarray< int > mg_eig_n_ev
int eig_n_kr
int mg_levels
quda::mgarray< double > mg_eig_amax
double omega
int eig_n_conv
quda::mgarray< QudaInverterType > setup_inv
bool mg_evolve_thin_updates
double clover_coeff
bool native_blas_lapack
int pipeline
QudaMatPCType matpc_type
quda::mgarray< double > setup_tol
int multishift
QudaFieldLocation location_ritz
quda::mgarray< double > coarse_solver_ca_lambda_min
QudaEigSpectrumType eig_spectrum
quda::mgarray< bool > mg_eig_use_poly_acc
double tol_precondition
quda::mgarray< double > mg_eig_qr_tol
QudaPrecision prec_eigensolver
quda::mgarray< QudaSolveType > coarse_solve_type
double tol_restart
bool compute_fatlong
double b5
quda::mgarray< double > mg_eig_tol
QudaSchwarzType precon_schwarz_type
quda::mgarray< int > mg_eig_batched_rotate
QudaPrecision prec_precondition
quda::mgarray< bool > mg_eig_use_normop
quda::mgarray< bool > mg_eig_use_eigen_qr
QudaPrecision prec
QudaReconstructType link_recon_eigensolver
quda::mgarray< QudaPrecision > mg_eig_save_prec
char eig_arpack_logfile[256]
QudaCABasis ca_basis
int n_naiks
quda::mgarray< double > smoother_tol
QudaSetupType setup_type
int Lsdim
quda::mgarray< QudaSolveType > smoother_solve_type
double eofa_mq3
bool eig_require_convergence
int eig_max_restarts
int & tdim
quda::mgarray< bool > mg_eig_require_convergence
quda::mgarray< int > mg_eig_block_size
int & xdim
quda::mgarray< double > coarse_solver_tol
bool eig_compute_gamma5
QudaPrecision smoother_halo_prec
int maxiter_precondition
int eigcg_max_restarts
quda::mgarray< QudaInverterType > smoother_type
quda::mgarray< int > setup_maxiter_refresh
int eofa_pm
double eig_amin
quda::mgarray< int > mg_schwarz_cycle
QudaMassNormalization normalization
quda::mgarray< std::array< int, 4 > > geo_block_size
QudaPrecision prec_sloppy
QudaGaugeParam gauge_param
Definition: covdev_test.cpp:26
QudaInvertParam inv_param
Definition: covdev_test.cpp:27
@ QUDA_DEFAULT_NORMALIZATION
Definition: enum_quda.h:233
@ QUDA_MG_CYCLE_RECURSIVE
Definition: enum_quda.h:182
@ QUDA_PACKED_CLOVER_ORDER
Definition: enum_quda.h:258
@ QUDA_STAGGERED_PHASE_MILC
Definition: enum_quda.h:516
@ QUDA_TWISTED_CLOVER_DSLASH
Definition: enum_quda.h:100
@ QUDA_MOBIUS_DWF_DSLASH
Definition: enum_quda.h:95
@ QUDA_CLOVER_WILSON_DSLASH
Definition: enum_quda.h:91
@ QUDA_TWISTED_MASS_DSLASH
Definition: enum_quda.h:99
@ QUDA_DOMAIN_WALL_DSLASH
Definition: enum_quda.h:93
@ QUDA_ASQTAD_DSLASH
Definition: enum_quda.h:98
@ QUDA_MOBIUS_DWF_EOFA_DSLASH
Definition: enum_quda.h:96
@ QUDA_LAPLACE_DSLASH
Definition: enum_quda.h:101
@ QUDA_DOMAIN_WALL_4D_DSLASH
Definition: enum_quda.h:94
@ QUDA_CUDA_FIELD_LOCATION
Definition: enum_quda.h:326
@ QUDA_CPU_FIELD_LOCATION
Definition: enum_quda.h:325
@ QUDA_KAPPA_NORMALIZATION
Definition: enum_quda.h:226
@ QUDA_MASS_NORMALIZATION
Definition: enum_quda.h:227
@ QUDA_DAG_NO
Definition: enum_quda.h:223
@ QUDA_SILENT
Definition: enum_quda.h:265
@ QUDA_VERBOSE
Definition: enum_quda.h:267
@ QUDA_BOOLEAN_FALSE
Definition: enum_quda.h:460
@ QUDA_BOOLEAN_TRUE
Definition: enum_quda.h:461
@ QUDA_DEGRAND_ROSSI_GAMMA_BASIS
Definition: enum_quda.h:368
@ QUDA_RECONSTRUCT_INVALID
Definition: enum_quda.h:76
@ QUDA_DIRAC_ORDER
Definition: enum_quda.h:245
QudaResidualType_s
Definition: enum_quda.h:192
@ QUDA_HEAVY_QUARK_RESIDUAL
Definition: enum_quda.h:195
@ QUDA_L2_RELATIVE_RESIDUAL
Definition: enum_quda.h:193
@ QUDA_TRANSFER_AGGREGATE
Definition: enum_quda.h:453
@ QUDA_TRANSFER_OPTIMIZED_KD
Definition: enum_quda.h:455
@ QUDA_EIG_IR_ARNOLDI
Definition: enum_quda.h:139
@ QUDA_EIG_BLK_TR_LANCZOS
Definition: enum_quda.h:138
@ QUDA_EIG_TR_LANCZOS
Definition: enum_quda.h:137
@ QUDA_GAUGE_FIXED_NO
Definition: enum_quda.h:80
@ QUDA_MATPC_ODD_ODD
Definition: enum_quda.h:217
@ QUDA_MATPC_EVEN_EVEN
Definition: enum_quda.h:216
enum QudaResidualType_s QudaResidualType
@ QUDA_GCR_INVERTER
Definition: enum_quda.h:109
@ QUDA_INC_EIGCG_INVERTER
Definition: enum_quda.h:117
@ QUDA_PCG_INVERTER
Definition: enum_quda.h:114
@ QUDA_CG_INVERTER
Definition: enum_quda.h:107
@ QUDA_EIGCG_INVERTER
Definition: enum_quda.h:116
@ QUDA_MG_INVERTER
Definition: enum_quda.h:122
@ QUDA_BICGSTAB_INVERTER
Definition: enum_quda.h:108
@ QUDA_GMRESDR_INVERTER
Definition: enum_quda.h:118
@ QUDA_PRESERVE_SOURCE_NO
Definition: enum_quda.h:238
@ QUDA_PRESERVE_SOURCE_YES
Definition: enum_quda.h:239
@ QUDA_MATPC_SOLUTION
Definition: enum_quda.h:159
@ QUDA_MAT_SOLUTION
Definition: enum_quda.h:157
@ QUDA_INVALID_PRECISION
Definition: enum_quda.h:66
@ QUDA_INVALID_SCHWARZ
Definition: enum_quda.h:189
@ QUDA_QDP_GAUGE_ORDER
Definition: enum_quda.h:44
@ QUDA_MILC_GAUGE_ORDER
Definition: enum_quda.h:47
@ QUDA_SPECTRUM_LR_EIG
Definition: enum_quda.h:149
@ QUDA_SPECTRUM_SR_EIG
Definition: enum_quda.h:150
@ QUDA_TWIST_NONDEG_DOUBLET
Definition: enum_quda.h:401
@ QUDA_INVALID_SOLVE
Definition: enum_quda.h:175
@ QUDA_DIRECT_SOLVE
Definition: enum_quda.h:167
@ QUDA_NORMOP_PC_SOLVE
Definition: enum_quda.h:170
@ QUDA_DIRECT_PC_SOLVE
Definition: enum_quda.h:169
@ QUDA_NORMOP_SOLVE
Definition: enum_quda.h:168
@ QUDA_SU3_LINKS
Definition: enum_quda.h:24
@ QUDA_WILSON_LINKS
Definition: enum_quda.h:30
@ QUDA_COMPUTE_NULL_VECTOR_NO
Definition: enum_quda.h:441
@ QUDA_COMPUTE_NULL_VECTOR_YES
Definition: enum_quda.h:442
QudaPrecision & cuda_prec
Definition: host_utils.cpp:58
QudaPrecision & cuda_prec_sloppy
Definition: host_utils.cpp:59
QudaPrecision & cuda_prec_eigensolver
Definition: host_utils.cpp:62
QudaPrecision & cuda_prec_precondition
Definition: host_utils.cpp:61
QudaPrecision & cuda_prec_refinement_sloppy
Definition: host_utils.cpp:60
QudaPrecision & cpu_prec
Definition: host_utils.cpp:57
double kappa5
Definition: host_utils.cpp:51
const char * get_solve_str(QudaSolveType type)
Definition: misc.cpp:231
const char * get_solver_str(QudaInverterType type)
Definition: misc.cpp:263
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.
void setQudaStaggeredEigTestParams()
void setStaggeredInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:868
void setWilsonGaugeParam(QudaGaugeParam &gauge_param)
Definition: set_params.cpp:37
void setMultigridInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:600
void setEigParam(QudaEigParam &eig_param)
Definition: set_params.cpp:263
void setInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:113
void setQudaStaggeredInvTestParams()
void setStaggeredGaugeParam(QudaGaugeParam &gauge_param)
Definition: set_params.cpp:69
void setStaggeredMGInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:792
void setContractInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:768
void setMultigridEigParam(QudaEigParam &mg_eig_param, int level)
Definition: set_params.cpp:712
void setDeflatedInvertParam(QudaInvertParam &inv_param)
void setMultigridParam(QudaMultigridParam &mg_param)
Definition: set_params.cpp:326
void setDeflationParam(QudaEigParam &df_param)
void setGaugeParam(QudaGaugeParam &gauge_param)
Definition: set_params.cpp:6
void setStaggeredMultigridParam(QudaMultigridParam &mg_param)
Definition: set_params.cpp:951
QudaEigSpectrumType spectrum
Definition: quda.h:466
QudaBoolean use_eigen_qr
Definition: quda.h:453
QudaPrecision save_prec
Definition: quda.h:528
QudaEigType eig_type
Definition: quda.h:416
int check_interval
Definition: quda.h:483
QudaBoolean import_vectors
Definition: quda.h:507
QudaBoolean use_dagger
Definition: quda.h:449
QudaBoolean arpack_check
Definition: quda.h:492
int n_ev_deflate
Definition: quda.h:477
QudaBoolean compute_svd
Definition: quda.h:456
QudaBoolean io_parity_inflate
Definition: quda.h:533
int batched_rotate
Definition: quda.h:487
QudaBoolean use_poly_acc
Definition: quda.h:419
char vec_outfile[256]
Definition: quda.h:525
QudaBoolean use_norm_op
Definition: quda.h:450
QudaPrecision cuda_prec_ritz
Definition: quda.h:510
QudaBoolean compute_gamma5
Definition: quda.h:460
char vec_infile[256]
Definition: quda.h:522
QudaFieldLocation location
Definition: quda.h:516
QudaExtLibType extlib_type
Definition: quda.h:542
int poly_deg
Definition: quda.h:422
double a_min
Definition: quda.h:425
double tol
Definition: quda.h:479
char arpack_logfile[512]
Definition: quda.h:494
double a_max
Definition: quda.h:426
int block_size
Definition: quda.h:489
QudaBoolean run_verify
Definition: quda.h:519
QudaBoolean require_convergence
Definition: quda.h:463
int n_ev
Definition: quda.h:469
int max_restarts
Definition: quda.h:485
QudaInvertParam * invert_param
Definition: quda.h:413
QudaMemoryType mem_type_ritz
Definition: quda.h:513
int n_kr
Definition: quda.h:471
int n_conv
Definition: quda.h:475
double qr_tol
Definition: quda.h:481
size_t struct_size
Definition: quda.h:408
double tadpole_coeff
Definition: quda.h:38
QudaReconstructType reconstruct_precondition
Definition: quda.h:58
double anisotropy
Definition: quda.h:37
QudaReconstructType reconstruct
Definition: quda.h:49
QudaPrecision cuda_prec_precondition
Definition: quda.h:57
int ga_pad
Definition: quda.h:65
QudaLinkType type
Definition: quda.h:41
double scale
Definition: quda.h:39
int mom_ga_pad
Definition: quda.h:71
QudaPrecision cuda_prec_refinement_sloppy
Definition: quda.h:54
QudaPrecision cuda_prec_sloppy
Definition: quda.h:51
size_t struct_size
Definition: quda.h:32
QudaReconstructType reconstruct_sloppy
Definition: quda.h:52
QudaGaugeFixed gauge_fix
Definition: quda.h:63
QudaGaugeFieldOrder gauge_order
Definition: quda.h:42
QudaPrecision cuda_prec
Definition: quda.h:48
QudaReconstructType reconstruct_eigensolver
Definition: quda.h:61
QudaStaggeredPhase staggered_phase_type
Definition: quda.h:73
int X[4]
Definition: quda.h:35
QudaPrecision cpu_prec
Definition: quda.h:46
QudaReconstructType reconstruct_refinement_sloppy
Definition: quda.h:55
QudaTboundary t_boundary
Definition: quda.h:44
QudaPrecision cuda_prec_eigensolver
Definition: quda.h:60
double ca_lambda_max
Definition: quda.h:332
int use_sloppy_partial_accumulator
Definition: quda.h:149
QudaSolveType solve_type
Definition: quda.h:229
QudaPrecision cuda_prec_refinement_sloppy
Definition: quda.h:240
int max_res_increase
Definition: quda.h:164
int maxiter_precondition
Definition: quda.h:320
QudaSolutionType solution_type
Definition: quda.h:228
QudaBoolean native_blas_lapack
Definition: quda.h:402
double tol_hq
Definition: quda.h:140
double tol_precondition
Definition: quda.h:317
QudaCABasis ca_basis
Definition: quda.h:326
double omega
Definition: quda.h:323
QudaCloverFieldOrder clover_order
Definition: quda.h:256
QudaSchwarzType schwarz_type
Definition: quda.h:338
double eigenval_tol
Definition: quda.h:366
QudaMassNormalization mass_normalization
Definition: quda.h:232
int use_alternative_reliable
Definition: quda.h:148
QudaPreserveSource preserve_source
Definition: quda.h:235
size_t struct_size
Definition: quda.h:101
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:206
int solution_accumulator_pipeline
Definition: quda.h:159
double tol_restart
Definition: quda.h:139
QudaResidualType residual_type
Definition: quda.h:348
double mq2
Definition: quda.h:128
int precondition_cycle
Definition: quda.h:335
int heavy_quark_check
Definition: quda.h:182
double inc_tol
Definition: quda.h:372
QudaPrecision clover_cuda_prec_refinement_sloppy
Definition: quda.h:252
int num_offset
Definition: quda.h:186
QudaPrecision cuda_prec_eigensolver
Definition: quda.h:242
QudaExtLibType extlib_type
Definition: quda.h:399
double mass
Definition: quda.h:109
QudaPrecision clover_cuda_prec
Definition: quda.h:250
int max_search_dim
Definition: quda.h:360
double m5
Definition: quda.h:112
int eigcg_max_restarts
Definition: quda.h:368
QudaTwistFlavorType twist_flavor
Definition: quda.h:134
double ca_lambda_min
Definition: quda.h:329
QudaPrecision clover_cpu_prec
Definition: quda.h:249
QudaDslashType dslash_type
Definition: quda.h:106
double mq1
Definition: quda.h:127
QudaPrecision clover_cuda_prec_precondition
Definition: quda.h:253
QudaPrecision cuda_prec
Definition: quda.h:238
double mu
Definition: quda.h:131
QudaVerbosity verbosity
Definition: quda.h:271
double_complex b_5[QUDA_MAX_DWF_LS]
Definition: quda.h:115
double clover_coeff
Definition: quda.h:260
int gcrNkrylov
Definition: quda.h:286
double eofa_shift
Definition: quda.h:125
double reliable_delta
Definition: quda.h:146
QudaVerbosity verbosity_precondition
Definition: quda.h:314
QudaPrecision clover_cuda_prec_eigensolver
Definition: quda.h:254
double offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:200
QudaDagType dagger
Definition: quda.h:231
QudaInverterType inv_type
Definition: quda.h:107
int max_restart_num
Definition: quda.h:370
QudaSolverNormalization solver_normalization
Definition: quda.h:233
double epsilon
Definition: quda.h:132
double clover_csw
Definition: quda.h:259
QudaPrecision cpu_prec
Definition: quda.h:237
int deflation_grid
Definition: quda.h:364
QudaMatPCType matpc_type
Definition: quda.h:230
double_complex c_5[QUDA_MAX_DWF_LS]
Definition: quda.h:116
QudaPrecision clover_cuda_prec_sloppy
Definition: quda.h:251
double tol_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:203
double mq3
Definition: quda.h:129
QudaInverterType inv_type_precondition
Definition: quda.h:297
QudaGammaBasis gamma_basis
Definition: quda.h:246
double tol
Definition: quda.h:138
QudaPrecision cuda_prec_sloppy
Definition: quda.h:239
QudaFieldLocation input_location
Definition: quda.h:103
QudaFieldLocation output_location
Definition: quda.h:104
QudaPrecision cuda_prec_precondition
Definition: quda.h:241
QudaDiracFieldOrder dirac_order
Definition: quda.h:244
double kappa
Definition: quda.h:110
QudaBoolean pre_orthonormalize
Definition: quda.h:607
int smoother_schwarz_cycle[QUDA_MAX_MG_LEVEL]
Definition: quda.h:655
QudaBoolean run_verify
Definition: quda.h:691
double coarse_solver_ca_lambda_min[QUDA_MAX_MG_LEVEL]
Definition: quda.h:628
double setup_ca_lambda_max[QUDA_MAX_MG_LEVEL]
Definition: quda.h:601
QudaSolutionType coarse_grid_solution_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:659
double coarse_solver_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:616
QudaMultigridCycleType cycle_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:665
double omega[QUDA_MAX_MG_LEVEL]
Definition: quda.h:646
QudaBoolean thin_update_only
Definition: quda.h:733
int setup_maxiter_refresh[QUDA_MAX_MG_LEVEL]
Definition: quda.h:589
QudaPrecision precision_null[QUDA_MAX_MG_LEVEL]
Definition: quda.h:568
QudaBoolean use_mma
Definition: quda.h:730
char vec_infile[QUDA_MAX_MG_LEVEL][256]
Definition: quda.h:703
int nu_post[QUDA_MAX_MG_LEVEL]
Definition: quda.h:643
QudaBoolean use_eig_solver[QUDA_MAX_MG_LEVEL]
Definition: quda.h:677
int coarse_solver_maxiter[QUDA_MAX_MG_LEVEL]
Definition: quda.h:619
int n_vec[QUDA_MAX_MG_LEVEL]
Definition: quda.h:565
int geo_block_size[QUDA_MAX_MG_LEVEL][QUDA_MAX_DIM]
Definition: quda.h:559
QudaInverterType coarse_solver[QUDA_MAX_MG_LEVEL]
Definition: quda.h:613
QudaBoolean coarse_guess
Definition: quda.h:712
int coarse_solver_ca_basis_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:625
QudaTransferType transfer_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:727
QudaFieldLocation setup_location[QUDA_MAX_MG_LEVEL]
Definition: quda.h:674
QudaBoolean post_orthonormalize
Definition: quda.h:610
int num_setup_iter[QUDA_MAX_MG_LEVEL]
Definition: quda.h:580
double mu_factor[QUDA_MAX_MG_LEVEL]
Definition: quda.h:724
QudaCABasis setup_ca_basis[QUDA_MAX_MG_LEVEL]
Definition: quda.h:592
QudaInverterType setup_inv_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:577
QudaInverterType smoother[QUDA_MAX_MG_LEVEL]
Definition: quda.h:634
int setup_maxiter[QUDA_MAX_MG_LEVEL]
Definition: quda.h:586
int setup_ca_basis_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:595
double coarse_solver_ca_lambda_max[QUDA_MAX_MG_LEVEL]
Definition: quda.h:631
size_t struct_size
Definition: quda.h:549
char vec_outfile[QUDA_MAX_MG_LEVEL][256]
Definition: quda.h:709
QudaBoolean run_low_mode_check
Definition: quda.h:694
double setup_ca_lambda_min[QUDA_MAX_MG_LEVEL]
Definition: quda.h:598
double smoother_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:637
QudaCABasis coarse_solver_ca_basis[QUDA_MAX_MG_LEVEL]
Definition: quda.h:622
int nu_pre[QUDA_MAX_MG_LEVEL]
Definition: quda.h:640
QudaSetupType setup_type
Definition: quda.h:604
QudaBoolean vec_store[QUDA_MAX_MG_LEVEL]
Definition: quda.h:706
QudaSolveType smoother_solve_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:662
QudaFieldLocation location[QUDA_MAX_MG_LEVEL]
Definition: quda.h:671
QudaVerbosity verbosity[QUDA_MAX_MG_LEVEL]
Definition: quda.h:574
QudaBoolean setup_minimize_memory
Definition: quda.h:682
int spin_block_size[QUDA_MAX_MG_LEVEL]
Definition: quda.h:562
int n_block_ortho[QUDA_MAX_MG_LEVEL]
Definition: quda.h:571
QudaBoolean generate_all_levels
Definition: quda.h:688
QudaComputeNullVector compute_null_vector
Definition: quda.h:685
QudaSchwarzType smoother_schwarz_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:652
QudaBoolean run_oblique_proj_check
Definition: quda.h:697
QudaInvertParam * invert_param
Definition: quda.h:551
double setup_tol[QUDA_MAX_MG_LEVEL]
Definition: quda.h:583
QudaPrecision smoother_halo_precision[QUDA_MAX_MG_LEVEL]
Definition: quda.h:649
QudaBoolean global_reduction[QUDA_MAX_MG_LEVEL]
Definition: quda.h:668
QudaBoolean vec_load[QUDA_MAX_MG_LEVEL]
Definition: quda.h:700
#define printfQuda(...)
Definition: util_quda.h:114
#define warningQuda(...)
Definition: util_quda.h:132
#define errorQuda(...)
Definition: util_quda.h:120