[gridengine users] export of environment variables from start_proc_args
SLIM H.A.
h.a.slim at durham.ac.uk
Thu Jul 5 14:26:53 UTC 2012
I want to redefine the env in the starter_method to capture any erroneous setting in the job script. But I realize that it works the other way round? Anything set in the starter_method can be redefined in the job script?
> -----Original Message-----
> From: Reuti [mailto:reuti at staff.uni-marburg.de]
> Sent: 05 July 2012 15:10
> To: SLIM H.A.
> Cc: users at gridengine.org
> Subject: Re: [gridengine users] export of environment variables from
> start_proc_args
>
> Am 05.07.2012 um 16:06 schrieb SLIM H.A.:
>
> > Hmmm. If OMP_NUM_THREADS is not set in the job script then the
> startup_method will be effective and the executed program has the
> variable set to $NSLOTS.
> > However if the job script does set OMP_NUM_THREADS its value is not
> overwritten.
>
> Did you define it as readonly in your starter_method?
>
> Normally you can redefine them in the jobscript without any problems.
>
> -- Reuti
>
>
> > Any ideas why this is?
> >
> > Thanks
> >
> > Henk
> >
> >> -----Original Message-----
> >> From: SLIM H.A.
> >> Sent: 05 July 2012 14:48
> >> To: 'Reuti'
> >> Cc: users at gridengine.org
> >> Subject: RE: [gridengine users] export of environment variables from
> >> start_proc_args
> >>
> >>> $1 will be the jobscript to be started
> >>> $2 first command_argument (if any) you supplied at the end of `qsub`,
> i.e.
> >> $1
> >>> inside the script
> >>> $3 second command_argument (if any) you supplied at the end of
> `qsub`,
> >>> i.e. $2 inside the script
> >>
> >> I suspected this but when I ran a trial job before, it failed and I got this
> >> error message:
> >>
> >> Unknown colorls variable 'rs'
> >>
> >> Googling this gives various causes of this error and suggest a connection
> >> with using tcsh (the job script is C shell) . Including a line
> >>
> >> unset LS_COLORS
> >>
> >> before
> >>
> >> exec "$@"
> >>
> >> fixes this.
> >>
> >> Regards
> >>
> >> Henk
> >>
> >>
> >>> -----Original Message-----
> >>> From: Reuti [mailto:reuti at staff.uni-marburg.de]
> >>> Sent: 05 July 2012 13:07
> >>> To: SLIM H.A.
> >>> Cc: users at gridengine.org
> >>> Subject: Re: [gridengine users] export of environment variables from
> >>> start_proc_args
> >>>
> >>> Am 05.07.2012 um 13:53 schrieb SLIM H.A.:
> >>>
> >>>> Thanks Reuti,
> >>>>
> >>>>> You could provide a startup_method for the queue(s) in question:
> >>>>>
> >>>>> #!/bin/sh
> >>>>> export OMP_NUM_THREADS=$NSLOTS
> >>>>> exec "$@"
> >>>>
> >>>> "@$" would expand to the startup_method arguments but these are
> >>> absent? The documentation about the starter_method is not clear to
> me,
> >>> are the "job arguments" the command_args to command in qsub?
> >>>
> >>> $1 will be the jobscript to be started
> >>> $2 first command_argument (if any) you supplied at the end of `qsub`,
> i.e.
> >> $1
> >>> inside the script
> >>> $3 second command_argument (if any) you supplied at the end of
> `qsub`,
> >>> i.e. $2 inside the script
> >>> ...
> >>>
> >>> -- Reuti
> >>>
> >>>
> >>>> Thanks
> >>>>
> >>>> Henk
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Reuti [mailto:reuti at staff.uni-marburg.de]
> >>>>> Sent: 04 July 2012 15:37
> >>>>> To: SLIM H.A.
> >>>>> Cc: users at gridengine.org
> >>>>> Subject: Re: [gridengine users] export of environment variables from
> >>>>> start_proc_args
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> Am 04.07.2012 um 14:57 schrieb SLIM H.A.:
> >>>>>
> >>>>>> I want to constrain the number of OpenMP threads in a job from
> >> within
> >>>>> GridEngine. The user should set this to $NSLOTS in the job script but
> can
> >>> this
> >>>>> be enforced by including this in a PE start script?
> >>>>>>
> >>>>>> I set a start_proc_args script "startopenmp.sh" with argument
> >> $pe_slots
> >>> in
> >>>>> an openmp PE and the script contains the line
> >>>>>>
> >>>>>> export OMP_NUM_THREADS=$1
> >>>>>
> >>>>> The start_proc_args is an independent script started before the actual
> >>> job.
> >>>>> Nothing is inherited to the executed jobscript.
> >>>>>
> >>>>> You could provide a startup_method for the queue(s) in question:
> >>>>>
> >>>>> #!/bin/sh
> >>>>> export OMP_NUM_THREADS=$NSLOTS
> >>>>> exec "$@"
> >>>>>
> >>>>> Thsi will also work without requesting a PE, as $NSLOTS will then
> >>> evaluate
> >>>>> to 1.
> >>>>>
> >>>>> The problem with -v is, that it's evaluated at submission time, but not
> >>>>> during execution.
> >>>>>
> >>>>> -- Reuti
> >>>>>
> >>>>>
> >>>>>> and then run a simple test job that prints the environment.
> >>>>> OMP_NUM_THREADS has not been set. Is there a way to achieve this
> >>>>> otherwise?
> >>>>>>
> >>>>>> Thanks
> >>>>>>
> >>>>>> Henk
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> users mailing list
> >>>>>> users at gridengine.org
> >>>>>> https://gridengine.org/mailman/listinfo/users
> >>>>
> >>>>
> >
> >
More information about the users
mailing list