Re: TCL: force not a vector

From: Peter Freddolino (
Date: Wed Jul 11 2007 - 10:23:54 CDT

Hi Peter,
as far as I know, this is a bug in the tcl interpreter (not
namd-specific) that shows up occasionally (and randomly) when doing
parallel runs. It only occurs on floating point math, and is relatively
rare. Until the underlying tcl implementation is fixed, there are 3 options:
-accept it as an occasional run-crasher, and just restart from the
latest checkpoint
-Use a compiled tcl extension (probably written in C and built using
swig) to do any serious math in the tclforces script
-run in serial

I usually go with option 2 if I have enough force evaluations for this
to happen frequently (it also yields better performance in such cases).
As long as tcl doesn't do any floating point math in your script (ie,
it's all handled using calls to the compiled extension), this crash
can't happen. I've verified (through pain of lots of print statements)
that even when the crash does occur in tclforces, all of the
calculations were correct, but obviously that doesn't help if tcl
doesn't properly recognize its own result as a number of vector in that
case ;-)


Peter Jones wrote:
> Hello all,
> I am running a simulation with some tcl restraints. I have run it for 500K steps with tcl forces on with no problems. I then
> continued the simulation using a subset of the first restraints and after 50000 steps I get the following error-
> TCL: force not a vector
> FATAL ERROR: force not a vector
> while executing
> "addforce $aid21 [vecscale $g16 $MG15]"
> (procedure "calcforces" line 53)
> invoked from within
> "calcforces"
> All the energies seem fine and the conformation of the atom referred to in the error appears normal. The tcl forces are
> contained in a script (attached) which is based on that in the manual. I am very puzzled by this, any help would be greatly
> appreciated,
> thanks,
> Peter Jones

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:44:57 CST