mlr-org / mlr-org/batchtools

QUESTION: Is `resources` the only way to pass data to the templates?

Open
#30 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
R
Stars
184
Forks
53
Avg merge
7d 2h
Merged PRs (30d)
1

Description

In BatchJobs, I think argument resources (named list) of submitJobs() was the only way to pass a variable to the template, which then is also named resources. Is this the case for batchtools as well? It looks so from inspecting the code.

There are two reasons why I ask:

  1. There could be other info that one wish to send to the template that is not really "resource" related;
  • email address (I know you can set this up with the registry too)
  • other hard to predict properties of future or rare job schedulers
  • there could be other things the user with to do at the same time as the template is compiled (though too early to come up with a reasonable example now)
  1. If resources is the only one, the couldn't one just attach its field so that the template doesn't have to do resources$foo etc. each time?

Maybe what I'm fishing for is a generic args argument that is a named list (or environment) whose elements are attached to the template evaluation environment. Then it could look like this:

resources <- list(ncpus = 4, walltime = 3600, memory = 2.0)
submitJobs(reg, args = resources)

and the template could immediate access ncpus, walltime, and memory without having to use resources$ncpus etc. The downside might be that it's less clear what's an argument coming from the submitJobs() call and what comes from the internals of batchtools.

Just a thought and wondered if you already thought about this in the past.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading submitJobs(), its resources argument, and the template evaluation path described in the issue. Determine whether template data is intentionally limited to resources and assess the proposed generic args interface, including how completion would be tested and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
hpc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.