R In parallel, is it better to create a new cluster every time you use parallel?

I use the function parLapplyon 20 cores. I think this is the same for another function parSapply, etc.

Firstly, is it inconvenient to pass a cluster as an argument to a function so that the function can then send cluster usage between different subfunctions?

Secondly, I pass this cluster argument to the function, so I assume that it is the same cluster every time I use parLapply, would it be better to use a new cluster for each call parLapply?

thanks

Rgds

+4
source share
2 answers

, .

1) - . , .

2) . , - , - .

+3

, .

, , ssh , . , , Fork, makeForkCluster . , mclapply, . , , .

0

All Articles