Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/quda_work' into deriv_mg_tune
Browse files Browse the repository at this point in the history
  • Loading branch information
kostrzewa committed Feb 10, 2024
2 parents 405f70c + 3d3c0b8 commit 2812388
Showing 1 changed file with 12 additions and 58 deletions.
70 changes: 12 additions & 58 deletions quda_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,15 +1143,6 @@ int invert_doublet_eo_quda(spinor * const Even_new_s, spinor * const Odd_new_s,
else
inv_param.residual_type = QUDA_L2_ABSOLUTE_RESIDUAL;

inv_param.kappa = g_kappa;

// IMPORTANT: use opposite TM mu-flavor since gamma5 -> -gamma5
inv_param.mu = -g_mubar /2./g_kappa;
inv_param.epsilon = g_epsbar/2./g_kappa;
// FIXME: in principle, there is also QUDA_TWIST_DEG_DOUBLET
inv_param.twist_flavor = QUDA_TWIST_NONDEG_DOUBLET;
inv_param.Ls = 2;

// figure out which BC to use (theta, trivial...)
set_boundary_conditions(&compression, &gauge_param);

Expand All @@ -1161,55 +1152,17 @@ int invert_doublet_eo_quda(spinor * const Even_new_s, spinor * const Odd_new_s,
// load gauge after setting precision
_loadGaugeQuda(compression);

// choose dslash type
if( g_c_sw > 0.0 ) {
inv_param.dslash_type = QUDA_TWISTED_CLOVER_DSLASH;
inv_param.matpc_type = QUDA_MATPC_EVEN_EVEN; // FIXME: note sure if this is the correct PC type
inv_param.solution_type = QUDA_MAT_SOLUTION;
inv_param.clover_order = QUDA_PACKED_CLOVER_ORDER;
inv_param.clover_coeff = g_c_sw*g_kappa;
inv_param.compute_clover = 1;
inv_param.compute_clover_inverse = 1;
}
else {
inv_param.dslash_type = QUDA_TWISTED_MASS_DSLASH;
inv_param.matpc_type = QUDA_MATPC_EVEN_EVEN_ASYMMETRIC;
inv_param.solution_type = QUDA_MAT_SOLUTION;
}

// choose solver
if(solver_flag == BICGSTAB) {
if(g_proc_id == 0) {printf("# TM_QUDA: Using BiCGstab!\n"); fflush(stdout);}
inv_param.inv_type = QUDA_BICGSTAB_INVERTER;
}
else {
/* Here we invert the hermitean operator squared */
inv_param.inv_type = QUDA_CG_INVERTER;
if(g_proc_id == 0) {
printf("# TM_QUDA: Using mixed precision CG!\n");
printf("# TM_QUDA: mu = %.12f, kappa = %.12f\n", g_mu/2./g_kappa, g_kappa);
fflush(stdout);
}
}

if( even_odd_flag ) {
inv_param.solve_type = QUDA_NORMERR_PC_SOLVE;
if(g_proc_id == 0) printf("# TM_QUDA: Using EO preconditioning!\n");
}
else {
inv_param.solve_type = QUDA_NORMERR_SOLVE;
if(g_proc_id == 0) printf("# TM_QUDA: Not using EO preconditioning!\n");
}

inv_param.tol = sqrt(precision);
inv_param.maxiter = max_iter;

if( g_c_sw > 0.0 ){
_loadCloverQuda(&inv_param);
}

// while the other solver interfaces may need to set this to QUDA_DAG_YES, we
// always want to set it to QUDA_DAG_NO
_setTwoFlavourSolverParam(g_kappa,
g_c_sw,
g_mubar,
g_epsbar,
solver_flag,
even_odd_flag,
precision,
max_iter,
0 /* not a single parity solve */,
0 /* not a QpQm solve */);
// in contrast to the HMC we always want QUDA_DAG_NO here
inv_param.dagger = QUDA_DAG_NO;

// reorder spinor
Expand Down Expand Up @@ -1729,6 +1682,7 @@ void _setTwoFlavourSolverParam(const double kappa, const double c_sw, const doub
// solver (for example in the HMC or when doing light and heavy inversions)
if( solver_type != MG ){
inv_param.inv_type_precondition = QUDA_INVALID_INVERTER;
inv_param.preconditioner = NULL;
}

// direct or norm-op. solve
Expand Down

0 comments on commit 2812388

Please sign in to comment.