Eidolon
Public Member Functions | Public Attributes | Private Member Functions | List of all members
AlgorithmProcess Class Reference

Inherits Process.

Collaboration diagram for AlgorithmProcess:
Collaboration graph

Public Member Functions

def __init__ (self, index, total, syncEvent, syncEvent2, syncCounter, syncLock, sharer, progress, stopEvent, parentPID)
 
def __repr__ (self)
 
def shareObject (self, name, obj, doExchange=True)
 
def getObjects (self, name)
 
def sync (self)
 
def nrange (self)
 
def prange (self)
 
def setProgress (self, val, forceUpdate=False)
 
def run (self)
 

Public Attributes

 index
 
 total
 
 syncEvent
 
 syncEvent2
 
 syncCounter
 
 syncLock
 
 sharer
 
 progress
 
 stopEvent
 
 parentPID
 
 startval
 
 endval
 
 maxval
 
 recv
 
 rrecv
 
 progressTime
 

Private Member Functions

def _continueRunning (self)
 

Detailed Description

This object represents a separate process as well as the mechanisms for sharing objects between them and
synchronization. It is used by 'concurrentAlgorithm' and 'concurrent', and should not be instantiated separately.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  index,
  total,
  syncEvent,
  syncEvent2,
  syncCounter,
  syncLock,
  sharer,
  progress,
  stopEvent,
  parentPID 
)

Member Function Documentation

◆ __repr__()

def __repr__ (   self)

◆ _continueRunning()

def _continueRunning (   self)
private
Returns True so long as the `stopEvent' is not set and the parent process has not exited.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObjects()

def getObjects (   self,
  name 
)
Returns a dict mapping process IDs to the shared objects of the given name, excluding the current process' object.
This will return {} if no shared objects of the given name isn't present or if the sharing object isn't present.
Here is the caller graph for this function:

◆ nrange()

def nrange (   self)
Returns an iterator from `self.startval' to `self.endval'-1.
Here is the caller graph for this function:

◆ prange()

def prange (   self)
Yield each number from self.startval to self.endval-1 and update progress by calling setProgress().
Here is the call graph for this function:

◆ run()

def run (   self)
Executes operations by unpacking instruction tuples from the receiving pipe and calling the appropriate
function and then returning the results (or an exception) back through the sending pipe.
Here is the call graph for this function:

◆ setProgress()

def setProgress (   self,
  val,
  forceUpdate = False 
)
Sets the progress indicator value of the associated Task object or the shared value array, only updates if
the previous update was more than 200ms in the past.
Here is the caller graph for this function:

◆ shareObject()

def shareObject (   self,
  name,
  obj,
  doExchange = True 
)
Share the value 'obj' under the name 'name', returning the objects of the same name from other processes
if 'doExchange' is true. The assumption is that all procs share objects of the same name at once and so this
method will call sync(). It will not return the object for the current process.
Here is the call graph for this function:

◆ sync()

def sync (   self)
Causes the calling process to block until all others have also called this method. This synchronizes between multiple
processes by incrementing the shared counter value `syncCounter'. Each process calls 'sync()' and is forced to wait
until all other processes have done the same. This essentially functions as a concurrent checkpointing mechanism.
If one process throws an exception then `syncCounter' is set to a negative value to indicate this, causing any proc
which calls sync() in this case to throw an exception as well. If self.syncEvent is None then this method exits
without doing anything, allowing it to be safely called in single-process operation. All processes MUST call
this method at the same point in code otherwise deadlock will result.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ endval

endval

◆ index

index

◆ maxval

maxval

◆ parentPID

parentPID

◆ progress

progress

◆ progressTime

progressTime

◆ recv

recv

◆ rrecv

rrecv

◆ sharer

sharer

◆ startval

startval

◆ stopEvent

stopEvent

◆ syncCounter

syncCounter

◆ syncEvent

syncEvent

◆ syncEvent2

syncEvent2

◆ syncLock

syncLock

◆ total

total

The documentation for this class was generated from the following file: