diff --git a/NEWS b/NEWS index 565683e8..e14b74fc 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ Package: future =============== -Version: 1.2.0-9000 [2016-12-30] +Version: 1.2.0-9000 [2017-01-05] o Added support for controlling whether a future is resolved eagerly or lazily when creating the future, e.g. future(..., lazy = TRUE) futureAssign(..., lazy = TRUE), and x %<-% { ... } %lazy% TRUE. @@ -17,7 +17,9 @@ o PRIVACY: Lookup of public / external IP number is now querying doesn't log usage. Note that the external IP number is only queried when using plan(remote, workers) and explicitly using revtunnel = FALSE (the default is revtunnel = TRUE). - +o BUG FIX: availableCores(methods = "_R_CHECK_LIMIT_CORES_") would + give an error if not running R CMD check. + Version: 1.2.0 [2016-11-12] o Added makeClusterPSOCK() - a version of parallel::makePSOCKcluster() diff --git a/R/availableCores.R b/R/availableCores.R index e942742d..6db7be38 100644 --- a/R/availableCores.R +++ b/R/availableCores.R @@ -8,15 +8,19 @@ #' For instance, on systems where multicore processing is not supported #' (i.e. Windows), using \code{constrains="multicore"} will force a #' single core to be reported. +#' #' @param methods A character vector specifying how to infer the number #' of available cores. +#' #' @param na.rm If TRUE, only non-missing settings are considered/returned. +#' #' @param default The default number of cores to return if no non-missing #' settings are available. +#' #' @param which A character specifying which settings to return. #' If \code{"min"}, the minimum value is returned. #' If \code{"max"}, the maximum value is returned (be careful!) -#' If \code{"all"}, all values are returned. +#' If \code{"all"}, all values are returned.#' #' #' @return Return a positive (>=1) integer. #' If \code{which="all"}, then more than one value may be returned. @@ -117,7 +121,7 @@ availableCores <- function(constraints=NULL, methods=getOption("future.available ## misleading to the reader. chk <- tolower(Sys.getenv("_R_CHECK_LIMIT_CORES_", "")) chk <- (nzchar(chk) && (chk != "false")) - if (chk) n <- 3L ## = 2+1 + n <- if (chk) 3L else NA_integer_ ## = 2+1 } else if (method == "system") { ## Number of cores available according to parallel::detectCores() n <- detectCores()