Error in colvars module in parsing accumulatedWork when it is -nan

Hi,

I recently added colvarsRestartFrequency 100 to my colvars configuration and I got this error whenever my accumulatedWork is -nan in the colvars.state restart file.

colvars: Error: in parsing "accumulatedWork”.
ERROR on proc 0: Fatal error in the collective variables module. (../colvarproxy_lammps.cpp:315)

In my colvars.state restart file:

restraint {
  configuration {
    step 2000000
    name harmonic1
    centers 3.00000000000000e+00
    centers_raw 3.00000000000000e+00
    accumulatedWork -nan
  }
}

Without the colvarsRestartFrequency tag, I didn’t seem to get this error.

I was able to solve this problem by doing reading the problematic restart file, omit fix colvars and write_restart. So, I’m posting this question to see if there is a better way to solve this problem?

Best,
Tonnam Balankura
Penn State University

Hi,

I recently added colvarsRestartFrequency 100 to my colvars configuration
and I got this error whenever my accumulatedWork is -nan in the
colvars.state restart file.

colvars: Error: in parsing "accumulatedWork”.
ERROR on proc 0: Fatal error in the collective variables module.
(../colvarproxy_lammps.cpp:315)

In my colvars.state restart file:

restraint {
  configuration {
    step 2000000
    name harmonic1
    centers 3.00000000000000e+00
    centers_raw 3.00000000000000e+00
    accumulatedWork -nan
  }
}

Without the colvarsRestartFrequency tag, I didn’t seem to get this error.

I was able to solve this problem by doing reading the problematic restart
file, omit fix colvars and write_restart. So, I’m posting this question to
see if there is a better way to solve this problem?

​the real problem is, that there *should* not be a -NaN.

you will have to figure out, why this happens; i.e. whether this ​is a
(fixed?) bug in colvars or an indication of a problem with your simulation.

axel.

I’m not aware of a bug in the harmonic restraint, can you look at the values that the collective variable takes over time?

Thanks Axel and Giacomo for your replies. Looking at my lammpstrj file, the simulation seem to be fine.

My out.colvars.traj is:

step ZPULL x0_ZPULL W_harmonic1

1000000 3.86582832134200e+00 3.00000000000000e+00 0.00000000000000e+00
1000100 3.89272402639424e+00 3.00000000000000e+00 -nan
1000200 4.02273383910695e+00 3.00000000000000e+00 -nan
1000300 3.90598924756570e+00 3.00000000000000e+00 -nan
1000400 3.81480499193611e+00 3.00000000000000e+00 -nan
1000500 3.75193022228514e+00 3.00000000000000e+00 -nan

In other windows without such problem, my out.colvars.traj is typically:

step ZPULL x0_ZPULL W_harmonic1

1028000 1.54967464283919e+01 1.57600000000000e+01 0.00000000000000e+00
1028100 1.55348447711368e+01 1.57600000000000e+01 0.00000000000000e+00
1028200 1.56061368474879e+01 1.57600000000000e+01 0.00000000000000e+00
1028300 1.57186100264062e+01 1.57600000000000e+01 0.00000000000000e+00
1028400 1.57976618800188e+01 1.57600000000000e+01 0.00000000000000e+00
1028500 1.59025738774480e+01 1.57600000000000e+01 0.00000000000000e+00

My colvars configuration is:

colvarsTrajFrequency 100
colvarsRestartFrequency 100

colvar {
name ZPULL
width 1.0
UpperBoundary 46.0
LowerBoundary 0.0
distanceZ {
main { atomNumbersRange 5017-5106 }
ref {
atomNumbersRange 1-418
}
axis (0.0,0.0,-1.0)
}
}

harmonic {
colvars ZPULL
forceConstant 1.7
centers 15.76
targetCenters 15.76
targetNumSteps 1000000
outputCenters yes
outputAccumulatedWork yes
}

Best,
Tonnam

I think it might be an error on my computation node? After I restart it, the -nan have not shown up yet. The cluster I’m using is relatively new and may not have been properly setup yet.

Best,
Tonnam

If the error cannot be reproduced, I would not worry about it. If it surfaces again, try increasing the thermo frequency and colvarsTrajFrequency to get an idea of when things do go wrong.

Giacomo