Package Biskit :: Package PVM :: Module Status :: Class Status
[hide private]
[frames] | no frames]

Class Status

source code

Keep track of objects that are processed by JobMaster.

Thread-savety:

Instance Methods [hide private]
  __init__(self, objects, redistribute=1)
  __activate(self, item)
not thread-save, synchronize on self.lock!
  deactivate(self, item)
mark item as processed.
[object] not_done(self)
Not yet finished items.
[object] not_started(self)
Returns list of not yet started items
[object] activ(self)
Returns list of currently active (started) items
1|0 done(self)
Returns 1 if all items have been processed and finished
([object], int) OR None next_chunk(self, nmax)
Get next chunk of at most nmax items that need to be processed.
  __str__(self)
  __repr__(self)

Method Details [hide private]

__init__(self, objects, redistribute=1)
(Constructor)

source code 
Parameters:
  • objects (any) - e.g. job IDs
  • redistribute (1|0) - send out started but not yet finished jobs to idle slaves (to not wait for slow slaves) (default: 1)

__activate(self, item)

source code 

not thread-save, synchronize on self.lock!

deactivate(self, item)

source code 

mark item as processed. not thread-save, synchronize on self.lock!

not_done(self)

source code 

Not yet finished items. The not-yet-started come first, then come the active items ordered by how often they have already been distributed.
Returns: [object]
list of not yet finished items (started or not)

not_started(self)

source code 
Returns: [object]
list of not yet started items

activ(self)

source code 
Returns: [object]
list of currently active (started) items

done(self)

source code 
Returns: 1|0
1 if all items have been processed and finished

next_chunk(self, nmax)

source code 

Get next chunk of at most nmax items that need to be processed. Thread-save.
Parameters:
  • nmax (int) - size of chunk
Returns: ([object], int) OR None
chunk of items to be processed, number of unproc OR None if all items have been processed

__str__(self)
(Informal representation operator)

source code 

__repr__(self)
(Representation operator)

source code