bachmannpatrick/CLVTools

Parallelization issue when using doFuture on Linux systems

Closed this issue · 1 comments

Test runs did show that parallelization stopped working properly on Linux systems. Using doParallel still works.

Here is a code chunk to replicate the issue:

start_time <- Sys.time()

library("CLVTools")
library("data.table")
library("doFuture")
library("doParallel")


#ohne die folgenden beiden Zeilen laeuft es schneller!
registerDoFuture()
plan(multisession) #sollte Multithreading aktivieren, funktioniert aber nicht richtig.


data("apparelTrans")

clv.apparel <- clvdata(apparelTrans,  
                       date.format="ymd", 
                       time.unit = "week",
                       estimation.split = 40,
                       name.id = "Id",
                       name.date = "Date",
                       name.price = "Price")

data("apparelDynCov")



clv.dyn <- SetDynamicCovariates(clv.data = clv.apparel, 
                                data.cov.life = apparelDynCov,
                                data.cov.trans = apparelDynCov, 
                                names.cov.life = c("Marketing", "Gender", "Channel"), 
                                names.cov.trans = c("Marketing", "Gender", "Channel"), 
                                name.id = "Id",
                                name.date = "Cov.Date")

est.pnbd.dyn <- pnbd(clv.dyn, 
                     start.params.model = c(r=1, alpha = 2, s = 1, beta = 2),
                     start.params.life = c(Marketing=0.5, Gender=0.6, Channel=0.4),
                     start.params.trans = c(Marketing=0.5, Gender=0.6, Channel=0.4),
                     optimx.args = list(control=list(trace=6)))

summary(est.pnbd.dyn)

end_time <- Sys.time()
end_time - start_time

To check the core usage use e.g. htop.

Check if related to the following doFuture issue: GitHub Link

Support for parallelization was removed in PR #158 by using Rcpp for the F2.3 part in the LL of the extended pnbd