olala
olala

Reputation: 4446

PBS: how to print history of jobs run and how to use script name as PBS_JOBNAME?

New to qsub and HPCs. I got three small questions:

I want to have a better way of knowing which job script corresponds to the which stderr and stdout. I understand I can manually type in the job name and their stderr and stdout like this (well, right now I'm using $PBS_JOBNAME.$PBS_JOBID for stderr and stdout) but 6 months from now, I'd have a hard time knowing from which job script stderr and stdout $PBS_JOBNAME.$PBS_JOBID are generated. I'm thinking of using the job script name as the prefix for stderr and stdout so I can associate them easily but besides manually edit the script, is there some variable I can set to make this automatic?

  2 #PBS -N testjob
  3 #PBS -d /home/mydir/projects/test
  4 #PBS -q home
  5 #PBS -V
  6 #PBS -l nodes=1:ppn=1
  7 #PBS -l walltime=1:00:00
  8 #PBS -M [email protected]
  9 #PBS -o $PBS_JOBNAME.$PBS_JOBID.out
 10 #PBS -e $PBS_JOBNAME.$PBS_JOBID.err

From the above script, I'm specifying running dir with /home/mydir/projects/test, I've tried #PBS -d $PWD but it didn't work. Is there a way also to automatically set the running dir as my current dir where I invoked the PBS job?

Lastly, I'd like to keep a record of jobs I've run. I can see the current running/queueing jobs with qstat, but after a few minutes the jobs is complete, qstat doesn't give any output. Is there some command that can print all the job history? Thanks!

Upvotes: 1

Views: 11514

Answers (1)

clusterdude
clusterdude

Reputation: 623

You can see much of the history of completed jobs by running:

tracejob <job ID>

Run it without an argument to see the usage message. If you get permission errors on portions of the output, you may use the available options to suppress those parts. Use -z to get max info.

It will only go back a day by default, so you'll have to include "-n <days>" to see further back.

Upvotes: 3

Related Questions