ck37 / varimpact

Variable importance through targeted causal inference, with Alan Hubbard
57 stars 13 forks source link

README: plan("cluster", workers = ...) => plan(multisession) [suggestion] #21

Open HenrikBengtsson opened 2 years ago

HenrikBengtsson commented 2 years ago

Hi, in the README, there's the following example:

library(RhpcBLASctl)
# Detect the number of physical cores on this computer using RhpcBLASctl.
cl = parallel::makeCluster(get_num_cores())
plan("cluster", workers = cl)
…

That can be replaced with:

plan(multisession)

or if you prefer get_num_cores() instead of the default parallelly::availableCores(), then:

plan(multisession, workers = RhpcBLASctl::get_num_cores())

will the equivalent to the above.