Skip to content

How to submit a NONMEM job to slurm with submit_slurm_job

This guide describes how to submit a NONMEM job to slurm using the submit_slurm_job function. First, make sure you have loaded slurmtools and are familiar with the needed options to use slurmtools.

Prerequisites

To use submit_slurm_job you need a few things set before hand

  1. A template file ready to be populated
  2. All files needed to run NONMEM - control stream and data
  3. bbr installed in your R environment
  4. A way of running NONMEM such as bbi or nmm

Once these are set, you’re ready to roll with your Slurm submission!

Submitting a NONMEM job

Here’s the code you’ll use to submit a job with submit_slurm_job, this uses default values for all arguments, many of which are determined via the slurmtools options discussed here.

submit_job.R
library(slurmtools)
library(bbr)
mod <- bbr::read_model(file.path("path", "to", "nonmem", "models", "1001"))
submit_slurm_job(mod)

With all prerequisites in place, running this code sends your NONMEM model to Slurm. Let’s look at what you can expect from the output.

Understanding the output

$status
[1] 0
$stdout
[1] "Submitted batch job 436"
$stderr
[1] ""
$timeout
[1] FALSE
  • $status: This shows an exit code of 0, which means everything went smoothly.
  • $stdout: Here, you’ll see a message confirming your job submission, along with the job ID (e.g., 436).
  • $stderr: If all goes well, this should be empty.
  • $timeout: A FALSE value here means there was no timeout during the submission.

Next Steps

For more advanced usage: If you’re interested in learning how to use non-default arguments with submit_slurm_job for more customized job submissions, please check out our submit_slurm_job Reference Guide