mschubert / clustermq

R package to send function calls as jobs on LSF, SGE, Slurm, PBS/Torque, or each via SSH
https://mschubert.github.io/clustermq/
Apache License 2.0
146 stars 27 forks source link

Newbie question: timeout flag #209

Closed rimorob closed 3 years ago

rimorob commented 3 years ago

This is probably a user error, but I can't get my script to run with the timeout flag. I set up: register_dopar_cmq(n_jobs=self$nCores, memory=1024, fail_on_error=FALSE, timeout=Self$walltime) And the template says:

SBATCH --time={{ timeout }}

And then I get this error: Error in fill_template(private$template, opts, required = c("master", : Template values required but not provided: timeout In addition: There were 50 or more warnings (use warnings() to see the first 50)

What am I doing wrong?

mschubert commented 3 years ago

It seems you created a custom template with a {{ timeout }} field that does not have a default value.

So, in order to be able to submit the job we need to fill this field. However, the timeout parameter to Q does something different (it is the time when we will assume a worker to be dead if we haven't heard from it) and it is not passed to your template.

So to solve this, you can pass it as a template argument:

Q(..., template=list(timeout=...))
register_dopar_cmq(..., template=list(timeout=...))
rimorob commented 3 years ago

That was it, thanks!