Closed wookietreiber closed 4 years ago
Thanks for testing this! Indeed this whole thread creation section might be not necessary anymore, as it was only included as a workaround for a python2/3 compability issue. Your proposal sounds good, I would highly appreciate your pull-request on this.
@thouska Great, please review #254.
We realized that for very short (few seconds) simulations, there is considerable overhead:
There's a lot going on in thread creation (clone) and coordination (futex) that is not necessary, especially not for a single-core run. This is due to
def simulate
inspotpy/algorithms/_algorithm.py
.My proposal is to only spawn the thread if
self.sim_timeout
is set to avoid the above-mentioned overhead. I'll prepare a pull request.