[gridengine users] job naming

Kasper Fischer kasper.fischer at ruhr-uni-bochum.de
Thu Sep 15 12:07:47 UTC 2011


Am 15.09.2011 10:44, schrieb Reuti:
> Hi,
>
> Am 15.09.2011 um 10:00 schrieb Sangmin Park:
>
>   
>> hello,
>> I have a question about naming of job.
>>
>> in the sge batch file, for example,
>>
>> I want to name my job below
>>
>> #!/bin/bash
>>
>> myjob=xxx
>> #$ -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 ***
> #!/bin/sh
> myjob=foobar
> jobscript=/tmp/script.$$.sh
> exec 4>$jobscript
>
> cat >&4 <<-EOF
> #!/bin/sh
> # -N $myjob
> echo "Hello World."
> sleep 60
> EOF
>
> 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
> https://gridengine.org/mailman/listinfo/users
>
>   
Hi everybody,

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.

Cheers,

Kasper


-------------- next part --------------
A non-text attachment was scrubbed...
Name: kasper_fischer.vcf
Type: text/x-vcard
Size: 412 bytes
Desc: not available
URL: <http://gridengine.org/pipermail/users/attachments/20110915/7da0816a/attachment.vcf>


More information about the users mailing list