jobqueues.simqueue module#
- class jobqueues.simqueue.QueueJobStatus(value)#
Bases:
IntEnum
Job status codes
- CANCELLED = 4#
- COMPLETED = 1#
- FAILED = 2#
- OUT_OF_MEMORY = 6#
- PENDING = 5#
- RUNNING = 0#
- TIMEOUT = 3#
- describe()#
- class jobqueues.simqueue.SimQueue#
Bases:
ABC
,ProtocolInterface
- abstract inprogress()#
Subclasses need to implement this method
- abstract property memory#
Subclasses need to have this property. This property is expected to return a integer in MiB
- abstract property ncpu#
Subclasses need to have this property
- abstract 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:
- abstract retrieve()#
Subclasses need to implement this method
- abstract stop()#
Subclasses need to implement this method
- abstract submit(dirs, commands=None)#
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()