Skip to content

Commit acc8e07

Browse files
committed
document and bump
1 parent f6f9c1a commit acc8e07

File tree

3 files changed

+39
-29
lines changed

3 files changed

+39
-29
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: SimDesign
22
Title: Structure for Organizing Monte Carlo Simulation Designs
3-
Version: 2.9.3
3+
Version: 2.10
44
Authors@R: c(person("Phil", "Chalmers", email = "[email protected]", role = c("aut", "cre"),
55
comment = c(ORCID="0000-0001-5332-2810")),
66
person("Matthew", "Sigal", role = c("ctb")),

R/runSimulation.R

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#' design conditions, and number of replications. Results can be saved as temporary files in case of
55
#' interruptions and may be restored by re-running \code{runSimulation}, provided that the respective temp
66
#' file can be found in the working directory. \code{runSimulation} supports parallel
7-
#' and cluster computing, global and local debugging, error handling (including fail-safe
7+
#' and cluster computing (with the \code{parallel} and \code{future} packages),
8+
#' global and local debugging, error handling (including fail-safe
89
#' stopping when functions fail too often, even across nodes), provides bootstrap estimates of the
910
#' sampling variability (optional), and automatic tracking of error and warning messages
1011
#' and their associated \code{.Random.seed} states.
@@ -116,7 +117,8 @@
116117
#'
117118
#' @section A note on parallel computing:
118119
#'
119-
#' When running simulations in parallel (either with \code{parallel = TRUE} or \code{MPI = TRUE})
120+
#' When running simulations in parallel (either with \code{parallel = TRUE} or \code{MPI = TRUE},
121+
#' or when using the \code{future} approach with a \code{plan()} other than sequential)
120122
#' R objects defined in the global environment will generally \emph{not} be visible across nodes.
121123
#' Hence, you may see errors such as \code{Error: object 'something' not found} if you try to use
122124
#' an object that is defined in the work space but is not passed to \code{runSimulation}.
@@ -182,11 +184,13 @@
182184
#' constant global elements (e.g., a constant for sample size)
183185
#'
184186
#' @param parallel logical; use parallel processing from the \code{parallel}
185-
#' package over each unique condition? Alternatively, if the \code{future} package has
186-
#' been attached prior to executing \code{runSimulation()} then the associated
187-
#' \code{plan()} will be followed
187+
#' package over each unique condition?
188+
#'
189+
#' Alternatively, if the \code{future} package has been attached prior to executing
190+
#' \code{runSimulation()} then the associated \code{plan()} will be followed instead
188191
#'
189-
#' @param cl cluster object defined by \code{\link{makeCluster}} used to run code in parallel.
192+
#' @param cl cluster object defined by \code{\link{makeCluster}} used to run code in parallel
193+
#' (ignored if using the \code{future} package approach).
190194
#' If \code{NULL} and \code{parallel = TRUE}, a local cluster object will be defined which
191195
#' selects the maximum number cores available
192196
#' and will be stopped when the simulation is complete. Note that supplying a \code{cl}
@@ -199,8 +203,8 @@
199203
#' \code{plan()} will be followed instead
200204
#'
201205
#' @param packages a character vector of external packages to be used during the simulation (e.g.,
202-
#' \code{c('MASS', 'extraDistr', 'simsem')} ). Use this input when \code{parallel = TRUE} or
203-
#' \code{MPI = TRUE} to use non-standard functions from additional packages,
206+
#' \code{c('MASS', 'extraDistr', 'simsem')} ). Use this input when running code in
207+
#' parallel to use non-standard functions from additional packages,
204208
#' otherwise the functions must be made available by using explicit
205209
#' \code{\link{library}} or \code{\link{require}} calls within the provided simulation functions.
206210
#' Alternatively, functions can be called explicitly without attaching the package
@@ -411,7 +415,8 @@
411415
#' something fatally problematic
412416
#' is going wrong in the generate-analyse phases. Default is 50
413417
#'
414-
#' @param ncores number of cores to be used in parallel execution. Default uses all available
418+
#' @param ncores number of cores to be used in parallel execution (ignored if using the
419+
#' \code{future} package approach). Default uses all available
415420
#'
416421
#' @param save logical; save the temporary simulation state to the hard-drive? This is useful
417422
#' for simulations which require an extended amount of time, though for shorter simulations
@@ -769,14 +774,14 @@
769774
#' library(future) # future structure to be used internally
770775
#' # plan(multisession) # specify different plan (default is sequential)
771776
#'
772-
#' # note that parallel and cl inputs no longer used, and progressr package
773-
#' # used for progress reporting (disable with progress = FALSE or redefine
774-
#' # using progressr::handlers())
777+
#' # note that parallel and cl inputs no longer used, and the progressr package
778+
#' # is used for progress reporting (disable with progress = FALSE or redefine
779+
#' # using progressr::handlers(); see below)
775780
#' res <- runSimulation(design=Design, replications=1000,
776781
#' generate=Generate, analyse=Analyse, summarise=Summarise)
777782
#' head(res)
778783
#'
779-
#' # re-define progress bar
784+
#' # re-define progress bar (requires cli)
780785
#' library(progressr)
781786
#' handlers(handler_pbcol(
782787
#' adjust = 1.0,
@@ -787,7 +792,7 @@
787792
#' res <- runSimulation(design=Design, replications=1000,
788793
#' generate=Generate, analyse=Analyse, summarise=Summarise)
789794
#'
790-
#' # stop using future package internally
795+
#' # to stop using future package internally use
791796
#' detach("package:future")
792797
#'
793798
#' ####################################

man/runSimulation.Rd

Lines changed: 19 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)