A Simplified Interface for Running Commands on Parallel Processes

Provides a function that wraps mcparallel() and mccollect() from 'parallel' with temporary variables and a task handler. Wrapped in this way the results of an mcparallel() call can be returned to the R session when the fork is complete without explicitly issuing a specific mccollect() to retrieve the value. Outside of top-level tasks, multiple mcparallel() jobs can be retrieved with a single call to mcparallelDoCheck().


A Simplified Interface for Running Commands on Parallel Processes.

mcparallelDo wraps mcparallel() and mccollect() from 'parallel' with temporary variables and a task handler. Wrapped in this way the results of an mcparallel() call can be returned to the R session when the fork is complete without explicitly issuing a specific mccollect() to retrieve the value. Outside of top-level tasks, multiple mcparallel() jobs can be retrieved with a single call to mcparallelDoCheck(). A warning, like a regular fork these functions do not currently return warnings, only errors.

NOTE: Given that Windows does not support parallalism through forks, the R base functions mcparallel and mccollect do not work. Therefore, although mcparallelDo will work on windows and pass through commands to be evaluated, it has no meaningful effect on Windows.

NOTE2: The package future appears to contain much of the functionality of mcparallelDo and more. Consider using it before using package:mcparallelDo if all you want to do is defer the execution of code. If you want an automatic notification when the code you are running is complete, then consider using package:mcparallelDo.

Purpose

In an interactive session one may be blocked in performing additional work by waiting for a model fit. It is cumbersome to launch an mcparallel fork to perform the work and the manually collect the result via mccollect. Specfically, one is left uncertain about when the work might be completed, requiring either some blocking due to the use of wait = TRUE or some inconvience by repeatedly running mccollect every now and again to see if the computation has finished.

Dependencies

  • parallel (for forking functions)
  • R.utils (for temporary variables)
  • checkmate (for argument checking)
  • R6 (for the management object that keeps track of jobs)

Getting Started

The package should install from source like any other R package.

Status

The package works well, is used in production, and has been on CRAN continuously since 2015-12-09. All issues related to desirable additional functionality. Pull requests, bug reports, and other contributions are welcome.

Author

Russell S. Pierce

License

GPL (>= 2)

News

mcparallelDo 1.1.0

  • Package now has the %mcpDo% assignment operator for improved flow when writing async code.
  • Added a NEWS.md file to track changes to the package.
  • Package now uses Checkmate for argument checking. Thanks to Benjamin Nutter for the commit that swapped the dependency.
  • Added covr based code coverage
  • Added URL and BugReporting URL

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mcparallelDo")

1.1.0 by Russell S. Pierce, 3 years ago


https://github.com/drknexus/mcparallelDo


Report a bug at https://github.com/drknexus/mcparallelDo/issues


Browse source code at https://github.com/cran/mcparallelDo


Authors: Russell S. Pierce


Documentation:   PDF Manual  


GPL-2 license


Imports parallel, R.utils, checkmate, R6

Suggests testthat, covr


See at CRAN