Hi, Am 21.09.2011 um 18:27 schrieb Christoph Müller:
> That sounds like a possible solution. I assume that the JSV runs in the > context of the scheduler, the JSV runs at submission times, and is just used to automate the adding of the context variables. If you have some kind of `qsub` wrapper anyway, you can even add it either on the command line or using $# in the jobscript. > 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 you do this in a prolog, the prolog needs to run as SGE admin user to have write access, i.e. it must be defined like: prolog sgeadmin@/usr/sge/cluster/context.sh in the Queue or SGE's configuration. $SGE_TASK_ID will be set to "undefined" and needs to be mangles to 1, in case it's not an array job. -- Reuti > Cheers, > Christoph > > Gesendet von meinem Windows Phone > > ----- Ursprüngliche Nachricht ----- > Von: Reuti > Gesendet: Mittwoch, 21. September 2011 16:32 > An: Christoph Müller > Cc: [email protected] > Betreff: Re: [gridengine users] Access complex resources from prolog script > > > Hi, > > Am 21.09.2011 um 15:54 schrieb Christoph Müller: > >> I have several custom complex values defined, which the user can request. I >> want to know now in the prolog script of a queue which of the resources have >> been requested for the current job. However, there do not seem to be any >> environment variables or data in the spool dir to achieve this. Is there any >> way to achieve this, and if so how? > > this is true. A workaround could be: > > - set up a JSV (job submission verifier), which add appropriate entries in > the context of the job (i.e. translate/copy them). This is just meta > information (like a comment) and can also be done beforehand by: > > qsub -ac INTEGRAL=FINE,PRECISION=TOTAL test.sh > > - in the prolog you can scan for the line in the qstat output: > > #!/bin/sh > . /usr/sge/default/common/settings.sh > qstat -j $JOB_ID | sed -n -e "/^context/s/^context: *//p" | tr "," "\n" > > This will give you an output of: > > INTEGRAL=FINE > PRECISION=TOTAL > > which you can write to a file, pipe to another command... > > Maybe it solves your request. > > -- Reuti > _______________________________________________ users mailing list [email protected] https://gridengine.org/mailman/listinfo/users
