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

Add support for controlling the submission rate of jobs #14

Closed
HenrikBengtsson opened this issue Oct 31, 2017 · 2 comments
Closed

Add support for controlling the submission rate of jobs #14

HenrikBengtsson opened this issue Oct 31, 2017 · 2 comments

Comments

@HenrikBengtsson
Copy link
Collaborator

HenrikBengtsson commented Oct 31, 2017

Add support for controlling the submission rate of jobs, by exposing the sleep argument of batchtools::submitJobs() in one way or the other, e.g. plan(batchtools_slurm, sleep = 5) for 5 seconds between each job submission.

It's possible that this should/could be implemented in the Future API (futureverse/future#172) and if so, then maybe the default should be controllable via ?future.options.

Related to Issue #13.

@HenrikBengtsson
Copy link
Collaborator Author

For the record: The future.batchtools framework creates one batchtools registry per future. Because of this, there will only be a single job submitted via batchtools::submitJobs() for each future. The batchtools sleep argument does therefore not come in play when using batchtools futures; the sleep only happens when multiple jobs are submitted to batchtools::submitJobs().

So, by the current future.batchtools design, it needs to roll it's own "sleep-on-submission" mechanism.

@HenrikBengtsson
Copy link
Collaborator Author

The scheduler.latency argument for batchtools::makeClusterFunctions...() can be used to control the submission rate. For example,

plan(batchtools_sge, scheduler.latency = 10.0)

will sleep 10.0 seconds after submitting a job to the scheduler.

The scheduler.latency argument is documented in batchtools as: "Time to sleep after important interactions with the scheduler to ensure a sane state. Currently only triggered after calling submitJobs". Code inspection of batchtools::submitJobs(), confirms this behavior:

> batchtools::submitJobs
function (ids = NULL, resources = list(), sleep = NULL, reg = getDefaultRegistry()) 
{
    assertRegistry(reg, writeable = TRUE, sync = TRUE)
    ...
    Sys.sleep(reg$cluster.functions$scheduler.latency)
    runHook(reg, "post.submit")
    return(invisible(ids))
}

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

No branches or pull requests

1 participant