Question

After reading the qstat and sge_qstat manuals, I still don't know what method I could use that will allow me to programmatically parse the name of the default queue in my SGE 6.1 system: this is to say, the name of the queue where jobs would be submitted if I do a qsub command.

I have an empty file in:

~/.sge_qstat    # actually the file doesn't exist

And this file only contains a '-u *':

$SGE_ROOT/$SGE_CELL/common/sge_qstat

I would like to have a method to programmatically be able to get the name of the queue where jobs would be submitted by default. Something equivalent to the name that follows the grep in this LSF command:

lsid 2>/dev/null | grep 'My cluster name is'

Is there something equivalent for SGE?

Was it helpful?

Solution

Assuming by "default" you mean the queue a job will fall to if you do not specify one with the -q switch to qsub, this is difficult.

Out of the box, SGE shouldn't have a hard default queue at all, but the default scheduler will pick a queue for a given submission(if you don't specify one) based on which queue has the lowest load average - this is defined by the scheduler attribute queue_sort_method(see sched_conf(5)). In this case, you'd be guessing at best.

However, if you can guarantee that a real default queue will be set in either the submitter's local .sge_request file or in the global $sge_root/$cluster/common/sge_request file(which defines default switches for qsub, see sge_request(5)), you can certainly parse -q switches out of those.

OTHER TIPS

Another way to work out the default queue is to send a dummy request.

qrsh -w p -verbose -verify | grep hard_queue_list

Note that the value could be a comma separated list. i.e hard_queue_list: all.q,some.q

The first is the system default, the second is the user default.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top