On a windows platform it seems that a high iterator value will stop foreach in its tracks. For example
library(doParallel)
library(foreach)
cl<-makeCluster(7)
registerDoParallel(cl)
bayes_results<-foreach (n=1:100) %dopar% {n}
This works just fine in a few seconds.
However increasing the value to a few million stops foreach from working even after a several hour wait.
bayes_results<-foreach (n=1:5000000) %dopar% {n}
What is the problem? How could it be solved?
Thank you.