Am 26.08.2013 um 10:53 schrieb Julien Nicoulaud:

> Is the -binding option supposed to work with qrsh ? It works fine when 
> submitting jobs with qsub (the SGE_BINDING env is exported), but nothing with 
> qrsh.

You mean `qrsh` without a command? Then you get a plain new shell without any 
environment variables set. Nevertheless you can use something like this in your 
~/.profile:

# Number of necessary MYPARENT= commands depends on the startup method builtin 
vs. SSH
MYPARENT=`ps -p $$ -o ppid --no-header`
#MYPARENT=`ps -p $MYPARENT -o ppid --no-header`
#MYPARENT=`ps -p $MYPARENT -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"

   set -a
   while read LINE; do export $LINE; done < 
/var/spool/sge/${HOSTNAME%%.*}/active_jobs/$MYJOBID.1/environment
fi

Still the SGE_BINDING won't be set, maybe it's only added on-the-fly by the 
shepherd. But as we know the path to the job's spool directory, we can look 
into:

$SGE_JOB_SPOOL_DIR/pe_hostfile

where it's recorded in case you submit with `qrsh -binding pe linear:2` instead 
of using the "env" binding_instance. (The pe_hostfile is always there, even for 
a serial job. But $PE_HOSTFILE is only set for a parallel one.)

HTH -- Reuti


> (Note: using SGE 6.2u5)
> 
> Regards,
> Julien
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users


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

Reply via email to