PLUMED mismatch error happened in metadynamics

344 views
Skip to first unread message

Wei-Tse WEHS7661

unread,
Jun 14, 2021, 5:53:13 AM6/14/21
to PLUMED users
Dear PLUMED users,
I encountered the following PLUMED error when running a 2D metadynamics with the sampling in the alchemical space enabled. 

+++ PLUMED error
+++ at IFile.cpp:98, function PLMD::IFile& PLMD::IFile::advanceField()
+++ message follows +++
file HILLS_2D: mismatch between number of fields in file and expected number

I'm not entirely sure what this error is about, but I assumed that it indicated my HILLS file might have been corrupted. However, I've checked my HILLS and COLVAR file but could not find any signs showing that the file was corrupted. Everything seemed fine before the simulation crashed and I had no idea which direction I should start with troubleshooting. Below are the simulation parameters I used in plumed.dat:

center: CENTER ATOMS=1-144            # geometric center of the host molecule
water_group: GROUP ATOMS=207-6656:3   # oxygen atom of the water molecules
n: COORDINATION GROUPA=center GROUPB=water_group R_0=0.35  # radius: 0.6 nm
lambda: EXTRACV NAME=lambda

METAD ...
ARG=lambda,n
SIGMA=0.01,0.05    # small SIGMA ensure that the Gaussian approaximate a delta function
HEIGHT=12.394781044629076
PACE=10
GRID_MIN=0,0     # index of alchemical states starts from 0
GRID_MAX=39,20     # we have 40 states in total
GRID_BIN=39,100
TEMP=298
BIASFACTOR=150
LABEL=metad
FILE=HILLS_2D
... METAD

PRINT STRIDE=10 ARG=n,lambda,metad.bias FILE=COLVAR

Specifically, in the metadynamics simulation, the number of water molecules in the binding cavity of the host-guest binding complex and the alchemical variable/state were biased. I know that the parameters I used were not typical for a metadynamics simulation but here are my reasons:

  • Large bias factor: Before deciding the value of bias factor, I conducted some preliminary tests, which are metadynamics simulations with different bias factors only biasing the number of water molecules. As a result, due to the high free energy barrier, a bias factor between 60 to 150 would lead to a flatter distribution in the CV space. With bias factor being 60, the sampling in the alchemical space was slow, so I decided to use 150, which did lead to a relatively flat distribution in both the alchemical space and the configurational CV space (the number of water molecules). In addition, from the 1D metadynamics simulations, it could be estimated that the largest free energy barrier in the configurational CV space was about 170 kT, so I thought a bias factor around 150 would probably reasonable. (In the paper "Well-Tempered Metadynamics: A Smoothly Converging and Tunable Free-Energy Method", it was experimentally found that the error tend to be the lowest given that the bias factor was set such that k(T+delta T) is of the order of magnitude of the barrier height.)
  • Small pace: Given a large bias factor, the Gaussian height would decrease pretty slowly in the simulation. To accelerate the sampling, instead of using a large pace (e.g. 500 simulation steps), I used PACE=10
I've decided metadynamcis parameters in the same way for other systems and all of them worked well. (They are simpler though.) I was pretty confused by the mismatch issue I had in my simulation. Here I attach the HILLS file generated in the simulation. Please let me know if other information would be useful to identify the reason for the issue. Any suggestions or experience shared would be greatly appreciated!

Best,
Wei-Tse




Giovanni Bussi

unread,
Jun 14, 2021, 6:06:46 AM6/14/21
to plumed...@googlegroups.com
Hi,

your HILLS file is corrupted:

grep FIELDS ~/Downloads/HILLS_2D_backup
#! FIELDS time lambda n sigma_lambda sigma_n height biasf
#! FIELDS time lambda n sigma_lambda sigma_n height biasf
                21428.1                      0      9.505067415588124                   #! FIELDS time lambda n sigma_lambda sigma_n height biasf

I would suggest to remove the offending Gaussians (usually the impact is negligible). That is, remove the third line I extracted above, and remove the last line of the HILLS file (that also looks incomplete)

Giovanni


--
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/04b19848-e9b4-489f-8565-78e6c3691f77n%40googlegroups.com.

William Hsu

unread,
Jun 16, 2021, 1:25:52 AM6/16/21
to PLUMED users
Hi Dr. Bussi,
Thanks a lot for your reply! 
The simulation was extended once at about 21 ns, so there are incomplete lines. Originally, I thought the incomplete lines before the simulation crashes should be fine, as the simulation always extends from checkpoint instead of the last, incomplete lines. Also, my simulation crashed at about 77 ns instead of right after 21.428 ns, so I guess I'm not entirely sure how incomplete lines at 21-ish ns did not cause an error until reaching 77-ish ns. 

With that being said, after removing the incomplete lines, I was able to keep extending the simulation. However, the simulation crashed again with the same error even if there are no corrupted lines (all have been removed right before the extension). When encountering this, I just remove the last few lines again and relaunched the simulation, then it worked fine and I was able to reach the simulation length I wanted. 

Best,
Wei-Tse



giovann...@gmail.com 在 2021年6月14日 星期一上午4:06:46 [UTC-6] 的信中寫道:

Giovanni Bussi

unread,
Jun 16, 2021, 3:49:56 AM6/16/21
to plumed...@googlegroups.com
Good that you solved the problem. I would suggest you find out the reason for the crash and make sure there's not something weird happening or a subtle bug.

Obviously, if you are exceeding the time limit of a queueing system, then this is expected. I would suggest the `mdrun -maxh` option for a clean exit. In the past I had troubles with that option (I think sometimes it doesn't work with replica exchange) and I wrote a small awk script that prunes the HILLS file removing all rows with a time larger than the one reported in a checkpoint. Basically, at every new job start I was (a) taking a zipped backup of HILLS file and checkpoints (b) pruning the HILLs file (c) starting the simulation.

Giovanni




Wei-Tse WEHS7661

unread,
Jun 21, 2021, 4:47:22 AM6/21/21
to PLUMED users

Hi Dr. Bussi,
Thanks a lot! This protocol did clarify things a lot.

Best,
Wei-Tse
Reply all
Reply to author
Forward
0 new messages