Skip to content

Commit

Permalink
Update accept_reject
Browse files Browse the repository at this point in the history
  • Loading branch information
prdm0 committed Apr 23, 2024
1 parent 7f97e8c commit 2508dd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 98 deletions.
95 changes: 0 additions & 95 deletions .github/workflows/rhub.yaml

This file was deleted.

1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ importFrom(lbfgs,lbfgs)
importFrom(numDeriv,grad)
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
importFrom(pbmcapply,pbmclapply)
importFrom(purrr,map_dbl)
importFrom(purrr,partial)
Expand Down
6 changes: 3 additions & 3 deletions R/accept_reject.r
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#' @importFrom lbfgs lbfgs
#' @importFrom purrr partial map_dbl
#' @importFrom numDeriv grad
#' @importFrom parallel detectCores makeCluster
#' @importFrom parallel detectCores makeCluster stopCluster
#' @importFrom stats dunif runif dweibull
#' @importFrom utils capture.output
#' @importFrom assertthat assert_that
Expand Down Expand Up @@ -245,13 +245,13 @@ accept_reject <-
mc.cores = n_cores
)))
} else if(parallel && .Platform$OS.type == "windows"){
cl <- makeCluster(parallel::detectCores())
cl <- parallel::makeCluster(getOption("cl.cores", 2L))
capture.output(
r <- unlist(parallel::parLapply(
X = n_each_core,
fun = one_step
)))
stopCluster(cl)
parallel::stopCluster(cl)
} else {
r <- one_step(n)
}
Expand Down

0 comments on commit 2508dd5

Please sign in to comment.