Home

Awesome

DRMAA for Slurm

Please note: DRMAA for Slurm is a continuation of PSNC DRMAA for SLURM by an unrelated developer.

Introduction

DRMAA for Slurm Workload Manager (Slurm) is an implementation of Open Grid Forum Distributed Resource Management Application API (DRMAA) version 1 for submission and control of jobs to Slurm. Using DRMAA, grid applications builders, portal developers and ISVs can use the same high-level API to link their software with different cluster/resource management systems.

History

DRMAA for Slurm was originally developed at the Poznań Supercomputing and Networking Center as PSNC DRMAA for SLURM. Following the unexpected death in 2013 of its primary maintainer, Mariusz Mamoński, there has been little additional development from PSNC, and no new releases.

This fork is maintained by Nate Coraor and was originally created in 2014 to add support for Slurm's --clusters (-M) option. Since that time, others have found it useful and additional features and bug fixes have been added. However, the majority of the credit for this work belongs to the original authors (found below). In 2017, current maintainer Piotr Kopta created psnc-apps/slurm-drmaa in Github, a snapshot of the unreleased 1.2.0 version (upon which this fork is also based) that has seen occasional work.

The title of the software in this fork has been changed from PSNC DRMAA for SLURM to simply DRMAA for Slurm. This change was made in order to alleviate confusion and differentiate from the canonical version. Additionally, this fork is not affiliated with PSNC; as such, releasing this software under PSNC's name would not be appropriate. However, this fork's maintainer is incredibly grateful for the work of the original authors of this software and the name change is in no way intended to minimize the efforts of those people.

Download

DRMAA for Slurm is distributed as a source package which can be downloaded via the Releases section.

Installation

To compile and install the library, go to main source directory and type:

$ ./configure [options] && make
$ sudo make install

The library uses the standard GNU Autotools system, so standard configure arguments are available; see ./configure --help for a full list. The library was tested with Slurm versions 16.05 and 18.08. If you encountered any problems using the library on different systems, please see the contact section.

Notable ./configure script options:

--with-slurm-inc SLURM_INCLUDE_PATH

Path to Slurm header files (i.e. directory containing slurm/slurm.h ). By default the library tries to guess the SLURM_INCLUDE_PATH and SLURM_LIBRARY_PATH based on location of the srun executable.

--with-slurm-lib SLURM_LIBRARY_PATH

Path to Slurm libraries (i.e. directory containing libslurm.a ).

--prefix INSTALLATION_DIRECTORY

Root directory where PSNC DRMAA for Slurm shall be installed. When not given library is installed in /usr/local.

--enable-debug

Compiles library with debugging enabled (with debugging symbols not stripped, without optimizations, and with many log messages enabled). Useful when you are to debug DRMAA enabled application or investigate problems with DRMAA library itself.

There are no unusual requirements for basic usage of library: a C99 compiler and standard make program should suffice. If you have taken sources directly from this repository or wish to run test-suite you would need additional developer tools.

Configuration

During DRMAA session initialization (drmaa_init), the library tries to read its configuration parameters from locations: /etc/slurm_drmaa.conf, ~/.slurm_drmaa.conf and from the file given in the $SLURM_DRMAA_CONF environment variable (if set to a non-empty string). If multiple configuration sources are present then all configurations are merged with values from user-defined files taking precedence (in the following order: $SLURM_DRMAA_CONF, ~/.slurm_drmaa.conf, /etc/slurm_drmaa.conf).

Currently recognized configuration parameters are:

cache_job_state

According to the DRMAA specification, every drmaa_job_ps() call should query the DRM system for job state. With this option one may optimize communication with the DRM. If set to a positive integer, drmaa_job_ps() returns the remembered job state without communicating with the DRM for cache_job_state seconds since the last update. By default the library conforms to the specification (no caching will be performed).

Type: integer, default: 0

job_categories

Dictionary of job categories. Its keys are job categories names mapped to native specification strings. Attributes set by job category can be overridden by corresponding DRMAA attributes or native specification. The special category name default is used when the drmaa_job_category job attribute is not set.

Type: dictionary with string values, default: empty dictionary

Configuration file syntax

The configuration file is in a form of a dictionary. A dictionary is set of zero or more key-value pairs. A key is a string, while a value can be a string, an integer or another dictionary.

  configuration: dictionary | dictionary_body
  dictionary: '{' dictionary_body '}'
  dictionary_body: (string ':' value ',')*
  value: integer | string | dictionary
  string: unquoted-string | single-quoted-string | double-quoted-string
  unquoted-string: [^ \t\n\r:,0-9][^ \t\n\r:,]*
  single-quoted-string: '[^']*'
  double-quoted-string: "[^"]*"
  integer: [0-9]+

Native specification

The DRMAA interface allows passing DRM-dependent job submission options. Those options may be specified directly by setting the drmaa_native_specification job template attribute or indirectly by the drmaa_job_category job template attribute. The legal format of the native options looks like:

  -A My_job_name -s -N 1-10

List of parameters that can be passed in the drmaa_native_specification attribute:

Native specificationDescription
-A, --account=nameCharge job to specified accounts
--acctg-freq=listDefine the job accounting sampling interval
--comment=stringAn arbitrary comment
-C, --constraint=listSpecify a list of constraints
-c, --cpus-per-task=nNumber of processors per task
--contiguousIf set, then the allocated nodes must form a contiguous set
-d, --dependency=listDefer the start of this job until the specified dependencies have been satisfied completed
--exclusiveAllocate nodenumber of tasks to invoke on each nodes in exclusive mode when cpu consumable resource is enabled
--gres=listSpecifies a comma delimited list of generic consumable resources
-k, --no-killDo not automatically terminate a job of one of the nodes it has been allocated fails
-L, --licenses=licenseSpecification of licenses
-M, --clusters=listComma delimited list of clusters to issue commands to
--mail-type=typeNotify user by email when certain event types occur. Valid type values are BEGIN, END, FAIL, REQUEUE, and ALL (any state change)
--mem=MBMinimum amount of real memory
--mem-per-cpu=MBMaximum amount of real memory per allocated cpu required by a job
--mincpus=nMinimum number of logical processors (threads) per node
-N, --nodes=minnodes[-maxnodes]Number of nodes on which to run
-n, --ntasks=nNumber of tasks
--no-requeueSpecifies that the batch job should not be requeued after node failure
--ntasks-per-node=nNumber of tasks to invoke on each node
-p, --partition=partitionPartition requested
--qos=qosQuality of Serice
--requeueIf set, permit the job to be requeued
--reservation=nameAllocate resources from named reservation
-s, --shareJob allocation can share nodes with other running jobs
--tmp=size[units]Specify a minimum amount of temporary disk space
-w, --nodelist=hostsRequest a specific list of hosts
-x, --exclude=nodelistExplicitly exclude certain nodes from the resources granted to the job

Additionally, the following parameters to drmaa_native_specification are supported, but their use is discouraged in favor of the corresponding DRMAA job attributes:

Native specificationDRMAA job attributeDescription
-e, --error=patterndrmaa_output_pathConnect the batch script's standard error directly to the file name specified in the pattern
-J, --job-name=namedrmaa_job_nameSpecify a name for the job allocation
-o, --output=patterndrmaa_error_pathConnect the batch script's standard output directly to the file name specified in the pattern
-t, --time=hours:minutesdrmaa_wct_hlimitSet a maximum job wallclock time

Descriptions of each parameter can be found in man sbatch.

Changelog

See CHANGELOG.md

Known bugs and limitations

The library covers all of the DRMAA 1.0 specification with exceptions listed below. It was successfully tested with Slurm 16.05 and 18.08. Known limitations:

Development and Pre-releases

note: This repository depends on FedStage DRMAA Utils, which is configured as a submodule. When cloning this repository, you should clone recursively, e.g.:

$ git clone --recursive https://github.com/natefoo/slurm-drmaa.git

The source repository does not contain Autotools-generated artifacts such as configure and Makefile. Please note the ./autogen.sh and ./autoclean.sh scripts which call the Autotools command chain in the appropriate order to generate these artifacts.

note: You need some developer tools to compile the source from git.

Developer tools

Although not needed to use the library or to compile from source distribution tarballs, user the following tools may be required if you intend to develop DRMAA for Slurm from git:

Authors

The library was developed by:

This library relies heavily on the Fedstage DRMAA utils code developed by:

The maintainer of this fork is:

with additional contributors.

Contact

You can submit issues and pull requests for DRMAA for Slurm in GitHub.

Links

Software using DRMAA for Slurm

License

Copyright (C) 2011-2015 Poznan Supercomputing and Networking Center Copyright (C) 2014-2019 The Pennsylvania State University

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Some portions of this program are copied or derived from Slurm, which is licensed under the GNU General Public License Version 2. For details, including the list of Slurm copyright holders, see <https://slurm.schedmd.com/>.