# htmd.queues.playqueue module¶

class htmd.queues.playqueue.PlayQueue

Bases: jobqueues.simqueue.SimQueue, protocolinterface.protocolinterface.ProtocolInterface

inprogress()

Subclasses need to implement this method

property memory

Subclasses need to have this property. This property is expected to return a integer in MiB

property ncpu

Subclasses need to have this property

property ngpu

Subclasses need to have this property

notcompleted()

Returns the sum of the number of job directories which do not have the sentinel file for completion.

Returns

total – Total number of directories which have not completed

Return type

int

retrieve()

Subclasses need to implement this method

stop()

Subclasses need to implement this method

submit(dirs)

Subclasses need to implement this method

wait(sentinel=False, sleeptime=5, reporttime=None, reportcallback=None)

Blocks script execution until all queued work completes

Parameters
• sentinel (bool) – If False, it relies on the queueing system reporting to determine the number of running jobs. If True, it relies on the filesystem, in particular on the existence of a sentinel file for job completion.

• sleeptime (float) – The number of seconds to sleep before re-checking for completed jobs.

• reporttime (float) – If set to a number it will report every reporttime seconds the number of non-completed jobs. If this argument is larger than sleepttime, the method will adjust it to the closest multiple of sleepttime. If it is shorter than sleepttime it will override the sleepttime value.

• reportcallback (method) – If not None, the reportcallback method will receive as it’s first argument the number of non-completed jobs.

Examples

>>> self.wait()