mfasiolo / qgam

Additive quantile regression R package
http://mfasiolo.github.io/qgam/
30 stars 7 forks source link

Better parallelization for tuneLearnFast() #17

Closed mfasiolo closed 7 years ago

mfasiolo commented 8 years ago

In tuneLearn each time a worker is called it creates a bootstrap datasets, and it uses it for all values of sigma. So each core creates only one copy of the data.

In tuneLearnFast the bootstrapped objects are created centrally and the whole list is passed to each node. So, if we suppose that we have N cores and N bootstrap datasets, the memory requirements are N times bigger in tuneLearnFast than in tuneLearn.

It would be better to export a specific bootstrapped object only to one specific core, which will have to handle it. Not sure clusterExport can be used to export objects to a specific core of a cluster.

mfasiolo commented 7 years ago

Solved by

https://github.com/mfasiolo/qgam/commit/5d51861972c3aabca6875817c2342cd78edd3b9e

and

https://github.com/mfasiolo/qgam/commit/f403449a66145b838ce00fc7bc9ce0cbbbbc478b