Skip to content

Commit

Permalink
Adding workaround for parallelization on Windows (#46)
Browse files Browse the repository at this point in the history
Not as elegant as simply using `makeCluster()`, but this avoids rewriting some unit tests. May be improved in the future.
  • Loading branch information
wleoncio committed Aug 20, 2024
1 parent 22be22e commit 8406510
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/MADMMplasso.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ MADMMplasso <- function(X, Z, y, alpha, my_lambda = NULL, lambda_min = 0.001, ma

# Pre-calculating my_values through my_values_matrix
if (parallel) {
cl <- parallel::makeForkCluster(cl1)
if (.Platform$OS.type == "unix") {
cl <- parallel::makeForkCluster(cl1)
} else {
cl <- parallel::makeCluster(cl1)
}
doParallel::registerDoParallel(cl = cl)
foreach::getDoParRegistered()
if (legacy) {
Expand Down

0 comments on commit 8406510

Please sign in to comment.