Using SGE_LOAD_AVG Environment Variable for Changing qstat -f Output (2012-07-24)

Normally you get with qstat -f (besides other values) the load_avg value which is the medium (5 min. avg. OS run-queue length in Linux) load of a machine. This is the same value which you will get with the „uptime“ command on the specific host. Sometimes it is useful to change the load output of qstat -f (and qstat -f -xml) to a value different to load_avg, like when your load formula in the Grid Engine scheduler is different. The default value can be changed in all Grid Engine versions with the undocumented environment variable SGE_LOAD_AVG.

When you want to change the load value column of qstat -f to lets say the normalized load (normalized through the amount of available processors) derived from the 5 min. load interval you can simply export SGE_LOAD_AVG=np_load_avg before doing a qstat -f.

Using this value is much more „natural“ in Grid Engine since it is used in other outputs and especially as default load formula in the scheduler as well.

Update: With Univa Grid Engine (UGE) 8.1 qhost and qstat are showing the normalized (np_load_avg) per default. This is less confusing since Grid Engine internally usually uses the load / #amount of processing units to calculate the host list order. This is the order the jobs are going to be placed (least loaded host in terms of np_load_avg (and not load_avg) first). For SGE 6.2u5 backward compatibility you can set SGE_LOAD_AVG to load_avg for qstat and SGE_REAL_LOAD=1 for the old qhost behavior.