diff --git a/DESCRIPTION b/DESCRIPTION index c1df5d973..abccd4b88 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: mirai Type: Package Title: Minimalist Async Evaluation Framework for R -Version: 0.10.0.9014 +Version: 0.10.0.9015 Description: Lightweight parallel code execution and distributed computing. Designed for simplicity, a 'mirai' evaluates an R expression asynchronously, on local or network resources, resolving automatically upon completion. diff --git a/NEWS.md b/NEWS.md index a78ceddeb..3b7d2a3d6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# mirai 0.10.0.9014 (development) +# mirai 0.10.0.9015 (development) * Implements an alternative communications backend for R, adding methods for the 'parallel' base package. + `make_cluster()` creates a 'miraiCluster', compatible with existing functions taking a 'cluster' object. diff --git a/R/mirai-package.R b/R/mirai-package.R index 39e8ec61b..9e1af27e5 100644 --- a/R/mirai-package.R +++ b/R/mirai-package.R @@ -62,7 +62,8 @@ NULL .onLoad <- function(libname, pkgname) { - .. <<- `[[<-`(new.env(hash = FALSE), "default", new.env(hash = FALSE)) + .. <<- new.env(hash = FALSE, parent = environment(daemons)) + `[[<-`(.., "default", new.env(hash = FALSE, parent = ..)) switch( Sys.info()[["sysname"]], Linux = { diff --git a/R/mirai.R b/R/mirai.R index 0d93a8d5d..eb44c8897 100644 --- a/R/mirai.R +++ b/R/mirai.R @@ -785,7 +785,7 @@ daemons <- function(n, url = NULL, dispatcher = TRUE, resilience = TRUE, envir <- ..[[.compute]] if (is.null(envir)) - envir <- `[[<-`(.., .compute, new.env(hash = FALSE, parent = environment(daemons)))[[.compute]] + envir <- `[[<-`(.., .compute, new.env(hash = FALSE, parent = ..))[[.compute]] if (is.character(url)) { @@ -828,7 +828,7 @@ daemons <- function(n, url = NULL, dispatcher = TRUE, resilience = TRUE, reap(envir[["sock"]]) length(envir[["sockc"]]) && reap(envir[["sockc"]]) envir <- NULL - `[[<-`(.., .compute, new.env(hash = FALSE)) + `[[<-`(.., .compute, new.env(hash = FALSE, parent = ..)) } else if (is.null(envir[["sock"]])) {