Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOTICE: plan(multiprocess) of future is deprecated #1

Closed
HenrikBengtsson opened this issue Oct 19, 2021 · 3 comments
Closed

NOTICE: plan(multiprocess) of future is deprecated #1

HenrikBengtsson opened this issue Oct 19, 2021 · 3 comments

Comments

@HenrikBengtsson
Copy link

Hi.

This is a friendly reminder that plan(multiprocess) of the future package is deprecated since future 1.20.0 (2020-11-03). It will eventually become defunct and removed. The background for this can be found in futureverse/future#420.

Your flowGraph package relies on multiprocess, cf. https://github.com/aya49/flowGraph/search?q=multiprocess.

Please migrate your code to the platform-independent plan(multisession) or the Linux/macOS-specific plan(multicore). If you want to emulate what multiprocess does, you can do something like:

  if (parallelly::supportsMulticore()) {
    oplan <- plan(multicore)
  } else {
    oplan <- plan(multisession)
  }
  on.exit(plan(oplan))

BTW, if you don't already do so, please make sure to undo any plan() you set in your code, as illustrated by the above example. This is needed to guarantee that calling your code won't override settings that the user has set previously. You can read about this in https://future.futureverse.org/reference/plan.html#for-package-developers.

Thank you,

Henrik
(maintainer of the future package)

@aya49
Copy link
Owner

aya49 commented Apr 7, 2022

Thank you for the update. plan(multiprocess) changed to plan(multisession).

@HenrikBengtsson
Copy link
Author

HenrikBengtsson commented Jun 2, 2022

FYI, you still mention 'multiprocess' in a source-code comment of one of your example():s;

flowGraph/R/00_helpers.R

Lines 35 to 53 in 78a1332

#' @title Prepares parallel loop indices.
#' @description \code{loop_ind_f} is a helper function that splits
#' a vector of loop indices into a list of multiple loop indices
#' for use in parallel processes within the flowGraph package.
#' @param x A vector of loop indices.
#' @param n An integer, or the number of vectors to split \code{x} into.
#' @return list of \code{n} vectors with elements from \code{x}.
#' @examples
#'
#' old_loop_inds <- 1:10
#' no_cores <- 5
#'
#' new_loop_inds <- flowGraph:::loop_ind_f(old_loop_inds, no_cores)
#' # future::plan(future::multiprocess)
#' # example_indices <- furrr::future_map(new_loop_inds, function(ii) {
#' # purrr::map(ii, function(i) i )
#' # s})
#'
#' @rdname loop_ind_f

@aya49
Copy link
Owner

aya49 commented Jun 2, 2022

Thank you Henrik!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants