Skip to content

Commit 6682674

Browse files
author
Mathieu Taillefumier
committed
More cleanup
1 parent 4ea1590 commit 6682674

File tree

2 files changed

+30
-54
lines changed

2 files changed

+30
-54
lines changed

src/lib/CMakeLists.txt

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,18 @@ list(
7878
solver/chrono_guess.c
7979
solver/gcr4complex.c
8080
solver/jdher.c
81-
# solver/gcr4complex_body.inc
8281
solver/gmres_dr.c
83-
# solver/fgmres4complex_body.inc
8482
solver/cg_her_bi.c
8583
solver/solver_field.c
8684
solver/quicksort.c
8785
solver/bicgstab2.c
8886
solver/cgs_real.c
89-
# solver/M_plus_block_psi_body.inc solver/little_mg_precon_body.inc
90-
# solver/little_project_eo_body.inc
9187
solver/monomial_solve.c
9288
solver/cr.c
9389
solver/gram-schmidt.c
9490
solver/solver_types.c
9591
solver/cg_her.c
9692
solver/jdher_bi.c
97-
# solver/mrblk_body.inc
9893
solver/eigcg.c
9994
solver/poly_precon.c
10095
solver/Msap.c
@@ -138,7 +133,6 @@ list(
138133
linalg/mul_r_gamma5.c
139134
linalg/convert_eo_to_lexic.c
140135
linalg/print_spinor.c
141-
# linalg/assign_add_mul_body.inc
142136
linalg/mul_diff_mul_r.c
143137
linalg/square_norm_32.c
144138
linalg/mul.c
@@ -183,7 +177,6 @@ list(
183177
linalg/set_even_to_zero.c
184178
linalg/assign_mul_add.c
185179
linalg/square_and_prod_r.c
186-
# linalg/scalar_prod_body.inc
187180
linalg/assign_mul_bra_add_mul_ket_add.c
188181
linalg/assign_add_mul_r_32.c
189182
linalg/scalar_prod.c
@@ -198,23 +191,16 @@ list(
198191
APPEND
199192
OPERATOR_SRC_C
200193
operator/clover_invert.c
201-
# operator/hopping_body_dbl.c
202194
operator/tm_operators_nd_32.c
203-
# operator/halfspinor_body.inc operator/Block_D_psi_body.inc
204-
# operator/mul_one_pm_imu_sub_mul_body.inc
205-
# operator/assign_mul_one_sw_pm_imu_site_lexic_body.inc
206-
# operator/assign_mul_one_sw_pm_imu_inv_block_body.inc
207195
operator/clover_accumulate_deriv.c
208196
operator/Hopping_Matrix.c
209197
operator/tm_operators.c
210198
operator/tm_times_Hopping_Matrix.c
211199
operator/clovertm_operators_32.c
212-
# operator/hopping_sgl.c
213200
operator/Dov_proj.c
214201
operator/clover_deriv.c
215202
operator/clover_det.c
216203
operator/clover_leaf.c
217-
# operator/D_psi_body.inc
218204
operator/clovertm_operators.c
219205
operator/Dov_psi.c
220206
operator/tm_operators_nd.c
@@ -225,7 +211,6 @@ list(
225211
operator/D_psi.c
226212
operator/tm_operators_32.c
227213
operator/Hopping_Matrix_32.c)
228-
# operator/halfspinor_body_32.c operator/mul_one_pm_imu_inv_body.inc)
229214

230215
list(
231216
APPEND
@@ -249,7 +234,6 @@ list(
249234
smearing/ape_ape_smear.c
250235
smearing/uils_print_config_to_screen.c
251236
smearing/utils_project_antiherm.c)
252-
# smearing/utils_print_config_to_screen.c smearing/utils_reunitarize_MILC.c)
253237

254238
list(
255239
APPEND
@@ -295,11 +279,9 @@ list(
295279
xchange/xchange_2fields.c
296280
xchange/xchange_gauge.c
297281
xchange/xchange_halffield.c
298-
# xchange/xchange_jacobi.c xchange/little_field_gather_body.inc
299282
xchange/little_field_gather.c
300283
xchange/xchange_deri.c
301284
xchange/xchange_field.c)
302-
# xchange/xchange_field_tslice.c)
303285

304286
list(
305287
APPEND
@@ -315,7 +297,6 @@ list(
315297
list(
316298
APPEND
317299
MAIN_SRC_C
318-
# cu/cu.c
319300
measure_gauge_action.c
320301
start.c
321302
deriv_Sb.c
@@ -332,7 +313,6 @@ list(
332313
get_rectangle_staples.c
333314
rnd_gauge_trafo.c
334315
measure_rectangles.c
335-
# invert.c
336316
deriv_Sb_D_psi.c
337317
mpi_init.c
338318
update_momenta_fg.c
@@ -359,12 +339,10 @@ list(
359339
aligned_malloc.c
360340
fatal_error.c
361341
operator.c
362-
# cu/cu.c chebyshev_polynomial.c qphix_test_Dslash.c
363342
expo.c
364343
overrelaxation.c
365344
Ptilde_nd.c
366345
update_gauge.c
367-
# hopping_test.c
368346
integrator.c)
369347

370348
list(APPEND TEST_SRC_C test/check_xchange.c test/check_geometry.c
@@ -456,20 +434,22 @@ target_include_directories(
456434
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
457435
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
458436

459-
install(TARGETS hmc
460-
EXPORT tmlqcd_targets
461-
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
437+
install(
438+
TARGETS hmc
439+
EXPORT tmlqcd_targets
440+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
462441

463-
install(EXPORT tmlqcd_targets
442+
install(
443+
EXPORT tmlqcd_targets
464444
FILE tmlQCDTargets.cmake
465445
NAMESPACE tmlQCD::
466446
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
467447

468-
install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/include
448+
install(
449+
DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/include
469450
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
470451
FILES_MATCHING
471452
PATTERN "*.h")
472453

473454
install(FILES "${CMAKE_BINARY_DIR}/tmlqcd_config_internal.h"
474-
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
475-
)
455+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")

src/lib/solver/gmres_precon.c

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -307,33 +307,29 @@ complex scalar_prod_nocom(spinor *const S, spinor *const R, const int N) {
307307
}
308308

309309
double square_norm_nocom(spinor *const P, const int N) {
310-
int ix;
311-
static double ks, kc, ds, tr, ts, tt;
312-
spinor *s;
313-
314-
ks = 0.0;
315-
kc = 0.0;
310+
double ks = 0.0;
311+
double kc = 0.0;
316312

317313
/* Change due to even-odd preconditioning : VOLUME to VOLUME/2 */
318-
for (ix = 0; ix < N; ix++) {
319-
s = P + ix;
320-
321-
ds = (*s).s0.c0.re * (*s).s0.c0.re + (*s).s0.c0.im * (*s).s0.c0.im +
322-
(*s).s0.c1.re * (*s).s0.c1.re + (*s).s0.c1.im * (*s).s0.c1.im +
323-
(*s).s0.c2.re * (*s).s0.c2.re + (*s).s0.c2.im * (*s).s0.c2.im +
324-
(*s).s1.c0.re * (*s).s1.c0.re + (*s).s1.c0.im * (*s).s1.c0.im +
325-
(*s).s1.c1.re * (*s).s1.c1.re + (*s).s1.c1.im * (*s).s1.c1.im +
326-
(*s).s1.c2.re * (*s).s1.c2.re + (*s).s1.c2.im * (*s).s1.c2.im +
327-
(*s).s2.c0.re * (*s).s2.c0.re + (*s).s2.c0.im * (*s).s2.c0.im +
328-
(*s).s2.c1.re * (*s).s2.c1.re + (*s).s2.c1.im * (*s).s2.c1.im +
329-
(*s).s2.c2.re * (*s).s2.c2.re + (*s).s2.c2.im * (*s).s2.c2.im +
330-
(*s).s3.c0.re * (*s).s3.c0.re + (*s).s3.c0.im * (*s).s3.c0.im +
331-
(*s).s3.c1.re * (*s).s3.c1.re + (*s).s3.c1.im * (*s).s3.c1.im +
332-
(*s).s3.c2.re * (*s).s3.c2.re + (*s).s3.c2.im * (*s).s3.c2.im;
333-
334-
tr = ds + kc;
335-
ts = tr + ks;
336-
tt = ts - ks;
314+
for (int ix = 0; ix < N; ix++) {
315+
spinor *s = P + ix;
316+
317+
double ds = (*s).s0.c0.re * (*s).s0.c0.re + (*s).s0.c0.im * (*s).s0.c0.im +
318+
(*s).s0.c1.re * (*s).s0.c1.re + (*s).s0.c1.im * (*s).s0.c1.im +
319+
(*s).s0.c2.re * (*s).s0.c2.re + (*s).s0.c2.im * (*s).s0.c2.im +
320+
(*s).s1.c0.re * (*s).s1.c0.re + (*s).s1.c0.im * (*s).s1.c0.im +
321+
(*s).s1.c1.re * (*s).s1.c1.re + (*s).s1.c1.im * (*s).s1.c1.im +
322+
(*s).s1.c2.re * (*s).s1.c2.re + (*s).s1.c2.im * (*s).s1.c2.im +
323+
(*s).s2.c0.re * (*s).s2.c0.re + (*s).s2.c0.im * (*s).s2.c0.im +
324+
(*s).s2.c1.re * (*s).s2.c1.re + (*s).s2.c1.im * (*s).s2.c1.im +
325+
(*s).s2.c2.re * (*s).s2.c2.re + (*s).s2.c2.im * (*s).s2.c2.im +
326+
(*s).s3.c0.re * (*s).s3.c0.re + (*s).s3.c0.im * (*s).s3.c0.im +
327+
(*s).s3.c1.re * (*s).s3.c1.re + (*s).s3.c1.im * (*s).s3.c1.im +
328+
(*s).s3.c2.re * (*s).s3.c2.re + (*s).s3.c2.im * (*s).s3.c2.im;
329+
330+
double tr = ds + kc;
331+
double ts = tr + ks;
332+
double tt = ts - ks;
337333
ks = ts;
338334
kc = tr - tt;
339335
}

0 commit comments

Comments
 (0)