netsim_hpc | R Documentation |
Simulates stochastic network epidemic models for infectious disease dynamics in parallel.
netsim_hpc(
x,
param,
init,
control,
cp.save.int = NULL,
save.min = TRUE,
save.max = FALSE,
compress = TRUE,
verbose = TRUE
)
x |
Character vector containing the file path of an Rdata
file where an object of class |
param |
Model parameters, as an object of class |
init |
Initial conditions, as an object of class |
control |
Control settings, as an object of class |
cp.save.int |
Check-pointing save interval, which is used to specify how
often intermediate data should be saved out to disk. When a job has been
check-pointed, it will resume automatically at the last saved time
step stored on disk. If set to |
save.min |
Argument passed to |
save.max |
Argument passed to |
compress |
Matches the |
verbose |
If |
This function provides a systematic method to running stochastic network models in parallel on high-performance computing systems.
The main purpose of using netsim_hpc
is for a standardized checkpointing
method. Checkpointing is defined as incrementally saving simulation data for
the purpose of reloading it if a simulation job is canceled and restarted. If
checkpointing is not needed, users are advised to run their models directly
with the EpiModel::netsim
function.
This function performs the following tasks:
Check for the existence of checkpointed data, using the
check_cp
function. If CP data are available, a
checkpointed model will be run, else a new model will be run.
Create a checkpoint directory if one does not exist at
"data/simsimno". This and the related checkpointing functions will
not occur if cp.save.int
is set to NULL
.
Sets the checkpoint save interval at the number of time steps specified
in cp.save.int
.
Resets the initialize module function to initialize_cp
if in checkpoint state.
Run the simulation, either new or checkpointed, with a call to
EpiModel::netsim
.
Save the completed simulation data, using the functionality of
savesim
.
Remove the checkpointed data and file directory created in step 1, if it exists.
The x
argument must specify a file name in a character string,
rather than a netest
or netsim
class object directly. This is
mainly for efficiency purposes in running the models in parallel.
If save.min
and save.max
are both set to FALSE
, then the
function will return rather than save the output EpiModel object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.