-
Notifications
You must be signed in to change notification settings - Fork 0
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
Resources: syntax #1
Comments
Flags:
Filesystem:
Networking:
Needs:
Consumables:
Genetic consumables (GREs):
Preferables:
|
> foo <- function(resources) resources
> res <- foo(resources= ~ gpu && !fork && r >= 3.2 && file("foo.txt") && ram <= 32*GiB && time <= 00:30:25 && scratch <= 256*GiB && matlab && capabilities == (jpeg || png) && profmem)
> res
~gpu && !fork && r >= 3.2 && file("foo.txt") && ram <= 32 * GiB &&
time <= 0:30:25 && scratch <= 256 * GiB && matlab && capabilities ==
(jpeg || png) && profmem Or maybe: > res <- foo(resources= ~ isTRUE({ getRversion() >= "3.2" && file_test("-f", "Makefile") && any(capabilities(c("jpeg", "png"))) && capabilities("profmem") }))
> res
~isTRUE({
getRversion() >= "3.2" && file_test("-f", "Makefile") &&
any(capabilities(c("jpeg", "png"))) && capabilities("profmem")
}) OTH, that requires R to evaluate, which means we need to launch R in order know if the resources are met, but can't always do that before the future is assigned to a worker, e.g. a HPC scheduler or a remote machine. |
There are different types of "resources":
Syntax ideas:
|
resources= ~ gpu && !fork && r >= 3.2 && file("foo.txt") && ram <= 32*GiB && time <= 00:30:25 && scratch <= 256*GiB && matlab && capabilities == (jpeg || png) && profmem
resources= ~ gpu() && !fork() && r >= 3.2 && file("foo.txt") && ram(32*GiB) && time(00:30:25) && scratch(256*GiB) && matlab && capabilities(jpeg || png) && profmem() gpu(nvidia, ram(64*GiB))
os(windows, version(10))
packages(MASS >= 3.2, future)
hello <- function() {
model <- y ~ x + 1
message("Hello world!")
invisible(model)
} passes with all OK, cf. https://github.com/HenrikBengtsson/teeny/blob/R_CMD_check/formula/R/hello.R. |
Are all resources static? Or can a machine have a resource that comes and goes? I guess it could, e.g. a GPU might come and go based on other processes using it |
RNG:
|
How to support the different cases of
globals
:The text was updated successfully, but these errors were encountered: