profit.run.interface
Runner-Worker Interface
The Interface is responsible for the data transfer between the Runner and all Workers. Each Interface consists of two components: a Runner-Interface and a Worker-Interface
Module Contents
Classes
Helper class that provides a standard way to create an ABC using |
|
The Worker-Interface |
- class profit.run.interface.RunnerInterface(size, input_config, output_config, *, logger_parent: logging.Logger = None)[source]
Bases:
profit.util.component.Component
Helper class that provides a standard way to create an ABC using inheritance.
- property config
- property size
- internal_vars = [('DONE',), ('TIME',)]
- class profit.run.interface.WorkerInterface(run_id: int, *, logger_parent: logging.Logger = None)[source]
Bases:
profit.util.component.Component
The Worker-Interface
The Worker-side of the Interface performs two tasks: retrieving input data and transmitting output data.
Only the Worker interacts directly with the Interface, following the scheme: ```
self.interface.retrieve() -> self.interface.input timestamp = time.time() self.interface.output = simulate() self.interface.time = int(time.time() - timestamp) self.interface.transmit()
- property config
- abstract retrieve()[source]
retrieve the input
connect to the Runner-Interface
retrieve the input data and store it in .input