HenrikBengtsson / future.batchtools

:rocket: R package future.batchtools: A Future API for Parallel and Distributed Processing using batchtools
https://future.batchtools.futureverse.org
84 stars 9 forks source link

Compatibility with promises package #80

Closed michaelmayer2 closed 1 year ago

michaelmayer2 commented 2 years ago

Describe the bug When used with promises package, future.batchtools complains about a missing option "background" to nbrOfWorkers() and secondly about a missing function nbrOfFreeWorkers()

Error Message Unhandled promise error: nbrOfFreeWorkers() is not implemented for this type of future backend (please contacts the maintainer of that backend): ‘FutureStrategy’, ‘tweaked’, ‘batchtools_slurm’, ‘batchtools_template’, ‘batchtools’, ‘multiprocess’, ‘future’, ‘function’

Expected behavior No error displayed

When using the attached patch against latest future.batchtools from github fixes the issue.

I am not sure if my approach of duplicating nbrOfWorkers() and renaming it to nbrOfWorkers(), additionally adding background as a dummy argument to both is sensible, at least the promises integration is working with this patch (see below).

promises-compat.diff.txt

HenrikBengtsson commented 1 year ago

Thanks for this, and sorry for the long delay. I think I finally got nbrOfFreeWorkers() implemented (Issue #67). It's available in the develop branch.

HenrikBengtsson commented 1 year ago

future.batchtools 0.11.0 fixing this is now on CRAN.