16 #if defined(QMP_COMMS) 18 #elif defined(MPI_COMMS) 24 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 68 extern void usage(
char **);
107 printfQuda(
"prec sloppy_prec link_recon sloppy_link_recon S_dimension T_dimension Ls_dimension\n");
121 printfQuda(
" - Operator: MdagM. Will compute SVD of M\n");
122 printfQuda(
" - ***********************************************************\n");
123 printfQuda(
" - **** Overriding any previous choices of operator type. ****\n");
124 printfQuda(
" - **** SVD demands normal operator, will use MdagM ****\n");
125 printfQuda(
" - ***********************************************************\n");
148 gauge_param.
X[0] =
xdim;
149 gauge_param.
X[1] =
ydim;
150 gauge_param.
X[2] =
zdim;
151 gauge_param.
X[3] =
tdim;
174 int x_face_size = gauge_param.
X[1] * gauge_param.
X[2] * gauge_param.
X[3] / 2;
175 int y_face_size = gauge_param.
X[0] * gauge_param.
X[2] * gauge_param.
X[3] / 2;
176 int z_face_size = gauge_param.
X[0] * gauge_param.
X[1] * gauge_param.
X[3] / 2;
177 int t_face_size = gauge_param.
X[0] * gauge_param.
X[1] * gauge_param.
X[2] / 2;
178 int pad_size =
MAX(x_face_size, y_face_size);
179 pad_size =
MAX(pad_size, z_face_size);
180 pad_size =
MAX(pad_size, t_face_size);
181 gauge_param.
ga_pad = pad_size;
240 for (
int k = 0; k <
Lsdim; k++) {
243 inv_param.
b_5[k] = 1.452;
244 inv_param.
c_5[k] = 0.452;
269 for (
int i = 0; i < inv_param.
num_offset; i++) {
283 inv_param.
omega = 1.0;
293 errorQuda(
"Only real spectrum type (LR or SR) can be passed to Lanczos type solver");
333 int main(
int argc,
char **argv)
335 for (
int i = 1; i < argc; i++) {
337 printf(
"ERROR: Invalid option:%s\n", argv[i]);
385 void *gauge[4], *clover = 0, *clover_inv = 0;
387 for (
int dir = 0; dir < 4; dir++) { gauge[dir] = malloc(
V *
gaugeSiteSize * gSize); }
433 void **host_evecs = (
void **)malloc(
eig_nConv *
sizeof(
void *));
435 host_evecs[i] = (
void *)malloc(
V * eig_inv_param.
Ls * sss * eig_inv_param.
cpu_prec);
437 double _Complex *host_evals = (
double _Complex *)malloc(eig_param.
nEv *
sizeof(
double _Complex));
443 double time = -((double)clock());
445 errorQuda(
"ARPACK check only available in double precision");
449 time += (double)clock();
450 printfQuda(
"Time for %s solution = %f\n", eig_param.
arpack_check ?
"ARPACK" :
"QUDA", time / CLOCKS_PER_SEC);
453 for (
int i = 0; i <
eig_nConv; i++) free(host_evecs[i]);
467 if (clover) free(clover);
468 if (clover_inv) free(clover_inv);
470 for (
int dir = 0; dir < 4; dir++) free(gauge[dir]);
int dimPartitioned(int dim)
QudaDiracFieldOrder dirac_order
QudaMassNormalization mass_normalization
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
QudaReconstructType reconstruct_sloppy
void freeCloverQuda(void)
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
int gridsize_from_cmdline[]
enum QudaPrecision_s QudaPrecision
double_complex c_5[QUDA_MAX_DWF_LS]
void dw_setDims(int *X, const int L5)
bool eig_require_convergence
QudaSchwarzType schwarz_type
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
enum QudaResidualType_s QudaResidualType
QudaInverterType inv_type_precondition
QudaTwistFlavorType twist_flavor
QudaDslashType dslash_type
QudaReconstructType reconstruct_precondition
QudaInverterType inv_type
int return_clover_inverse
enum QudaSolveType_s QudaSolveType
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
const char * get_eig_spectrum_str(QudaEigSpectrumType type)
int process_command_line_option(int argc, char **argv, int *idx)
QudaGaugeParam gauge_param
QudaGaugeFieldOrder gauge_order
QudaReconstructType link_recon_sloppy
const char * get_prec_str(QudaPrecision prec)
void loadCloverQuda(void *h_clover, void *h_clovinv, QudaInvertParam *inv_param)
enum QudaEigType_s QudaEigType
QudaPrecision clover_cuda_prec_sloppy
QudaFieldLocation input_location
double_complex b_5[QUDA_MAX_DWF_LS]
QudaSolutionType solution_type
QudaPrecision clover_cuda_prec
void setGaugeParam(QudaGaugeParam &gauge_param)
const char * get_eig_type_str(QudaEigType type)
QudaSolutionType solution_type
QudaInvertParam * invert_param
QudaBoolean require_convergence
void initQuda(int device)
QudaFieldLocation output_location
QudaPrecision clover_cuda_prec_precondition
QudaInvertParam inv_param
void setTransferGPU(bool)
QudaPrecision cuda_prec_sloppy
void setSpinorSiteSize(int n)
double tol_offset[QUDA_MAX_MULTI_SHIFT]
QudaPrecision & cuda_prec_sloppy
QudaInvertParam newQudaInvertParam(void)
const char * get_recon_str(QudaReconstructType recon)
QudaPrecision cuda_prec_precondition
QudaCloverFieldOrder clover_order
enum QudaMatPCType_s QudaMatPCType
void setEigParam(QudaEigParam &eig_param)
enum QudaSolutionType_s QudaSolutionType
void eigensolveQuda(void **h_evecs, double_complex *h_evals, QudaEigParam *param)
QudaGammaBasis gamma_basis
QudaPrecision cuda_prec_sloppy
QudaPrecision prec_precondition
QudaPrecision & cuda_prec_precondition
QudaReconstructType reconstruct
QudaEigSpectrumType eig_spectrum
int compute_clover_inverse
void construct_clover_field(void *clover, double norm, double diag, QudaPrecision precision)
int main(int argc, char **argv)
QudaReconstructType link_recon
char eig_arpack_logfile[]
QudaPrecision cuda_prec_precondition
enum QudaEigSpectrumType_s QudaEigSpectrumType
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
QudaTwistFlavorType twist_flavor
QudaReconstructType link_recon_precondition
QudaPrecision prec_sloppy
enum QudaDslashType_s QudaDslashType
QudaEigSpectrumType spectrum
QudaResidualType residual_type
enum QudaVerbosity_s QudaVerbosity
void initComms(int argc, char **argv, int *const commDims)
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
QudaDslashType dslash_type
QudaPrecision clover_cpu_prec
QudaPrecision cuda_prec_ritz
QudaEigParam newQudaEigParam(void)
void setInvertParam(QudaInvertParam &inv_param)
QudaGaugeParam newQudaGaugeParam(void)
QudaPreserveSource preserve_source
enum QudaTwistFlavorType_s QudaTwistFlavorType
QudaPrecision & cuda_prec