diff options
| -rw-r--r-- | R/multistart.R | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/R/multistart.R b/R/multistart.R index 61ef43dc..bdfbfe63 100644 --- a/R/multistart.R +++ b/R/multistart.R @@ -100,9 +100,12 @@ multistart.saem.mmkin <- function(object, n = 50, cores = 1,    }    if (is.null(cluster)) { -    res <- parallel::mclapply(1:n, fit_function, mc.cores = cores) +    res <- parallel::mclapply(1:n, fit_function, +      mc.cores = cores, mc.preschedule = FALSE)    } else { -    res <- parallel::parLapply(cluster, 1:n, fit_function) +    res <- parallel::parLapplyLB(cluster, 1:n, fit_function, +      mc.preschedule = FALSE +    )    }    attr(res, "orig") <- object    attr(res, "start_parms") <- start_parms | 
