JeffersonLab / chroma

The Chroma Software System for Lattice QCD
http://jeffersonlab.github.io/chroma
Other
58 stars 50 forks source link

Solver exception #31

Closed bjoo closed 6 years ago

bjoo commented 6 years ago

I have attempted to i) Allow failing solvers (Multigrid for QUDA and MG Proto) to raise exceptions to be caught in the HMC. ii) I have rejiggered the HMC so that any reverseibility test occurs after the acceptance and rejection decision is already made (initial and final energies are evaluated). This is so that a reversibility test which may evolve a preconditioner back to the start of the original trajectory does not provide a subsequent final energy calculation with a crummy preconditioner. Rather the final energy calc will use the preconditioner, as it is at the proper end of the trajectory before the reverse check. (It may still be bad of course if it is just about to need refreshment).

The possibilities for acceptState should be true (always if WarmUp is set or if the acceptReject step accepts), false if acceptReject test rejects or if a MGSolverException is caught.

I have tested this on Titan and at least when not encountering any exceptions the code appears to repro delta H-s within rounding differences (which can be introduced just by retuning kernels). Still this is sufficiently big a change, that I'd like a code review of the diffs.

Thanks, Balint

grokqcd commented 6 years ago

Implements the desired changes.