-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration to batchtools #64
Comments
A pull request would be great incentive for this, yes. |
Based on the existence of future.batchtools, I suggest it might be better to write a backend for future and get batchtools support for free. The downside is that such a solution might not support the more advanced features of batchtools, so it depends on what batchtools features BiocParallel needs. |
Actually, I just noticed that @HenrikBengtsson appears to have already done so: https://github.com/HenrikBengtsson/BiocParallel.FutureParam. So maybe BiocParallel already supports batchtools through the future package. |
@DarwinAwardWinner Nice! I hadn't seen that library previously. Rather new, but looks promising. I still think it would be useful to integrate such functionality directly into BiocParallel rather than having an additional dependency. |
I don't have time to migrate this myself in the next 2-3 month, but I could export functions and complement missing helpers in |
I'm willing to contribute the code of BiocParallel.FutureParam to the BiocParallel package. That way BiocParallel would support all backends that implement the Future API, including future.batchtools (and hence batchtools). All the end user would do is BTW, in lieu of FutureParam, a working solution to utilize (future.)batchtools in BiocParallel is to go via doFuture and DoParParam, e.g. library("BiocParallel")
register(DoparParam(), default = TRUE)
doFuture::registerDoFuture()
library("future.batchtools")
plan(batchtools_local)
y <- bplapply(X = 1:3, FUN = function(x) list(x = x, pid = Sys.getpid()))
str(y)
## List of 3
## $ :List of 2
## ..$ x : int 1
## ..$ pid: int 26553
## $ :List of 2
## ..$ x : int 2
## ..$ pid: int 26554
## $ :List of 2
## ..$ x : int 3
## ..$ pid: int 26555 PS. This solution illustrates the goal of the future package; to bridge parallel frontends with parallel backends by providing a backend Future API that parallel backends implement and a frontend Future API that higher-level APIs implement. |
I guess the question is, is there any special functionality provided by batchtools that BiocParallel needs/wants to access and which is not exposed through the Future API? If not, then I would consider this pretty much solved. |
It seemed like the future api was also committing to a particular programming style (of unevaluated expressions)? |
There's f <- future({ expr }) and f <- futureCall(FUN, args) Is that what you're looking for, or did you mean something else? The other two key components of the frontend Future API are resolved(f) to check if future is resolved or not, and v <- value(f) to collect the value (or signal error if it occurred). The idea is that those are the building blocks for higher level needs. There's also Certain features such as stopping ("killing") futures are not part of the frontend Future API. This might be added in the future, cf. futureverse/future#93 (long story). UPDATE 2017-11-16: The civis package implements a CivisFuture for their services and added their own |
Coming back to this one. Not sure if my most recent reply helped or caused confusion. From the end user's point of view, futures just provide another backend that the user can register for BiocParallel, i.e. For the actual internals of the FutureParam backend, there are a few alternatives, but my existing working proposal shows how it can be done. There might be features in BiocParallel that I'm not aware of and that's missing, but the package tests against the existing BiocParallel API that I'm aware of. Let me know if you want me to do a PR of what I've got. |
Hi, There is now a Please take a look. Best, Nitesh |
Are there any plans to migrate away from BatchJobs to its successor, batchtools?
If not, would a contributed PR be accepted? For instance, one could write a
BatchToolsParam
class paralleling theBatchJobsParam
one, and then eventually mark theBatchJobsParam
as deprecated (e.g., throws a warning when using) once theBatchToolsParam
has been verified to be stable across different platforms.The text was updated successfully, but these errors were encountered: