[R] makeCluster() hangs infinitely

Zhihao Huang zhhhw@ng @ending from umich@edu
Mon Sep 17 00:23:09 CEST 2018


Hi all,

The function makeCluster() of parallel does not work on my laptop. It hangs
infinitely.

*1. Problem Summary:*

> # Loading parallel packages

> library(parallel)

> cl <- makeCluster(2) # It hangs at this line of code.
It hangs at the second line of the code.

*2. Potential Reason*
I also tried to see the details of what it does internally by using the
following code.

> library(future)

> cl <- future::makeClusterPSOCK(1L, verbose = TRUE) # It hangs at this
line of code.
And it returns the following descriptions and hangs.

*Workers: [n = 1] ‘localhost’*

*Base port: 11214*

*Creating node 1 of 1 ...*

*- setting up node*

*Starting worker #1 on ‘localhost’:
'/Library/Frameworks/R.framework/Resources/bin/Rscript'
--default-packages=datasets,utils,grDevices,graphics,stats,methods -e
'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11214 OUT=/dev/null
TIMEOUT=2592000 XDR=TRUE*

*Waiting for worker #1 on ‘localhost’ to connect back*
So the problem is that the "worker #1 on 'local host'" never connects back,
and that's why it hangs forever. I have no idea what causes this.

*3. my sessionInfo():*

R version 3.5.1 (2018-07-02)

Platform: x86_64-apple-darwin15.6.0 (64-bit)

Running under: macOS High Sierra 10.13.6


Matrix products: default

BLAS:
/Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib

LAPACK:
/Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib


locale:

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


attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base


loaded via a namespace (and not attached):

[1] compiler_3.5.1

I spent hours searching for the solutions but failed. It looks like some
other people met similar problem here
<http://r.789695.n4.nabble.com/makeCluster-hangs-td4748238.html>. Also, I
posted this question online here
<https://stackoverflow.com/questions/52264460/r-parallel-makecluster-hangs-infinitely-on-mac/52284709#52284709>
a
week ago.

Any suggestion would be appreciated. Thanks a lot!

Thanks,
Zhihao
--
Zhihao (Daniel) Huang
Graduate Student
Department of Statistics,
University of Michigan, Ann Arbor
Email: zhhhwang using umich.edu

-- 
黄 之昊
Zhihao Huang

Graduate Student
Department of Statistics,
University of Michigan, Ann Arbor
Email: zhhhwang using umich.edu

	[[alternative HTML version deleted]]



More information about the R-help mailing list