Metadynamics very slow when using GRID_MIN and GRID_MAX

883 views
Skip to first unread message

Ángel Piñeiro

unread,
Sep 6, 2021, 4:09:45 PM9/6/21
to PLUMED users
I have a metadynamics simulation with 4 walkers using gromacs 2021 with plumed 2.7.1. The simulation goes VERY slow (it is practically frozen) if I use GRID_MIN and GRID_MAX (both with reasonable values) while it goes quite fast when these parameters are not specified. Is this normal? My reaction coordinate is the COORDINATION between 2 groups of atoms.

Here my input file (working well):
CM: COORDINATION GROUPA=5,26,40,54,67,81,102,116,137,151,165,178,192,213 GROUPB=235-266 R_0=1.5
METAD ARG=CM SIGMA=1.0 HEIGHT=2.0 PACE=500 WALKERS_N=4 WALKERS_ID=0 WALKERS_DIR=../ WALKERS_RSTRIDE=100 LABEL=metad FILE=HILLS BIASFACTOR=6.0 TEMP=298.0 RESTART=YES
PRINT ARG=CM,metad.bias STRIDE=100  FILE=COLVAR

My second input file (very slow) is identical except the second line, which is:
METAD ARG=CM SIGMA=1.0 HEIGHT=2.0 PACE=500 WALKERS_N=4 WALKERS_ID=0 WALKERS_DIR=../ WALKERS_RSTRIDE=100 LABEL=metad FILE=HILLS BIASFACTOR=6.0 TEMP=298.0 RESTART=YES GRID_MIN=0 GRID_MAX=425

The only difference is that the second one specifies the values of GRID_MIN and GRID_MAX

Thanks for any help!

Ángel.

Ángel Piñeiro

unread,
Sep 9, 2021, 6:50:20 AM9/9/21
to PLUMED users

I have been checking this issue. The problem is not that the simulation runs slow but that it gets stuck at some point after several tens of picoseconds. Then the simulation is still consuming computational time but the simulation does not advance at all. First I thought that the system could move out of the grid bounds and that this could be the source of the problem... then I added walls to prevent this but the problem remains. My simulations of the same system without the grid run well but they become slower as the trajectory advances and I have not control on the grid size... Any clue to solve this?

Michele Invernizzi

unread,
Sep 9, 2021, 7:20:17 AM9/9/21
to plumed...@googlegroups.com
Hi,

I have never experienced something similar. Does it happen also if you do not use multiple walkers or if you use WALKERS_MPI ?

Best,
Michele

--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/cc889ba7-1ce6-4755-94dd-f9d01a36368en%40googlegroups.com.

Ángel Piñeiro

unread,
Sep 9, 2021, 3:53:15 PM9/9/21
to PLUMED users
I have run a couple of tests with just 1 walker and it seems to be working well.

Michele Invernizzi

unread,
Sep 10, 2021, 3:54:56 AM9/10/21
to plumed...@googlegroups.com
Then the issue is probably related to the file implementation of multiple walkers. I personally never use it so I cannot be of great help in debugging.

But if you are using gromacs you can use the MPI version of multiple walkers, which is also more efficient. You have to run your simulation with the -multidir option and in the plumed files add the flag WALKERS_MPI to the METAD input, instead of all the other WALKERS_* options.
All the walkers will write on the same HILLS file, so I suggest to place it in a common folder, e.g. FILE=../HILLS

Best,
Michele


Ángel Piñeiro

unread,
Sep 10, 2021, 6:52:59 AM9/10/21
to PLUMED users
OK, I will try. Thank you very much! Just one more question related to this subject: if I have several independent simulations, can I analyze the file resulting from the concatenation of the independent HILLS files as usually with "plumed sum_hills"? I have this doubt because in that case the time column in the concatenated file would not be continously increasing but it would start from 0 once per simulation... I guess plumed is able to process this but I want to be sure. Also, should I remove the head of the independent HILLS files after the concatenation?

Thank you for the help!

Ángel.

Michele Invernizzi

unread,
Sep 10, 2021, 10:00:16 AM9/10/21
to plumed...@googlegroups.com
Yes, you can simply concatenate the HILLS files, run sum_hills and divide the result by the number of replicas N, then you will get an average free energy surface (FES) estimate. However, I would rather keep the HILLS separated and get N different FES, then you can average them point by point and also get the standard deviation, to have an estimate of the uncertainty.

It is also useful to look at how the FES estimate evolves with time, to have an idea of the METAD convergence.
For example in this plumed-nest entry you can find a script I used, called get_fes_running-metad.sh, that calculates the FES over time of various independent replicas and from them it gets the free energy difference, with error bars. It's written in bash and not very user-friendly, but it might be helpful... This is the kind of plot you can get for alanine dipeptide (from the SI of the paper):
convergence.PNG
Best,
Michele


Ángel Piñeiro

unread,
Sep 10, 2021, 10:12:05 AM9/10/21
to PLUMED users
OK, thank you very much again. 

BTW: WALKERS_MPI seems to work perfectly well for my system.

Best,

Ángel.

Danai Kotzampasi

unread,
Jan 31, 2024, 2:36:32 PM1/31/24
to PLUMED users
Hi all and sorry for opening a closed issue,

I have experienced the same problem. I am running multiple walkers (N=8) and when I run them simultaneously one/more of them gets stuck. I am using gromacs 2021.5 patched with plumed 2.8. In the past, I ran similar simulations with the same setup I have not experienced the same problem.

What do you recommend? Could you please send me a tutorial or describe me the setup (file setup etc) you used using the -multidir flag?

Thank you in advance!
Danai
Reply all
Reply to author
Forward
0 new messages