The Problem with the SingleShot API function and PlayPause with a single iteration is that a Method instance has to be created. When e.g. sampling with single iterations (or only a few), the resulting overhead is significant!
How could this be avoided?
The main problem with keeping around an instance of Method while it is potentially unused is that this may use a significant amount of memory. Depending on system size, this may be unacceptable.
Currently, my best idea is:
add an API function, e.g. Simulation_Start_Single(state *, const char * method, const char * solver, int, int)
this would create a Method, which would be stored in the State and block the corresponding image/chain from other simulations
then calling Simulation_SingleShot would not have any unusual overhead
this could also be used to avoid all the output currently generated from repeated single iterations, see also #417
add an API function, e.g. Simulation_End_Single, which would delete the Method and free the blockade
The Problem with the
SingleShot
API function andPlayPause
with a single iteration is that aMethod
instance has to be created. When e.g. sampling with single iterations (or only a few), the resulting overhead is significant! How could this be avoided?The main problem with keeping around an instance of
Method
while it is potentially unused is that this may use a significant amount of memory. Depending on system size, this may be unacceptable.Currently, my best idea is:
Simulation_Start_Single(state *, const char * method, const char * solver, int, int)
Method
, which would be stored in theState
and block the corresponding image/chain from other simulationsSimulation_SingleShot
would not have any unusual overheadSimulation_End_Single
, which would delete theMethod
and free the blockade