Hiho,

Am 22.09.2011 um 21:13 schrieb Christoph Müller:

> the idea with the JSV works great - I can event do more than I originally 
> wanted to achieve. Thanks for the suggestion.
> 
>> -----Ursprüngliche Nachricht-----
>> Von: Reuti [mailto:[email protected]]
>> Gesendet: Mittwoch, 21. September 2011 19:00
>> An: Christoph Müller
>> Cc: [email protected]
>> Betreff: Re: AW: Re: [gridengine users] Access complex resources from
>> prolog script
> 
> 
>>> i.e. I have no possibility to copy stuff into the spool dir or to set 
>>> envvars for
>> the job, right?
>> 
>> This is a different game. To set additonal envvars for the job, you can 
>> either
>> add them in a starter_method and exec afterwards the real jobscript, or add
>> some lines to the appropriate file in the exec spool directory where you have
>> active_jobs/$JOB_ID.$SGE_TASK_ID/environment at execution times. When
> 
> Can I do the latter from the queue prolog script, i.e. will the changes to 
> the environment file be applied to the process of the job? As far as I 
> remember, the documentation says that the environment for the prolog and the 
> job are the same, so I am not sure whether it is possible to change it here.

the documentation didn't anticipate any changes to any of the spooling files. 
The best thing is in such cases to ignore the documentation and just try it.

1) Get a prolog:

$ cat prolog.sh
#!/bin/sh
if [ -f "$SGE_JOB_SPOOL_DIR/environment" -a -w "$SGE_JOB_SPOOL_DIR/environment" 
]; then
    echo "FOOBAR=baz" >> $SGE_JOB_SPOOL_DIR/environment
fi

2) Get a queue:

$qconf -sq all.q
...
prolog                sgeadmin@/home/reuti/prolog.sh

3) Get a job:

$ cat test.sh
#!/bin/sh
echo "I got FOOBAR=$FOOBAR"
sleep 60

4) Submit a job:

qsub -q all.q@pc15370 test.sh

5) Get an output:

$ cat test.sh.o3429
I got FOOBAR=baz


-- Reuti
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to