Support full initialization of volumetric maps within Colvars
Currently, volumetric map and Multi-Map variables (link) are implemented in NAMD in two ways:
- using
MGridForcekeywords, with atoms selected byMGridForceFileand scalable computation over multiple processors/nodes (more efficient) - using
MGridForcekeywords, but with atoms selected internally by Colvars and computation done on rank 0 (more flexible)
The first approach only works for CPU-only and GPU-offload code path, with the exception of the current NAMD main branch, where a gridForces overhaul has temporarily removed the ability by Colvars to access the NAMD volumetric maps on any platform including CPU-only.
The second approach can theoretically work in any mode: however, NAMD 3.0 GPU-resident raises an error if any volmap-related options are defined (link).
This PR attempts to solve the second issue by having Colvars load directly OpenDX maps without touching NAMD data structures, through the new mapFile keyword. This is also supported in VMD, but its implementation still loads the map through VMD (simpler and more robust in an interactive workflow). In either case, future implementations that do not rely on NAMD or VMD internal code could be easily swapped in.
It seems with this PR and NAMD's main branch, the interface volmap tests are still failed either in the CPU build or in the GPU build. Do I miss something?
It seems with this PR and NAMD's main branch, the interface volmap tests are still failed either in the CPU build or in the GPU build.
Correct, this PR tries to fix the issue of NAMD raising an error when gridForces are defined with GPU-resident, even if they are never meant to be used on the GPU. By making Colvars load them instead, the user's intent is much clearer.
The issue of NAMD main no longer supporting reduction via ComputeGlobal (on any hardware configuration) still remains unaddressed.
Is this ready for review?
@jhenin I have a few jobs that showed discontinuities upon restarting: likely a PBC issue. I converted it back to draft accordingly.