Bases: exceptions.Exception
Exception raised when an invalid options for the specified runner is passed.
Bases: threading.Thread, misctools.hook.Hookable
Runner of a PENELOPE simulation. The method run build the input file(s) and the material file(s) based on the options. It then starts the simulation. The results are saved in the current folder or in the specified results directory. The class is derived from threading.Thread so it can be run in a thread.
Parameters: |
|
---|
Creates all simulation files with the defined options, without starting the simulation. The simulation files are saved in the results directory.
Filepath to the IN file. Raises a ValueError if the work path is not defined.
Program to create the material file(s).
Options of the simulation. The name of the thread is automatically set as the title of the simulation in the options.
Program to execute the simulation.
Results directory. The directory must a valid path.
Resumes a simulation that was stopped. The simulation files must be placed in the specified results directory.
Executes the simulation. This is an internal method. The method start or resume should be called to start or resume a simulation.
Starts the simulation with the defined options.
The input file, the material file(s) and the geometry file are automatically created in the work directory. The method run is called and the simulation is started in a thread. When the simulation is completed, the results are copied into the results directory.
Stops the execution of a simulation.
Sets the work path to be the same as the base results path.
Directory where the files are saved during the simulation. The directory must a valid path. If the attribute is deleted, the files are saved in a temporary folder during the simulation.
Bases: Queue.Queue
Queue to run several simulations in different threads. The simulations must all have the same type of options and be run with the same program.
To put a simulation in the queue, the method put must be called with one tuple as argument. The tuple contains two items:
- the options of the simulation (_Options)
- the results directory for the simulation
The method join can be called to wait for all the simulations to finish.
Parameters: |
|
---|
Examples:
>>> queue = RunnerQueue(2, program, material_program)
>>> queue.put((options1, resultsdir1))
>>> queue.put((options1, resultsdir1))
>>> queue.join()
Stops all the simulations in the queue.