From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Mon Sep 04 2006 - 11:18:05 CDT

On 9/4/06, Gordon Wells <gordon.wells_at_gmail.com> wrote:
> I'm trying to run a frame by frame rmsd-per-residue analysis using a
> combination of code from the bigdcd.tcl and residue_rmsd.tcl scripts.
> The analysis runs fine manually, but vmd dies prematurely when launched from
> my qsub script. The exit corresponds to when the command prompt returns
> (after the third frame) in vmd. Is it possible to let vmd run scripts to
> completion with qsub?

yes. it is possible. there are just some caveats with certain scripts.

> Here is the qsub script:
> #!/bin/bash
> #
> #PBS -N rmsd-per-res-noMg-chB
> #PBS -l nodes=1
> #PBS -q md
>
> dir=~/nd-solv-fug-sym-nomg
> cd $dir
>
> echo "group main" > rmsdhost
>
> counter=0
> for node in `cat $PBS_NODEFILE`; do
> echo "host $node" >> rmsdhost;
> done;

i don't understand this part of your submit script.
what is its purpose? you only requested one node,
and on top of that, vmd does not use charm++

> ssh $node "cd $dir; vmd-1.8.5 -dispdev text -e rmsd-per-res.tcl >
> rmsd-per-resChB.out"

another question: why ssh to host?
you _are_ already on this machine, unless you have a
very, very weird VMD setup.

> The tcl:
>
> mol new equilall-somemore.coor
> mol addfile ionized.psf molid 0

hmmm... this makes not much sense. the correct order
is to _first_ read the .psf file. the .coor file is useless
without any structure information. for analyzing the .dcd
file it is actually harmful unless it would be the first frame
before the trajectory in the dcd starts.

the cleanest way of handling this kind of situation (e.g. when
loading the label/structure information from a file with coordinates)
is to use 'animate delete all' before loading the trajectory
and starting the analysis
.
> source bigdcd.tcl
> pre_rmsd_per_res 0 "segid ARB1 or segid ARB2" test.dat test.res 0

where does this command come from?
did you have the script set up to be autoloaded?

> set finished 0
> trace variable vmd_frame w rmsd_per_res_callback

same thing here. is the callback sourced (not shown) or autoloaded?

> bigdcd rmsd_per_res small.dcd

> The trace is meant to do the final calculations, and quit vmd, but is never
> reached when running from qsub.

the problem here may be related to the fact, that the bigdcd
script keeps loading the trajectory in the backgroud, i.e. the command
prompt is returned and your script might terminate. it may also terminate
elsewhere, since your output redirection, does not redirect the for debugging
purposes dearly needed error output (try >& instead of >). this would
contain potential error messages.

in case of bigdcd returning control early and thus vmd terminating,
the simplest workaround would be to add a sufficiently large sleep
to the script.

cheers,
    axel.

>
> Lastly, the vmd output:
>
> # tail -f rmsd-per-resChB.out
> Info) Waters: 26855
> Info) Segments: 15
> Info) Fragments: 26886 Protein: 6 Nucleic: 0
> 0
> 0
> dcdplugin) detected standard 32-bit DCD file of native endianness
> dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
> Info) Using plugin dcd for coordinates from file small.dcd
> 1: 1.06965327263
> 2: 1.08540391922
> 3: 1.07799816132
> Info) VMD for LINUX, version 1.8.5 (August 25, 2006)
> Info) Exiting normally.
>
> Thanks in advance
> gordon
>
> --
>
> POLITICS, n. A strife of interests masquerading as a contest of
> principles. The conduct of public affairs for private advantage.
>
> -- Ambrose Bierce, The Devil's Dictionary
>
> Gordon Wells
> Bioinformatics and Computational Biology Unit
> Department of Biochemistry
> University of Pretoria
>
>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
  Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.