grale.inverters
This module provides different ‘inverters’ that can be used to execute the genetic algorithm for lens inversion. Depending on the platform you’re working on, you may be able to use MPI to distribute the needed calculations (typically speeding up the process) for example.
In the inversion
module, you can specify the inverter to use as
a (case insensitive) string, or as an instance of the available inverter
classes. Available are:
“Threads”/”Threads:numthreads” or an instance of
ThreadsInverter
“MPI”/”MPI:numprocesses”/”MPI:numprocesses:numthreadsperprocess:extraoptions” or an instance of
MPIProcessInverter
Defaults
- grale.inverters.getDefaultInverter()
Returns the default inverter to use when running the genetic algorithm for the lens inversion. Can be changed using
setDefaultInverter()
.
- grale.inverters.setDefaultInverter(x)
Sets the default inverter to use when running the genetic algorithm.
InverterException
- exception grale.inverters.InverterException
An exception that’s generated if something goes wrong in this module.
Inverters
- class grale.inverters.ThreadsInverter(numThreads=0, feedbackObject=None, parametric=False)
- __init__(numThreads=0, feedbackObject=None, parametric=False)
- class grale.inverters.SingleProcessGdbInverter(feedbackObject=None, gdbExe='gdb', parametric=False)
If this inverter is used, a single process, single core method is used which is started using the debugger GDB. To be able to interact with GDB, it is started in an xterm process. This is meant to make debugging this multi-process architecure somewhat easier.
- class grale.inverters.MPIProcessInverter(numProcesses=None, numThreadsPerProcess=1, extraArgs=[], incomingConnectionTimeout=10, feedbackObject=None, parametric=False)
- __init__(numProcesses=None, numThreadsPerProcess=1, extraArgs=[], incomingConnectionTimeout=10, feedbackObject=None, parametric=False)