nuno-agostinho / psichomics

Interactive R package to quantify, analyse and visualise alternative splicing
http://nuno-agostinho.github.io/psichomics/
Other
33 stars 12 forks source link

Introduce parallel programming in slow loops #50

Open nuno-agostinho opened 8 years ago

nuno-agostinho commented 8 years ago

The number of cores to use could default to 1 (for safety reasons) or maybe use 2 or 4 depending on cores available… is it possible to check available cores in R?

This should be a setting the user could modify (see #80).

nuno-agostinho commented 7 years ago

Unfortunately, when trying to parallelise a function using the standard parallel package in Shiny, the computer gets alarmingly slow and never completes the task at hand. I waited around 30min before stopping the execution of R.

The following instructions were tried (both with 1 and 2 cores, the result is the same):

cl <- parallel::makeCluster(getOption("cl.cores", 2))
stats <- apply(cl, psi, 1, aFunction)
parallel::stopCluster(cl)