makeCluster hangs on Windows 10

Hello,

I'm working on an assignment in which I need to perform a simple parallization. However, when I try to use the command makeCluster, the program just hangs in there. I changed all the windows security configurations to allow for the R and RStudio to work, but to no avail.

This is the code that I am using:

library(doParallel) # basic parallelization package
library(foreach) #"foreach" parallelization module is nice and intuitive

ncore <- detectCores(logical = TRUE) # detect number of cores
cl <- makeCluster(ncore - 1, type = "PSOCK") # create clusters of ncore - 1

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252

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

other attached packages:
[1] doParallel_1.0.16 iterators_1.0.13 foreach_1.5.1

loaded via a namespace (and not attached):
[1] compiler_4.1.2 tools_4.1.2 codetools_0.2-18

Thanks for the help!

1 Like

A similar post:

1 Like