gc3libs.backends.sge

Job control on SGE clusters (possibly connecting to the front-end via SSH).

class gc3libs.backends.sge.SgeLrms(name, architecture, max_cores, max_cores_per_job, max_memory_per_core, max_walltime, auth, frontend, transport, default_pe=None, **extra_args)

Job control on SGE clusters (possibly by connecting via SSH to a submit node).

get_resource_status(*args, **kwargs)

Update the status of the resource associated with this LRMS instance in-place. Return updated Resource object.

gc3libs.backends.sge.compute_nr_of_slots(qstat_output)

Compute the number of total, free, and used/reserved slots from the output of SGE’s qstat -F.

Return a dictionary instance, mapping each host name into a dictionary instance, mapping the strings total, available, and unavailable to (respectively) the the total number of slots on the host, the number of free slots on the host, and the number of used+reserved slots on the host.

Cluster-wide totals are associated with key global.

Note: The ‘available slots’ computation carried out by this function is unreliable: there is indeed no notion of a ‘global’ or even ‘per-host’ number of ‘free’ slots in SGE. Slot numbers can be computed per-queue, but a host can belong in different queues at the same time; therefore the number of ‘free’ slots available to a job actually depends on the queue it is submitted to. Since SGE does not force users to submit explicitly to a queue, rather encourages use of a sort of ‘implicit’ routing queue, there is no way to compute the number of free slots, as this entirely depends on how local policies will map a job to the available queues.

gc3libs.backends.sge.count_jobs(qstat_output, whoami)

Parse SGE’s qstat output (as contained in string qstat_output) and return a quadruple (R, Q, r, q) where:

  • R is the total number of running jobs in the SGE cell (from any user);
  • Q is the total number of queued jobs in the SGE cell (from any user);
  • r is the number of running jobs submitted by user whoami;
  • q is the number of queued jobs submitted by user whoami
gc3libs.backends.sge.parse_qhost_f(qhost_output)

Parse SGE’s qhost -F output (as contained in string qhost_output) and return a dict instance, mapping each host name to its attributes.

gc3libs.backends.sge.parse_qstat_f(qstat_output)

Parse SGE’s qstat -F output (as contained in string qstat_output) and return a dict instance, mapping each queue name to its attributes.