submit_lpjml | R Documentation |
LPJmL simulations are submitted to SLURM using "config*.json"
files written
by write_config()
. write_config()
returns a
tibble that can be used as an input (see x
). It serves the details to
submit single or multiple (dependent/subsequent) model simulations.
submit_lpjml(
x,
model_path,
sim_path = NULL,
group = "lpjml",
sclass = "short",
ntasks = 256,
wtime = "",
blocking = "",
no_submit = FALSE,
output_path = NULL
)
x |
A tibble with at least one column named |
model_path |
Character string providing the path to LPJmL
(equal to |
sim_path |
Character string defining path where all simulation data are
written, including output, restart and configuration files. If |
group |
Character string defining the user group for which the job is
submitted. Defaults to |
sclass |
Character string defining the job classification. Available
options at PIK: |
ntasks |
Integer defining the number of tasks/threads. More information
at https://www.pik-potsdam.de/en and https://slurm.schedmd.com.
Defaults to |
wtime |
Character string defining the time limit. Setting a lower time
limit than the maximum runtime for |
blocking |
Integer defining the number of cores to be blocked. More information at https://www.pik-potsdam.de/en and https://slurm.schedmd.com. |
no_submit |
Logical. Set to |
output_path |
Argument is deprecated as of version 1.0; use sim_path instead. |
A tibble for x
that has been generated by
write_config()
and can look like the following examples can
supplied:
sim_name |
scen1_spinup |
scen2_transient |
To perform subsequent or rather dependent simulations the optional run
parameter "dependency"
needs to be provided within the initial
tibble supplied as param
to write_config()
.
sim_name | dependency |
scen1_spinup | NA |
scen2_transient | scen1 _spinup |
To use different SLURM settings for each run the optional SLURM options
"sclass"
, "ntask"
, "wtime"
or "blocking"
can also be supplied to the
initial tibble supplied as param
to
write_config()
. These overwrite the (default) SLURM
arguments (sclass
, ntask
, wtime
or blocking
) supplied to
submit_lpjml
.
sim_name | dependency | wtime |
scen1_spinup | NA | "8:00:00" |
scen2_transient | scen1 _spinup | "2:00:00" |
As a shortcut it is also possible to provide the config file
"config_*.json"
as a character string or multiple config files as a
character string vector directly as the x
argument to submit_lpjml
.
With this approach, run parameters or SLURM options cannot be taken into
account.
See x
, extended by columns "type"
, "job_id"
and "status"
.
## Not run:
library(tibble)
model_path <- "./LPJmL_internal"
sim_path <-"./my_runs"
# Basic usage
my_params <- tibble(
sim_name = c("scen1", "scen2"),
random_seed = as.integer(c(42, 404)),
pftpar.1.name = c("first_tree", NA),
param.k_temp = c(NA, 0.03),
new_phenology = c(TRUE, FALSE)
)
config_details <- write_config(my_params, model_path, sim_path)
run_details <- submit_lpjml(
x = config_details,
model_path = model_path,
sim_path = sim_path
)
run_details
# sim_name job_id status
# <chr> <int> <chr>
# 1 scen1 21235215 submitted
# 2 scen2 21235216 submitted
# With run parameter dependency and SLURM option wtime being
# set (also less other parameters than in previous example)
my_params <- tibble(
sim_name = c("scen1", "scen2"),
random_seed = as.integer(c(42, 404)),
dependency = c(NA, "scen1_spinup"),
wtime = c("8:00:00", "4:00:00"),
)
config_details2 <- write_config(my_params2, model_path, sim_path)
run_details2 <- submit_lpjml(config_details2, model_path, sim_path)
run_details2
# sim_name order dependency wtime type job_id status
# <chr> <dbl> <chr> <chr> <chr> <chr> <chr>
# 1 scen1_spinup 1 NA 8:00:00 simulation 22910240 submitted
# 2 scen1_transient 2 scen1_spinup 4:00:00 simulation 22910241 submitted
# Same but by using the pipe operator
library(magrittr)
run_details <- tibble(
sim_name = c("scen1_spinup", "scen1_transient"),
random_seed = as.integer(c(1, 42)),
dependency = c(NA, "scen1_spinup"),
wtime = c("8:00:00", "4:00:00"),
) %>%
write_config(model_path, sim_path) %>%
submit_lpjml(model_path, sim_path)
# Shortcut approach
run_details <- submit_lpjml(
x = "./config_scen1_transient.json",
model_path = model_path,
sim_path = sim_path
)
run_details <- submit_lpjml(
c("./config_scen1_spinup.json", "./config_scen1_transient.json"),
model_path,
sim_path
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.