Skip to content

Commit

Permalink
* new function to help work in parallel using PCs
Browse files Browse the repository at this point in the history
  • Loading branch information
thierrygosselin committed Nov 29, 2016
1 parent 97f40a9 commit 5169b73
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/mclapply_win.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @name .mclapply_win
#' @name mclapply_win
#' @title hack to switch function for parallel computation based on OS
#' @description \code{parallel::mclapply} doesn't work on Windows,
#' because forking is not supported.
Expand Down Expand Up @@ -30,7 +30,7 @@
#' @importFrom parallel detectCores makeCluster clusterExport mclapply parLapply stopCluster
#' @keywords internal

.mclapply_win <- function(
mclapply_win <- function(
X, FUN, ..., mc.preschedule = TRUE, mc.set.seed = TRUE,
mc.silent = FALSE, mc.cores = NULL, mc.cleanup = TRUE, mc.allow.recursive = TRUE
) {
Expand Down Expand Up @@ -97,7 +97,7 @@
# @export
.stackr_parallel <- switch(
Sys.info()[['sysname']],
Windows = {.mclapply_win},
Windows = {mclapply_win},
Linux = {parallel::mclapply},
Darwin = {parallel::mclapply}
)
Expand Down
45 changes: 45 additions & 0 deletions man/mclapply_win.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5169b73

Please sign in to comment.