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

Separate computation and update steps into two distinct functions of the module's external API #747

Open
giacomofiorin opened this issue Oct 31, 2024 Discussed in #746 · 0 comments

Comments

@giacomofiorin
Copy link
Member

Discussed in #746

Originally posted by HanatoK October 30, 2024
I think the separation is required for using Monte-Carlo barostat. In the Monte-Carlo barostat, we don't increase the step number, and evaluate the forces multiple times at the same step. PLUMED has two entrance functions for the MD engine, namely (i) calculate() and (ii) update(). Both of them are supposed to be called in a forward manner, but the former should only calculate the CVs, biasing energy and forces, while the latter is supposed to update the internal state of the biases. In the OpenMM-PLUMED interface, the two routines are called by the following code (https://github.com/openmm/openmm-plumed/blob/a3e935bc88ed8771f17f6f4d60588b81789b9c89/openmmapi/src/PlumedForceImpl.cpp#L143-L148):

    plumed_cmd(plumedmain, "performCalcNoUpdate", NULL);
    if (step != lastStepIndex) {
        plumed_cmd(plumedmain, "update", NULL);
        lastStepIndex = step;
    }

As you can see, update() will be only called after the step counter changed.

Now that NAMD is going to support the Monte-Carlo barostat in the GPU-resident code path. I wish Colvars can be compatible with it (or can be used in OpenMM in the future), so I think it is important to separate the calculation of CVs and biases and the update of their internal states.

@giacomofiorin giacomofiorin changed the title Separate (i) the calculation of CVs, biasing energies and forces from (ii) the printing of CVs, and the update of time-dependent states in the bias object Separate computation and update steps into two distinct functions of the module's external API Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant