diff --git a/R/parallelization-vignette.R b/data-raw/parallelization-vignette.R similarity index 100% rename from R/parallelization-vignette.R rename to data-raw/parallelization-vignette.R index be3c291..79c04ce 100644 --- a/R/parallelization-vignette.R +++ b/data-raw/parallelization-vignette.R @@ -2,11 +2,11 @@ # Setup ------------------------------------------------------------------- -library(flipr) library(future) library(parallel) library(progressr) library(tictoc) +library(flipr) ngrid_in <- 50L nperms <- 5000 diff --git a/vignettes/parallelization.Rmd b/vignettes/parallelization.Rmd index 7ae24ed..76a7ebb 100644 --- a/vignettes/parallelization.Rmd +++ b/vignettes/parallelization.Rmd @@ -12,6 +12,7 @@ knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) +library(flipr) load("../R/sysdata.rda") time_without_parallelization <- df_parallelization$time_without_par time_with_parallelization <- df_parallelization$time_par @@ -19,10 +20,6 @@ time_with_parallelization <- df_parallelization$time_par The [**flipr**](https://lmjl-alea.github.io/flipr/) package uses functions contained in the [**furrr**](https://future.futureverse.org/index.html) package for parallel processing. The setting of parallelization has to be done on the user side. We illustrate here how to achieve asynchronous evaluation. We use the [**future**](https://future.futureverse.org/index.html) package to set the plan, the **parallel** package to define a default cluster, and the [**progressr**](https://progressr.futureverse.org/index.html) package to report progress updates. -```{r setup} -library(flipr) -``` - ## Computation without parallel processing To show the benefit of parallel processing, we compare here the processing times necessary to evaluate a grid with a plausibility function. First, here is the computation without parallelization.