Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

doRSR and foreach - numCoresToUse has no effect


View products that this article applies to.

numCoresToUse (and rxOptions, in general) is related only to setting up distributed computing for RevoScaleR functions. foreach and doParallel do not use it. To run your script in parallel mode, you will need to first register a parallel backend for your foreach command.  Instead of setting numCoresToUse, use
library(doParallel} registerDoParallel(cores=6)
getDoParWorkers() should return 6 at this point. This sets up a "compute cluster" across each core, each of which can run an R process and communicate over sockets with the others. 

Some additional resources on using foreach and doParallel that will explain more options on running in parallel:

http://cran.r-project.org/web/packages/foreach/vignettes/foreach.pdf 
http://cran.r-project.org/web/packages/doParallel/vignettes/gettingstartedParallel.pdf

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 3103818
Revision : 1
Created on : 1/7/2017
Published on : 11/1/2015
Exists online : False
Views : 90