QUDA  v1.1.0
A library for QCD on GPUs
staggered_invert_test.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <stdio.h>
3 #include <time.h>
4 #include <stdlib.h>
5 #include <string.h>
6 
7 // QUDA headers
8 #include <quda.h>
9 #include <color_spinor_field.h>
10 #include <gauge_field.h>
11 
12 // External headers
13 #include <misc.h>
14 #include <host_utils.h>
15 #include <command_line_params.h>
16 #include <dslash_reference.h>
18 #include <staggered_gauge_utils.h>
19 #include <llfat_utils.h>
20 
21 #define MAX(a, b) ((a) > (b) ? (a) : (b))
22 
24 {
25  printfQuda("running the following test:\n");
26  printfQuda("prec prec_sloppy multishift matpc_type recon recon_sloppy solve_type S_dimension T_dimension "
27  "Ls_dimension dslash_type normalization\n");
28  printfQuda(
29  "%6s %6s %d %12s %2s %2s %10s %3d/%3d/%3d %3d %2d %14s %8s\n",
33 
34  if (inv_multigrid) {
35  printfQuda("MG parameters\n");
36  printfQuda(" - number of levels %d\n", mg_levels);
37  for (int i = 0; i < mg_levels - 1; i++) {
38  printfQuda(" - level %d number of null-space vectors %d\n", i + 1, nvec[i]);
39  printfQuda(" - level %d number of pre-smoother applications %d\n", i + 1, nu_pre[i]);
40  printfQuda(" - level %d number of post-smoother applications %d\n", i + 1, nu_post[i]);
41  }
42 
43  printfQuda("MG Eigensolver parameters\n");
44  for (int i = 0; i < mg_levels; i++) {
45  if (low_mode_check || mg_eig[i]) {
46  printfQuda(" - level %d solver mode %s\n", i + 1, get_eig_type_str(mg_eig_type[i]));
47  printfQuda(" - level %d spectrum requested %s\n", i + 1, get_eig_spectrum_str(mg_eig_spectrum[i]));
49  printfQuda(" - eigenvector block size %d\n", mg_eig_block_size[i]);
50  printfQuda(" - level %d number of eigenvectors requested n_conv %d\n", i + 1, nvec[i]);
51  printfQuda(" - level %d size of eigenvector search space %d\n", i + 1, mg_eig_n_ev[i]);
52  printfQuda(" - level %d size of Krylov space %d\n", i + 1, mg_eig_n_kr[i]);
53  printfQuda(" - level %d solver tolerance %e\n", i + 1, mg_eig_tol[i]);
54  printfQuda(" - level %d convergence required (%s)\n", i + 1, mg_eig_require_convergence[i] ? "true" : "false");
55  printfQuda(" - level %d Operator: daggered (%s) , norm-op (%s)\n", i + 1,
56  mg_eig_use_dagger[i] ? "true" : "false", mg_eig_use_normop[i] ? "true" : "false");
57  if (mg_eig_use_poly_acc[i]) {
58  printfQuda(" - level %d Chebyshev polynomial degree %d\n", i + 1, mg_eig_poly_deg[i]);
59  printfQuda(" - level %d Chebyshev polynomial minumum %e\n", i + 1, mg_eig_amin[i]);
60  if (mg_eig_amax[i] <= 0)
61  printfQuda(" - level %d Chebyshev polynomial maximum will be computed\n", i + 1);
62  else
63  printfQuda(" - level %d Chebyshev polynomial maximum %e\n", i + 1, mg_eig_amax[i]);
64  }
65  printfQuda("\n");
66  }
67  }
68  }
69 
70  if (inv_deflate) {
71  printfQuda("\n Eigensolver parameters\n");
72  printfQuda(" - solver mode %s\n", get_eig_type_str(eig_type));
73  printfQuda(" - spectrum requested %s\n", get_eig_spectrum_str(eig_spectrum));
74  if (eig_type == QUDA_EIG_BLK_TR_LANCZOS) printfQuda(" - eigenvector block size %d\n", eig_block_size);
75  printfQuda(" - number of eigenvectors requested %d\n", eig_n_conv);
76  printfQuda(" - size of eigenvector search space %d\n", eig_n_ev);
77  printfQuda(" - size of Krylov space %d\n", eig_n_kr);
78  printfQuda(" - solver tolerance %e\n", eig_tol);
79  printfQuda(" - convergence required (%s)\n", eig_require_convergence ? "true" : "false");
80  if (eig_compute_svd) {
81  printfQuda(" - Operator: MdagM. Will compute SVD of M\n");
82  printfQuda(" - ***********************************************************\n");
83  printfQuda(" - **** Overriding any previous choices of operator type. ****\n");
84  printfQuda(" - **** SVD demands normal operator, will use MdagM ****\n");
85  printfQuda(" - ***********************************************************\n");
86  } else {
87  printfQuda(" - Operator: daggered (%s) , norm-op (%s)\n", eig_use_dagger ? "true" : "false",
88  eig_use_normop ? "true" : "false");
89  }
90  if (eig_use_poly_acc) {
91  printfQuda(" - Chebyshev polynomial degree %d\n", eig_poly_deg);
92  printfQuda(" - Chebyshev polynomial minumum %e\n", eig_amin);
93  if (eig_amax <= 0)
94  printfQuda(" - Chebyshev polynomial maximum will be computed\n");
95  else
96  printfQuda(" - Chebyshev polynomial maximum %e\n\n", eig_amax);
97  }
98  }
99 
100  printfQuda("Grid partition info: X Y Z T\n");
101  printfQuda(" %d %d %d %d\n", dimPartitioned(0), dimPartitioned(1), dimPartitioned(2),
102  dimPartitioned(3));
103 }
104 
105 int main(int argc, char **argv)
106 {
108  // Parse command line options
109  auto app = make_app();
114  CLI::TransformPairs<int> test_type_map {{"full", 0}, {"full_ee_prec", 1}, {"full_oo_prec", 2}, {"even", 3},
115  {"odd", 4}, {"mcg_even", 5}, {"mcg_odd", 6}};
116  app->add_option("--test", test_type, "Test method")->transform(CLI::CheckedTransformer(test_type_map));
117  try {
118  app->parse(argc, argv);
119  } catch (const CLI::ParseError &e) {
120  return app->exit(e);
121  }
124 
125  if (inv_deflate && inv_multigrid) {
126  printfQuda("Error: Cannot use both deflation and multigrid preconditioners on top level solve.\n");
127  exit(0);
128  }
129 
130  // Set values for precisions via the command line.
132 
133  // initialize QMP/MPI, QUDA comms grid and RNG (host_utils.cpp)
134  initComms(argc, argv, gridsize_from_cmdline);
135 
136  initRand();
137 
138  // Only these fermions are supported in this file. Ensure a reasonable default,
139  // ensure that the default is improved staggered
141  printfQuda("dslash_type %s not supported, defaulting to %s\n", get_dslash_str(dslash_type),
144  }
145 
146  // Need to add support for LAPLACE MG?
147  if (inv_multigrid) {
149  printfQuda("dslash_type %s not supported for multigrid preconditioner\n", get_dslash_str(dslash_type));
150  exit(0);
151  }
152  }
153 
154  // Deduce operator, solution, and operator preconditioning types
156 
158 
159  // Set QUDA internal parameters
164 
165  QudaInvertParam mg_inv_param = newQudaInvertParam();
167  QudaEigParam mg_eig_param[mg_levels];
168 
169  // params related to split grid.
174 
175  int num_sub_partition = grid_partition[0] * grid_partition[1] * grid_partition[2] * grid_partition[3];
176  bool use_split_grid = num_sub_partition > 1;
177 
178  if (inv_multigrid) {
179 
180  // Set some default values for MG solve types
182 
184  // Set sub structures
185  mg_param.invert_param = &mg_inv_param;
186 
187  for (int i = 0; i < mg_levels; i++) {
188  if (mg_eig[i]) {
189  mg_eig_param[i] = newQudaEigParam();
190  setMultigridEigParam(mg_eig_param[i], i);
191  mg_param.eig_param[i] = &mg_eig_param[i];
192  } else {
193  mg_param.eig_param[i] = nullptr;
194  }
195  }
196  setStaggeredMultigridParam(mg_param);
197  }
198 
199  QudaEigParam eig_param = newQudaEigParam();
200  if (inv_deflate) {
201  setEigParam(eig_param);
202  inv_param.eig_param = &eig_param;
203  if (use_split_grid) { errorQuda("Split grid does not work with deflation yet.\n"); }
204  } else {
205  inv_param.eig_param = nullptr;
206  }
207 
208  // This must be before the FaceBuffer is created (this is because it allocates pinned memory - FIXME)
210 
212  // Hack: use the domain wall dimensions so we may use the 5th dim for multi indexing
214 
215  // Staggered Gauge construct START
216  //-----------------------------------------------------------------------------------
217  // Allocate host staggered gauge fields
218  void* qdp_inlink[4] = {nullptr,nullptr,nullptr,nullptr};
219  void* qdp_fatlink[4] = {nullptr,nullptr,nullptr,nullptr};
220  void* qdp_longlink[4] = {nullptr,nullptr,nullptr,nullptr};
221  void *milc_fatlink = nullptr;
222  void *milc_longlink = nullptr;
223  GaugeField *cpuFat = nullptr;
224  GaugeField *cpuLong = nullptr;
225 
226  for (int dir = 0; dir < 4; dir++) {
227  qdp_inlink[dir] = malloc(V * gauge_site_size * host_gauge_data_type_size);
228  qdp_fatlink[dir] = malloc(V * gauge_site_size * host_gauge_data_type_size);
229  qdp_longlink[dir] = malloc(V * gauge_site_size * host_gauge_data_type_size);
230  }
231  milc_fatlink = malloc(4 * V * gauge_site_size * host_gauge_data_type_size);
232  milc_longlink = malloc(4 * V * gauge_site_size * host_gauge_data_type_size);
233 
234  // For load, etc
236 
237  constructStaggeredHostGaugeField(qdp_inlink, qdp_longlink, qdp_fatlink, gauge_param, argc, argv);
238  // Reorder gauge fields to MILC order
240  reorderQDPtoMILC(milc_longlink, qdp_longlink, V, gauge_site_size, gauge_param.cpu_prec, gauge_param.cpu_prec);
241 
242  // Compute plaquette. Routine is aware that the gauge fields already have the phases on them.
243  // This needs to be called before `loadFatLongGaugeQuda` because this routine also loads the
244  // gauge fields with different parameters.
245  double plaq[3];
247  printfQuda("Computed plaquette is %e (spatial = %e, temporal = %e)\n", plaq[0], plaq[1], plaq[2]);
248 
250  // Compute fat link plaquette
252  printfQuda("Computed fat link plaquette is %e (spatial = %e, temporal = %e)\n", plaq[0], plaq[1], plaq[2]);
253  }
254 
255  // Create ghost gauge fields in case of multi GPU builds.
261 
262  GaugeFieldParam cpuFatParam(milc_fatlink, gauge_param);
264  cpuFat = GaugeField::Create(cpuFatParam);
265 
267  GaugeFieldParam cpuLongParam(milc_longlink, gauge_param);
268  cpuLongParam.ghostExchange = QUDA_GHOST_EXCHANGE_PAD;
269  cpuLong = GaugeField::Create(cpuLongParam);
270 
271  loadFatLongGaugeQuda(milc_fatlink, milc_longlink, gauge_param);
272 
273  // Staggered Gauge construct END
274  //-----------------------------------------------------------------------------------
275 
276  // Setup the multigrid preconditioner
277  void *mg_preconditioner = nullptr;
278  if (inv_multigrid) {
279  if (use_split_grid) { errorQuda("Split grid does not work with MG yet."); }
280  mg_preconditioner = newMultigridQuda(&mg_param);
281  inv_param.preconditioner = mg_preconditioner;
282  }
283 
284  // Staggered vector construct START
285  //-----------------------------------------------------------------------------------
286  std::vector<quda::ColorSpinorField *> in;
287  std::vector<quda::ColorSpinorField *> out;
290  quda::ColorSpinorParam cs_param;
292  for (int k = 0; k < Nsrc; k++) {
293  in.emplace_back(quda::ColorSpinorField::Create(cs_param));
294  out.emplace_back(quda::ColorSpinorField::Create(cs_param));
295  }
296  ref = quda::ColorSpinorField::Create(cs_param);
298  // Staggered vector construct END
299  //-----------------------------------------------------------------------------------
300 
301  // Prepare rng
302  auto *rng = new quda::RNG(quda::LatticeFieldParam(gauge_param), 1234);
303  rng->Init();
304 
305  // Performance measuring
306  std::vector<double> time(Nsrc);
307  std::vector<double> gflops(Nsrc);
308  std::vector<int> iter(Nsrc);
309 
310  // Pointers for tests 5 and 6
311  // Quark masses
312  std::vector<double> masses(multishift);
313  // Host array for solutions
314  void **outArray = (void **)malloc(multishift * sizeof(void *));
315  // QUDA host array for internal checks and malloc
316  std::vector<ColorSpinorField *> qudaOutArray(multishift);
317 
318  std::vector<quda::ColorSpinorField *> _h_b(Nsrc, nullptr);
319  std::vector<quda::ColorSpinorField *> _h_x(Nsrc, nullptr);
320 
321  // QUDA invert test
322  //----------------------------------------------------------------------------
323  switch (test_type) {
324  case 0: // full parity solution, full parity system
325  case 1: // full parity solution, solving EVEN EVEN prec system
326  case 2: // full parity solution, solving ODD ODD prec system
327  case 3: // even parity solution, solving EVEN system
328  case 4: // odd parity solution, solving ODD system
329  if (multishift != 1) {
330  printfQuda("Multishift not supported for test %d\n", test_type);
331  exit(0);
332  }
333 
334  for (int k = 0; k < Nsrc; k++) { quda::spinorNoise(*in[k], *rng, QUDA_NOISE_UNIFORM); }
335 
336  if (!use_split_grid) {
337  for (int k = 0; k < Nsrc; k++) {
339  invertQuda(out[k]->V(), in[k]->V(), &inv_param);
340  time[k] = inv_param.secs;
341  gflops[k] = inv_param.gflops / inv_param.secs;
342  iter[k] = inv_param.iter;
343  printfQuda("Done: %i iter / %g secs = %g Gflops\n\n", inv_param.iter, inv_param.secs,
345  }
346  } else {
347  std::vector<void *> _hp_x(Nsrc);
348  std::vector<void *> _hp_b(Nsrc);
349  for (int k = 0; k < Nsrc; k++) {
350  _hp_x[k] = out[k]->V();
351  _hp_b[k] = in[k]->V();
352  }
354  inv_param.num_src_per_sub_partition = Nsrc / num_sub_partition;
355  invertMultiSrcStaggeredQuda(_hp_x.data(), _hp_b.data(), &inv_param, (void *)milc_fatlink, (void *)milc_longlink,
356  &gauge_param);
358  inv_param.iter /= comm_size() / num_sub_partition;
360  inv_param.gflops /= comm_size() / num_sub_partition;
362  printfQuda("Done: %d sub-partitions - %i iter / %g secs = %g Gflops\n\n", num_sub_partition, inv_param.iter,
364  }
365 
366  for (int k = 0; k < Nsrc; k++) {
367  if (verify_results)
368  verifyStaggeredInversion(tmp, ref, in[k], out[k], mass, qdp_fatlink, qdp_longlink, (void **)cpuFat->Ghost(),
369  (void **)cpuLong->Ghost(), gauge_param, inv_param, 0);
370  }
371  break;
372 
373  case 5: // multi mass CG, even parity solution, solving EVEN system
374  case 6: // multi mass CG, odd parity solution, solving ODD system
375 
376  if (use_split_grid) { errorQuda("Multishift currently doesn't support split grid.\n"); }
377 
378  if (multishift < 2) {
379  printfQuda("Multishift inverter requires more than one shift, multishift = %d\n", multishift);
380  exit(0);
381  }
382 
384  for (int i = 0; i < multishift; i++) {
385  // Set masses and offsets
386  masses[i] = 0.06 + i * i * 0.01;
387  inv_param.offset[i] = 4 * masses[i] * masses[i];
388  // Set tolerances for the heavy quarks, these can be set independently
389  // (functions of i) if desired
392  // Allocate memory and set pointers
393  qudaOutArray[i] = ColorSpinorField::Create(cs_param);
394  outArray[i] = qudaOutArray[i]->V();
395  }
396 
397  for (int k = 0; k < Nsrc; k++) {
398  quda::spinorNoise(*in[k], *rng, QUDA_NOISE_UNIFORM);
399  invertMultiShiftQuda((void **)outArray, in[k]->V(), &inv_param);
400 
401  time[k] = inv_param.secs;
402  gflops[k] = inv_param.gflops / inv_param.secs;
403  iter[k] = inv_param.iter;
404  printfQuda("Done: %i iter / %g secs = %g Gflops\n\n", inv_param.iter, inv_param.secs,
406 
407  for (int i = 0; i < multishift; i++) {
408  printfQuda("%dth solution: mass=%f, ", i, masses[i]);
409  verifyStaggeredInversion(tmp, ref, in[k], qudaOutArray[i], masses[i], qdp_fatlink, qdp_longlink,
410  (void **)cpuFat->Ghost(), (void **)cpuLong->Ghost(), gauge_param, inv_param, i);
411  }
412  }
413 
414  for (int i = 0; i < multishift; i++) delete qudaOutArray[i];
415  break;
416 
417  default: errorQuda("Unsupported test type");
418 
419  } // switch
420 
421  // Compute timings
422  if (Nsrc > 1 && !use_split_grid) performanceStats(time, gflops, iter);
423 
424  // Free RNG
425  rng->Release();
426  delete rng;
427 
428  // Free the multigrid solver
429  if (inv_multigrid) destroyMultigridQuda(mg_preconditioner);
430 
431  // Clean up gauge fields
432  for (int dir = 0; dir < 4; dir++) {
433  if (qdp_inlink[dir] != nullptr) {
434  free(qdp_inlink[dir]);
435  qdp_inlink[dir] = nullptr;
436  }
437  if (qdp_fatlink[dir] != nullptr) {
438  free(qdp_fatlink[dir]);
439  qdp_fatlink[dir] = nullptr;
440  }
441  if (qdp_longlink[dir] != nullptr) {
442  free(qdp_longlink[dir]);
443  qdp_longlink[dir] = nullptr;
444  }
445  }
446  if (milc_fatlink != nullptr) { free(milc_fatlink); milc_fatlink = nullptr; }
447  if (milc_longlink != nullptr) { free(milc_longlink); milc_longlink = nullptr; }
448 
449  if (cpuFat != nullptr) { delete cpuFat; cpuFat = nullptr; }
450  if (cpuLong != nullptr) { delete cpuLong; cpuLong = nullptr; }
451 
452  for (auto in_vec : in) { delete in_vec; }
453  for (auto out_vec : out) { delete out_vec; }
454  delete ref;
455  delete tmp;
456  free(outArray);
457 
458  if (use_split_grid) {
459  for (auto p : _h_b) { delete p; }
460  for (auto p : _h_x) { delete p; }
461  }
462 
463  // Finalize the QUDA library
464  endQuda();
465 
466  // Finalize the communications layer
467  finalizeComms();
468 
469  return 0;
470 }
static ColorSpinorField * Create(const ColorSpinorParam &param)
const void ** Ghost() const
Definition: gauge_field.h:368
Class declaration to initialize and hold CURAND RNG states.
Definition: random_quda.h:23
int comm_size(void)
void comm_allreduce_int(int *data)
void comm_allreduce_max(double *data)
void comm_allreduce(double *data)
bool inv_multigrid
QudaSolveType solve_type
int eig_poly_deg
QudaEigType eig_type
quda::mgarray< int > mg_eig_poly_deg
quda::mgarray< QudaEigType > mg_eig_type
QudaReconstructType link_recon_sloppy
int eig_n_ev
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
double eig_tol
double mass
QudaReconstructType link_recon
int test_type
quda::mgarray< bool > mg_eig
int device_ordinal
bool eig_compute_svd
QudaVerbosity verbosity
int & ydim
void add_multigrid_option_group(std::shared_ptr< QUDAApp > quda_app)
bool eig_use_poly_acc
std::array< int, 4 > grid_partition
bool verify_results
quda::mgarray< int > nu_post
quda::mgarray< int > nu_pre
quda::mgarray< int > mg_eig_n_kr
quda::mgarray< double > mg_eig_amin
int eig_block_size
double eig_amax
quda::mgarray< int > nvec
bool eig_use_dagger
bool inv_deflate
quda::mgarray< QudaEigSpectrumType > mg_eig_spectrum
int & zdim
QudaDslashType dslash_type
bool eig_use_normop
quda::mgarray< bool > mg_eig_use_dagger
bool low_mode_check
quda::mgarray< int > mg_eig_n_ev
int eig_n_kr
int mg_levels
quda::mgarray< double > mg_eig_amax
void add_eigen_option_group(std::shared_ptr< QUDAApp > quda_app)
int eig_n_conv
QudaMatPCType matpc_type
int multishift
QudaEigSpectrumType eig_spectrum
quda::mgarray< bool > mg_eig_use_poly_acc
int Nsrc
quda::mgarray< double > mg_eig_tol
void add_deflation_option_group(std::shared_ptr< QUDAApp > quda_app)
quda::mgarray< bool > mg_eig_use_normop
QudaPrecision prec
int Lsdim
bool eig_require_convergence
int & tdim
quda::mgarray< bool > mg_eig_require_convergence
quda::mgarray< int > mg_eig_block_size
int & xdim
void add_comms_option_group(std::shared_ptr< QUDAApp > quda_app)
double eig_amin
std::array< int, 4 > gridsize_from_cmdline
QudaMassNormalization normalization
QudaPrecision prec_sloppy
int V
Definition: host_utils.cpp:37
void setDims(int *)
Definition: host_utils.cpp:315
cudaColorSpinorField * tmp
Definition: covdev_test.cpp:34
QudaGaugeParam gauge_param
Definition: covdev_test.cpp:26
QudaInvertParam inv_param
Definition: covdev_test.cpp:27
void verifyStaggeredInversion(quda::ColorSpinorField *tmp, quda::ColorSpinorField *ref, quda::ColorSpinorField *in, quda::ColorSpinorField *out, double mass, void *qdp_fatlink[], void *qdp_longlink[], void **ghost_fatlink, void **ghost_longlink, QudaGaugeParam &gauge_param, QudaInvertParam &inv_param, int shift)
@ QUDA_NOISE_UNIFORM
Definition: enum_quda.h:385
@ QUDA_STAGGERED_DSLASH
Definition: enum_quda.h:97
@ QUDA_ASQTAD_DSLASH
Definition: enum_quda.h:98
@ QUDA_LAPLACE_DSLASH
Definition: enum_quda.h:101
@ QUDA_CPU_FIELD_LOCATION
Definition: enum_quda.h:325
@ QUDA_BOOLEAN_FALSE
Definition: enum_quda.h:460
@ QUDA_BOOLEAN_TRUE
Definition: enum_quda.h:461
@ QUDA_RECONSTRUCT_NO
Definition: enum_quda.h:70
@ QUDA_EIG_BLK_TR_LANCZOS
Definition: enum_quda.h:138
@ QUDA_GHOST_EXCHANGE_PAD
Definition: enum_quda.h:509
@ QUDA_INVALID_SOLVE
Definition: enum_quda.h:175
@ QUDA_SU3_LINKS
Definition: enum_quda.h:24
@ QUDA_ASQTAD_LONG_LINKS
Definition: enum_quda.h:32
@ QUDA_ASQTAD_FAT_LINKS
Definition: enum_quda.h:31
#define gauge_site_size
Definition: face_gauge.cpp:34
size_t host_gauge_data_type_size
Definition: host_utils.cpp:65
int dimPartitioned(int dim)
Definition: host_utils.cpp:376
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
Definition: host_utils.cpp:255
void setQudaMgSolveTypes()
Definition: host_utils.cpp:81
void finalizeComms()
Definition: host_utils.cpp:292
void performanceStats(std::vector< double > &time, std::vector< double > &gflops, std::vector< int > &iter)
void setQudaDefaultMgTestParams()
Definition: host_utils.cpp:89
void dw_setDims(int *X, const int L5)
Definition: host_utils.cpp:353
void setQudaPrecisions()
Definition: host_utils.cpp:69
void initRand()
Definition: host_utils.cpp:302
void setStaggeredInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:868
void constructStaggeredTestSpinorParam(quda::ColorSpinorParam *csParam, const QudaInvertParam *inv_param, const QudaGaugeParam *gauge_param)
void reorderQDPtoMILC(void *milc_out, void **qdp_in, int V, int siteSize, QudaPrecision out_precision, QudaPrecision in_precision)
void setEigParam(QudaEigParam &eig_param)
Definition: set_params.cpp:263
void setQudaStaggeredInvTestParams()
void setStaggeredGaugeParam(QudaGaugeParam &gauge_param)
Definition: set_params.cpp:69
void setStaggeredMGInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:792
void setMultigridEigParam(QudaEigParam &eig_param, int level)
Definition: set_params.cpp:712
void constructStaggeredHostGaugeField(void **qdp_inlink, void **qdp_longlink, void **qdp_fatlink, QudaGaugeParam &gauge_param, int argc, char **argv)
void setStaggeredMultigridParam(QudaMultigridParam &mg_param)
Definition: set_params.cpp:951
void loadFatLongGaugeQuda(QudaInvertParam *inv_param, QudaGaugeParam *gauge_param, void *milc_fatlinks, void *milc_longlinks)
const char * get_matpc_str(QudaMatPCType type)
Definition: misc.cpp:200
const char * get_prec_str(QudaPrecision prec)
Definition: misc.cpp:26
const char * get_solve_str(QudaSolveType type)
Definition: misc.cpp:231
const char * get_eig_spectrum_str(QudaEigSpectrumType type)
Definition: misc.cpp:154
const char * get_dslash_str(QudaDslashType type)
Definition: misc.cpp:118
const char * get_eig_type_str(QudaEigType type)
Definition: misc.cpp:171
const char * get_mass_normalization_str(QudaMassNormalization type)
Definition: misc.cpp:186
const char * get_recon_str(QudaReconstructType recon)
Definition: misc.cpp:68
void spinorNoise(ColorSpinorField &src, RNG &randstates, QudaNoiseType type)
Generate a random noise spinor. This variant allows the user to manage the RNG state.
Main header file for the QUDA library.
void * newMultigridQuda(QudaMultigridParam *param)
QudaGaugeParam newQudaGaugeParam(void)
void invertMultiShiftQuda(void **_hp_x, void *_hp_b, QudaInvertParam *param)
void initQuda(int device)
void invertMultiSrcStaggeredQuda(void **_hp_x, void **_hp_b, QudaInvertParam *param, void *milc_fatlinks, void *milc_longlinks, QudaGaugeParam *gauge_param)
Really the same with @invertMultiSrcQuda but for staggered-style fermions, by accepting pointers to f...
QudaMultigridParam newQudaMultigridParam(void)
QudaInvertParam newQudaInvertParam(void)
QudaEigParam newQudaEigParam(void)
void endQuda(void)
void destroyMultigridQuda(void *mg_instance)
Free resources allocated by the multigrid solver.
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
void computeStaggeredPlaquetteQDPOrder(void **qdp_link, double plaq[3], const QudaGaugeParam &gauge_param_in, const QudaDslashType dslash_type)
int main(int argc, char **argv)
void display_test_info()
QudaBoolean preserve_deflation
Definition: quda.h:431
QudaReconstructType reconstruct
Definition: quda.h:49
QudaLinkType type
Definition: quda.h:41
QudaFieldLocation location
Definition: quda.h:33
int X[4]
Definition: quda.h:35
QudaPrecision cpu_prec
Definition: quda.h:46
double gflops
Definition: quda.h:277
double tol_hq
Definition: quda.h:140
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:206
int num_offset
Definition: quda.h:186
int split_grid[QUDA_MAX_DIM]
Definition: quda.h:195
int num_src_per_sub_partition
Definition: quda.h:190
double secs
Definition: quda.h:278
double offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:200
double tol_offset[QUDA_MAX_MULTI_SHIFT]
Definition: quda.h:203
void * eig_param
Definition: quda.h:306
double tol
Definition: quda.h:138
void * preconditioner
Definition: quda.h:300
QudaEigParam * eig_param[QUDA_MAX_MG_LEVEL]
Definition: quda.h:553
QudaInvertParam * invert_param
Definition: quda.h:551
QudaGhostExchange ghostExchange
Definition: lattice_field.h:77
#define printfQuda(...)
Definition: util_quda.h:114
void setVerbosity(QudaVerbosity verbosity)
Definition: util_quda.cpp:25
#define errorQuda(...)
Definition: util_quda.h:120