cmmid / covid-uk

Scenario analyses for COVID-19 outbreak in the United Kingdom
GNU General Public License v3.0
64 stars 27 forks source link

Saving the dynamics file in the middle of experiments #11

Open innovative-simulator opened 4 years ago

innovative-simulator commented 4 years ago

At present, UK.R does not save its results (especially the 1-dynamics.qs file) until the end of the 200 repetitions (assuming you ran Rscript UK.R 1 200). (See lines 513, 514.) This may be hours or days after you started it.

It would be useful to have it periodically save its results before then, not least because if the computer fails mid-experiment, at present one loses all the simulation work up to that point. (I'm running it in Debian 10 in a virtual machine, on a Win10 laptop, and this has happened a lot! Laptop overheating? VMWare fault? Who knows! 67 repetitions is my record, so far.)

Suggest additions to UK.R like this:

Line 430: cm_save(dynamics, paste0(covid_uk_path, analysis, "-dynamics", ifelse(option.single > 0, option.single, ""), ".qs")); # Periodically save A-dynamics.qs file, in case UK.R doesn't complete all its repetitions. Line 504: cm_save(dynamics, paste0(covid_uk_path, analysis, "-dynamics", ifelse(option.single > 0, option.single, ""), ".qs")); # Periodically save A-dynamics.qs file, in case UK.R doesn't complete all its repetitions.