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

Hotfix: MILC+QUDA error if MILC is compiled with QUDA_VERBOSITY >= VERBOSE #1386

Closed weinbe2 closed 1 year ago

weinbe2 commented 1 year ago

This hotfix addresses an issue where MILC+QUDA would error out if MILC was compiled with QUDA_VERBOSITY=VERBOSE or higher. The core of the issue is in qudaInit:

void qudaInit(QudaInitArgs_t input)
{
  if (initialized) return;
  setVerbosityQuda(input.verbosity, "", stdout);
  qudamilc_called<true>(__func__);
  qudaSetLayout(input.layout);
  initialized = true;
  qudamilc_called<false>(__func__);
}

Here, qudamilc_called<true> itself calls printfQuda if QUDA's verbosity is >= QUDA_VERBOSE --- however, in this case, the default communicator hasn't been initialized yet, and won't be until qudaSetLayout is called (...on the next line), so we hit a catch-22 and QUDA errors out.

The easiest WAR is to manually pass QUDA_SUMMARIZE as the verbosity to qudamilc_called, preventing the call to printfQuda.