milc-qcd / milc_qcd

MILC collaboration code for lattice QCD calculations
Other
34 stars 33 forks source link

Offloading plaquette, polyakov loop, and gauge action calculations to QUDA #55

Closed weinbe2 closed 1 year ago

weinbe2 commented 1 year ago

This PR within the lattice group's version of milc_qcd is complimentary to the QUDA PR that enables this functionality, https://github.com/lattice/quda/pull/1308 . The changes in this diff correspond to adding a new MILC Makefile flag, WANT_GA_GPU, corresponding to offloading the gauge action ("GA"), as well as the plaquette and Polyakov loop during the RHMC/D evolution.

To simplify this, I split out computing the gauge action from generic/gauge_stuff.c into its own file, and created complimentary *_gpu.c versions of different gauge observable routines. I also added complimentary *_ks.c versions in the generic_ks directory, matching the conventions for other QUDA offload features for RHMC, which handles rephase-ing appropriately as part of the evolution.

I also slipped in making it easier to specify the QUDA verbosity level from the Makefile, adding support for a new environment variable QUDA_VERBOSITY.

There is a bit of outstanding clean-up, but I've confirmed that this code gives results consistent with previous versions of MILC/QUDA, and "does no harm" to a CPU-only build.

Once this (plus the complimentary QUDA PR) is approved, I'll open a PR into the "milc-qcd" group version of MILC.

weinbe2 commented 1 year ago

FYI @maddyscientist @mathiaswagner