RECETOX / recetox-aplcms

This is a custom fork of apLCMS containing adaptations for large scale studies.
GNU General Public License v2.0
4 stars 8 forks source link

Refactor parallel execution in semi.sup.R and two.step.hybrid.R #38

Open maximskorik opened 2 years ago

maximskorik commented 2 years ago

two.step.hybrid.R and semi.sup.R rely on parallel execution with R's parallel package. Instead of exporting individual functions to clusters the whole package is exported (once in two.step.hybrid, 6 times in semi.sup).

clusterEvalQ(cluster, library(recetox.aplcms))

Such an approach requires recetox.aplcms package to be installed prior to testing, which is wrong. The solution would be to register each cluster's individual functions instead of the whole package, e.g., clusterEvalQ(cluster, "adjust.time"). However, that approach distorts cache handling: some cache files won't get written on disk.


The task is to refactor the parallel execution so that two-step-hybrid test passes without having recetox.aplcms package installed.

maximskorik commented 2 years ago

The issue can also be solved by using hybrid() instead of semi.sup() in two.step.hybrid, after #35 is resolved. That may be the best solution.