GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tlverse/delayed: :clock430: Dependent Delayed Computation

BranchesTags
Open more actions menu

Latest commit

 

History

89 Commits
89 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
R
R
 
 
docs
docs
 
 
inst
inst
 
 
man
man
 
 
tests
tests
 
 
vignettes
vignettes
 
 
.Rbuildignore
.Rbuildignore
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
CRAN-SUBMISSION
CRAN-SUBMISSION
 
 
DESCRIPTION
DESCRIPTION
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
NAMESPACE
NAMESPACE
 
 
NEWS.md
NEWS.md
 
 
README.Rmd
README.Rmd
 
 
README.html
README.html
 
 
README.md
README.md
 
 
_pkgdown.yml
_pkgdown.yml
 
 
codecov.yml
codecov.yml
 
 
cran-comments.md
cran-comments.md
 
 
delayed.Rproj
delayed.Rproj
 
 

Repository files navigation

R/delayed

R-CMD-check Coverage Status CRAN CRAN downloads CRAN total downloads Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: GPL v3

A framework for parallelizing dependent tasks

Author: Jeremy Coyle


What’s delayed?

delayed is an R package that provides a framework for parallelizing dependent tasks in an efficient manner. It brings to R a subset of the functionality implemented in Python’s Dask library. For details on how best to use delayed, please consult the package documentation and vignette online, or do so from within R.


Installation

For standard use, we recommend installing the package from CRAN via

install.packages("delayed")

Install the most recent stable release from GitHub via devtools:

devtools::install_github("tlverse/delayed")

Issues

If you encounter any bugs or have any specific feature requests, please file an issue.


Example

This minimal example shows how to use delayed to handle dependent computations via chaining of tasks:

library(delayed)
#> delayed v0.4.0: A Framework for Parallelizing Dependent Tasks

# delay a function that does a bit of math
mapfun <- function(x, y) {(x + y) / (x - y)}
delayed_mapfun <- delayed_fun(mapfun)

set.seed(14765)
library(future)
plan(multicore, workers = 2)
const <- 7

# re-define the delayed object from above
delayed_norm <- delayed(rnorm(n = const))
delayed_pois <- delayed(rpois(n = const, lambda = const))
chained_norm_pois <- delayed_mapfun(delayed_norm, delayed_pois)

# compute it using the future plan (multicore with 2 cores)
chained_norm_pois$compute(nworkers = 2, verbose = TRUE)
#> run:0 ready:2 workers:2
#> updating rnorm(n = const) from ready to running
#> run:1 ready:1 workers:2
#> updating rpois(n = const, lambda = const) from ready to running
#> run:2 ready:0 workers:2
#> updating rnorm(n = const) from running to resolved
#> updating rpois(n = const, lambda = const) from running to resolved
#> updating mapfun(x = delayed_norm, y = delayed_pois) from waiting to ready
#> run:0 ready:1 workers:2
#> updating mapfun(x = delayed_norm, y = delayed_pois) from ready to running
#> run:1 ready:0 workers:2
#> updating mapfun(x = delayed_norm, y = delayed_pois) from running to resolved
#> [1] -0.6688907 -1.2691496 -1.1808899 -1.7605806 -0.5992127 -0.6838026 -1.4086257

Remark: In the above, the delayed computation is carried out in parallel using the framework offered by the excellent future package and its associated ecosystem.


License

© 2017-2021 Jeremy R. Coyle

The contents of this repository are distributed under the GPL-3 license. See file LICENSE for details.

About

🕟 💻 Dependent Delayed Computation

tlverse.org/delayed

Topics

parallel-computingr

Resources

Readme
GPL-3.0 license

Contributing

Contributing
Activity
Custom properties

Stars

23 stars

Watchers

2 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.