Reputation: 1353
To initiate the cluster, it is advised to use below codes
library(parallel)
cl <- makeCluster(getOption("cl.cores", 2))
However I fail to understand what is the meaning of getOption("cl.cores", 2)
? How exactly I can find the number of cores in my windows system to run parallel computation?
Upvotes: 0
Views: 215
Reputation: 20405
The usual way to do this is:
num_cores <- parallel::detectCores() # 8 in my case
cluster <- parallel::makeCluster(num_cores-1)
Upvotes: 1