Question

VincentGuyader on Tue, 23 Feb 2016 14:46:39


Hi, 

I'm trying to execute a "simple" foreach loop.

This is the code I use in "Execute R script"

library(foreach)
require(foreach)
  require(parallel)
  require(doSNOW)
  
    c1<-makeCluster(4, type = "SOCK")
  registerDoSNOW(c1)
print(system.time(foreach(i=1:30) %do%  sqrt(i)))

print(system.time(foreach(i=1:30) %dopar%  sqrt(i)))
print("fin")

but I get this error :

[Verbose]         Begin invoking method Run ... 
[ModuleOutput] Microsoft Drawbridge Console Host [Version 1.0.2108.0]
[ModuleOutput] [1] 56000
[ModuleOutput] 
[ModuleOutput] Loading objects:
[ModuleOutput] 
[ModuleOutput] Loading required package: parallel
[ModuleOutput] 
[ModuleOutput] Loading required package: doSNOW
[ModuleOutput] 
[ModuleOutput] Loading required package: iterators
[ModuleOutput] 
[ModuleOutput] Loading required package: snow
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] Attaching package: 'snow'
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] The following objects are masked from 'package:parallel':
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput]     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
[ModuleOutput] 
[ModuleOutput]     clusterExport, clusterMap, clusterSplit, makeCluster, parApply,
[ModuleOutput] 
[ModuleOutput]     parCapply, parLapply, parRapply, parSapply, splitIndices,
[ModuleOutput] 
[ModuleOutput]     stopCluster
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] 
[ModuleOutput] Warning message:
[ModuleOutput] 
[ModuleOutput] In socketConnection(port = port, server = TRUE, blocking = TRUE,  :
[ModuleOutput] 
[ModuleOutput]   port 11822 cannot be opened
[ModuleOutput] 
[Stop]     DllModuleMethod::Execute. Duration = 00:00:10.8540264
[Critical]     Error: Error 0063: The following error occurred during evaluation of R script:
---------- Start of error message from R ----------
cannot open the connection

Any Idea why ?

Regards


Sponsored



Replies

Roope Astala - MSFT on Tue, 23 Feb 2016 15:05:21


Hi Vincent! Azure ML doesn't support distributed execution within Execute R Script module, the error you get is likely due to the R sandbox blocking socket connection.

For distributed execution, one option is to split the dataset, and have multiple Execute R modules work in parallel at experiment graph level.

Hope this helps,

Roope

aiacobucci on Thu, 09 Jun 2016 10:19:31


Hello, 

I have the same issue.

Do you have some news on this subject? Are you going to implement this feature in Azure?

Thank you.

Andrea

Scott Wise on Tue, 23 May 2017 16:59:59


I also have this issue and would like to use clustering. I did find this and will give it a go.

https://azure.microsoft.com/en-us/blog/doazureparallel/