Skip to content

Commit 93630b0

Browse files
committed
explicitly export to global
1 parent 5190306 commit 93630b0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

R/SimSolve.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,14 +605,15 @@ SimSolve <- function(design, interval, b, generate, analyse, summarise,
605605
on.exit(parallel::stopCluster(cl), add = TRUE)
606606
}
607607
}
608+
browser()
608609
export_funs <- parent_env_fun(control$global_fun_level)
609610
if(parallel){
610611
if(!useFuture && is.null(cl)){
611612
cl <- parallel::makeCluster(ncores, type=type)
612613
on.exit(parallel::stopCluster(cl), add = TRUE)
613614
}
614615
if(!useFuture){
615-
parallel::clusterExport(cl=cl, export_funs, envir = parent.frame(1L))
616+
parallel::clusterExport(cl=cl, export_funs)
616617
parallel::clusterExport(cl=cl, "ANALYSE_FUNCTIONS", envir = environment())
617618
if(verbose > 0 && verbose < 2)
618619
message(sprintf("\nNumber of parallel clusters in use: %i", length(cl)))

R/runSimulation.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,10 +1295,10 @@ runSimulation <- function(design, replications, generate, analyse, summarise,
12951295
on.exit(parallel::stopCluster(cl), add = TRUE)
12961296
}
12971297
if(!useFuture){
1298-
parallel::clusterExport(cl=cl, export_funs, envir = parent.frame(1L))
1298+
parallel::clusterExport(cl=cl, export_funs)
12991299
parallel::clusterExport(cl=cl, "ANALYSE_FUNCTIONS", envir = environment())
13001300
parallel::clusterExport(cl=cl, "TRY_ALL_ANALYSE", envir = environment())
1301-
if(verbose)
1301+
if(verbose > 0 && verbose < 2)
13021302
message(sprintf("\nNumber of parallel clusters in use: %i", length(cl)))
13031303
}
13041304
}

0 commit comments

Comments
 (0)