forked from etmc/tmLQCD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invert_eo.c
429 lines (383 loc) · 19.3 KB
/
invert_eo.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
/***********************************************************************
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Carsten Urbach
*
* This file is part of tmLQCD.
*
* tmLQCD is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* tmLQCD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with tmLQCD. If not, see <http://www.gnu.org/licenses/>.
*
* invert_eo makes an inversion with EO preconditioned
* tm Operator
*
* Even and Odd are the numbers of spinor_field that contain
* the even and the odd sites of the source. The result is stored
* int Even_new and Odd_new.
*
* invert_eo returns the number of iterations needed or -1 if the
* solver did not converge.
*
* Author: Carsten Urbach
* urbach@physik.fu-berlin.de
*
****************************************************************/
#ifdef HAVE_CONFIG_H
# include<config.h>
#endif
#include<stdlib.h>
#include"global.h"
#include"linalg_eo.h"
#include"operator/tm_operators.h"
#include"operator/Hopping_Matrix.h"
#include"operator/D_psi.h"
#include"gamma.h"
#include"solver/solver.h"
#include"read_input.h"
#include"xchange/xchange.h"
#include"solver/poly_precon.h"
#include"solver/dfl_projector.h"
#include"invert_eo.h"
#include "solver/dirac_operator_eigenvectors.h"
#ifdef HAVE_GPU
#include"GPU/cudadefs.h"
#include"temporalgauge.h"
#include"measure_gauge_action.h"
extern int mixed_solve (spinor * const P, spinor * const Q, const int max_iter,
double eps, const int rel_prec,const int N);
extern int mixed_solve_eo (spinor * const P, spinor * const Q, const int max_iter,
double eps, const int rel_prec, const int N);
#ifdef TEMPORALGAUGE
extern su3* g_trafo;
#endif
#endif
int invert_eo(spinor * const Even_new, spinor * const Odd_new,
spinor * const Even, spinor * const Odd,
const double precision, const int max_iter,
const int solver_flag, const int rel_prec,
const int sub_evs_flag, const int even_odd_flag,
const int no_extra_masses, double * const extra_masses,
const int id ) {
int iter = 0;
/* here comes the inversion using even/odd preconditioning */
if(even_odd_flag) {
if(g_proc_id == 0) {printf("# Using even/odd preconditioning!\n"); fflush(stdout);}
#ifdef HAVE_GPU
#ifdef TEMPORALGAUGE
/* initialize temporal gauge here */
int retval;
double dret;
double plaquette = 0.0;
if(usegpu_flag){
/* need VOLUME here (not N=VOLUME/2)*/
if((retval=init_temporalgauge_trafo(VOLUME, g_gauge_field)) !=0){
if(g_proc_id == 0) printf("Error while gauge fixing to temporal gauge. Aborting...\n");
exit(200);
}
plaquette = measure_gauge_action(g_gauge_field);
if(g_proc_id == 0) printf("Plaquette before gauge fixing: %.16e\n", plaquette/6./VOLUME);
/* do trafo */
apply_gtrafo(g_gauge_field, g_trafo);
plaquette = measure_gauge_action(g_gauge_field);
if(g_proc_id == 0) printf("Plaquette after gauge fixing: %.16e\n", plaquette/6./VOLUME);
/* do trafo to odd part of source */
dret = square_norm(Odd, VOLUME/2 , 1);
if(g_proc_id == 0) printf("square norm before gauge fixing: %.16e\n", dret);
apply_gtrafo_spinor_odd(Odd, g_trafo);
dret = square_norm(Odd, VOLUME/2, 1);
if(g_proc_id == 0) printf("square norm after gauge fixing: %.16e\n", dret);
/* do trafo to even part of source */
dret = square_norm(Even, VOLUME/2 , 1);
if(g_proc_id == 0) printf("square norm before gauge fixing: %.16e\n", dret);
apply_gtrafo_spinor_even(Even, g_trafo);
dret = square_norm(Even, VOLUME/2, 1);
if(g_proc_id == 0) printf("square norm after gauge fixing: %.16e\n", dret);
}
#endif
#endif /* HAVE_GPU*/
assign_mul_one_pm_imu_inv(Even_new, Even, +1., VOLUME/2);
Hopping_Matrix(OE, g_spinor_field[DUM_DERI], Even_new);
/* The sign is plus, since in Hopping_Matrix */
/* the minus is missing */
assign_mul_add_r(g_spinor_field[DUM_DERI], +1., Odd, VOLUME/2);
/* Do the inversion with the preconditioned */
/* matrix to get the odd sites */
if(solver_flag == BICGSTAB) {
if(g_proc_id == 0) {printf("# Using BiCGstab!\n"); fflush(stdout);}
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
iter = bicgstab_complex(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, &Mtm_plus_sym_psi);
}
else if(solver_flag == GMRES) {
if(g_proc_id == 0) {printf("# Using GMRES! m = %d\n", gmres_m_parameter); fflush(stdout);}
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
iter = gmres(Odd_new, g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME/2, 1, &Mtm_plus_sym_psi);
}
else if(solver_flag == GCR) {
if(g_proc_id == 0) {printf("# Using GCR! m = %d\n", gmres_m_parameter); fflush(stdout);}
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
iter = gcr(Odd_new, g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME/2, 0, &Mtm_plus_sym_psi);
}
else if(solver_flag == GMRESDR) {
if(g_proc_id == 0) {printf("# Using GMRES-DR! m = %d, NrEv = %d\n",
gmres_m_parameter, gmresdr_nr_ev); fflush(stdout);}
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
iter = gmres_dr(Odd_new, g_spinor_field[DUM_DERI], gmres_m_parameter, gmresdr_nr_ev, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME/2, &Mtm_plus_sym_psi);
}
else if(solver_flag == FGMRES) {
if(g_proc_id == 0) {printf("# Using FGMRES!\n"); fflush(stdout);}
iter = fgmres(Odd_new, g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME/2, 0, &Qtm_pm_psi);
gamma5(Odd_new, Odd_new, VOLUME/2);
Qtm_minus_psi(Odd_new, Odd_new);
}
else if(solver_flag == BICGSTABELL) {
if(g_proc_id == 0) {printf("# Using BiCGstab2!\n"); fflush(stdout);}
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
iter = bicgstabell(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, 3, VOLUME/2, &Mtm_plus_sym_psi);
}
else if(solver_flag == PCG) {
/* Here we invert the hermitean operator squared */
gamma5(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI], VOLUME/2);
if(g_proc_id == 0) {printf("# Using PCG!\n"); fflush(stdout);}
iter = pcg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, &Qtm_pm_psi);
Qtm_minus_psi(Odd_new, Odd_new);
}
else if(solver_flag == MIXEDCG) {
/* Here we invert the hermitean operator squared */
gamma5(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI], VOLUME/2);
if(g_proc_id == 0) {printf("# Using Mixed Precision CG!\n"); fflush(stdout);}
iter = mixed_cg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec,
VOLUME/2, &Qtm_pm_psi);
Qtm_minus_psi(Odd_new, Odd_new);
}
else if(solver_flag == CG) {
/* Here we invert the hermitean operator squared */
gamma5(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI], VOLUME/2);
if(g_proc_id == 0) {
printf("# Using CG!\n");
printf("# mu = %f, kappa = %f\n", g_mu/2./g_kappa, g_kappa);
fflush(stdout);
}
#ifdef HAVE_GPU
if(usegpu_flag){
if(g_proc_id == 0) printf("Using GPU for inversion\n");
iter = mixed_solve_eo(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2);
}
else{
iter = cg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, &Qtm_pm_psi);
Qtm_minus_psi(Odd_new, Odd_new);
}
#else
iter = cg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec,
VOLUME/2, &Qtm_pm_psi);
Qtm_minus_psi(Odd_new, Odd_new);
#endif /*HAVE_GPU*/
}
else if(solver_flag == MR) {
if(g_proc_id == 0) {printf("# Using MR!\n"); fflush(stdout);}
iter = mr(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, 1, &Mtm_plus_psi);
}
else if(solver_flag == CGS) {
if(g_proc_id == 0) {printf("# Using CGS!\n"); fflush(stdout);}
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
iter = cgs_real(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, &Mtm_plus_sym_psi);
}
else {
if(g_proc_id == 0) {printf("# Using CG as default solver!\n"); fflush(stdout);}
gamma5(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI], VOLUME/2);
#ifdef HAVE_GPU
if(g_proc_id == 0) {printf("Using GPU for inversion\n");
fflush(stdout);}
iter = mixed_solve_eo(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2);
#else
iter = cg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, &Qtm_pm_psi);
Qtm_minus_psi(Odd_new, Odd_new);
#endif
}
/* In case of failure, redo with CG */
if(iter == -1 && solver_flag !=CG) {
/* Here we invert the hermitean operator squared */
mul_one_pm_imu(g_spinor_field[DUM_DERI], +1.);
gamma5(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI], VOLUME/2);
if(g_proc_id == 0) {printf("# Redoing it with CG!\n"); fflush(stdout);}
iter = cg_her(Odd_new, g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME/2, &Qtm_pm_psi);
Qtm_minus_psi(Odd_new, Odd_new);
}
/* Reconstruct the even sites */
Hopping_Matrix(EO, g_spinor_field[DUM_DERI], Odd_new);
mul_one_pm_imu_inv(g_spinor_field[DUM_DERI], +1., VOLUME/2);
/* The sign is plus, since in Hopping_Matrix */
/* the minus is missing */
assign_add_mul_r(Even_new, g_spinor_field[DUM_DERI], +1., VOLUME/2);
#ifdef HAVE_GPU
/* return from temporal gauge again */
#ifdef TEMPORALGAUGE
if(usegpu_flag){
plaquette = measure_gauge_action(g_gauge_field);
if(g_proc_id == 0) printf("Plaquette before inverse gauge fixing: %.16e\n", plaquette/6./VOLUME);
/* undo trafo */
/*apply_inv_gtrafo(g_gauge_field, g_trafo);*/
/* copy back the saved original field located in g_tempgauge_field -> update necessary*/
copy_gauge_field(g_gauge_field, g_tempgauge_field);
g_update_gauge_copy = 1;
plaquette = measure_gauge_action(g_gauge_field);
if(g_proc_id == 0) printf("Plaquette after inverse gauge fixing: %.16e\n", plaquette/6./VOLUME);
/* undo trafo to source (Even, Odd) */
dret = square_norm(Even, VOLUME/2 , 1);
if(g_proc_id == 0) printf("square norm before gauge fixing: %.16e\n", dret);
apply_inv_gtrafo_spinor_even(Even, g_trafo);
dret = square_norm(Even, VOLUME/2, 1);
if(g_proc_id == 0) printf("square norm after gauge fixing: %.16e\n", dret);
dret = square_norm(Odd, VOLUME/2 , 1);
if(g_proc_id == 0) printf("square norm before gauge fixing: %.16e\n", dret);
apply_inv_gtrafo_spinor_odd(Odd, g_trafo);
dret = square_norm(Odd, VOLUME/2, 1);
if(g_proc_id == 0) printf("square norm after gauge fixing: %.16e\n", dret);
dret = square_norm(Even_new, VOLUME/2 , 1);
if(g_proc_id == 0) printf("square norm before gauge fixing: %.16e\n", dret);
apply_inv_gtrafo_spinor_even(Even_new, g_trafo);
dret = square_norm(Even_new, VOLUME/2, 1);
if(g_proc_id == 0) printf("square norm after gauge fixing: %.16e\n", dret);
dret = square_norm(Odd_new, VOLUME/2 , 1);
if(g_proc_id == 0) printf("square norm before gauge fixing: %.16e\n", dret);
apply_inv_gtrafo_spinor_odd(Odd_new, g_trafo);
dret = square_norm(Odd_new, VOLUME/2, 1);
if(g_proc_id == 0) printf("square norm after gauge fixing: %.16e\n", dret);
finalize_temporalgauge();
}
#endif
#endif
}
else {
/* here comes the inversion not using even/odd preconditioning */
if(g_proc_id == 0) {printf("# Not using even/odd preconditioning!\n"); fflush(stdout);}
convert_eo_to_lexic(g_spinor_field[DUM_DERI], Even, Odd);
convert_eo_to_lexic(g_spinor_field[DUM_DERI+1], Even_new, Odd_new);
if(solver_flag == BICGSTAB) {
if(g_proc_id == 0) {printf("# Using BiCGstab!\n"); fflush(stdout);}
if(use_preconditioning==1 && g_precWS!=NULL){
if(g_proc_id == 0) {printf("# Using preconditioning (which one?)!\n");}
iter = bicgstab_complex(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME, &D_psi_prec);
} else {
if(g_proc_id == 0) {printf("# Not using preconditioning (which one?)!\n");}
iter = bicgstab_complex(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME, &D_psi);
}
}
else if(solver_flag == CGS) {
if(g_proc_id == 0) {printf("# Using CGS!\n"); fflush(stdout);}
if(use_preconditioning==1 && g_precWS!=NULL){
if(g_proc_id == 0) {printf("# Using preconditioning (which one?)!\n");}
iter = cgs_real(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME, &D_psi_prec);
} else {
if(g_proc_id == 0) {printf("# Not using preconditioning (which one?)!\n");}
iter = cgs_real(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME, &D_psi);
}
}
else if(solver_flag == GMRES) {
if(g_proc_id == 0) {printf("# Using GMRES! m = %d\n", gmres_m_parameter); fflush(stdout);}
if(use_preconditioning==1 && g_precWS!=NULL){
if(g_proc_id == 0) {printf("# Using preconditioning (which one?)!\n");}
iter = gmres(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, 1, &D_psi_prec);
} else {
if(g_proc_id == 0) {printf("# not using preconditioning (which one?)!\n");}
iter = gmres(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, 1, &D_psi);
}
}
else if(solver_flag == FGMRES) {
if(g_proc_id == 0) {printf("# Using FGMRES! m = %d\n", gmres_m_parameter); fflush(stdout);}
iter = fgmres(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, 1, &D_psi);
/* gamma5(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], VOLUME); */
/* iter = fgmres(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI+1], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, &Q_pm_psi); */
/* Q_minus_psi(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI]); */
}
else if(solver_flag == GCR) {
if(g_proc_id == 0) {printf("# Using GCR! m = %d\n", gmres_m_parameter); fflush(stdout);}
iter = gcr(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, 1, &D_psi);
/* gamma5(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], VOLUME); */
/* iter = gcr(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI+1], gmres_m_parameter, max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, &Q_pm_psi); */
/* Q_minus_psi(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI]); */
}
else if(solver_flag == DFLGCR || solver_flag == DFLFGMRES) {
if(g_proc_id == 0) {printf("# Using deflated solver! m = %d\n", gmres_m_parameter); fflush(stdout);}
/* apply P_L to source */
project_left(g_spinor_field[DUM_DERI+2], g_spinor_field[DUM_DERI]);
if(g_proc_id == 0) printf("# Applied P_L to source\n");
/* invert P_L D on source -> chi */
if(solver_flag == DFLGCR) {
iter = gcr(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI+2], gmres_m_parameter,
max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, 1, &project_left_D);
}
else {
iter = fgmres(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI+2], gmres_m_parameter,
max_iter/gmres_m_parameter, precision, rel_prec, VOLUME, 1, &project_left_D);
}
/* apply P_R to chi */
project_right(g_spinor_field[DUM_DERI+2], g_spinor_field[DUM_DERI+1]);
if(g_proc_id == 0) printf("# Applied P_R to solution\n");
/* reconstruct solution */
project(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI]);
add(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI+2], VOLUME);
}
else if (solver_flag == CGMMS) {
if(g_proc_id == 0) {printf("# Using multi mass CG!\n"); fflush(stdout);}
gamma5(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], VOLUME);
iter = cg_mms_tm(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI+1],
max_iter, precision, rel_prec, VOLUME, &Q_pm_psi, no_extra_masses, extra_masses, id);
Q_minus_psi(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI]);
}
else {
if(g_proc_id == 0) {printf("# Using CG!\n"); fflush(stdout);}
#ifdef HAVE_GPU
if(usegpu_flag){
if(g_proc_id == 0) printf("# Using GPU for inversion\n");
iter = mixed_solve(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], max_iter, precision, rel_prec, VOLUME);
}
else{
gamma5(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], VOLUME);
iter = cg_her(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI+1], max_iter, precision,
rel_prec, VOLUME, &Q_pm_psi);
Q_minus_psi(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI]);
}
#else
gamma5(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI], VOLUME);
if(use_preconditioning==1 && g_precWS!=NULL){
spinorPrecWS *ws=(spinorPrecWS*)g_precWS;
static _Complex double alpha = 0.0;
if(g_proc_id==0) {printf("# Using preconditioning (which one?)!\n");}
if(g_prec_sequence_d_dagger_d[2] != 0.0){
alpha = g_prec_sequence_d_dagger_d[2];
spinorPrecondition(g_spinor_field[DUM_DERI+1],g_spinor_field[DUM_DERI+1],ws,T,L,alpha,0,1);
}
iter = cg_her(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI+1], max_iter, precision,
rel_prec, VOLUME, &Q_pm_psi_prec);
if(g_prec_sequence_d_dagger_d[0] != 0.0){
alpha = g_prec_sequence_d_dagger_d[0];
spinorPrecondition(g_spinor_field[DUM_DERI],g_spinor_field[DUM_DERI],ws,T,L,alpha,0,1);
}
} else {
if(g_proc_id==0) {printf("# Not using preconditioning!\n");}
iter = cg_her(g_spinor_field[DUM_DERI], g_spinor_field[DUM_DERI+1], max_iter, precision,
rel_prec, VOLUME, &Q_pm_psi);
}
Q_minus_psi(g_spinor_field[DUM_DERI+1], g_spinor_field[DUM_DERI]);
if(use_preconditioning==1 && g_precWS!=NULL){
spinorPrecWS *ws=(spinorPrecWS*)g_precWS;
static _Complex double alpha = 0.0;
if(g_prec_sequence_d_dagger_d[1] != 0.0){
alpha = g_prec_sequence_d_dagger_d[1];
spinorPrecondition(g_spinor_field[DUM_DERI+1],g_spinor_field[DUM_DERI+1],ws,T,L,alpha,0,1);
}
}
#endif
}
convert_lexic_to_eo(Even_new, Odd_new, g_spinor_field[DUM_DERI+1]);
}
return(iter);
}