MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #16978] Feature request: parallel::clusterApply: Add hook for tracking progress #6280

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

Created attachment 2111 [details] Patch to src/library/parallel

For processing in parallel a large amount of data or running parallel routines (such as simulations) that take a long time, it can be helpful to have a means of monitoring progress through the task. The attached patch to parallel::clusterApply, clusterApplyLB, and clusterMap adds a hook for an optional closure to enable external tracking of progress, such as with a txtProgressBar. The closure is called as the results from parallel workers are processed.


METADATA

MichaelChirico commented 4 years ago

Created attachment 2112 [details] Revised patch to src/library/parallel

This revised patch provides more timely progress updating when results to statistcClusterApply() come in at different times (even though users would likely be better served with the *LB versions). Also simplifies the .progress function specification (no arguments).


METADATA

INCLUDED PATCH

MichaelChirico commented 4 years ago

Created attachment 2114 [details] mc version of patch to src/library/parallel

This second patch provides an analogous implementation for mclapply.


METADATA

INCLUDED PATCH