shadow
shadow copied to clipboard
End simulation if all hosts finish execution
If all hosts finish running their processes and have no future processes to start, we can stop the simulation (even if it is before the configured stop time).
- at start-up, compute min process start time across all processes
- during heartbeat, check if current time is after min process start time
- if yes, we know that no more processes will start
- check number of running processes
- if 0, set kill time to now
Once the per-process expected_final_state property is merged, it might make sense to do this when all processes that are expected to exit have exited. e.g. for simulations that have servers that run forever, but clients that do a fixed amount of work and then exit.
We'd want to think about how this interacts with shutdown_signal
. e.g. maybe we'd fire all the shutdown_signal
s immediately when we decide we're shutting down early, but then keep simulating until either all processes have actually exited, or we've reached the original static end_time