Closed HenrikBengtsson closed 3 years ago
An even better default might be makeClusterPSOCK(workers = availableWorkers())
, which falls back to rep("localhost", times = availableCores())
if no other information is available.
Having said this, I'm gonna take the conservative approach and not set a default. It's better/safer to always specify workers
explicitly.
Advantages:
cl <- makeClusterPSOCK()
andcl <- makeClusterPSOCK(workers = availableCores())
cl <- parallel::makeClusterPSOCK()
andcl <- parallel::makeClusterPSOCK(workers = parallel::availableCores())
Disadvantages:
cl <- makeClusterPSOCK(workers = 4)
when all you have to do is writecl <- makeClusterPSOCK()
, especially if the latter works just fine on your local 4 or 8 core machine. Then you run the same on a 96 core machine.