From 42a04b02edcafe97dec276e98d13a4bb323adb95 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Thu, 30 Apr 2015 13:55:54 -0400 Subject: [PATCH 1/5] fixed handling of fermilab residual in qudaCloverInvert --- lib/milc_interface.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/milc_interface.cpp b/lib/milc_interface.cpp index e1d9f2212b..1a62acd832 100644 --- a/lib/milc_interface.cpp +++ b/lib/milc_interface.cpp @@ -11,7 +11,7 @@ #include #define MAX(a,b) ((a)>(b)?(a):(b)) - +#define BUILD_MILC_INTERFACE #ifdef BUILD_MILC_INTERFACE static bool initialized = false; @@ -485,7 +485,7 @@ static void setInvertParams(const int dim[4], invertParam->gamma_basis = QUDA_DEGRAND_ROSSI_GAMMA_BASIS; // not used, but required by the code. invertParam->dirac_order = QUDA_DIRAC_ORDER; - invertParam->dslash_type = QUDA_ASQTAD_DSLASH; + invertParam->dslash_type = QUDA_STAGGERED_DSLASH; invertParam->tune = QUDA_TUNE_YES; invertParam->gflops = 0.0; @@ -1121,10 +1121,7 @@ void qudaCloverInvert(int external_precision, int* num_iters) { - if(target_fermilab_residual !=0 && target_residual != 0){ - errorQuda("qudaCloverInvert: conflicting residuals requested\n"); - exit(1); - }else if(target_fermilab_residual == 0 && target_residual == 0){ + if(target_fermilab_residual == 0 && target_residual == 0){ errorQuda("qudaCloverInvert: requesting zero residual\n"); exit(1); } @@ -1137,8 +1134,12 @@ void qudaCloverInvert(int external_precision, QudaInvertParam invertParam = newQudaInvertParam(); setInvertParam(invertParam, inv_args, external_precision, quda_precision, kappa); - invertParam.residual_type = (target_residual != 0) ? QUDA_L2_RELATIVE_RESIDUAL : QUDA_HEAVY_QUARK_RESIDUAL; - invertParam.tol = (target_residual != 0) ? target_residual : target_fermilab_residual; + invertParam.residual_type = static_cast(0); + invertParam.residual_type = (target_residual != 0) ? static_cast ( invertParam.residual_type | QUDA_L2_RELATIVE_RESIDUAL) : invertParam.residual_type; + invertParam.residual_type = (target_fermilab_residual != 0) ? static_cast (invertParam.residual_type | QUDA_HEAVY_QUARK_RESIDUAL) : invertParam.residual_type; + + invertParam.tol = target_residual; + invertParam.tol_hq = target_fermilab_residual; // solution types invertParam.solution_type = QUDA_MAT_SOLUTION; From e6d15296dbbea36a3202104324b81ae05a041a96 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Thu, 30 Apr 2015 14:03:38 -0400 Subject: [PATCH 2/5] fixed erroneous commit --- lib/milc_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/milc_interface.cpp b/lib/milc_interface.cpp index 1a62acd832..3bfa052521 100644 --- a/lib/milc_interface.cpp +++ b/lib/milc_interface.cpp @@ -11,7 +11,7 @@ #include #define MAX(a,b) ((a)>(b)?(a):(b)) -#define BUILD_MILC_INTERFACE + #ifdef BUILD_MILC_INTERFACE static bool initialized = false; @@ -485,7 +485,7 @@ static void setInvertParams(const int dim[4], invertParam->gamma_basis = QUDA_DEGRAND_ROSSI_GAMMA_BASIS; // not used, but required by the code. invertParam->dirac_order = QUDA_DIRAC_ORDER; - invertParam->dslash_type = QUDA_STAGGERED_DSLASH; + invertParam->dslash_type = QUDA_ASQTAD_DSLASH; invertParam->tune = QUDA_TUNE_YES; invertParam->gflops = 0.0; From 26363ac427aaa3b0198691bcc24a0290018fb5bc Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Thu, 30 Apr 2015 14:38:19 -0400 Subject: [PATCH 3/5] verbosity fixes vor cloverInvert --- lib/milc_interface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/milc_interface.cpp b/lib/milc_interface.cpp index 3bfa052521..c815ebbbed 100644 --- a/lib/milc_interface.cpp +++ b/lib/milc_interface.cpp @@ -1007,7 +1007,7 @@ void setInvertParam(QudaInvertParam &invertParam, QudaInvertArgs_t &inv_args, device_precision_sloppy = device_precision; } - + static const QudaVerbosity verbosity = getVerbosity(); invertParam.dslash_type = QUDA_CLOVER_WILSON_DSLASH; invertParam.kappa = kappa; @@ -1018,8 +1018,8 @@ void setInvertParam(QudaInvertParam &invertParam, QudaInvertArgs_t &inv_args, invertParam.maxiter = inv_args.max_iter; invertParam.cuda_prec_precondition = device_precision_sloppy; - invertParam.verbosity_precondition = QUDA_SILENT; - invertParam.verbosity = QUDA_SILENT; + invertParam.verbosity_precondition = verbosity; + invertParam.verbosity = verbosity; invertParam.cpu_prec = host_precision; invertParam.cuda_prec = device_precision; invertParam.cuda_prec_sloppy = device_precision_sloppy; From 9cefdb9f4e43d9ffe002e7322af39a32add67694 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Mon, 4 May 2015 15:40:53 -0400 Subject: [PATCH 4/5] increase frequency of heavy-quark residual checks --- lib/inv_bicgstab_quda.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inv_bicgstab_quda.cpp b/lib/inv_bicgstab_quda.cpp index b59d9f0b2c..fa7f2fbd7b 100644 --- a/lib/inv_bicgstab_quda.cpp +++ b/lib/inv_bicgstab_quda.cpp @@ -146,7 +146,7 @@ namespace quda { const bool use_heavy_quark_res = (param.residual_type & QUDA_HEAVY_QUARK_RESIDUAL) ? true : false; double heavy_quark_res = use_heavy_quark_res ? sqrt(HeavyQuarkResidualNormCuda(x,r).z) : 0.0; - int heavy_quark_check = 10; // how often to check the heavy quark residual + const int heavy_quark_check = 1; // how often to check the heavy quark residual double delta = param.delta; From c1199229c332e8c3b362d52ed606b4a2b9ab4c2e Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Fri, 15 May 2015 13:29:25 -0400 Subject: [PATCH 5/5] Revert "increase frequency of heavy-quark residual checks" This reverts commit 9cefdb9f4e43d9ffe002e7322af39a32add67694. --- lib/inv_bicgstab_quda.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inv_bicgstab_quda.cpp b/lib/inv_bicgstab_quda.cpp index fa7f2fbd7b..b59d9f0b2c 100644 --- a/lib/inv_bicgstab_quda.cpp +++ b/lib/inv_bicgstab_quda.cpp @@ -146,7 +146,7 @@ namespace quda { const bool use_heavy_quark_res = (param.residual_type & QUDA_HEAVY_QUARK_RESIDUAL) ? true : false; double heavy_quark_res = use_heavy_quark_res ? sqrt(HeavyQuarkResidualNormCuda(x,r).z) : 0.0; - const int heavy_quark_check = 1; // how often to check the heavy quark residual + int heavy_quark_check = 10; // how often to check the heavy quark residual double delta = param.delta;