NBI-Slurm

 view release on metacpan or  search on metacpan

arxiv/paper_arxiv.tex  view on Meta::CPAN

\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
  \sbox\pandoc@box{#1}%
  \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
  \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
  \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
  \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
  \else\usebox{\pandoc@box}%
  \fi%
}
% Set default figure placement to htbp
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\usepackage[]{natbib}
\bibliographystyle{plainnat}
\usepackage{bookmark}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
  pdftitle={NBI-Slurm: Simplified submission of Slurm jobs with energy saving mode},
  pdfauthor={Andrea Telatin Quadram Institute Bioscience, Norwich, NR4 7UQ, UK Center for Microbial Interactions, Norwich Research Park, Norwich, NR4 7UG, UK ORCID: 0000-0001-7619-281X},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}

\title{NBI-Slurm: Simplified submission of Slurm jobs with energy saving
mode}
\author{Andrea Telatin\\
Quadram Institute Bioscience, Norwich, NR4 7UQ, UK\\
Center for Microbial Interactions, Norwich Research Park, Norwich, NR4 7UG, UK\\
ORCID: 0000-0001-7619-281X}
\date{18 March 2026}

\begin{document}
\maketitle

\section{Summary}\label{summary}

NBI-Slurm is a Perl package that provides a simplified, user-friendly
interface for submitting and managing jobs on SLURM
\citep{jette2002slurm} high-performance computing (HPC) clusters. It
offers both a library of Perl modules for programmatic job management
and a suite of command-line tools designed to reduce the cognitive
overhead of SLURM's native interface. Distinctive features of NBI-Slurm
are (a) TUI applications to view and cancel jobs, (b) the possibility to
generate tool specific wrappers for (bioinformatic) tools and (c) an
energy-aware scheduling mode --- ``eco mode'' --- that automatically
defers flexible jobs to off-peak periods, helping research institutions
reduce their computational carbon footprint without requiring users to
manually plan submission times.

\section{Statement of Need}\label{statement-of-need}

HPC clusters are indispensable in modern research, particularly in the
life sciences where large-scale sequence analyses, genome assemblies,
and statistical models demand resources beyond a desktop workstation.
SLURM has become the dominant workload manager in this space
\citep{slurm_adoption}, yet its interface presents a steep learning
curve. Users must learn a verbose \texttt{sbatch} scripting syntax,
understand resource unit conventions (memory in megabytes, time in
\texttt{D-HH:MM:SS} format), manage job dependencies manually, and
repeat boilerplate directives across every submission script.

Workflow managers such as Snakemake \citep{molder2021snakemake} and
Nextflow \citep{di2017nextflow} address this at the pipeline level by
abstracting SLURM as an execution backend, but they require users to
rewrite their analysis logic inside a domain-specific language. Many
researchers have existing shell scripts or one-off analyses that do not
warrant a full pipeline refactor. NBI-Slurm occupies a complementary
niche: it wraps SLURM's interface without imposing a workflow model,
making it straightforward to submit individual commands or small batches
while retaining access to all SLURM features through pass-through
options.

The \texttt{lsjobs} utility prints a colour-coded, human-readable table
of queued jobs as a static snapshot, offering a more ergonomic
alternative to the raw output of \texttt{squeue}. Its companion tool
\texttt{viewjobs} provides a fully interactive terminal user interface
(TUI) that allows users to browse the live job queue without leaving the
terminal (\autoref{fig:viewjobs}). Users can scroll through jobs with
arrow or Vim keys, sort columns, inspect per-job details, toggle column
visibility, and adjust column widths interactively. Individual jobs can
be selected with \texttt{Space} and multiple selected jobs can be
cancelled in bulk with a single keypress, removing the need to
copy-paste job IDs into \texttt{scancel}.

\begin{figure}
\centering
\pandocbounded{\includegraphics[keepaspectratio,alt={Interactive TUI of viewjobs, showing job navigation, multi-column display, and bulk-cancel workflow. The image is AI generated from a real screenshot (Google NanoBanana) }]{viewjobs.png}}
\caption{Interactive TUI of \protect\texttt{viewjobs}, showing job
navigation, multi-column display, and bulk-cancel workflow. The image is
AI generated from a real screenshot (Google NanoBanana)
\label{fig:viewjobs}}
\end{figure}

Energy consumption in research computing is a growing concern
\citep{lannelongue2021green}. Most researchers have no practical
mechanism to shift flexible jobs to periods when grid electricity is
cheaper or cleaner. NBI-Slurm addresses this directly with a
configurable scheduling module that calculates the next available
low-energy window and injects a \texttt{-\/-begin} directive into the
submission, requiring no change to the underlying command.

\section{NBI::Slurm package}\label{nbislurm-package}

\subsection{Availability and
Installation}\label{availability-and-installation}

NBI-Slurm is distributed under the MIT licence and is available from
CPAN as \texttt{NBI::Slurm}. Installation requires Perl 5.16 or later
and can be performed with:

\begin{Shaded}
\begin{Highlighting}[]
\ExtensionTok{cpanm}\NormalTok{ NBI::Slurm}
\end{Highlighting}



( run in 3.661 seconds using v1.01-cache-2.11-cpan-364913b4093 )