| Professor | Aymeric STAMM (CNRS & ENSAI) |
| ECTS Credits | 0 (preliminary course) |
| Lectures and Tutorials | 9 hrs (ENSAI) |
| Estimated personal workload (beyond lecture and tutorial time) | ~2–3 hrs per session: completing the lab-*.qmd documents. |
| Teaching language | English |
| Software & Packages | R (base + tidyverse), and the packages {future}, {future.apply}, {furrr}, {futurize}, {progressify}, {progressr}, {mirai}, {mori}, {mizu}, {future.mirai}, {future.mizu}, {purrr}, {tidymodels}. |
| Teaching materials | Per-session slide decks and matching lab-*.qmd documents, a course FAQ and an Rcpp case study, all on this site. |
Futureverse
Parallel computing in R from laptop to HPC
A course on parallel computing in R: the docile lapply() one-liners you already write, boosted to run on every core — of your laptop, your lab’s workstation, or a Slurm cluster — with one tweak. Built on the Futureverse ({future}, {future.apply}, {furrr}, and the 2026 {futurize} / {progressify} pair) and on the newer async / shared-memory siblings ({mirai}, {mori}, {mizu}). It runs over three 3-hour sessions, each pairing slide decks with hands-on labs in R (.qmd).
Synopsis
Prerequisites
The companion The R Statistical Language course (or equivalent base-R fluency) is assumed. Session 1 and 2 are self-contained; Session 3 adds a quick {purrr} and {tidymodels} refresh inside the deck, so prior exposure is helpful but not required.
Subjects Covered
| Slide deck | Description | Lab material |
|---|---|---|
| 1 · The Futureverse: one tweak to parallelize your R code | Why (and where) we parallelize; R’s built-in tools (mclapply(), parLapply()) and their friction; futures — future(), value(), %<-%, plan(); apply / map / foreach idioms (“they’re all the same”); {futurize} — just add a pipe; {progressify} — live progress bars; messages, warnings, errors and RNG in parallel; when parallelization does not help; non-exportable references; resource specifications; the Futureverse roadmap. |
lab 1 · lab 2 |
| 2 · mirai, mori & mizu: async and shared memory | {mirai} — minimalist async evaluation (daemons(), mirai(), m[], mirai_map()) and how it maps onto futures; the memory wall of process-based parallelism (8 workers × 200 MB = 1.6 GB of copies); {mori} — shared memory for R objects (share()); {mizu} — thread-speed shared-memory IPC; future.mirai and future.mizu backends so your future code runs everywhere. |
lab 1 |
| 3 · Parallel data science: purrr & tidymodels | Functional iteration with {purrr}; modelling workflows with {tidymodels} (fit, resample, tune); purrr::in_parallel() — built-in parallelism over {mirai}, no extra framework; tune::parallel_over — "resamples" vs "everything", and when each wins. |
lab 1 |
Learning Outcomes
By the end of this course you will be able to:
- Explain what a future is, and rewrite sequential apply / map / foreach code into parallel code with
futurize()— write once, run anywhere. - Pick the right backend with
plan()— sequential, multisession, mirai, callr, cluster, batchtools Slurm — and move your code from laptop to HPC unchanged. - Add live progress reporting with
progressify()and handle globals, RNG, messages, warnings and errors correctly in parallel code; recognise when parallelization will not help. - Describe the memory cost of process-based parallelism and mitigate it with
{mori}/{mizu}shared memory and the{mirai}async engine; run the same future code over mirai, mori and mizu backends. - Use the built-in parallelism of
{purrr}(in_parallel()) and{tidymodels}(tune::parallel_over) inside everyday data-science pipelines.
Materials
Everything you need for the labs is downloadable from this page; no need to clone a course repository.
- Session labs: see the lab column in Subjects Covered, where each lab links its
.qmdsource. - Futureverse FAQ: the full course FAQ on parallel computing, errors and marshalling, adapted from the original futureverse course.
- Hausdorff distance case study: an Rcpp + future case study on distance-matrix computation (with data and solutions).
- Shared data: the case-study data files ship with the case study page and are also listed in its Downloads section.
Bibliography
- Futureverse hub: https://www.futureverse.org · tutorial collection: https://www.futureverse.org/tutorials.html
{future}: https://future.futureverse.org ·{future.apply}: https://future.apply.futureverse.org ·{furrr}: https://furrr.futureverse.org{futurize}: https://futurize.futureverse.org ·{progressify}: https://progressify.futureverse.org ·{progressr}: https://progressr.futureverse.org{mirai}: https://mirai.r-lib.org ·{mori}: https://mori.r-lib.org ·{mizu}: https://github.com/shikokuchuo/mizu{future.mirai}: https://future.mirai.futureverse.org ·{future.mizu}: https://future.mizu.futureverse.org- Bengtsson, H. (2026), useR! 2026 tutorial: https://henrikbengtsson.github.io/futureverse-tutorial-user2026/ and COMPUTE! 2026 talk: https://henrikbengtsson.github.io/talk-compute2026-futurize/
{purrr}1.1.0 parallel announcement: https://tidyverse.org/blog/2025/07/purrr-1-1-0-parallel/- Kuhn, M. & Vaughan, D. (2020), The future of tune: https://tidyverse.org/blog/2020/11/tune-parallel/