furrr error
plan(multiprocess) # on Macbook
Warning message: [ONE-TIME WARNING] Forked processing ('multicore') is disabled in future (>= 1.13.0) when running R from RStudio, because it is considered unstable. Because of this, plan("multicore") will fall back to plan("sequential"), and plan("multiprocess") will fall back to plan("multisession") - not plan("multicore") as in the past. For more details, how to control forked processing or not, and how to silence this warning in future R sessions, see ?future::supportsMulticore
> supportsMulticore() [1] FALSE
#Sys.getenv("R_FUTURE_FORK_ENABLE") #"" #Sys.setenv(R_FUTURE_FORK_ENABLE=TRUE) getOption("future.fork.enable") #NULL options(future.fork.enable=TRUE) supportsMulticore()
https://blog.seulgi.kim/2016/03/fork-in-multithread.html – 멀티 쓰레드 환경에서 fork는 조심해야 한다.
POSIX시스템(Unix…)에서는 fork
를 이용해서 자신과 똑같은 프로세스를 만들 수 있다. forking means cloning everything in the process including things like file descriptors — that means things like sockets that the rsession uses for communication with the front-end, or even possibly things like mutexes held by background threads.
> rm(list=ls()) > options(shiny.reactlog=T) > options(useFancyQuotes=F) # windows error > Sys.setenv(R_FUTURE_FORK_ENABLE=TRUE) > options(future.fork.enable=TRUE) > library(future) > plan(multiprocess, workers = 2, verbose=T) Error in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE, : Failed to launch and connect to R worker on local machine 'localhost' from local machine 'SIXXPC'. * The error produced by socketConnection() was: 'reached elapsed time limit' (which suggests that the connection timeout of 120 seconds (argument 'connectTimeout') kicked in) * The localhost socket connection that failed to connect to the R worker used port 11819 using a communication timeout of 2592000 seconds and a connection timeout of 120 seconds. * Worker launch call: "C:/PROGRA~1/R/R-36~1.1/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "parallel:::.slaveRSOCK()" MASTER=localhost PORT=11819 OUT=/dev/null TIMEOUT=2592000 XDR=TRUE. * Failed to kill local worker because it's PID is could not be identified. * Troubleshooting suggestions: - Suggestion #1: Set 'verbose=TRUE' to see more details. - Suggestion #2: On Windows, output from worker when using 'outfile=NULL' is only visible when running R from a terminal (not a GUI). In addition: Warning messages: 1: In tweak.future(function (expr, envir = parent.frame(), substitute = TRUE, : Ignored 1 unknown arguments: 'verbose' 2: In system(test_cmd, intern = TRUE, input = input) : running command '"C:/PROGRA~1/R/R-36~1.1/bin/x64/Rscript" -e "try(suppressWarnings(cat(Sys.getpid(),file=\\"C:/Users/ADMINI~1/AppData/Local/Temp/RtmpI9b5nk/future.parent=14004.36b41e57741c.pid\\")), silent = TRUE)" -e "file.exists(\\"C:/Users/ADMINI~1/AppData/Local/Temp/RtmpI9b5nk/future.parent=14004.36b41e57741c.pid\\")"' had status 1 >