colvars icon indicating copy to clipboard operation
colvars copied to clipboard

Support full initialization of volumetric maps within Colvars

Open giacomofiorin opened this issue 1 year ago • 4 comments

Currently, volumetric map and Multi-Map variables (link) are implemented in NAMD in two ways:

  1. using MGridForce keywords, with atoms selected by MGridForceFile and scalable computation over multiple processors/nodes (more efficient)
  2. using MGridForce keywords, 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.

giacomofiorin avatar Oct 23 '24 15:10 giacomofiorin

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?

HanatoK avatar Oct 25 '24 18:10 HanatoK

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.

giacomofiorin avatar Oct 25 '24 18:10 giacomofiorin

Is this ready for review?

jhenin avatar Nov 27 '24 12:11 jhenin

@jhenin I have a few jobs that showed discontinuities upon restarting: likely a PBC issue. I converted it back to draft accordingly.

giacomofiorin avatar Dec 02 '24 00:12 giacomofiorin