PBSPro qsub output error file directed to path with jobid in name
Asked Answered
C

2

2

I'm using PBSPro and am trying to use qsub command line to submit a job but can't seem to get the output and error files to be named how I want them. Currently using:

  qsub -N ${subjobname_short} \
       -o ${path}.o{$PBS_JOBID} -e ${path}.e${PBS_JOBID}
       ... submission_script.sc

Where $path=fulljobname      (i.e. more than 15 characters)

I'm aware that $PBS_JOBID won't be set until after the job is submitted...

Any ideas?

Thanks

Charente answered 21/10, 2014 at 5:9 Comment(0)
A
3

The solution I came up with was following the qsub command with a qalter command like so:

jobid=$(qsub -N ${subjobname_short} submission_script.sc)
qalter -o ${path}.o{$jobid} -e ${path}.e${jobid} ${jobid}

This way, PBS Pro does not need to resolve the variables, as it failed to do so in our install (this may be a configuration issue)

Allyson answered 28/1, 2015 at 7:21 Comment(0)
G
1

If you want the ${PBS_JOBID} to be resolved by PBSPro, you need to escape it on the command line:

qsub -o \$PBS_JOBID 

Otherwise, bash will attempt to resolve $PBS_JOBID before it gets to the qsub command. I don't know if $subjobname_short and $path are actual environment variables or ones you want pbs to resolve, but if you want pbs to resolve them you'll also need to escape these ones or place it inside the job script.

NOTE: I also notice that your -o argument says {$PBS_JOBID} and I'm pretty sure you want ${PBS_JOBID}. I don't know if that's a typo in the question or what you tried to pass to qsub.

Gearbox answered 22/10, 2014 at 17:39 Comment(2)
Thank you so much ... going to try it now! Hopefully it works! :)Charente
I can't seem to get this to work! :( ... When I submit with the command qsub -o /path/jobname.o\$PBS_JOBID the script runs fine on cluster until it's exiting and error/output files are being written... I end up getting an email saying that: "Unable to copy file ....7989270.OU to hostname1 >>> error from copy /bin/cp: cannot create regular file `/path/jobname.o/${PBS_JOBID}': No such file or directory >>> end error output Output retained on that host in: /jobfs/local/pbs/undelivered/7989270.OU" Any ideas dbeer?Charente

© 2022 - 2024 — McMap. All rights reserved.