plumed / plumed2

Development version of plumed 2
https://www.plumed.org
GNU Lesser General Public License v3.0
357 stars 284 forks source link

Question: How to use CONSTANT in keywords for Biases? #979

Closed Clownshift closed 11 months ago

Clownshift commented 11 months ago

Hi Devs, I would like to use CONSTANT values to define certain parameters of multiple bias potentials, but I cannot get it to work. I am trying to use the same spring constant for multiple biases. I thought I might be able to achieve that by writing in the plumed.dat:

k: CONSTANT VALUE=150.0
uwallA: UPPER_WALLS ARG=dA AT=5.8 KAPPA=k EXP=2 EPS=1 OFFSET=.1
lwallA: LOWER_WALLS ARG=dA AT=0.0 KAPPA=k EXP=2 EPS=1 OFFSET=.1

The error message that I get is the following:

Program:     gmx mdrun, version 2022.5-plumed_2.8.2
Source file: src/gromacs/gpu_utils/devicebuffer.cuh (line 91)
Function:    freeDeviceBuffer(DeviceBuffer*) [with DeviceBuffer = float2*]::<lambda()>

Assertion failed:
Condition: stat == cudaSuccess
Freeing of the device buffer failed. CUDA error #1 (cudaErrorInvalidValue):
invalid argument.

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

In case this might be a bug and not just a simple input error from my side, I would be happy to provide a minimal example.

For reference: I am using gromacs 2022.5 and I patched it with plumed 2.8.2

GiovanniBussi commented 11 months ago

Hi,

you can't. You can use constants as argument to functions expecting a collective variables. Not as parameters. If you want to do this, I suggest to create the plumed input file using a script.

Giovanni

Clownshift commented 11 months ago

Hi Giovanni,

Thanks for the reply and for clarifying this.

Patrick