[gridengine users] export of environment variables from start_proc_args

Dave Love d.love at liverpool.ac.uk
Wed Jul 4 14:43:08 UTC 2012


SLIM H.A. <h.a.slim at durham.ac.uk> writes:

> 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
>
> and then run a simple test job that prints the
> environment. OMP_NUM_THREADS has not been set.

Eventually that's meant to be dealt with conveniently by
https://arc.liv.ac.uk/trac/SGE/ticket/1381.

Rather than mess with starters, my JSV does:

    if [ $(jsv_is_param pe_name) = true ]; then
	pe=$(jsv_get_param pe_name)
	pemin=$(jsv_get_param pe_min)
	pemax=$(jsv_get_param pe_max)
	late_pe=$pe
	case $pe in

            ...

	    smp)
		# Anyone using a PE range should set this to SLOTS
		# in the script.
		jsv_add_env OMP_NUM_THREADS $pemin
		;;

-- 
Community Grid Engine:  http://arc.liv.ac.uk/SGE/


More information about the users mailing list