Skip to content

Commit 9941c2c

Browse files
committedJun 28, 2017
QPhiX interface: prepare for two flavour implementation of simple
(non-multi-shift) solvers. 1) Remove source preparation and even-site reconstruction ability from interface because it would not be supported for the two-flavour case anyway. Also, it is generally not required. The base classes are still necessary to provide tests for single applications of the full operators. 2) In inverter, use vector of FourSpinorHandle for managing QPhiX spinor storage. 3) Remove unnecessary function arguments in some places.
1 parent 0abf8f0 commit 9941c2c

File tree

5 files changed

+244
-319
lines changed

5 files changed

+244
-319
lines changed
 

‎invert_clover_eo.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ int invert_clover_eo(spinor * const Even_new, spinor * const Odd_new,
111111
#ifdef TM_USE_QPHIX
112112
if( inverter==QPHIX_INVERTER ) {
113113
// QPhiX inverts M(mu)M(mu)^dag or M(mu), no gamma_5 multiplication required
114-
iter = invert_eo_qphix(NULL, Odd_new, NULL, g_spinor_field[DUM_DERI],
115-
precision, max_iter,
116-
solver_flag, rel_prec,
117-
solver_params,
118-
sloppy,
119-
compression, Qsq);
114+
iter = invert_eo_qphix_oneflavour(Odd_new, g_spinor_field[DUM_DERI],
115+
precision, max_iter,
116+
solver_flag, rel_prec,
117+
solver_params,
118+
sloppy,
119+
compression);
120120
// for solver_params.solution_type == TM_SOLUTION_M (the default)
121121
// QPhiX applies M(mu)^dag internally for normal equation solves, no call to tmLQCD operaor required
122122
} else

‎invert_eo.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ int invert_eo(spinor * const Even_new, spinor * const Odd_new,
161161
#ifdef TM_USE_QPHIX
162162
if( inverter==QPHIX_INVERTER ) {
163163
// QPhiX inverts M(mu)M(mu)^dag or M(mu), no gamma_5 source multiplication required
164-
iter = invert_eo_qphix(NULL, Odd_new, NULL, g_spinor_field[DUM_DERI],
165-
precision, max_iter,
166-
solver_flag, rel_prec,
167-
solver_params,
168-
sloppy,
169-
compression, &Qtm_pm_psi);
164+
iter = invert_eo_qphix_oneflavour(Odd_new, g_spinor_field[DUM_DERI],
165+
precision, max_iter,
166+
solver_flag, rel_prec,
167+
solver_params,
168+
sloppy,
169+
compression);
170170
// for solver_params.solution_type == TM_SOLUTION_M (the default)
171171
// QPhiX applies M(mu)^dag internally for normal equation solves, no call to tmLQCD operaor required
172172
} else

‎qphix_interface.cpp

+213-300
Large diffs are not rendered by default.

‎qphix_interface.h

+17-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,23 @@ extern "C" {
7676
void initQPhiX(int argc, char** argv, QphixParams_t params, int c12, QphixPrec_t precision);
7777
void _endQphix();
7878

79-
// Wrapper functions for Full Solver and Dslash
80-
int invert_eo_qphix(spinor* const Even_new, spinor* const Odd_new, spinor* const Even,
81-
spinor* const Odd, const double precision, const int max_iter,
82-
const int solver_flag, const int rel_prec, solver_params_t solver_params,
83-
const SloppyPrecision sloppy, const CompressionType compression,
84-
matrix_mult mat_op);
79+
int invert_eo_qphix_oneflavour(spinor * const Odd_out, spinor* const Odd_in,
80+
const double precision, const int max_iter,
81+
const int solver_flag, const int rel_prec, solver_params_t solver_params,
82+
const SloppyPrecision sloppy, const CompressionType compression);
83+
84+
int invert_eo_qphix_twoflavour(spinor * Odd_out_s, spinor * Odd_out_c,
85+
spinor * Odd_in_s, spinor * Odd_in_c,
86+
const double precision, const int max_iter,
87+
const int solver_flag, const int rel_prec, solver_params_t solver_params,
88+
const SloppyPrecision sloppy, const CompressionType compression);
89+
90+
int invert_eo_qphix_nflavour(spinor ** Odd_out, spinor ** Odd_in,
91+
const double target_precision, const double precision_lambda,
92+
const int max_iter,
93+
const int solver_flag, solver_params_t solver_params,
94+
const SloppyPrecision sloppy, const CompressionType compression,
95+
const int num_flavour);
8596

8697
void Mfull_qphix(spinor* Even_out, spinor* Odd_out, const spinor* Even_in, const spinor* Odd_in,
8798
const op_type_t op_type);

‎solver/monomial_solve.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ int solve_degenerate(spinor * const P, spinor * const Q, solver_params_t solver_
9595
// gamma_5 (M M^dagger)^{-1} gamma_5 b
9696
// FIXME: this needs to be adjusted to also support BICGSTAB
9797
gamma5(temp[1], Q, VOLUME/2);
98-
iteration_count = invert_eo_qphix(NULL, P, NULL, temp[1], eps_sq, max_iter, solver_type, rel_prec, solver_params, sloppy, compression, f);
98+
iteration_count = invert_eo_qphix_oneflavour(P, temp[1], eps_sq, max_iter, solver_type,
99+
rel_prec, solver_params, sloppy, compression);
99100
mul_gamma5(P, VOLUME/2);
100101

101102
#ifdef WIP

0 commit comments

Comments
 (0)
Please sign in to comment.