[Rd] MacOS parallel::makeCluster fails

Dominik Leutnant |eutn@nt @end|ng |rom |h-muen@ter@de
Tue Jun 4 10:45:22 CEST 2019

Hi all,

The call parallel::makeCluster(1L) hangs infinitely on my MacOS machine which seems to be already reported by some people (e.g., https://stat.ethz.ch/pipermail/r-devel/2018-February/075565.html).
However, the solutions posted on SO, GH or R-devel do not work in my case.

So far, I unsuccessfully tested …

  1.  Couple of reboots
  2.  Adding to /etc/hosts
  3.  Using R.app instead of RStudio.app
  4.  Turn off the firewall

Following Hendriks advice, “cl <- future::makeClusterPSOCK(1L, verbose = TRUE, timeout = 60)” gives (note: without adding the timeout parameter, R just hangs):
> Sys.setenv(LANGUAGE='en')
> cl <- future::makeClusterPSOCK(1L, verbose = TRUE, timeout = 60)
[local output] Workers: [n = 1] ‘localhost’
[local output] Base port: 11867
[local output] Creating node 1 of 1 ...
[local output] - setting up node
Testing if worker's PID can be inferred: ‘'/Library/Frameworks/R.framework/Resources/bin/Rscript' -e 'try(cat(Sys.getpid(),file="/var/folders/5s/kgm05t2s0_52gz1s445mnlgw0000gn/T//RtmpZp1RX6/future.parent=835.3434fe0c5c6.pid"), silent = TRUE)' -e "file.exists('/var/folders/5s/kgm05t2s0_52gz1s445mnlgw0000gn/T//RtmpZp1RX6/future.parent=835.3434fe0c5c6.pid')"’
- Possible to infer worker's PID: TRUE
[local output] Starting worker #1 on ‘localhost’: '/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e 'try(cat(Sys.getpid(),file="/var/folders/5s/kgm05t2s0_52gz1s445mnlgw0000gn/T//RtmpZp1RX6/future.parent=835.3434fe0c5c6.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11867 OUT=/dev/null TIMEOUT=60 XDR=TRUE
[local output] - Exit code of system() call: 0
[local output] Waiting for worker #1 on ‘localhost’ to connect back
[local output] Detected a warning from socketConnection(): ‘problem in listening on this socket’
Killing worker process (PID 903) if still alive
Worker (PID 903) was successfully killed: TRUE
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 ‘Dominiks-MBP.local’.
* The error produced by socketConnection() was: ‘cannot open the connection’
* In addition, socketConnection() produced 1 warning(s):
   - Warning #1: ‘problem in listening on this socket’
* The localhost socket connection that failed to connect to the R worker used port 11867 using a communication timeout of 60 seconds and a connection timeout of 120 seconds.
* Worker launch call: '/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e 'try(cat(Sys.getpid(),file="/var/folders/5s/kgm05t2s0_52gz1s445mnlgw0000gn/T//RtmpZp1RX6/future.parent=835.3434fe0c5c6.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11867 OUT=/dev/null TIMEOUT=60 XDR=TRUE.
* Worker (PID 903) was successfully killed: TRUE
* Troubleshooting suggestions:
   - Suggestion #1: Set 'outfile=NULL' to see output from worker.
In addition: Warning message:
In socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  :
  problem in listening on this socket

My session looks like:
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

Random number generation:
RNG:     Mersenne-Twister
 Normal:  Inversion
 Sample:  Rounding

[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.6.0

Any help is greatly appreciated.
Best regards

Dr. Dominik Leutnant

Muenster University of Applied Sciences
Department of Civil Engineering
Institute for Infrastucture·Water·Resources·Environment (IWARU)
WG Urban Hydrology and Water Management
Corrensstr. 25
FRG-48149 Münster, Germany

Tel.:  +49 (0) 251/83-65274
Fax:  +49 (0) 251/83-65915
Mail:  leutnant using fh-muenster.de<mailto:leutnant using fh-muenster.de>
Web: https://www.fh-muenster.de/

	[[alternative HTML version deleted]]

More information about the R-devel mailing list