doParabar

An `R` package that provides a `foreach` parallel adaptor for `parabar` backends.

https://github.com/mihaiconstantin/doparabar

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary

Keywords

foreach parallel-computing r
Last synced: 6 months ago · JSON representation

Repository

An `R` package that provides a `foreach` parallel adaptor for `parabar` backends.

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 3
Topics
foreach parallel-computing r
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

parabar logo

Parallel Adaptor
foreach 🔌 parabar

Repository status GitHub version CRAN version CRAN RStudio mirror downloads R-CMD-check CRAN checks Documentation website

The doParabar package acts as a foreach parallel adaptor for parabar backends. It provides a minimal implementation for the foreach::%dopar% operator, enabling seamless integration of the parabar package with the foreach package.

Installation

You can install doParabar directly from CRAN using the following command:

```r

Install the package from CRAN.

install.packages("doParabar") ```

Alternatively, you can also install the latest development version from GitHub via:

```r

Install the package from GitHub.

remotes::install_github("mihaiconstantin/doParabar") ```

Then, load the package as usual using the library function:

```r

Load the package.

library(doParabar) ```

Note. By default, and for various reasons, the doParabar package does not automatically load other packages. Instead, it is recommended to load the foreach and parabar packages explicitly in your scripts (i.e., or add them to your Imports in the DESCRIPTION file when developing an R package).

```r

Load the foreach package.

library(foreach)

Load the parabar package.

library(parabar) ```

Note. Should you need to suppress the package startup messages (e.g., from the parabar package) you can use the suppressPackageStartupMessages function (e.g., suppressPackageStartupMessages(parabar)).

Usage

Below you can find a minimal example of how to use doParabar and parabar packages in your R scripts. All examples below assume that you have already installed and loaded the packages.

Tip. For a more detailed discussion see the vignette "Using parabar with foreach".

```r

Create an asynchronous parabar backend.

backend <- startbackend(cores = 2, clustertype = "psock", backend_type = "async")

Register the backend with the foreach package for the %dopar% operator.

registerDoParabar(backend)

Get the parallel backend name.

getDoParName()

Check that the parallel backend has been registered.

getDoParRegistered()

Get the current version of backend registration.

getDoParVersion()

Get the number of cores used by the backend.

getDoParWorkers()

Define some variables strangers to the backend.

x <- 10 y <- 100 z <- "Not to be exported."

Used the registered backend to run a task in parallel via foreach.

results <- foreach(i = 1:300, .export = c("x", "y"), .combine = c) %dopar% { # Sleep a bit. Sys.sleep(0.01)

# Compute and return.
i + x + y

}

Show a few results.

head(results, n = 10) tail(results, n = 10)

Verify that the variable z was not exported.

try(evaluate(backend, z))

To make packages available on the backend, see the .packages argument.

Stop the backend.

stop_backend(backend) ```

Note. The doParabar package provides only a minimal implementation for the foreach::%dopar% operator. If you need additional functionality, please consider contributing to the package, or opening an issue on GitHub.

Contributing

  • Any contributions are welcome and greatly appreciated. Please open a pull request on GitHub.
  • To report bugs, or request new features, please open an issue on GitHub.

License

Owner

  • Name: Mihai Constantin
  • Login: mihaiconstantin
  • Kind: user
  • Location: Tilburg
  • Company: Tilburg University

PhD at Tilburg University. Passionate about R and statistical computing. Working on sample size planning for social sciences. Enjoying software design & squash.

GitHub Events

Total
  • Release event: 3
  • Watch event: 2
  • Delete event: 4
  • Push event: 13
  • Pull request event: 11
  • Create event: 11
Last Year
  • Release event: 3
  • Watch event: 2
  • Delete event: 4
  • Push event: 13
  • Pull request event: 11
  • Create event: 11

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 69
  • Total Committers: 1
  • Avg Commits per committer: 69.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 69
  • Committers: 1
  • Avg Commits per committer: 69.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
mihaiconstantin m****i@m****m 69
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • mihaiconstantin (11)
Top Labels
Issue Labels
Pull Request Labels
documentation (6) enhancement (3)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 208 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: doParabar

'foreach' Parallel Adapter for 'parabar' Backends

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 208 Last month
Rankings
Dependent packages count: 27.5%
Dependent repos count: 33.9%
Average: 49.5%
Downloads: 87.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • foreach * imports
  • iterators * imports
  • parabar * imports
  • testthat >= 3.0.0 suggests