[torqueusers] Keep option: -k n

Zach Teitler zteitler at tamu.edu
Thu Dec 4 08:52:51 MST 2008


Hello,

I found in this recent thread:

     http://www.clusterresources.com/pipermail/torqueusers/2008-November/008274.html

a discussion of how to manage output and error files. The suggestion  
there was to use -j oe to join them, and a daily script to wipe files  
of size 0.

I have tried using the option -k n and yet I still get these output  
and error files. While I am willing to have a script wipe out size-0  
files, I would rather have my -k n option work. Perhaps I am using  
some other option that overrides the -k n? Here is the situation.

I am submitting jobs like

qsub -t 1-400  /my/home/directory/my/script.sh

(It is a high-throughput computation, i.e., a serial computation that  
takes 2-3 hours; so we queue up a ton of them and let the queue work  
through them overnight.) (You can see why I would like to avoid having  
400 output/error files, even if they are size 0.) The file script.sh  
contains:

#!/bin/bash
### Job name
#PBS -N myjobname
### Queue
#PBS -q night
### Walltime
#PBS -l walltime=5:00:00
### Working directory
#PBS -d /my/home/directory/my/
### Discard output+error
#PBS -k n

sh ./allcpus.sh 1

And the file allcpus.sh contains:
#!/bin/bash
[ do some computations ] [ redirect stdouts and stderrs to separate  
files ]
[ put the stdouts and stderrs together with some headers (date,  
hostname, etc) ]
[ delete the stdout and stderr files ]

And this all works --- I am getting my nicely formatted output/error  
files just the way I wan them --- *except* that I am *also* getting  
output+error files from qsub. They have size 0.

One option is to replace
#PBS -k n
with
#PBS -j oe
#PBS -o /my/home/directory/my/unwantedoutputs/$PBS_JOBID

and then cron up a script to delete everything in there. That would be  
okay. If no one can help me, then that is what will be done.

But I still have the question, why does the -k n option not stick? Is  
one of my other #PBS options overriding it?

Thank you very much!

Zach Teitler



More information about the torqueusers mailing list