I get the correct output when I use %do% (sequential processing) in foreach
However, the the script gets stuck when I try %dopar% (parallel processing) in foreach
for(i in seq(10,8,-2)){
for(j in seq(10,8,-2)){
foreach(k = 96:100,.packages=c('recommenderlab','ggplot2','reshape2') ) %dopar% {
results <- run_algorithms(r.binary, "cross", k, k)
#plot the performance of the three algos
jpeg(sprintf('u_%d_d_%d_%d.jpg',i,j,k))
plot(results,annotate=c(1,3),legend="topleft")
dev.off()
}
}
}