-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEPRECATION: Deprecated plan(multiprocess, ...) now equals plan(seque…
…ntial); same for multiprocess() -> sequential() [#546]
- Loading branch information
1 parent
e15ebd4
commit 9b632d8
Showing
10 changed files
with
22 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,30 @@ | ||
#' Create a multiprocess future whose value will be resolved asynchronously using multicore or a multisession evaluation | ||
#' | ||
#' A multiprocess future is a future that uses [multicore] evaluation | ||
#' if supported, otherwise it uses [multisession] evaluation. | ||
#' Regardless, its _value is computed and resolved in | ||
#' parallel in another process_.\cr | ||
#' \cr | ||
#' **WARNING: The 'multiprocess' future plan is deprecated. | ||
#' Instead, explicitly specify 'multisession' or 'multicore'. The former works | ||
#' everywhere and is the recommended one between the two. _Forked processing_, | ||
#' which 'multicore' uses, is unstable in various environment and setups. | ||
#' The 'multiprocess' alias is therefore being phased out.** | ||
#' The 'multiprocess' alias is therefore being phased out, and is now | ||
#' equal to using 'sequential' (sic!)** | ||
#' | ||
#' @inheritParams ClusterFuture-class | ||
#' @inheritParams future | ||
#' @inheritParams Future-class | ||
#' | ||
#' @param workers A positive numeric scalar or a function specifying the | ||
#' maximum number of parallel futures that can be active at the same time | ||
#' before blocking. | ||
#' If a function, it is called without arguments _when the future | ||
#' is created_ and its value is used to configure the workers. | ||
#' The function should return a numeric scalar. | ||
#' @param workers Ignored in **future** (>= 1.31.0). | ||
#' | ||
#' @param \dots Additional arguments passed to [Future()]. | ||
#' | ||
#' @return | ||
#' A [MultiprocessFuture] implemented as either a | ||
#' [MulticoreFuture] or a [MultisessionFuture]. | ||
#' | ||
#' @example incl/multiprocess.R | ||
#' | ||
#' @seealso | ||
#' Internally [multicore()] and [multisession()] | ||
#' are used. | ||
#' A [SequentialFuture] (sic!) since **future** 1.31.0. | ||
#' | ||
#' @keywords internal | ||
#' | ||
#' @export | ||
multiprocess <- function(..., workers = availableCores(), envir = parent.frame()) { | ||
if (!is.element("multiprocess", getOption("future.deprecated.ignore"))) { | ||
.Deprecated(msg = sprintf("Detected creation of a 'multiprocess' future. Strategy 'multiprocess' is deprecated in future (>= 1.20.0) [2020-10-30]. Instead, explicitly specify either 'multisession' (recommended) or 'multicore'. In the current R session, 'multiprocess' equals '%s'.", if (supportsMulticore()) "multicore" else "multisession")) | ||
} | ||
|
||
fun <- if (supportsMulticore(warn = TRUE)) multicore else multisession | ||
fun(..., workers = workers, envir = envir) | ||
.Deprecated(msg = sprintf("Detected creation of a 'multiprocess' future. Strategy 'multiprocess' is deprecated in future (>= 1.20.0) [2020-10-30]. Instead, explicitly specify either 'multisession' (recommended) or 'multicore'. Starting with future 1.31.0 [2023-01-??], 'multiprocess' is the same as 'sequential'.")) | ||
sequential(..., envir = envir) | ||
} | ||
class(multiprocess) <- c("multiprocess", "future", "function") | ||
attr(multiprocess, "init") <- NA ## Set to FALSE/TRUE in .onLoad() | ||
class(multiprocess) <- c("sequential", "uniprocess", "future", "function") | ||
## future (> 1.30.0): 'multiprocess' always resolves to 'sequential' | ||
attr(multiprocess, "init") <- FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters