[Rd] Progress reporting from parallel::mclapply

David Norris d@v|d @end|ng |rom prec|@|onmethod@@guru
Mon Jul 26 10:52:29 CEST 2021


The following git diff shows that just a few lines of code suffice to add useful progress reporting to mclapply:
https://github.com/dcnorris/precautionary/commit/3e561cc8bea7305a03faf000cd21da19d285842f#diff-328c889e85e15d64ac52741999d1afe338d9f299076fe4a7448625301317d887

I've done this in package https://dcnorris.github.io/precautionary/ to support the 'odometer' that you can appreciate by loading the following app:
https://precision-methodologies.shinyapps.io/EscRisk/
... and clicking the "CRM" radio button about halfway down on the left.

1. In this application, I report *absolute* progress because it's not knowable in advance what the final total will be. But the more customary type of "% complete" reporting would easily be managed by a 'progreport' function that knows the denominator in advance.
2. The 'proginit' argument is needed for my application because the initial single-threaded unrolling (to generate partial computations which the parallel workers finish) may yield some completed computations as well.

Would there be interest in discussing modifications to parallel::mclapply along these lines?

Kind regards,
David Norris





More information about the R-devel mailing list