2

I can not use parallel::makeCluster or snow::makeCluster on a windows 10 computer. I frequently receive this error, each time with a different port number:

Error in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  : 
  cannot open the connection
In addition: Warning message:
In socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  :  port 45416 cannot be opened

I use this R code, which worked fine on another computer, but I do not know the reason why the same code did not work for me:

require(parallel)
CL <- makeCluster(rep("localhost", 12))

I tried some suggested solutions without success, including disabling firewall. Is there a way to avoid blocked ports (or unblock them) on windows computers to use R on parallel?

Ahmed El-Gabbas
  • 398
  • 3
  • 10
  • I'm on win10 (64bit) and have been using `parallel` (and `future`) several times today with no issue. I use just `parallel::makeCluster(12)` instead of `rep("localhost",12)`, perhaps that would change the misbehavior? – r2evans Mar 25 '19 at 22:54
  • To be clear, part of what I'm saying is confirming that your behavior is specific to your laptop, not necessarily your code (as it worked for me almost as-written). If you have a non-Microsoft firewall installed, consider you might need to disable both *that* firewall as well as Microsoft's firewall/defender. Also, some anti-virus/firewall apps disallow (or at least audit) network connections *per-process* (by path/name), so firewall alone might be insufficient to lift all restrictions. – r2evans Mar 25 '19 at 23:26
  • The same two lines of code work nicely for few times in a row, then the same error appears for many times even after I restart R or the computer. I already disabled the firewall software with no effect yet. I re-installed RStudio to see if this was a bug of the previous installation or not. – Ahmed El-Gabbas Mar 26 '19 at 09:13
  • I would not expect this to be a problem of RStudio. Since it works sometimes, this is unlikely to be an R-based problem, though it's difficult to be certain. Since it works intermittently ... I really don't know what to troubleshoot next, sorry. – r2evans Mar 26 '19 at 12:02

0 Answers0