### Install slurmtools with pak
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/getting_started.mdx
Installs the slurmtools package from a GitHub repository using the pak package manager in R.
```r
#install.packages("pak")
pak::pkg_install("a2-ai/slurmtools")
```
--------------------------------
### Load slurmtools library
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/getting_started.mdx
Loads the slurmtools library into the current R session, making its functions available for use.
```r
library(slurmtools)
```
--------------------------------
### slurmtools: Needed Options Status
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/getting_started.mdx
Displays the status of essential slurmtools configuration options, highlighting which ones are not set and are needed for default job submission behavior.
```r
── Needed slurmtools options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
```
--------------------------------
### Get Slurm Partitions
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/intro.mdx
Wrapper for the 'sinfo' command to list available Slurm partitions. Provides information about the cluster's resource allocation groups.
```Python
def get_slurm_partitions(**kwargs):
"""Gets a list of available Slurm partitions using sinfo.
Args:
**kwargs: Additional arguments to pass to sinfo.
Returns:
list: A list of partition information.
"""
# Implementation details would go here, calling sinfo command
pass
```
--------------------------------
### Example Filled nmm Slurm Job (bash)
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/nmm_template.mdx
This example shows a filled-in version of the nmm Slurm job template after variables have been injected by the submit_slurm_job function. It demonstrates how placeholders like {{ nmm_binary }} and {{ nonmem_config_toml }} are replaced with actual values, resulting in an executable bash script.
```bash
#!/bin/bash
#SBATCH --job-name=nonmem_job
#SBATCH --output=nonmem_job.out
#SBATCH --error=nonmem_job.err
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
/usr/local/bin/nmm --config /home/user/models/model1/config.toml
```
--------------------------------
### Get Slurm Jobs
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/intro.mdx
Wrapper for the 'squeue' command to retrieve a summary of running Slurm jobs. Provides an overview of active jobs in the cluster.
```Python
def get_slurm_jobs(**kwargs):
"""Gets a summary of running Slurm jobs using squeue.
Args:
**kwargs: Additional arguments to pass to squeue.
Returns:
list: A list of job summaries.
"""
# Implementation details would go here, calling squeue command
pass
```
--------------------------------
### Generated nmm configuration file
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/using_alerter_with_nmm.mdx
An example TOML configuration file for nmm, specifying the model details, directories, and alerter settings to send notifications via ntfy.sh.
```toml
model_number = '1001'
watched_dir = '/cluster-data/user-homes/user/slurmtools/model/nonmem'
output_dir = '/cluster-data/user-homes/user/slurmtools/model/nonmem/in_progress'
[alerter]
alerter = '/usr/bin/curl'
command = 'ntfy.sh/NONMEMmonitor'
message_flag = 'd'
```
--------------------------------
### Submit Slurm Job
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/intro.mdx
Wrapper for the 'sbatch' command to easily submit Slurm jobs. Allows customization of job submissions through flexible template files, adapting to specific research workflows.
```Python
def submit_slurm_job(script_path, **kwargs):
"""Submits a Slurm job using sbatch.
Args:
script_path (str): Path to the Slurm submission script.
**kwargs: Additional arguments to pass to sbatch.
Returns:
str: The job ID or submission output.
"""
# Implementation details would go here, calling sbatch command
pass
```
--------------------------------
### Generate NONMEM Monitor Config
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/intro.mdx
A helper function to assist in setting up 'nmm', a monitor tool for NONMEM. This function simplifies the configuration process for nmm.
```Python
def generate_nmm_config(**kwargs):
"""Generates configuration for the NONMEM monitor (nmm).
Args:
**kwargs: Configuration parameters for nmm setup.
Returns:
None: Or relevant output indicating success/failure.
"""
# Implementation details would go here for nmm config generation
pass
```
--------------------------------
### R: Passing Options to Slurm Templates
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Demonstrates passing additional options to a Slurm template file using the `slurm_template_opts` argument in R. This example sets an email address for notifications, which will replace `{{email}}` in the template.
```r
slurm_template_opts = list(email = "matthews@a2-ai.com")
```
--------------------------------
### Example Filled Bash Script for Slurm Job
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/simple_template_file.mdx
This bash script demonstrates a filled-in template file after the `submit_slurm_job` function has processed it. Variables like `parallel` are replaced with actual values, and conditional blocks (`{{#parallel}}...{{/parallel}}`) are resolved based on the provided options.
```bash
#!/bin/bash
#SBATCH --job-name=nonmem_job
#SBATCH --output=nonmem_job.out
#SBATCH --error=nonmem_job.err
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem=4G
echo "Running in serial mode"
# Add serial specific commands here
echo "Job finished."
```
--------------------------------
### Submit NONMEM Job with submit_slurm_job
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/submit_slurm_job.mdx
Demonstrates submitting a NONMEM job to Slurm using the `submit_slurm_job` function. It utilizes default arguments and requires specific prerequisites like a template file and NONMEM setup. The actual code is imported from an external file.
```r
submit_slurm_job()
# Example with specific arguments:
# submit_slurm_job(
# job_name = "my_nonmem_job",
# template_file = "path/to/your/template.R",
# output_dir = "path/to/output"
# )
```
--------------------------------
### 1001.toml
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/generate_nmm_config.mdx
Example TOML configuration file generated by `generate_nmm_config`. It specifies the model number, the directory to watch for new models, and the output directory for processed files.
```toml
model_number = "1001"
watched_dir = "/cluster-data/user-homes/user/slurmtools/model/nonmem"
output_dir = "/cluster-data/user-homes/user/slurmtools/model/nonmem/in_progress"
```
--------------------------------
### submit_job.R - ncpu Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Illustrates using the ncpu argument to specify the number of CPU cores for a SLURM job. The value should not exceed the available cores in the selected partition. An example of an error case and suggested partitions is also provided.
```r
```
--------------------------------
### Slurm Job Template with ntfy.sh Notifications
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/simple_notifications.mdx
This Slurm job template file demonstrates how to incorporate ntfy.sh notifications. It uses curl commands to send messages to a specified ntfy.sh topic when the job starts and upon its completion, providing status updates.
```bash
#!/bin/bash
#SBATCH --job-name=my-slurm-job
#SBATCH --output=my-slurm-job.out
#SBATCH --error=my-slurm-job.err
#SBATCH --time=00:10:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
# Replace with your actual ntfy.sh topic and server
NTFY_TOPIC="mytopic"
NTFY_SERVER="ntfy.sh"
# Notify when job starts
curl -d "Slurm job ${SLURM_JOB_ID} is starting." ${NTFY_SERVER}/${NTFY_TOPIC}
# Your actual job commands go here
echo "Running Slurm job ${SLURM_JOB_ID}..."
sleep 60
# Notify when job finishes
curl -d "Slurm job ${SLURM_JOB_ID} has finished." ${NTFY_SERVER}/${NTFY_TOPIC}
```
--------------------------------
### Cancel Slurm Job
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/intro.mdx
Wrapper for the 'scancel' command to cancel a specific Slurm job. Allows users to terminate jobs that are no longer needed.
```Python
def cancel_slurm_job(job_id, **kwargs):
"""Cancels a Slurm job using scancel.
Args:
job_id (int or str): The ID of the job to cancel.
**kwargs: Additional arguments to pass to scancel.
Returns:
str: The output from the scancel command.
"""
# Implementation details would go here, calling scancel command
pass
```
--------------------------------
### nmm template configuration
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/using_alerter_with_nmm.mdx
This is a template file for nmm configuration, demonstrating the structure and placeholders for job monitoring settings.
```bash
model_number = '{{model_number}}'
watched_dir = '{{watched_dir}}'
output_dir = '{{output_dir}}'
[alerter]
alerter = '{{alerter}}'
command = '{{command}}'
message_flag = '{{message_flag}}'
```
--------------------------------
### View Slurm Partitions (R)
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/get_slurm_partitions.mdx
Demonstrates how to view available Slurm partitions using the `get_slurm_partitions` function in R. This function queries the Slurm system to list all accessible partitions.
```r
get_slurm_partitions()
```
--------------------------------
### Project Development Commands
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/README.md
Common npm commands used for developing and managing the slurmtools documentation site. These commands are executed from the project's root directory.
```bash
npm install
Installs dependencies
npm run dev
Starts local dev server at localhost:4321
npm run build
Build your production site to ./dist/
npm run preview
Preview your build locally, before deploying
```
--------------------------------
### Simple Bash Template File for Slurm Jobs
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/simple_template_file.mdx
This bash template file is used with the slurmtools package to define Slurm job configurations. It utilizes the Mustache templating standard for variable injection, allowing dynamic customization of job parameters when submitted via the `submit_slurm_job` function.
```bash
#!/bin/bash
#SBATCH --job-name=nonmem_job
#SBATCH --output=nonmem_job.out
#SBATCH --error=nonmem_job.err
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem=4G
{{#parallel}}
echo "Running in parallel mode"
# Add parallel specific commands here
{{/parallel}}
{{^parallel}}
echo "Running in serial mode"
# Add serial specific commands here
{{/parallel}}
echo "Job finished."
```
--------------------------------
### submit_job.R - submission_root Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Illustrates using the submission_root argument to define the directory for tracking submission scripts and output files. If the directory does not exist, submit_slurm_job will create it.
```r
```
--------------------------------
### Configure files_to_track argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'files_to_track' argument defines which NONMEM output files the system should monitor for changes. The default is NULL, which tracks '.ext', '.lst', and '.grd' files. Users can specify any NONMEM output file extension to be tracked.
```R
files_to_track = c(".ext", ".lst", ".grd")
```
--------------------------------
### Create nmm Slurm Job Template (bash)
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/nmm_template.mdx
This is a basic template file for submitting NONMEM jobs using the nmm tool on Slurm. It uses the whisker package for templating, allowing variables like {{ nmm_binary }} and {{ nonmem_config_toml }} to be dynamically filled. The template is designed to be processed by the submit_slurm_job function.
```tmpl
#!/bin/bash
#SBATCH --job-name=nonmem_job
#SBATCH --output=nonmem_job.out
#SBATCH --error=nonmem_job.err
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
{{ nmm_binary }} --config {{ nonmem_config_toml }}
```
--------------------------------
### Slurmtools R Package Functions
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/README.md
Overview of core R functions provided by the slurmtools package for interacting with SLURM. These functions act as wrappers for underlying SLURM commands.
```R
submit_slurm_job: Wrapper for sbatch to submit jobs.
get_slurm_jobs: Wrapper for squeue to get job status.
cancel_slurm_job: Wrapper for scancel to cancel jobs.
get_slurm_partitions: Wrapper for sinfo to list partitions.
```
--------------------------------
### Configure alerter_opts for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'alerter_opts' argument accepts a named list to configure external alerting mechanisms. It allows specifying the alerter binary, command, message flag, whether to use stdout, and additional arguments for the alerter. This enables custom notifications for model completion or failures.
```R
alerter_opts = list(
alerter = "path/to/alerter/binary",
command = "notify_command",
message_flag = "s",
use_stdout = TRUE,
args = list(
email = "your_email@example.com",
config = "path/to/alerter/config.file"
)
)
```
--------------------------------
### submit_job.R - bbi_config_path Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Shows how to specify the path to a bbi config file (bbi.yaml) using the bbi_config_path argument. This is relevant when using the bbi tool for submitting NONMEM jobs.
```r
```
--------------------------------
### submit_job.R - dry_run Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Explains the dry_run argument for submit_slurm_job. When set to TRUE, it previews the submission template script without executing the sbatch command, useful for debugging or verification.
```r
```
--------------------------------
### Generate nmm config with alerter
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/using_alerter_with_nmm.mdx
An R script function to generate the nmm configuration file, including settings for an alerter to send notifications. It takes parameters for model details and alerter specifics.
```r
generate_nmm <- function(model_number, watched_dir, output_dir, alerter, command, message_flag) {
config <- list(
model_number = model_number,
watched_dir = watched_dir,
output_dir = output_dir,
alerter = list(
alerter = alerter,
command = command,
message_flag = message_flag
)
)
# Convert to TOML format (simplified for example)
# In a real scenario, you'd use a TOML library
toml_string <- sprintf("model_number = '%s'\nwatched_dir = '%s'\noutput_dir = '%s'\n\n[alerter]\nalerter = '%s'\ncommand = '%s'\nmessage_flag = '%s'",
config$model_number,
config$watched_dir,
config$output_dir,
config$alerter$alerter,
config$alerter$command,
config$alerter$message_flag)
writeLines(toml_string, paste0(model_number, ".toml"))
print(paste0("Generated config file: ", model_number, ".toml"))
}
# Example usage:
generate_nmm(
model_number = '1001',
watched_dir = '/cluster-data/user-homes/user/slurmtools/model/nonmem',
output_dir = '/cluster-data/user-homes/user/slurmtools/model/nonmem/in_progress',
alerter = '/usr/bin/curl',
command = 'ntfy.sh/NONMEMmonitor',
message_flag = 'd'
)
```
--------------------------------
### Configure level argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'level' argument controls the logging verbosity for 'nmm'. Accepted values include 'Trace', 'Debug', 'Info', 'Warn', and 'Fatal', with 'Info' being the default. This parameter helps manage the amount of diagnostic information generated.
```R
level = "Debug"
```
--------------------------------
### Configure output_dir argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'output_dir' argument determines where 'nmm' will save log files and any generated output files. By default, it saves to 'here::here()/model/nonmem/in_progress'. This path can be customized to manage output storage effectively.
```R
output_dir = file.path(watched_dir, "in_progress")
```
--------------------------------
### Configure bbi_config_path argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'bbi_config_path' argument points to the location of the bbi configuration file. The default path is 'model/nonmem/bbi.yaml', but it can also be set via R options using 'options("slurmtools.bbi_config_path")'. This file is essential for Bayesian Bioequivalence (BBI) related configurations.
```R
bbi_config_path = file.path("model", "nonmem", "bbi.yaml")
```
--------------------------------
### Configure watched_dir argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'watched_dir' argument specifies the directory where 'nmm' will look for model output folders to monitor NONMEM output files. The default path is relative to the project root, specifically 'model/nonmem/'. This setting is tailored for internal A2-Ai directory structures.
```R
watched_dir = file.path("model", "nonmem")
```
--------------------------------
### submit_job.R - slurm_job_template_path Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Demonstrates how to specify a custom path for the SLURM job template file using the slurm_job_template_path argument in submit_slurm_job. This allows for using alternative template configurations.
```r
```
--------------------------------
### generate_nmm_config.R
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/generate_nmm_config.mdx
R code to generate a `config.toml` file for NONMEM monitor using the `generate_nmm_config` function. It takes arguments like `model_number`, `watched_dir`, and `output_dir`.
```r
library(nmm)
# Generate a config.toml file
generate_nmm_config(
model_number = "1001",
watched_dir = "/cluster-data/user-homes/user/slurmtools/model/nonmem",
output_dir = "/cluster-data/user-homes/user/slurmtools/model/nonmem/in_progress"
)
```
--------------------------------
### Configure tmp_dir argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'tmp_dir' argument is reserved for future use within the 'nmm' functionality. Currently, it is not actively utilized by the system. Its intended purpose relates to temporary directory management for model operations.
```R
tmp_dir = "/path/to/temp/directory"
```
--------------------------------
### submit_job.R - Partition Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Demonstrates how to specify a higher memory partition for SLURM jobs when using the submit_slurm_job function. This is useful for models requiring more memory than the default partition provides.
```r
```
--------------------------------
### R Script to Submit Slurm Job with ntfy.sh Notifications
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/blogs/simple_notifications.mdx
This R script utilizes the submit_slurm_job function to run a Slurm job with ntfy.sh notifications. It configures the job by passing the ntfy.sh topic and server details through the slurm_template_opts argument, which are then used within the job's template file.
```r
library(slurmjobs)
# Define ntfy.sh parameters
my_ntfy_topic <- "mytopic"
my_ntfy_server <- "ntfy.sh"
# Define Slurm job template options
slurm_opts <- list(
slurm_template_opts = list(
ntfy_topic = my_ntfy_topic,
ntfy_server = my_ntfy_server
)
)
# Submit the Slurm job using the template and options
submit_slurm_job(
script = "/path/to/your/slurm-job.tmpl", # Path to the template file
name = "ntfy-job",
cpus_per_task = 1,
memory = "2GB",
time = "00:10:00",
opts = slurm_opts
)
```
--------------------------------
### Configure threads argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'threads' argument specifies the number of CPU cores to allocate for model execution. Setting this value greater than 1 enables parallel processing, potentially speeding up computations.
```R
threads = 4
```
--------------------------------
### View all slurm jobs
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/get_slurm_jobs.mdx
This code snippet retrieves all currently running slurm jobs. It returns a tibble where each row represents a job with detailed information.
```r
library(slurmjobs)
# View all jobs
view_jobs <- get_slurm_jobs()
print(view_jobs)
```
--------------------------------
### Configure model_number argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'model_number' argument specifies the model number as a string. If set to NULL (the default), this information is inferred from the '.mod' argument. This parameter is crucial for organizing and identifying specific model runs.
```R
model_number = "12345"
```
--------------------------------
### NONMEM Job Submission Output Structure
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/submit_slurm_job.mdx
Illustrates the typical output structure returned by the `submit_slurm_job` function after a successful submission. It includes status, standard output, standard error, and timeout information.
```r
$status
[1] 0
$stdout
[1] "Submitted batch job 436"
$stderr
[1] ""
$timeout
[1] FALSE
```
--------------------------------
### Slurm Template Default Variables for submit_slurm_job
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/values_provided_to_template.mdx
This section details the default variables and their values that are automatically provided to the Slurm template file when `submit_slurm_job` is called without explicit overrides. These variables define job parameters, paths, and tool configurations, often derived from R expressions or `submit_slurm_job` arguments.
```APIDOC
Variables provided to Slurm template by `submit_slurm_job`:
partition: string
Default value: Derived from `submit_slurm_job` argument.
Description: The Slurm partition to use for the job.
parallel: boolean
Default value: `TRUE` if `ncpu > 1`, otherwise `FALSE`.
Description: Indicates whether the job should run in parallel.
ncpu: integer
Default value: Derived from `submit_slurm_job` argument.
Description: The number of CPUs requested for the job.
job_name: string
Default value: `sprintf("%s-nonmem-run", basename(.mod$absolute_model_path))`
Description: The name assigned to the Slurm job, typically based on the model path.
project_path: string
Default value: `here::here()`
Description: The absolute path to the project root directory.
project_name: string
Default value: `here::here() %>% basename()`
Description: The base name of the project directory.
bbi_exe_path: string
Default value: `Sys.which("bbi")`
Description: The detected path to the 'bbi' executable.
bbi_config_path: string
Default value: `getOption("slurmtools.bbi_config_path")`
Description: The path to the 'bbi' configuration file.
model_path: string
Default value: `.mod$absolute_model_path`
Description: The absolute path to the model file.
config_toml_path: string
Default value: `paste0(.mod$absolute_model_path, ".toml")`
Description: The path to the TOML configuration file, required for 'nmm'.
nmm_exe_path: string
Default value: `Sys.which("nmm")`
Description: The detected path to the 'nmm' (nonmem-monitor) executable.
```
--------------------------------
### Configure overwrite argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'overwrite' argument is a boolean flag that controls whether previously run models should be overwritten. Setting this to TRUE allows for re-execution and updating of existing model runs, while FALSE prevents overwriting.
```R
overwrite = TRUE
```
--------------------------------
### submit_job.R - overwrite Argument
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/submit_slurm_job_reference.mdx
Shows how to use the overwrite argument in submit_slurm_job. Setting overwrite = TRUE allows the function to replace previously run models, which defaults to FALSE.
```r
```
--------------------------------
### Configure poll_duration argument for nmm
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/generate_nmm_config_reference.mdx
The 'poll_duration' argument sets the interval, in seconds, between checks for updates in the 'watched_dir'. The default is NULL, causing polling to occur every second. This argument must be an integer greater than 1.
```R
poll_duration = 5
```
--------------------------------
### View user-specific slurm jobs
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/get_slurm_jobs.mdx
This code snippet retrieves slurm jobs filtered by a specific user. It returns a tibble containing only the jobs associated with the specified user.
```r
library(slurmjobs)
# View jobs for a specific user
view_jobs_user <- get_slurm_jobs(user = "user_y")
print(view_jobs_user)
```
--------------------------------
### Cancel SLURM Job with Confirmation Disabled
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/reference/cancel_slurm_job_reference.mdx
Demonstrates how to use the 'confirm = FALSE' argument with the cancel_slurm_job function to bypass the confirmation prompt when cancelling SLURM jobs. This is useful for scripting automated job cancellations.
```r
cancel_slurm_job(job_id, confirm = FALSE)
```
--------------------------------
### cancel_slurm_jobs.R
Source: https://github.com/a2-ai/slurmtools-docs/blob/main/src/content/docs/guides/cancel_slurm_job.mdx
This R code snippet is used to cancel Slurm jobs. It prompts the user for confirmation before irreversibly cancelling a specified job. Ensure you have the Job ID of the job you wish to cancel.
```r
import cancel_job from '/src/code/cancel_job.R?raw';
// The actual R code content is expected to be in the 'cancel_job' variable.
// Example of the interactive prompt:
// You are about to cancel job: 12345. Are you sure you want to cancel? [Y/n]
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.