QUDA  v1.1.0
A library for QCD on GPUs
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 <string.h>
5 
6 // In a typical application, quda.h is the only QUDA header required.
7 #include <quda.h>
8 // This extended test utilizes some QUDA internals
9 #include <qio_field.h>
10 #include <gauge_field.h>
11 #include <pgauge_monte.h>
12 #include <unitarization_links.h>
13 
14 #include <host_utils.h>
15 #include <command_line_params.h>
16 #include <dslash_reference.h>
19 #include "misc.h"
20 
21 namespace quda {
22  extern void setTransferGPU(bool);
23 }
24 
26 {
27  using namespace quda;
28  const double unitarize_eps = 1e-14;
29  const double max_error = 1e-10;
30  const int reunit_allow_svd = 1;
31  const int reunit_svd_only = 0;
32  const double svd_rel_error = 1e-6;
33  const double svd_abs_error = 1e-6;
34  setUnitarizeLinksConstants(unitarize_eps, max_error, reunit_allow_svd, reunit_svd_only, svd_rel_error, svd_abs_error);
35 }
36 
38 {
39  using namespace quda;
40  int *num_failures_dev = (int *)device_malloc(sizeof(int));
41  int num_failures;
42  qudaMemset(num_failures_dev, 0, sizeof(int));
43  unitarizeLinks(*cudaInGauge, num_failures_dev);
44 
45  qudaMemcpy(&num_failures, num_failures_dev, sizeof(int), cudaMemcpyDeviceToHost);
46  if (num_failures > 0) errorQuda("Error in the unitarization\n");
47  device_free(num_failures_dev);
48 }
49 
51 {
52  printfQuda("running the following test:\n");
53 
54  printfQuda("prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension Ls_dimension\n");
55  printfQuda("%s %s %s %s %d/%d/%d %d %d\n", get_prec_str(prec),
57  tdim, Lsdim);
58 
59  printfQuda("MG parameters\n");
60  printfQuda(" - number of levels %d\n", mg_levels);
61  for (int i=0; i<mg_levels-1; i++) {
62  printfQuda(" - level %d number of null-space vectors %d\n", i+1, nvec[i]);
63  printfQuda(" - level %d number of pre-smoother applications %d\n", i+1, nu_pre[i]);
64  printfQuda(" - level %d number of post-smoother applications %d\n", i+1, nu_post[i]);
65  }
66 
67  printfQuda("Outer solver paramers\n");
68  printfQuda(" - pipeline = %d\n", pipeline);
69 
70  printfQuda("Eigensolver parameters\n");
71  for (int i = 0; i < mg_levels; i++) {
72  if (low_mode_check || mg_eig[i]) {
73  printfQuda(" - level %d solver mode %s\n", i + 1, get_eig_type_str(mg_eig_type[i]));
74  printfQuda(" - level %d spectrum requested %s\n", i + 1, get_eig_spectrum_str(mg_eig_spectrum[i]));
75  if (mg_eig_type[i] == QUDA_EIG_BLK_TR_LANCZOS) printfQuda(" - eigenvector block size %d\n", mg_eig_block_size[i]);
76  printfQuda(" - level %d number of eigenvectors requested n_conv %d\n", i + 1, nvec[i]);
77  printfQuda(" - level %d size of eigenvector search space %d\n", i + 1, mg_eig_n_ev[i]);
78  printfQuda(" - level %d size of Krylov space %d\n", i + 1, mg_eig_n_kr[i]);
79  printfQuda(" - level %d solver tolerance %e\n", i + 1, mg_eig_tol[i]);
80  printfQuda(" - level %d convergence required (%s)\n", i + 1, mg_eig_require_convergence[i] ? "true" : "false");
81  printfQuda(" - level %d Operator: daggered (%s) , norm-op (%s)\n", i + 1, mg_eig_use_dagger[i] ? "true" : "false",
82  mg_eig_use_normop[i] ? "true" : "false");
83  if (mg_eig_use_poly_acc[i]) {
84  printfQuda(" - level %d Chebyshev polynomial degree %d\n", i + 1, mg_eig_poly_deg[i]);
85  printfQuda(" - level %d Chebyshev polynomial minumum %e\n", i + 1, mg_eig_amin[i]);
86  if (mg_eig_amax[i] <= 0)
87  printfQuda(" - level %d Chebyshev polynomial maximum will be computed\n", i + 1);
88  else
89  printfQuda(" - level %d Chebyshev polynomial maximum %e\n", i + 1, mg_eig_amax[i]);
90  }
91  printfQuda("\n");
92  }
93  }
94 
95  printfQuda("Grid partition info: X Y Z T\n");
96  printfQuda(" %d %d %d %d\n", dimPartitioned(0), dimPartitioned(1), dimPartitioned(2),
97  dimPartitioned(3));
98 }
99 
100 int main(int argc, char **argv)
101 {
103  // command line options
104  auto app = make_app();
106  try {
107  app->parse(argc, argv);
108  } catch (const CLI::ParseError &e) {
109  return app->exit(e);
110  }
111 
112  // Set values for precisions via the command line.
114 
115  // initialize QMP/MPI, QUDA comms grid and RNG (host_utils.cpp)
116  initComms(argc, argv, gridsize_from_cmdline);
117 
118  // call srand() with a rank-dependent seed
119  initRand();
120 
121  // Only these fermions are supported in this file
126  printfQuda("dslash_type %d not supported\n", dslash_type);
127  exit(0);
128  }
129 
130  if (inv_multigrid) {
131  // Only these fermions are supported with MG
134  printfQuda("dslash_type %d not supported for MG\n", dslash_type);
135  exit(0);
136  }
137 
138  // Only these solve types are supported with MG
140  printfQuda("Solve_type %d not supported with MG. Please use QUDA_DIRECT_SOLVE or QUDA_DIRECT_PC_SOLVE\n\n",
141  solve_type);
142  exit(0);
143  }
144  }
145 
146  // Set QUDA's internal parameters
151  QudaInvertParam mg_inv_param = newQudaInvertParam();
152  QudaEigParam mg_eig_param[mg_levels];
153 
154  if (inv_multigrid) {
157  // Set sub structures
158  mg_param.invert_param = &mg_inv_param;
159  for (int i = 0; i < mg_levels; i++) {
160  if (mg_eig[i]) {
161  mg_eig_param[i] = newQudaEigParam();
162  setMultigridEigParam(mg_eig_param[i], i);
163  mg_param.eig_param[i] = &mg_eig_param[i];
164  } else {
165  mg_param.eig_param[i] = nullptr;
166  }
167  }
168  // Set MG
169  setMultigridParam(mg_param);
170  } else {
172  }
173 
174  // All parameters have been set. Display the parameters via stdout
176 
177  // initialize the QUDA library
179 
180  // *** Everything between here and the timer is application specific
182 
183  // Allocate host side memory for the gauge field.
184  //----------------------------------------------------------------------------
185  void *gauge[4];
186  // Allocate space on the host (always best to allocate and free in the same scope)
187  for (int dir = 0; dir < 4; dir++) gauge[dir] = malloc(V * gauge_site_size * host_gauge_data_type_size);
188  constructHostGaugeField(gauge, gauge_param, argc, argv);
189  // Load the gauge field to the device
190  loadGaugeQuda((void *)gauge, &gauge_param);
191 
192  // Allocate host side memory for clover terms if needed.
193  //----------------------------------------------------------------------------
194  void *clover = nullptr;
195  void *clover_inv = nullptr;
196  // Allocate space on the host (always best to allocate and free in the same scope)
198  clover = malloc(V * clover_site_size * host_clover_data_type_size);
199  clover_inv = malloc(V * clover_site_size * host_spinor_data_type_size);
200  constructHostCloverField(clover, clover_inv, inv_param);
201  // This line ensures that if we need to construct the clover inverse (in either the smoother or the solver) we do so
204  }
205  // Load the clover terms to the device
206  loadCloverQuda(clover, clover_inv, &inv_param);
207  // Restore actual solve_type we want to do
209  }
210 
211  void *spinorIn = malloc(V * spinor_site_size * host_spinor_data_type_size * inv_param.Ls);
212  void *spinorCheck = malloc(V * spinor_site_size * host_spinor_data_type_size * inv_param.Ls);
214 
215  // start the timer
216  double time0 = -((double)clock());
217  {
218  using namespace quda;
220  gParam.pad = 0;
226  cudaGaugeField *gauge = new cudaGaugeField(gParam);
227 
228  int pad = 0;
229  int y[4];
230  int R[4] = {0,0,0,0};
231  for(int dir=0; dir<4; ++dir) if(comm_dim_partitioned(dir)) R[dir] = 2;
232  for(int dir=0; dir<4; ++dir) y[dir] = gauge_param.X[dir] + 2 * R[dir];
233  GaugeFieldParam gParamEx(y, prec, link_recon,
235  gParamEx.create = QUDA_ZERO_FIELD_CREATE;
236  gParamEx.order = gParam.order;
237  gParamEx.siteSubset = QUDA_FULL_SITE_SUBSET;
238  gParamEx.t_boundary = gParam.t_boundary;
239  gParamEx.nFace = 1;
240  for(int dir=0; dir<4; ++dir) gParamEx.r[dir] = R[dir];
241  cudaGaugeField *gaugeEx = new cudaGaugeField(gParamEx);
242 
246 
247  // CURAND random generator initialization
248  RNG *randstates = new RNG(*gauge, 1234);
249  randstates->Init();
250  int nsteps = 10;
251  int nhbsteps = 1;
252  int novrsteps = 1;
253  bool coldstart = false;
254  double beta_value = 6.2;
255 
256  if(link_recon != QUDA_RECONSTRUCT_8 && coldstart) InitGaugeField( *gaugeEx);
257  else
258  InitGaugeField(*gaugeEx, *randstates);
259  // Reunitarization setup
261 
262  // Do a series of Heatbath updates
263  Monte(*gaugeEx, *randstates, beta_value, 100 * nhbsteps, 100 * novrsteps);
264 
265  // Copy into regular field
266  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
267 
268  // load the gauge field from gauge
269  gauge_param.gauge_order = gauge->Order();
271  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
272  gaugeObservablesQuda(&obs_param);
273 
274  // Demonstrate MG evolution on an evolving gauge field
275  //----------------------------------------------------
276  printfQuda("\n======================================================\n");
277  printfQuda("Running pure gauge evolution test at constant quark mass\n");
278  printfQuda("======================================================\n");
279  printfQuda("step=%d plaquette = %g topological charge = %g, mass = %g kappa = %g, mu = %g\n", 0,
280  obs_param.plaquette[0], obs_param.qcharge, inv_param.mass, inv_param.kappa, inv_param.mu);
281 
282  // this line ensure that if we need to construct the clover inverse (in either the smoother or the solver) we do so
286  loadCloverQuda(clover, clover_inv, &inv_param);
287  inv_param.solve_type = solve_type; // restore actual solve_type we want to do
288 
289  // Create a point source at 0 (in each subvolume... FIXME)
293 
295  for (int i = 0; i < inv_param.Ls * V * spinor_site_size; i++) ((float *)spinorIn)[i] = rand() / (float)RAND_MAX;
296  } else {
297  for (int i = 0; i < inv_param.Ls * V * spinor_site_size; i++) ((double *)spinorIn)[i] = rand() / (double)RAND_MAX;
298  }
299 
300  // Setup the multigrid solver
301  void *mg_preconditioner = nullptr;
302  if (inv_multigrid) {
303  mg_preconditioner = newMultigridQuda(&mg_param);
304  inv_param.preconditioner = mg_preconditioner;
305  }
306  invertQuda(spinorOut, spinorIn, &inv_param);
307 
308  for (int step = 1; step < nsteps; ++step) {
309  freeGaugeQuda();
310  Monte( *gaugeEx, *randstates, beta_value, nhbsteps, novrsteps);
311 
312  // Reunitarize gauge links
313  CallUnitarizeLinks(gaugeEx);
314 
315  // Copy into regular field
316  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
317  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
318 
320  constructHostCloverField(clover, clover_inv, inv_param);
321 
324  }
325  // Load the clover terms to the device
326  loadCloverQuda(clover, clover_inv, &inv_param);
327  // Restore actual solve_type we want to do
329  }
330 
331  // Recompute Gauge Observables
332  gaugeObservablesQuda(&obs_param);
333  printfQuda("step=%d plaquette = %g topological charge = %g, mass = %g kappa = %g, mu = %g\n", step,
334  obs_param.plaquette[0], obs_param.qcharge, inv_param.mass, inv_param.kappa, inv_param.mu);
335 
336  // Update the multigrid operator for new gauge and clover fields
337  if (inv_multigrid) updateMultigridQuda(mg_preconditioner, &mg_param);
338  invertQuda(spinorOut, spinorIn, &inv_param);
339 
341  char vec_outfile[QUDA_MAX_MG_LEVEL][256];
342  for (int i=0; i<mg_param.n_level; i++) {
343  strcpy(vec_outfile[i], mg_param.vec_outfile[i]);
344  sprintf(mg_param.vec_outfile[i], "dump_step_evolve_%d", step);
345  }
346  warningQuda("Solver failed to converge within max iteration count - dumping null vectors to %s",
347  mg_param.vec_outfile[0]);
348 
349  dumpMultigridQuda(mg_preconditioner, &mg_param);
350  for (int i=0; i<mg_param.n_level; i++) {
351  strcpy(mg_param.vec_outfile[i], vec_outfile[i]); // restore output file name
352  }
353  }
354  }
355 
356  // free the multigrid solver
357  if (inv_multigrid) destroyMultigridQuda(mg_preconditioner);
358 
359  // Demonstrate MG evolution on a fixed gauge field and different masses
360  //---------------------------------------------------------------------
361  // setup the multigrid solver
362  printfQuda("\n====================================================\n");
363  printfQuda("Running MG mass scaling test at constant gauge field\n");
364  printfQuda("====================================================\n");
365 
366  if (inv_multigrid) {
368  for (int i = 0; i < mg_param.n_level; i++) mg_param.setup_maxiter_refresh[i] = 0;
369  mg_preconditioner = newMultigridQuda(&mg_param);
370  inv_param.preconditioner = mg_preconditioner;
371  }
372 
373  invertQuda(spinorOut, spinorIn, &inv_param);
374 
375  freeGaugeQuda();
376 
377  // Reunitarize gauge links...
378  CallUnitarizeLinks(gaugeEx);
379 
380  // copy into regular field
381  copyExtendedGauge(*gauge, *gaugeEx, QUDA_CUDA_FIELD_LOCATION);
382 
383  loadGaugeQuda(gauge->Gauge_p(), &gauge_param);
384  // Recompute Gauge Observables
385  gaugeObservablesQuda(&obs_param);
386 
387  for (int step = 1; step < nsteps; ++step) {
388 
389  // Increment the mass/kappa and mu values to emulate heavy/light flavour updates
390  if (kappa == -1.0) {
391  inv_param.mass = mass + 0.01 * step;
392  inv_param.kappa = 1.0 / (2.0 * (1 + 3 / anisotropy + mass + 0.01 * step));
393  } else {
394  inv_param.kappa = kappa - 0.001 * step;
395  inv_param.mass = 0.5 / (kappa - 0.001 * step) - (1 + 3 / anisotropy);
396  }
397  if (inv_multigrid) {
398  mg_param.invert_param->mass = inv_param.mass;
399  mg_param.invert_param->kappa = inv_param.kappa;
400  }
401 
403  // Multiply by -1.0 to emulate twist switch
404  inv_param.mu = -1.0 * mu + 0.01 * step;
405  if (inv_multigrid) mg_param.invert_param->mu = inv_param.mu;
406  }
407 
408  // as needed to bake in mu
410  constructHostCloverField(clover, clover_inv, inv_param);
411 
414  }
415  // Load the clover terms to the device
416  loadCloverQuda(clover, clover_inv, &inv_param);
417  // Restore actual solve_type we want to do
419  }
420 
421  printfQuda("step=%d plaquette = %g topological charge = %g, mass = %g kappa = %g, mu = %g\n", step,
422  obs_param.plaquette[0], obs_param.qcharge, inv_param.mass, inv_param.kappa, inv_param.mu);
423 
424  if (inv_multigrid) updateMultigridQuda(mg_preconditioner, &mg_param);
425  invertQuda(spinorOut, spinorIn, &inv_param);
426 
428  char vec_outfile[QUDA_MAX_MG_LEVEL][256];
429  for (int i = 0; i < mg_param.n_level; i++) {
430  strcpy(vec_outfile[i], mg_param.vec_outfile[i]);
431  sprintf(mg_param.vec_outfile[i], "dump_step_shift_%d", step);
432  }
433  warningQuda("Solver failed to converge within max iteration count - dumping null vectors to %s",
434  mg_param.vec_outfile[0]);
435 
436  dumpMultigridQuda(mg_preconditioner, &mg_param);
437  for (int i = 0; i < mg_param.n_level; i++) {
438  strcpy(mg_param.vec_outfile[i], vec_outfile[i]); // restore output file name
439  }
440  }
441  }
442 
443  // free the multigrid solver
444  if (inv_multigrid) destroyMultigridQuda(mg_preconditioner);
445 
446  delete gauge;
447  delete gaugeEx;
448  //Release all temporary memory used for data exchange between GPUs in multi-GPU mode
450 
451  randstates->Release();
452  delete randstates;
453  }
454 
455  // stop the timer
456  time0 += clock();
457  time0 /= CLOCKS_PER_SEC;
458 
459  printfQuda("\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n", inv_param.iter, inv_param.secs,
460  inv_param.gflops / inv_param.secs, time0);
461 
462  freeGaugeQuda();
464 
465  // finalize the QUDA library
466  endQuda();
467 
468  // finalize the communications layer
469  finalizeComms();
470 
472  if (clover) free(clover);
473  if (clover_inv) free(clover_inv);
474  }
475 
476  for (int dir = 0; dir<4; dir++) free(gauge[dir]);
477 
478  free(spinorIn);
479  free(spinorCheck);
480  free(spinorOut);
481 
482  return 0;
483 }
QudaGaugeFieldOrder Order() const
Definition: gauge_field.h:287
Class declaration to initialize and hold CURAND RNG states.
Definition: random_quda.h:23
void Release()
void Init()
int comm_dim_partitioned(int dim)
bool inv_multigrid
double kappa
QudaSolveType solve_type
quda::mgarray< int > mg_eig_poly_deg
quda::mgarray< QudaEigType > mg_eig_type
QudaReconstructType link_recon_sloppy
bool mg_eig_preserve_deflation
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
double mass
QudaReconstructType link_recon
quda::mgarray< bool > mg_eig
double anisotropy
int device_ordinal
int & ydim
void add_multigrid_option_group(std::shared_ptr< QUDAApp > quda_app)
quda::mgarray< int > nu_post
quda::mgarray< int > nu_pre
quda::mgarray< int > mg_eig_n_kr
quda::mgarray< double > mg_eig_amin
quda::mgarray< int > nvec
double mu
quda::mgarray< QudaEigSpectrumType > mg_eig_spectrum
int & zdim
QudaDslashType dslash_type
quda::mgarray< bool > mg_eig_use_dagger
bool low_mode_check
quda::mgarray< int > mg_eig_n_ev
int mg_levels
quda::mgarray< double > mg_eig_amax
int pipeline
quda::mgarray< bool > mg_eig_use_poly_acc
quda::mgarray< double > mg_eig_tol
quda::mgarray< bool > mg_eig_use_normop
QudaPrecision prec
int Lsdim
int & tdim
quda::mgarray< bool > mg_eig_require_convergence
quda::mgarray< int > mg_eig_block_size
int & xdim
std::array< int, 4 > gridsize_from_cmdline
QudaPrecision prec_sloppy
int V
Definition: host_utils.cpp:37
void * memset(void *s, int c, size_t n)
void setDims(int *)
Definition: host_utils.cpp:315
cpuColorSpinorField * spinorOut
Definition: covdev_test.cpp:31
QudaGaugeParam gauge_param
Definition: covdev_test.cpp:26
QudaInvertParam inv_param
Definition: covdev_test.cpp:27
@ QUDA_WILSON_DSLASH
Definition: enum_quda.h:90
@ 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_DOMAIN_WALL_4D_DSLASH
Definition: enum_quda.h:94
@ QUDA_CUDA_FIELD_LOCATION
Definition: enum_quda.h:326
@ QUDA_FULL_SITE_SUBSET
Definition: enum_quda.h:333
@ QUDA_BOOLEAN_FALSE
Definition: enum_quda.h:460
@ QUDA_BOOLEAN_TRUE
Definition: enum_quda.h:461
@ QUDA_RECONSTRUCT_8
Definition: enum_quda.h:72
@ QUDA_VECTOR_GEOMETRY
Definition: enum_quda.h:501
@ QUDA_EIG_BLK_TR_LANCZOS
Definition: enum_quda.h:138
@ QUDA_GHOST_EXCHANGE_EXTENDED
Definition: enum_quda.h:510
@ QUDA_GHOST_EXCHANGE_NO
Definition: enum_quda.h:508
@ QUDA_SINGLE_PRECISION
Definition: enum_quda.h:64
@ QUDA_ZERO_FIELD_CREATE
Definition: enum_quda.h:361
@ QUDA_NULL_FIELD_CREATE
Definition: enum_quda.h:360
@ QUDA_DIRECT_SOLVE
Definition: enum_quda.h:167
@ QUDA_DIRECT_PC_SOLVE
Definition: enum_quda.h:169
#define gauge_site_size
Definition: face_gauge.cpp:34
GaugeFieldParam gParam
void constructHostCloverField(void *clover, void *clover_inv, QudaInvertParam &inv_param)
Definition: host_utils.cpp:186
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
size_t host_spinor_data_type_size
Definition: host_utils.cpp:66
void setQudaMgSolveTypes()
Definition: host_utils.cpp:81
void finalizeComms()
Definition: host_utils.cpp:292
void setQudaDefaultMgTestParams()
Definition: host_utils.cpp:89
size_t host_clover_data_type_size
Definition: host_utils.cpp:67
void setQudaPrecisions()
Definition: host_utils.cpp:69
void constructHostGaugeField(void **gauge, QudaGaugeParam &gauge_param, int argc, char **argv)
Definition: host_utils.cpp:166
void initRand()
Definition: host_utils.cpp:302
#define clover_site_size
Definition: host_utils.h:11
void setWilsonGaugeParam(QudaGaugeParam &gauge_param)
Definition: set_params.cpp:37
void setMultigridInvertParam(QudaInvertParam &inv_param)
Definition: set_params.cpp:600
#define spinor_site_size
Definition: host_utils.h:9
void setMultigridEigParam(QudaEigParam &eig_param, int level)
Definition: set_params.cpp:712
void setMultigridParam(QudaMultigridParam &mg_param)
Definition: set_params.cpp:326
#define device_malloc(size)
Definition: malloc_quda.h:102
#define device_free(ptr)
Definition: malloc_quda.h:110
void setInvertParam(QudaInvertParam &invertParam, QudaInvertArgs_t &inv_args, int external_precision, int quda_precision, double kappa, double reliable_delta)
const char * get_prec_str(QudaPrecision prec)
Definition: misc.cpp:26
const char * get_eig_spectrum_str(QudaEigSpectrumType type)
Definition: misc.cpp:154
const char * get_eig_type_str(QudaEigType type)
Definition: misc.cpp:171
const char * get_recon_str(QudaReconstructType recon)
Definition: misc.cpp:68
void CallUnitarizeLinks(quda::cudaGaugeField *cudaInGauge)
int main(int argc, char **argv)
void setReunitarizationConsts()
void display_test_info()
void Monte(GaugeField &data, RNG &rngstate, double Beta, int nhb, int nover)
Perform heatbath and overrelaxation. Performs nhb heatbath steps followed by nover overrelaxation ste...
void setUnitarizeLinksConstants(double unitarize_eps, double max_error, bool allow_svd, bool svd_only, double svd_rel_error, double svd_abs_error)
void InitGaugeField(GaugeField &data)
Perform a cold start to the gauge field, identity SU(3) matrix, also fills the ghost links in multi-G...
void PGaugeExchangeFree()
Release all allocated memory used to exchange data between nodes.
void unitarizeLinks(GaugeField &outfield, const GaugeField &infield, int *fails)
void setTransferGPU(bool)
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
Main header file for the QUDA library.
void dumpMultigridQuda(void *mg_instance, QudaMultigridParam *param)
Dump the null-space vectors to disk.
void * newMultigridQuda(QudaMultigridParam *param)
QudaGaugeParam newQudaGaugeParam(void)
void freeGaugeQuda(void)
void initQuda(int device)
QudaMultigridParam newQudaMultigridParam(void)
QudaGaugeObservableParam newQudaGaugeObservableParam(void)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
void loadCloverQuda(void *h_clover, void *h_clovinv, QudaInvertParam *inv_param)
void freeCloverQuda(void)
QudaInvertParam newQudaInvertParam(void)
QudaEigParam newQudaEigParam(void)
void endQuda(void)
void gaugeObservablesQuda(QudaGaugeObservableParam *param)
Calculates a variety of gauge-field observables. If a smeared gauge field is presently loaded (in gau...
void updateMultigridQuda(void *mg_instance, QudaMultigridParam *param)
Updates the multigrid preconditioner for the new gauge / clover field.
void destroyMultigridQuda(void *mg_instance)
Free resources allocated by the multigrid solver.
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
#define qudaMemcpy(dst, src, count, kind)
Definition: quda_api.h:204
#define qudaMemset(ptr, value, count)
Definition: quda_api.h:218
#define QUDA_MAX_MG_LEVEL
Maximum number of multi-grid levels. This number may be increased if needed.
QudaBoolean compute_qcharge
Definition: quda.h:741
QudaBoolean compute_plaquette
Definition: quda.h:739
QudaReconstructType reconstruct
Definition: quda.h:49
QudaLinkType type
Definition: quda.h:41
QudaFieldLocation location
Definition: quda.h:33
QudaGaugeFieldOrder gauge_order
Definition: quda.h:42
int X[4]
Definition: quda.h:35
QudaSolveType solve_type
Definition: quda.h:229
double gflops
Definition: quda.h:277
double mass
Definition: quda.h:109
double mu
Definition: quda.h:131
double secs
Definition: quda.h:278
QudaPrecision cpu_prec
Definition: quda.h:237
double kappa
Definition: quda.h:110
void * preconditioner
Definition: quda.h:300
int setup_maxiter_refresh[QUDA_MAX_MG_LEVEL]
Definition: quda.h:589
QudaEigParam * eig_param[QUDA_MAX_MG_LEVEL]
Definition: quda.h:553
QudaBoolean preserve_deflation
Definition: quda.h:715
char vec_outfile[QUDA_MAX_MG_LEVEL][256]
Definition: quda.h:709
QudaSolveType smoother_solve_type[QUDA_MAX_MG_LEVEL]
Definition: quda.h:662
QudaInvertParam * invert_param
Definition: quda.h:551
QudaReconstructType reconstruct
Definition: gauge_field.h:50
QudaGaugeFieldOrder order
Definition: gauge_field.h:51
void setPrecision(QudaPrecision precision, bool force_native=false)
Helper function for setting the precision and corresponding field order for QUDA internal fields.
Definition: gauge_field.h:173
QudaLinkType link_type
Definition: gauge_field.h:53
QudaFieldCreate create
Definition: gauge_field.h:60
QudaTboundary t_boundary
Definition: gauge_field.h:54
QudaGhostExchange ghostExchange
Definition: lattice_field.h:77
QudaPrecision Precision() const
Definition: lattice_field.h:59
#define printfQuda(...)
Definition: util_quda.h:114
#define warningQuda(...)
Definition: util_quda.h:132
#define errorQuda(...)
Definition: util_quda.h:120