Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Libraries to load
- library("foreach")
- library("doParallel")
- no_cores <- detectCores() - 1
- cl <- makeCluster(no_cores, type="FORK")
- registerDoParallel(cl)
- result <- foreach(i=10:10000) %dopar% sqrt(i)
- stopCluster(cl)
Add Comment
Please, Sign In to add comment