ssubmit
Submit sbatch jobs without having to create a submission script
Motivation
This project is motivated by the fact that I want to just be able to submit commands as jobs and I don't want to fluff around with making a submission script.
ssubmit
wraps that whole process and lets you live your best lyf #blessed.
Install
Precompiled binary
Run this little scriptlet or download for you system from the releases page.
VERSION="0.1.1" # ssubmit version you want
OS=$(uname -s)
if [ "$OS" = "Linux" ]; then
triple="x86_64-unknown-linux-musl"
elif [ "$OS" = "Darwin" ]; then
triple="x86_64-apple-darwin"
else
echo "ERROR: $OS not a recognised operating system"
fi
if [ -n "$triple" ]; then
URL="https://github.com/mbhall88/ssubmit/releases/download/${VERSION}/ssubmit-${VERSION}-${triple}.tar.gz"
wget "$URL" -O - | tar -xzf -
./ssubmit --help
fi
Cargo
$ cargo install ssubmit
Build from source
$ git clone https://github.com/mbhall88/ssubmit.git
$ cd ssubmit
$ cargo build --release
$ target/release/ssubmit -h
Usage
Submit an rsync job named "foo" and request 350MB of memory and a one week time limit
$ ssubmit -m 350m -t 1w foo "rsync -az src/ dest/"
Submit a job that needs 8 CPUs
$ ssubmit -m 16g -t 1d align "minimap2 -t 8 ref.fa query.fq > out.paf" -- -c 8
The basic anatomy of a ssubmit
call is
ssubmit [OPTIONS]
[--
...]
NAME
is the name of the job (the --job-name
parameter in sbatch
).
COMMAND
is what you want to be executed by the job. It must be quoted (siungle or double).
REMAINDER
is any (optional) sbatch
-specific parameters you want to pass on. These must follow a --
after COMMAND
.
Memory
Memory (-m,--mem
) is intended to be a little more user-friendly than the sbatch --mem
option. For example, you can pass -m 0.5g
and ssubmit
will interpret and convert this as 500M. However, -m 1.7G
will be rounded up to 2G. One place where this option differs from sbatch
is that if you don't give units, it will be interpreted as bytes - i.e., -m 1000
will be converted to 1K. Units are case insensitive.
Time
As with memory, time (-t,--time
) is intended to be simple. If you want a time limit of three days, then just pass -t 3d
. Want two and a half hours? Then -t 2h30m
works. If you want to just use the default limit of your cluster, then just pass -t 0
. You can also just pass the time format sbatch
uses and this will be seamlessly passed on. For a full list of support time units, check out the duration-str
repo.
Dry run
You can see what ssubmit
would do without actually submitting a job using dry run (-n,--dry-run
). This will print the sbatch
command and also the submission script that would have been provided.