Colvars resseting the count history halfway through the run

Hi all,

I’m using the colvars module to calculate the pmf of adsorption of a given surfactant with ABF. One of the output files is a .hist.count file that counts the number of timesteps a colvar (a distance, in this case) has been in each of the defined bins, and does this several times per run (history), each in their own block. The problem is, halfway through the run, the counts in the .hist.count file seem to reset, e.g., if a colvar had been in the bin between 3.025 and 3.075A for 300,000 times in a given block, it goes back to zero in the next one. Below is my colvars config file:

####################################

Configuration file for COLVARS

####################################

Global keywords

colvarsTrajFrequency 1000
colvarsRestartFrequency 1000000
indexFile circum_abf.ndx
indexFile pibsi_head.ndx

Colvar definition

colvar {
# colvar = (0.0, 0.0, 1.0) x (r - r1)
name dist2surf
outputTotalForce on
outputAppliedForce on
width 0.05 # Sets the width of the bins
lowerBoundary 2
upperBoundary 5 # The colvar space can be partitioned to use a different width on each section

distance {
group1 indexGroup pibsi_head # Position r measured
group2 indexGroup circum_abf # Position r1 measured
}
}

Harmonic wall

harmonicWalls {
name PinkFloids
colvars dist2surf
lowerWalls 2
upperWalls 5
lowerWallConstant 20.0
upperWallConstant 20.0
}

Umbrella sampling of the Colvar

abf {
name ABF
colvars dist2surf
fullSamples 15000
historyFreq 1000000
maxForce 20.0
hideJacobian yes
applyBias yes
}

Kind regards,
Carlos

This is a question for @giacomo.fiorin

Please let us know which version of LAMMPS you are using, what platform you are running on and what the colvars version is.

Hi Axel,

Thank you for the reply. I’m using LAMMPS version 3Mar20 and colvars version 2020-01-27 in my HPC facility over 3 nodes and 120 cores. I’m not sure what more information I can provide but I’ll be happy to look it up if it could help.

Kind regards,
Carlos

Hi Carlos, thanks for the detailed information.

I have only one question: are you using the same output prefix for consecutive (i.e. restarted) jobs? If so, please use different file prefixes, like you would for a LAMMPS trajectory dump file. You can easily concatenate history files from consecutive jobs after the fact.

The problem is the following. To write history files across multiple jobs, the version of Colvars that you are using is appending to existing files, rather than keeping them open within the same job or opening a new file in the next job. This can be fragile when certain jobs crash and are repeated later.

We have now almost completely removed the instances where files are opened in “append” mode. Specifically, .hist.count files are now kept open during a single job, rather than being reopened in “append” mode. And any existing file with the same name will be overwritten. This approach is more stable, and it is followed in the Colvars versions bundled with later LAMMPS versions, e.g. 29Oct2020 or 29Sep2021.

Giacomo

1 Like