[gridengine users] job naming
kasper.fischer at ruhr-uni-bochum.de
Thu Sep 15 12:07:47 UTC 2011
Am 15.09.2011 10:44, schrieb Reuti:
> Am 15.09.2011 um 10:00 schrieb Sangmin Park:
>> I have a question about naming of job.
>> in the sge batch file, for example,
>> I want to name my job below
>> #$ -N $myjob
>> #$ -q serial.q
> the substitution of environment variables is done by the shell, not SGE. And for the shell it's a plain comment. There are some exceptions for -e/-o/-i to have some "pseudo" variables replaced by the actual value of the SGE job like $job_id, but not arbitrary ones.
> If you want to set some variables and honor them during the creation of the job, you have to either include it on the command line, where the shell will replace it again:
> $ myjob=foobar
> $ qsub -N $myjob script.sh
> or generate a temporary document where the shell has a chance to replace it again:
> *** Top of data ***
> exec 4>$jobscript
> cat >&4 <<-EOF
> # -N $myjob
> echo "Hello World."
> sleep 60
> exec 4>&-
> qsub $jobscript
> rm $jobscript
> *** End of data ***
> The replacement will be done already by the shell in the temporary script file.
> -- Reuti
> users mailing list
> users at gridengine.org
I am using qalter at the beginning of the job script to change the name
of the job:
# Change name of job.
qalter $JOB_ID -N "$myjob"
Maybe this can be used in your case as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 412 bytes
Desc: not available
More information about the users