lattice / quda

QUDA is a library for performing calculations in lattice QCD on GPUs.
https://lattice.github.io/quda
Other
287 stars 94 forks source link

Extend invert_test_gtest.hpp with testing for HQ CG solves. #1400

Closed maddyscientist closed 1 year ago

maddyscientist commented 1 year ago

This PR adds support for testing heavy-quark CG solves in the gtest solver testing. In doing so, I have seemingly discovered a bug in the HQ solver, where it fails to converge in mixed-precision.

The following command

tests/invert_test --dslash-type wilson --ngcrkrylov 8 --dim 2 4 6 8 --prec double --prec-sloppy single --tol 1e-7 --tolhq 1e-7

fails to converge.

CG: Convergence at 161 iterations, L2 relative residual: iterated = 2.738192e+05, true = 2.738192e+05 (requested = 1.000000e-07), heavy-quark residual = 1.085493e+00 (requested = 1.000000e-07)

This is seemingly a mixed-precision bug in the HQ CG solver, as convergence is fine for the regular CG solver, and also proceeds as expected in the HQ solver in uni-precision.

@weinbe2 handing this to you to fix this bug, so we can get this test merged in.