Dynamic Parallelization of R Functions

R offers several extension packages that allow it to perform parallel computations. These operate on fixed points in the program flow and make it difficult to deal with nested parallelism and to organize parallelism in complex computations in general. In this article we discuss, first, of how to detect parallelism in functions, and second, how to minimize user intervention in that process. We present a solution that requires minimal code changes and enables to flexibly and dynamically choose the degree of parallelization in the resulting computation. An implementation is provided by the R package parallelize.dynamic and practical issues are discussed with the help of examples.

Stefan Böhringer

CRAN packages used

Rsge, foreach, boot, snow, parallelize.dynamic

CRAN Task Views implied by cited packages

HighPerformanceComputing, Econometrics, Optimization, SocialSciences, Survival, TimeSeries


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Böhringer, "The R Journal: Dynamic Parallelization of R Functions", The R Journal, 2013

BibTeX citation

  author = {Böhringer, Stefan},
  title = {The R Journal: Dynamic Parallelization of R Functions},
  journal = {The R Journal},
  year = {2013},
  note = {https://doi.org/10.32614/RJ-2013-029},
  doi = {10.32614/RJ-2013-029},
  volume = {5},
  issue = {2},
  issn = {2073-4859},
  pages = {88-96}