Comments (4)
Thanks for explaining, Henrik. targets
is already capable of temporary plans, and I have updated the docs to encourage that kind of usage.
From my perspective as a user, it seemed safer to supply resources to the future
instead of the plan because temporary plans seem difficult in the general case: for example, if temporarily switching to a different plan automatically shuts down the PSOCK cluster in the original plan. targets
currently relies on future::plan(.cleanup = FALSE)
, which as you explained earlier, is not really officially supported either.
But I do understand the need for a consistent interface with appropriate semantic guardrails.
from future.batchtools.
Downgrading to future
version 1.21.0 appears to have fixed the issue on my end. So could this have to do with the recent release of version 1.22.1 on August 25? Apologies for posting the issue in the wrong place.
from future.batchtools.
Thanks @wlandau - I can confirm the behavior and that downgrading to future
1.21.0 fixes this in our environment.
from future.batchtools.
Hi, this actually never meant to work, because resources
is not an argument that is part of the Future API, and more specifically future()
. It was just a side effect of ...
arguments being passed down to the underlying future backend constructor (here batchtools_sge
). The reason it is not meant to work is that it breaks the core philosophy that future code should not make assumptions about what backend is being used.
You can argue that being able to specify "resources" should be part of the Future API. There is indeed a plan to work on this, cf. https://www.futureverse.org/roadmap.html. With such an API, it would make sense for a developer to specify certain "resources" that is requires in order to resolve a future.
A somewhat hacky workaround would be to do something like the following in targets;
the_plan <- plan("list")
strategy <- the_plan[[1]]
if (inherits(strategy, "batchtools_template")) {
strategy <- tweak(strategy, resources = resources)
the_plan[[1]] <- strategy
old_plan <- plan(the_plan)
on.exit(plan(old_plan), add = TRUE)
}
This also highlight my point above. Imagine there's another HPC backend that names the corresponding argument, say, needs
. Then you would have to add conditional code for that as well. More importantly, if the developer would use future(..., resources = ...)
their code would not run as expected with this new backend. So, resources
is not part of the Future API (yet).
PS. We have the related problem that batchtools don't have a strict definition of what resources
should hold. So, it is really up to the person writing the template file to define what it should contain. It could be different between different HPC templates, which would again cause the code to be hard-coded for a specific backend. The goal to add support for "resource specifications" to the Future API is to at least identify a core set of well-defined specs (and syntax for it).
from future.batchtools.
Related Issues (20)
- huge results file with 'conditions' - performance bottleneck HOT 4
- use batchtools directly for scheduling
- Eqw on SGE cluster while R code finishes without error
- Simple chunking with nested parallelism HOT 1
- Slurm readLog() Error - Option to change fs.latency & scheduler.latency from batchtools_slurm or future::tweak HOT 10
- Proposed bugfix for batchtools reveals bug in future.batchtools? HOT 4
- problem with running example parallel futures using batchtools_lsf
- Add batchtools template for SGE
- batchtools templates: `resources[["asis"]]` for as-is declarations HOT 1
- print() for BatchtoolsFuture should report on the template file used HOT 1
- Compatibility with promises package HOT 2
- TESTS: Error: identical(Sys.getenv(), oenvs0) is not TRUE on MS Windows CRAN HOT 1
- run(), resolved()[?], and result(): the RNG state is updated - from where? HOT 3
- Add support for plan(batchtools_multicore, workers = I(1))
- All batchtools_nnn() functions should return the future invisibly
- Template tools: add option to ShellCheck rendered template
- Template tools: export functions to find and render template
- PERFORMANCE: status() to memoize "finalized" state? HOT 2
- Error: Log file for job with id 1 not available HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from future.batchtools.