NAME

runjob - Run a job in the cluster using NBI::Slurm

VERSION

version 0.9.0

SYNOPSIS

runjob [options] "Command to run"

DESCRIPTION

The runjob script allows you to submit a job to the cluster using the NBI::Slurm module.

It provides a command-line interface for setting job parameters, including queue, memory, threads, execution time, and input files.

OPTIONS

-n, --name STR

Specifies the name of the job (optional). If not provided, an automatic name will be generated based on the command being run.

-q, --queue STR

Specifies the queue name for the job. The default value is "qib-short". Note that if you include a "*", it will be replaced by 'short', 'medium', or 'long' depending on the time specified with '--time'.

-m, --memory INT[SUFFIX]

Specifies the amount of memory to use for the job. The default value is 8000 (8GB). You can add a suffix like "900Mb" or "12Gb" (floats are not supported). An integer is interpreted as Mb if > 200, otherwise it is interpreted as Gb.

-c, --cores, --threads INT

Specifies the number of threads (cores) to use for the job. The default value is 1.

-T, -t, --time STR

Specifies the time string for the job. The default value is "2h". The format should be in the form of "Xd Xh Xm" where X represents the number of days (d), hours (h), and minutes (m) respectively.

--after INT

Specifies the job ID to wait for before running the job. This option can be used multiple times to specify multiple jobs to wait for.

-w, --tmpdir PATH

Specifies the temporary (working) directory for the job. The default value is "/tmp".

-f, --files STR

Specifies input files or file patterns for the job. This option can be used multiple times. You can use quoted patterns like "*.fasta" to include multiple files matching the pattern.

--placeholder STR [default: #FILE#]

Specifies a placeholder string to be used in the command for input files. If not provided, the default placeholder is "#FILE#".

-a, --email-address STR

Specifies the email address for job notifications.

-e, --mail-type STR

Specifies the type of email notifications to receive. Options include 'BEGIN', 'END', 'FAIL', 'REQUEUE', 'ALL'.

-r, --run

Runs the job immediately after submitting. If not specified, the script will only print the job script without running it.

--verbose

Enables verbose output, displaying additional information about the job and its options.

--debug

Enables debug mode, providing even more detailed information about the job setup and execution.

--version

Displays the version of the runjob script.

--help

Displays the help message for the script.

CONFIGURATION

The script will look for a configuration file in the user's home directory at ~/.nbislurm.config.

Example configuration:

queue=qib-*,nbi-*
email=my@address
tmpdir=/home/user/slurm
memory=8000
time=3h

EXAMPLES

Submitting a job to the default queue with 4Gb memory and running the job:

runjob -m 4Gb -r "ls -l"

Submitting a job with a custom name, 2 threads, and running a Python script:

runjob -n "my-job" -c 2 -r "python script.py"

Chaining jobs together:

JOB1=$(runjob -r "echo 'Hello, world!'")
runjob --after $JOB1 -r "echo 'Goodbye, world!'"

Running a job with multiple input files (use placeholder #FILE#):

runjob -f "*.fasta" -f "data.txt" -r "process_files #FILE#"

Using a custom placeholder for input files:

runjob -f "*.fastq" --placeholder "FASTQ" -r "fastqc FASTQ"

AUTHOR

Andrea Telatin <proch@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Andrea Telatin.

This is free software, licensed under:

The MIT (X11) License