Re: vmd-l: multiple automated calls to NAMD

From: Axel Kohlmeyer (
Date: Thu Jun 09 2005 - 02:38:35 CDT

On Wed, 8 Jun 2005 wrote:

EN> I have need for running NAMD multiple times (for short minimization runs)
EN> in a semi-automated way, driven by a VMD (Tcl) script. My inquiry is this:
EN> Is it possible to send command-line parameters to NAMD? Something


since VMD uses the tcl interpreter, you should be able
to use the tcl 'exec' command without problems and use
VMD/tcl variables as arguments. you may have to build the
command line as a tcl list beforehand. some of the VMD plugins
do spawn external programs, so you may try to grep through
the bundled tcl scripts for examples that are similar to
your needs.

EN> analogous to the "args" command for VMD or simple Tcl procs? If not, how can
EN> I communicate the values of variable parameters from a higher-level script
EN> into a particular instance of NAMD? I see in the manual that NAMD can
EN> read shell environment variables, and this works if I set the variables from
EN> my C-shell and run NAMD once; but when I tried this using "exec setenv"
EN> commands from within a VMD/Tcl script, the environment variables were not
EN> readable by NAMD. I also tried reading/writing my variables from/to a text

true. since each 'exec' will spawn a new shell, the environment
won't be carried over. however, you can try to run NAMD via 'env'
and get the environment exported. totally stupid example:

please compare

exec sh -c {echo $PATH}


exec env PATH=/bin:/usr/bin sh -c {echo $PATH}

and especially

set my_path {/bin:/usr/bin}
exec env PATH=$my_path sh -c {echo $PATH}

EN> file, using Tcl commands from within VMD and NAMD, but again to no avail.
EN> (Again, running my NAMD job directly from the Unix shell, taking its input
EN> parameters from my VMD-written text file, DOES work; but this time, when I
EN> try running the same NAMD config file from within VMD, I get this message:
EN> "ERROR:src/NamdState.C(158): Number of pdb and psf atoms are not the same".)

if the suggestions from above don't help you, could you provide a
(small) example that demonstrates the problem, so we could try
locating the root of the problem. your current discription is
rather vague to me.


EN> I had hoped that, since NAMD and VMD come from the same "house" and are
EN> supposed to play well together, that there might be a simple solution to
EN> my problem. Maybe I've just missed something obvious? Well, anyone who
EN> has any experience and could shed some light, I'd be most grateful.
EN> thanks, as always,
EN> - Erik
EN> C. Erik Nordgren, Ph.D.
EN> Department of Chemistry
EN> University of Pennsylvania

Dr. Axel Kohlmeyer   e-mail:
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum
If you make something idiot-proof, the universe creates a better idiot.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:40:49 CST