Re: output to multiple files

From: Leandro Martinez (leandromartinez98_at_gmail.com)
Date: Tue Oct 26 2004 - 13:09:26 CDT

For if anyone else is interested, the simple csh script bellow will
run namd multiple times changing the output file name. The
configuration file must not have the outputname, run and rescaleTemp
keywords. This is not the solution I would like better, but it works.
Leandro.

#!/bin/csh -ef

set filename = ./protein.namd
set actualrun = ./ARprotein.namd
set output = protein_out
set log = ./run.log

set RUN = 10000
set TEMP = 398
set TARGETTEMP = 298

while ($TEMP >= $TARGETTEMP)

  set CHARTEMP = "$TEMP.15"
  cp -f $filename $actualrun
  echo "START: Temperature $CHARTEMP" >> $log
  date >> $log

  echo "outputname $output$CHARTEMP" >> $actualrun
  echo "rescaleTemp $CHARTEMP" >> $actualrun
  echo "run $RUN" >> $actualrun

  charmrun +p2 /home2/lmartinez/namd/bin/namd2 $actualrun >> $log

  date >> $log
  echo "END: Temperature $CHARTEMP" >> $log

  set TEMP = `expr $TEMP - 1`

end

On Tue, 26 Oct 2004 12:43:31 -0200, Leandro Martinez
<leandromartinez98_at_gmail.com> wrote:
> Good idea, but unfortunately it doesn't work. The file must be
> preserved to namd keep writing the coordinates. If I simply move the
> file, as in
>
> for { set TEMP 318.15 } { $TEMP >= 298.15 } { set TEMP [ expr $TEMP - 1.0 ] } {
> rescaleTemp $TEMP
> run 10
> catch {
> exec mv protein_out.dcd ./protein_out.dcd_$TEMP
> } msg
> }
>
> the output will be fully written to the first protein_out.dcd_$TEMP
> file created. If, instead, I copy the file to a new name and remove the
> protein_out.dcd file, no output is written anymore. Furthermore, if
> copy the file to a new name and instead of removing it I clear it,
> with some "cat emptyfile > protein_out.dcd" the output is written to
> the empty file, but since namd writes not to the last empty position
> but to a position calculated from the number of atoms and frames (I
> guess), the protein_out.dcd file size will be the same as if all the
> frames were written to it from the first to the current frame, even if
> the file has actually only one frame written. In this last case VMD is
> not able to open the dcd file.
> Any other idea or the only solution would be to restart the simulation
> periodically with a new output file name?
> Thanks,
> Leandro.
>
>
>
> On Fri, 22 Oct 2004 12:37:37 -0700 (PDT), Brian Bennion
> <brian_at_youkai.llnl.gov> wrote:
> >
> > Perhaps a simple command to rename the file after the initial one is
> > written might get around this problem.
> >
> > Brian
> >
> > On Thu, 21 Oct 2004, Leandro Martinez wrote:
> >
> > > I'm performing a simulated annealing MD and I'm trying to write the output
> > > to multiple dcd files, one for each temperature. I tried the following script:
> > >
> > > temperature 898.15
> > > for { set TEMP 898.15 } { $TEMP >= 298.15 } { set TEMP [ expr $TEMP - 1.0 ] } {
> > > outputname protein_out$TEMP
> > > rescaleTemp $TEMP
> > > run 50000
> > > }
> > >
> > > The temperature is being scaled just fine, the the first output name
> > > protein_out898.15 is not changed so that the frames from each
> > > temperature are output to a different dcd file.
> > > It seems that namd ignores further outputnames once it finds one. It
> > > is possible to
> > > do what I want?
> > > Thanks in advance,
> > > Leandro.
> > >
> >
> > *****************************************************************
> > **Brian Bennion, Ph.D. **
> > **Computational and Systems Biology Division **
> > **Biology and Biotechnology Research Program **
> > **Lawrence Livermore National Laboratory **
> > **P.O. Box 808, L-448 bennion1_at_llnl.gov **
> > **7000 East Avenue phone: (925) 422-5722 **
> > **Livermore, CA 94550 fax: (925) 424-6605 **
> > *****************************************************************
> >
> >
>

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:37:56 CST