[GE users] SGE 6.2 and qrsh

Reuti reuti at staff.uni-marburg.de
Thu Oct 16 15:13:43 BST 2008


Am 16.10.2008 um 14:04 schrieb Andreas Haupt:

> Hi Ron,
>
> On Thu, 2008-10-16 at 02:52 -0700, Ron Chen wrote:
>> --- On Thu, 10/16/08, Andreas Haupt <andreas.haupt at desy.de> wrote:
>>> thanks for your reply. Yes, we've implemented a
>>> workaround for this for
>>> qrsh over ssh in 6.x. Do you see any possibility to place
>>> some "hooks"
>>> in the new qrsh to get those variables eventually set? We
>>> really need them...
>>
>> Can you describe the hooks that you need? May be we can get some  
>> simple APIs defined for qrsh and ssh (the tight SGE-SSH  
>> integration), so that in the future all environment setups in qrsh  
>> or tight SGE-SSH can be done by calling those APIs.
>
> What I need would be e.g. a script that is called with e.g. the job-id
> as parameter so that this script can prepare the job environment.  
> But I
> don't really know what is so special about the "new" qrsh jobs  
> compared
> to non-interactive ones. I thought they are now "integrated" and not
> something like a hack any more.

Hi Andreas,

when you have an interactive shell on a node, you will find that a  
"ps -e f" (f w/o -) is like before in 6.0/6.1: a complete fresh shell  
is started. Hence it doesn't know anything about any variables set  
before. You could put in your ~/.profile (or ~/.bash_profile):

MYPARENT=`ps -p $$ -o ppid --no-header`
MYSTARTUP=`ps -p $MYPARENT -o command --no-header`
if [ "${MYSTARTUP:0:13}" = "sge_shepherd-" ]; then
    echo "Running inside SGE"
    MYJOBID=${MYSTARTUP:13}
    MYJOBID=${MYJOBID% -bg}
    echo "Job $MYJOBID"

    . /usr/sge/default/spool/$HOSTNAME/active_jobs/$MYJOBID.1/ 
environment
fi

This will check the whether it's running as a kid of a shepherd and  
source the environment.

-- Reuti


> The job prolog script still knows about all those variables. They must
> get lost somewhere when starting the shell.
>
> Cheers,
> Andreas
>
> -- 
> | Andreas Haupt             | E-Mail: andreas.haupt at desy.de
> |  DESY Zeuthen             | WWW:    http://www-zeuthen.desy.de/ 
> ~ahaupt
> |  Platanenallee 6          | Phone:  +49/33762/7-7359
> |  D-15738 Zeuthen          | Fax:    +49/33762/7-7216
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail: users-help at gridengine.sunsource.net
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list