Skip to content
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

batchtools templates: resources[["asis"]] for as-is declarations #78

Open
HenrikBengtsson opened this issue Jan 7, 2022 · 1 comment

Comments

@HenrikBengtsson
Copy link
Collaborator

Issue

There is no standard for how batchtools resources are used in the batchtools templates. This means that we all have slightly different templates and ways to declare the resources argument.

Suggestion

I'd like to suggest that we could reserve resources[["asis"]] to mean "use these strings as-is CLI options/declaration for the scheduler". This would work the same for all templates and would allow the user to pass arbitrary options to the scheduler (via declaration comments).

For example,

asis <- c("-pe smp 2", "-R yes")
plan(batchtools_sge, resources = list(asis = asis, mem_free="1G"))

should be result in the following SGE declarations in the template:

#$ -pe smp 2
#$ -R yes
#$ -l mem_free=1G
@HenrikBengtsson
Copy link
Collaborator Author

Maybe "as-is" resource specifications should be even more verbatim, e.g.

asis <- c("#$ -pe smp 2", "#$ -R yes")
resources <- list(asis = asis, mem_free="1G")
plan(batchtools_sge, resources = resources)

Internally, it can be pre-pasted using:

resources[["asis"]] <- paste(c(resources[["asis"]], ""), collapse = "\n")

so it can be used in the templates as:

<%= resources[["as-is"]] %>

to be rendered as:

#$ -pe smp 2
#$ -R yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant