Skip to content

Bunch of helper files for the Slurm resource manager

Notifications You must be signed in to change notification settings

nicksan2c/slurm-helper

 
 

Repository files navigation

slurm-helper

Bunch of helper files for the Slurm resource manager

OPA topology

build_opa_slurm_topology.py builds a topology.conf file from the output of the opaextractsellinks command in a fat tree configuration.

Typical usage:

    opaextractsellinks | python parse_opaextractsellinks.py

Bash completion

The Bash completion script offers completion for Slurm commands.

At present the following Slurm commands are considered

  • scontrol
  • sreport

Installation

Simply source the script in your .bashrc or .profile

Known issues

Keyword arguments are not auto-completed beyond the first one.

Vim syntax file

The Vim syntax file renders the Slurm batch submission scripts easier to read and to spot errors in the submission options.

As submission scripts are indeed shell scripts, and all Slurm options are actually Shell comments, it can be difficult to spot errors in the options.

This syntax file allows vim to understand the Slurm option and highlight them accordingly. Whenever possible, the syntax rules check the validity of the options and put in a special color what is not recognized as a valid option, or valid parameters values.

Installation

Under Linux or MacOS, simply copy the file in the directory

.vim/after/syntax/sh/

or whatever shell other than sh you prefer.

The syntax file is then read and applied on a Shell script after the usual syntax file has been processed.

Known issues

  • Some regex needed to validate options or parameter values are not exactly correct, but should work in most cases.
  • Any new option unknown to the syntax file will be spotted as an error.

Nano syntax file

The Nano syntax file highlights SBATCH comments in a font distinct from other comments.

Installation

Under Linux or MacOS, simply copy the file in your nano directory, e.g.

.nano.d

and add

include ~/.nano.d/slurm.nanorc

to your .nanorc file

Known issues

  • Very basic syntax highlighting without any syntax checking, contrarily to the Vim version.

Emacs syntax file

The Emacs syntax file highlights SBATCH comments in a font distinct from other comments:

Example of slurm-mode highlighting

Installation

Under Linux or MacOS, simply copy the slurm-mode.el file in your emacs load path, e.g.

.emacs.d

and add

(add-to-list 'load-path "~/.emacs.d/")

(require 'slurm-mode)
(add-hook 'sh-mode-hook 'turn-on-slurm-mode)

to your .emacs or .emacs.d/init.el file

Known issues

  • Very basic syntax highlighting without any syntax checking (beyond arguments spelling), contrarily to the Vim version.

Emacs interface

slurm.el provides a User Interface to slurm within Emacs:

Example of slurm.el interface

Installation

Simply copy the slurm.el file in your emacs load path, e.g.

.emacs.d

and add the following snippet to your init file (.emacs or .emacs.d/init.el):

(add-to-list 'load-path "~/.emacs.d/")

(require 'slurm)

Usage

Just run M-x slurm to see a list of all SLURM jobs on the cluster. From there, let C-h m guide you through the various key bindings allowing to manipulate the different view:

  • j: jobs list (default view)
  • p: partitions list
  • i: cluster information

About

Bunch of helper files for the Slurm resource manager

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 65.7%
  • Emacs Lisp 22.5%
  • Vim Script 10.2%
  • Python 1.6%