Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Allow for saving and replaying baseline simulation #538

Open
alexdewar opened this issue Sep 27, 2024 · 0 comments
Open

[ENHANCEMENT] Allow for saving and replaying baseline simulation #538

alexdewar opened this issue Sep 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@alexdewar
Copy link
Contributor

It would be useful if users could run an intervention simulation without also having to run the baseline simulation at the same time. Currently, there is no way to do this; if you want to run multiple intervention simulations with the same baseline simulation (i.e. the same random seed), you end up re-running the baseline simulation in parallel each time. This is a waste of memory and CPU resources. In addition, quite a lot of complexity is required to pass messages back and forth between the baseline and intervention simulations, which could (eventually) be removed, simplifying the code and improving performance by removing locking contention.

For now, let's just start by allowing users to save and replay the baseline simulation. You can run a baseline simulation by itself, so we just need to modify this mode of operation to allow for saving this data somewhere. Then we need to change the "intervention mode" so that it can read the adjustment messages from disk rather than a parallel simulation.

We should make all this optional for now. Once the researchers have confirmed that this workflow works for them, we can consider ripping out all the messaging code.

I should add that this approach does have one potential drawback: in the case where a user wants to run only one intervention simulation they will still need to run the baseline simulation separately beforehand which might be slower than running them in parallel, depending on available CPU resources etc. Without testing, we have no way to know whether performance will be worse or better though, so we will need to do this in the longer term, so we can assess what our options are. In the absolute worst case, we could just pass data between simulations via a file/named pipe and still do our big refactor.

@alexdewar alexdewar added the enhancement New feature or request label Sep 27, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Health-GPS Sep 27, 2024
@alexdewar alexdewar moved this from 📋 Backlog to 🔖 Ready in Health-GPS Sep 27, 2024
@alexdewar alexdewar self-assigned this Sep 27, 2024
@alexdewar alexdewar removed their assignment Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant