3

After entering a qsub command, the output stream is updated in my home directory as it runs. This causes two problems for me:

1) My /home/brian folder is slow, even writing a few text characters. Utilities with a significant amount of output text are depressingly slow. However, my job files are in /tmp/brian and this location is very fast and local to the compute nodes.

2) If I run myscript.sh in /tmp/brian, I'd like the output stream to update in the same folder as it runs, so I can check the results without having to go search in a different folder than the job.

I've tried this and several permutations of the qsub command:

cd /tmp/brian
set HOME=`pwd`
qsub -j oe -k oe -d `pwd` -w `pwd` -v "HOME=`pwd`,PBS_O_HOME=`pwd`" "./my_script.sh"

I can set the -e and -o options to place the streams in /tmp/brian after the run, but I can't get it to update in /tmp during the run, only my home folder.

If I type the "env" command within my_script.sh, I get these:

HOME=/home/brian
PWD=/tmp/brian
PBS_O_HOME=/tmp/brian
PBS_O_INITDIR=/tmp/brian
PBS_O_WORKDIR=/tmp/brian

The $HOME environment variable is set incorrectly, despite passing it explicitly. Perhaps there's a config file somewhere overriding my settings?

Brian
  • 1,988
  • 1
  • 14
  • 29
  • What about redirecting your script's output directly into a file with a '>'? Like having in `myscript.sh` a line similar to `./a.out > $PBS_O_WORKDIR/output.$PBS_JOBID`? – Gilles Dec 02 '15 at 06:58
  • We've got several users with a number of existing scripts that are used and it would be a shame to have to update every internal command to duplicate the file that's being created somewhere else. It would also still be slow because qsub is still spending time to write to the /home/brian folder. – Brian Dec 03 '15 at 12:43
  • Too late probably but... How do the scripts determine the directory for output? Do they do something like `echo xyz >$HOME/file.txt` or do they do `>/home/brian/file.txt` instead? In the latter case there are little chances to change the behavior. If the output is written to a folder in you home, you may try creating a symlink from /home/brian/folder -> /tmp/brian/folder. – Ott Toomet Jan 15 '16 at 00:18
  • did you try the `#PBS -e="experiment_output_job.%j.%N.out"` -e and -o options did they work for you? – Charlie Parker Nov 17 '20 at 21:23
  • related: https://community.openpbs.org/t/how-to-include-the-job-id-and-other-info-in-the-output-file-for-qsub/2369 `How to include the job id and other info in the output file for qsub?` – Charlie Parker Nov 17 '20 at 21:45
  • What about setting `HOME=${PBS_O_WORKDIR}` as a very first line in your script? – DaBler Nov 23 '20 at 17:56

1 Answers1

0

Use -D to define the root directory to be used for the job

sancelot
  • 1,905
  • 12
  • 31