From 051333848090060e474058a367b6a9aa6b931bf6 Mon Sep 17 00:00:00 2001 From: Dharmesh Makvana <212810347+n3orma@users.noreply.github.com> Date: Fri, 2 Oct 2026 19:44:20 +0530 Subject: [PATCH 1/2] document how to reload updated templates Clarify that changes to the configuration file or a scheduler template can be applied by reloading the existing registry with loadRegistry(). This avoids the need to remove and recreate the registry. --- vignettes/batchtools.Rmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vignettes/batchtools.Rmd b/vignettes/batchtools.Rmd index 2a5bfc96..4248df7e 100644 --- a/vignettes/batchtools.Rmd +++ b/vignettes/batchtools.Rmd @@ -86,6 +86,9 @@ In order to set the cluster function implementation, you would generate a file w cluster.functions = makeClusterFunctionsInteractive() ``` The configuration file is parsed whenever you create or load a `?Registry`. +After editing the configuration file or a scheduler template referenced by it, +reload the registry with `loadRegistry()` to apply the changes without removing +and recreating the registry. It is sourced inside of your registry which has the advantage that you can (a) access all of the parameters which are passed to makeRegistry() and (b) you can also directly change them. Lets say you always want your working directory in your home directory and you always want to load the `checkmate` package on the nodes, you can just append these lines: ```{r, eval = FALSE} From 3c44fafe9f0b93047df0f70738f62ccb1962a2df Mon Sep 17 00:00:00 2001 From: Dharmesh Makvana <212810347+n3orma@users.noreply.github.com> Date: Wed, 7 Oct 2026 10:28:37 +0530 Subject: [PATCH 2/2] docs: document reloading registry configuration --- R/loadRegistry.R | 9 +++++++++ vignettes/batchtools.Rmd | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/R/loadRegistry.R b/R/loadRegistry.R index f970ba51..e051c2d5 100644 --- a/R/loadRegistry.R +++ b/R/loadRegistry.R @@ -7,6 +7,15 @@ #' loaded into the global environment when the registry is loaded. Existing #' objects with the same names may be overwritten. #' +#' The configuration file specified by \code{conf.file} is sourced each time +#' the registry is loaded. This also reloads the cluster functions configured +#' there, so changes to the configuration or to a referenced scheduler template +#' can be applied by calling \code{loadRegistry()} again instead of recreating +#' the registry. +#' +#' Only jobs submitted with \code{\link{submitJobs}} after reloading the registry +#' use the updated configuration. Jobs that have already been submitted or +#' queued are not affected. #' Multiple R sessions accessing the same registry simultaneously can lead to database inconsistencies. #' This is especially dangerous if the same \code{file.dir} is accessed from multiple machines, e.g. via a mount. #' diff --git a/vignettes/batchtools.Rmd b/vignettes/batchtools.Rmd index 4248df7e..2a5bfc96 100644 --- a/vignettes/batchtools.Rmd +++ b/vignettes/batchtools.Rmd @@ -86,9 +86,6 @@ In order to set the cluster function implementation, you would generate a file w cluster.functions = makeClusterFunctionsInteractive() ``` The configuration file is parsed whenever you create or load a `?Registry`. -After editing the configuration file or a scheduler template referenced by it, -reload the registry with `loadRegistry()` to apply the changes without removing -and recreating the registry. It is sourced inside of your registry which has the advantage that you can (a) access all of the parameters which are passed to makeRegistry() and (b) you can also directly change them. Lets say you always want your working directory in your home directory and you always want to load the `checkmate` package on the nodes, you can just append these lines: ```{r, eval = FALSE}