Skip to content

Support full initialization of volumetric maps within Colvars#737

Open
giacomofiorin wants to merge 23 commits into
masterfrom
internalize-gridforces
Open

Support full initialization of volumetric maps within Colvars#737
giacomofiorin wants to merge 23 commits into
masterfrom
internalize-gridforces

Conversation

@giacomofiorin

@giacomofiorin giacomofiorin commented Oct 23, 2024

Copy link
Copy Markdown
Member

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 done by NAMD as implemented here (more efficient)
  2. using MGridForce keywords, but with atoms selected and processed internally by Colvars (more flexible)

In VMD the situation is similar, with MGridForce replaced by VMD commands and with the distinction that

This PR improves the use-case no. 2, i.e. when atoms are selected and processed directly by Colvars. It allows to specify the volumetric map's file name directly in the Colvars configuration, with the following advantages:

  • there is no need for an additional Tcl script to load the maps
  • the syntax is now identical to NAMD and VMD

One disadvantage of processing the atoms and the maps internally to Colvars is that NAMD's parallel communication cannot be used any more (use-case no. 1). However, in today's most GPU-based computations there are not many CPU tasks.

The documentation and the Colvars Dashboard template for mapTotal are updated accordingly. Additionally, there is now a template configuration for a Multi-Map variable as well (although using the generator script is still preferred)

@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

HanatoK commented Oct 25, 2024

Copy link
Copy Markdown
Member

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

giacomofiorin commented Oct 25, 2024

Copy link
Copy Markdown
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. (EDIT: Should be fixed soon as of April 2026, but performance with GPU-resident is not great)

@giacomofiorin giacomofiorin force-pushed the internalize-gridforces branch 3 times, most recently from 42ed8ad to 4c45a16 Compare October 27, 2024 19:44
@jhenin

jhenin commented Nov 27, 2024

Copy link
Copy Markdown
Member

Is this ready for review?

@giacomofiorin giacomofiorin marked this pull request as draft December 2, 2024 00:41
@giacomofiorin

Copy link
Copy Markdown
Member Author

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

@giacomofiorin giacomofiorin self-assigned this Mar 4, 2025
@giacomofiorin giacomofiorin force-pushed the internalize-gridforces branch 2 times, most recently from d191eb2 to 180446a Compare March 14, 2025 20:19
@giacomofiorin giacomofiorin force-pushed the internalize-gridforces branch from 180446a to cec10ae Compare March 28, 2025 15:03
@giacomofiorin giacomofiorin force-pushed the internalize-gridforces branch 2 times, most recently from ed017ad to 702b47b Compare April 16, 2026 21:33
@giacomofiorin

Copy link
Copy Markdown
Member Author

After rebasing onto master:

  • NAMD ARM volmap regtests fail, but this looks like another instance of single-precision math
  • VMD volmap tests segfault

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 702b47b to 3a068b1 Compare June 9, 2026 19:08
@giacomofiorin giacomofiorin marked this pull request as ready for review June 11, 2026 20:29
@giacomofiorin giacomofiorin requested review from HanatoK and jhenin June 11, 2026 20:29
@giacomofiorin

Copy link
Copy Markdown
Member Author

All tests pass now, minus the small numerical deviations in AMD64 due to the use of the NAMD GridForces code, which uses single-precision math. I disabled those.

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