NAME
runjob - Run a job in the cluster using NBI::Slurm
VERSION
version 0.7.1
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 the job parameters, including the queue, memory, threads, and execution time.
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 "nbi-short". Note that if you put a "*", it will be replaced by 'short', 'medium', or 'long' depending on the time specified with '--time'.
- -m, --memory INT (Mb)
-
Specifies the amount of memory to use for the job. The default value is 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, --time STR
-
Specifies the time string for the job. The default value is "
0d 8h
". The format should be in the format 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".
- -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.
- --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
.
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 "echo 'Hello, world!'")
runjob --after $JOB1 "echo 'Goodbye, world!'"
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