#concerning ncores, any non-integer type will be treated as "use parallel:detectCores()"
#1) acquire data (process curves, get as coeffs)
+ #TODO: for data.frame and custom function, run in parallel (connections are sequential[?!])
index = 1
nb_curves = 0
repeat
library(parallel)
ncores = ifelse(is.integer(ncores), ncores, parallel::detectCores())
cl = parallel::makeCluster(ncores)
- parallel::clusterExport(cl=cl, varlist=c("X", "Y", "K", "p"), envir=environment())
+ parallel::clusterExport(cl=cl, varlist=c("TODO:", "what", "to", "export?"), envir=environment())
#TODO: be careful of writing to a new temp file, then flush initial one, then re-use it...
repeat
{
} else if (remainder > 0)
{
#spread the load among other workers
-
+ #...
}
li = parallel::parLapply(cl, indices, processChunk, K, WER=="mix")
#C) flush tmp file (current parallel processes will write in it)