Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support full initialization of volumetric maps within Colvars #737

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

giacomofiorin
Copy link
Member

@giacomofiorin giacomofiorin commented Oct 23, 2024

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 giacomofiorin force-pushed the internalize-gridforces branch from 10238ef to 6c2ac5b Compare October 23, 2024 16:04
@giacomofiorin giacomofiorin changed the title Support full initialization volumetric maps within Colvars Support full initialization of volumetric maps within Colvars Oct 23, 2024
@HanatoK
Copy link
Member

HanatoK commented Oct 25, 2024

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?

@giacomofiorin
Copy link
Member Author

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 giacomofiorin force-pushed the internalize-gridforces branch 2 times, most recently from bae0383 to 42ed8ad Compare October 26, 2024 02:22
Here, the main test is that numatoms (computed with internal loops) is equal
to numatoms_ref (computed by NAMD)
Also remove a few heap allocations
Allow different deformation amplitude between leaflets, small fixes

Fix reading input from --deformation-map-mask option

Issue identified by @1004parky, mask map was initialized to 1 in all cases.

Silence NumPy warnings

Small fixes

Fix handling of PDB files in generated VMD input

Make single-map CVs optional

Allow customizing selection for COM and orientation restraints

Make generated NAMD and VMD scripts more uniform

Unify writing of Colvars input between NAMD and VMD

Add support for mapFile keyword
@giacomofiorin giacomofiorin force-pushed the internalize-gridforces branch from 42ed8ad to 4c45a16 Compare October 27, 2024 19:44
@jhenin
Copy link
Member

jhenin commented Nov 27, 2024

Is this ready for review?

@giacomofiorin giacomofiorin marked this pull request as draft December 2, 2024 00:41
@giacomofiorin
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants