Pmap that uses workers() AND the master process for computation?

question

#1

i understand that pmap distributes tasks among workers() by default. in particular, ?pmap say`

If a worker pool is not specified, all available workers, i.e., the default worker pool is used.

Is it possible to define a worker pool that inlcudes the master process? How? If not, what is the best way to use all available compute resources (workers + master) in a pmap kind of way? thanks.


#2

Do you specifically want the master process to be in the worker pool?
If you just want to match the number of workers with compute cores, then simply add another worker.
(Note that any number of workers can be added, regardless of actual compute cores).

Intuitively, it makes sense to add the same number of workers as physical cores, and this is probably a good starting point.
In practice, finding the optimal number of workers may require some experimenting.

Interesting read here: http://www.stochasticlifestyle.com/236-2/


#3

thanks, that is helpful!