15 #if defined(QMP_COMMS) 17 #elif defined(MPI_COMMS) 23 #define MAX(a,b) ((a)>(b)?(a):(b)) 58 extern void usage(
char** );
67 printfQuda(
"prec prec_sloppy multishift matpc_type recon recon_sloppy S_dimension T_dimension Ls_dimension dslash_type normalization\n");
68 printfQuda(
"%6s %6s %d %12s %2s %2s %3d/%3d/%3d %3d %2d %14s %8s\n",
92 printfQuda(
" --num_src n # Numer of sources used\n");
99 int main(
int argc,
char **argv)
104 for (
int i = 1;
i < argc;
i++){
112 if(
strcmp(argv[
i],
"--num_src") == 0){
116 num_src=
atoi(argv[
i+1]);
200 for(
int k = 0; k <
Lsdim; k++)
212 double offset[12] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12};
245 errorQuda(
"qudaInvert: requesting zero residual\n");
296 int pad_size =
MAX(x_face_size, y_face_size);
297 pad_size =
MAX(pad_size, z_face_size);
298 pad_size =
MAX(pad_size, t_face_size);
330 void *gauge[4], *clover_inv=0, *
clover=0;
332 for (
int dir = 0; dir < 4; dir++) {
355 int asymmetric = preconditioned &&
358 if (!preconditioned) {
361 }
else if (asymmetric) {
377 void **spinorOutMulti = NULL;
433 time0 /= CLOCKS_PER_SEC;
435 printfQuda(
"Device memory used:\n Spinor: %f GiB\n Gauge: %f GiB\n",
440 printfQuda(
"\nDone: %i iter / %g secs = %g Gflops, total time = %g secs\n",
499 void *evenOut = spinorCheck[
i];
500 void *oddOut =
cpu_prec ==
sizeof(
double) ? (
void*)((
double*)evenOut + tm_offset): (
void*)((
float*)evenOut + tm_offset);
502 void *evenIn = spinorOutMulti[
i];
503 void *oddIn =
cpu_prec ==
sizeof(
double) ? (
void*)((
double*)evenIn + tm_offset): (
void*)((
float*)evenIn + tm_offset);
505 tm_ndeg_mat(evenOut, oddOut, gauge, evenIn, oddIn,
inv_param.
kappa,
inv_param.
mu,
inv_param.
epsilon, 0,
inv_param.
cpu_prec,
gauge_param);
535 errorQuda(
"Twisted mass solution type not supported");
546 double *kappa_b, *kappa_c;
549 for(
int xs = 0 ; xs <
Lsdim ; xs++)
554 mdw_matpc(spinorCheck[
i], gauge, spinorOutMulti[
i], kappa_b, kappa_c,
inv_param.
matpc_type, 0,
inv_param.
cpu_prec,
gauge_param,
inv_param.
mass,
inv_param.
b_5,
inv_param.
c_5);
581 errorQuda(
"Twisted mass solution type not supported");
597 errorQuda(
"Mass normalization not implemented");
608 double l2r =
sqrt(nrm2 / src2);
612 printfQuda(
"rhs %d residuals: (L2 relative) tol %g, QUDA = %g, host = %g; (heavy-quark) tol %g, QUDA = %g\n",
int dimPartitioned(int dim)
QudaDiracFieldOrder dirac_order
void usage_extra(char **argv)
QudaMassNormalization mass_normalization
double tol_hq_offset[QUDA_MAX_MULTI_SHIFT]
enum QudaMassNormalization_s QudaMassNormalization
QudaReconstructType reconstruct_sloppy
void freeCloverQuda(void)
double b_5[QUDA_MAX_DWF_LS]
void dw_4d_matpc(void *out, void **gauge, void *in, double kappa, QudaMatPCType matpc_type, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm)
void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param)
QudaDslashType dslash_type
QudaVerbosity verbosity_precondition
enum QudaPrecision_s QudaPrecision
void dw_setDims(int *X, const int L5)
QudaSchwarzType schwarz_type
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
void tm_mat(void *out, void **gauge, void *in, double kappa, double mu, QudaTwistFlavorType flavor, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param)
QudaInverterType inv_type_precondition
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
QudaDslashType dslash_type
QudaReconstructType reconstruct_precondition
QudaInverterType inv_type
double c_5[QUDA_MAX_DWF_LS]
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
int process_command_line_option(int argc, char **argv, int *idx)
void tm_ndeg_mat(void *evenOut, void *oddOut, void **gauge, void *evenIn, void *oddIn, double kappa, double mu, double epsilon, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
const char * get_matpc_str(QudaMatPCType type)
void ax(const double &a, ColorSpinorField &x)
QudaGaugeParam gauge_param
QudaGaugeFieldOrder gauge_order
void dw_mat(void *out, void **gauge, void *in, double kappa, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm)
void tm_matpc(void *outEven, void **gauge, void *inEven, double kappa, double mu, QudaTwistFlavorType flavor, QudaMatPCType matpc_type, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
const char * get_prec_str(QudaPrecision prec)
void loadCloverQuda(void *h_clover, void *h_clovinv, QudaInvertParam *inv_param)
QudaPrecision & cuda_prec_precondition
void exit(int) __attribute__((noreturn))
QudaPrecision clover_cuda_prec_sloppy
QudaFieldLocation input_location
double true_res_hq_offset[QUDA_MAX_MULTI_SHIFT]
QudaSolutionType solution_type
else return(__swbuf(_c, _p))
QudaSolverNormalization solver_normalization
int strcmp(const char *__s1, const char *__s2)
QudaPrecision clover_cuda_prec
QudaInverterType precon_type
void initQuda(int device)
void dw_matpc(void *out, void **gauge, void *in, double kappa, QudaMatPCType matpc_type, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm)
QudaFieldLocation output_location
void * malloc(size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(1)))
QudaPrecision clover_cuda_prec_precondition
QudaInvertParam inv_param
QudaPrecision & cuda_prec_sloppy
QudaPrecision cuda_prec_sloppy
void setSpinorSiteSize(int n)
const char * get_mass_normalization_str(QudaMassNormalization type)
double tol_offset[QUDA_MAX_MULTI_SHIFT]
double true_res_offset[QUDA_MAX_MULTI_SHIFT]
QudaInvertParam newQudaInvertParam(void)
const char * get_recon_str(QudaReconstructType recon)
QudaPrecision cuda_prec_precondition
QudaCloverFieldOrder clover_order
enum QudaMatPCType_s QudaMatPCType
void mdw_matpc(void *out, void **gauge, void *in, double *kappa_b, double *kappa_c, QudaMatPCType matpc_type, int dagger, QudaPrecision precision, QudaGaugeParam &gauge_param, double mferm, double *b5, double *c5)
QudaGammaBasis gamma_basis
QudaPrecision cuda_prec_sloppy
const char * get_dslash_str(QudaDslashType type)
double offset[QUDA_MAX_MULTI_SHIFT]
int use_sloppy_partial_accumulator
QudaReconstructType reconstruct
double norm_2(void *v, int len, QudaPrecision precision)
QudaReconstructType link_recon_sloppy
int rand(void) __attribute__((__availability__(swift
void construct_clover_field(void *clover, double norm, double diag, QudaPrecision precision)
void * memset(void *__b, int __c, size_t __len)
void wil_mat(void *out, void **gauge, void *in, double kappa, int dagger_bit, QudaPrecision precision, QudaGaugeParam &gauge_param)
QudaPrecision cuda_prec_precondition
QudaInverterType inv_type
enum QudaReconstructType_s QudaReconstructType
Main header file for the QUDA library.
void invertMultiSrcQuda(void **_hp_x, void **_hp_b, QudaInvertParam *param)
QudaTwistFlavorType twist_flavor
QudaTwistFlavorType twist_flavor
enum QudaDslashType_s QudaDslashType
void mxpy(ColorSpinorField &x, ColorSpinorField &y)
QudaResidualType residual_type
void wil_matpc(void *outEven, void **gauge, void *inEven, double kappa, QudaMatPCType matpc_type, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
int main(int argc, char **argv)
clock_t clock(void) __asm("_" "clock")
QudaMassNormalization normalization
QudaReconstructType link_recon
cpuColorSpinorField * spinorTmp
void read_gauge_field(const char *filename, void *gauge[], QudaPrecision prec, const int *X, int argc, char *argv[])
QudaPrecision clover_cpu_prec
int gridsize_from_cmdline[]
void initComms(int argc, char **argv, const int *commDims)
enum QudaInverterType_s QudaInverterType
QudaPrecision prec_sloppy
QudaGaugeParam newQudaGaugeParam(void)
QudaPreserveSource preserve_source
enum QudaTwistFlavorType_s QudaTwistFlavorType