Moab and SLURM

Author: Blaise Barney, Lawrence Livermore National Laboratory UCRL-PRES-228819

Table of Contents

  1. Abstract
  2. What are Moab and SLURM?
  3. What a "Job" Means to Moab
  4. Moab Grid Configurations
  5. Queues and Queue Limits
  6. Moab Banks
  7. Fair Share Job Scheduling
  8. Basic Moab Functions
    1. Building a Job Script
    2. Submitting Jobs and MSUB Options
    3. Monitoring Jobs
    4. Exercise 1
    5. Job States and Exit Status Codes
    6. Holding/Releasing Jobs
    7. Canceling Jobs
    8. Changing Job Parameters
    9. Setting Up Dependent Jobs
    10. Running in Standby Mode
    11. Setting User Job Priority
    12. Banks and Usage Information
    13. Guesstimating Jobs
    14. Output Files
  9. Other Moab Functions
    1. Displaying Configuration and Accounting Information
    2. Showing System State
    3. Expediting Jobs
    4. Determining When Your Job's Time is About to Expire
  10. Parallel Jobs
  11. Running on the Aztec and Inca Clusters
  12. Batch Commands Summary
  13. Exercise 2
  14. References and More Information
  15. Appendix A: Moab Support for Legacy LCRM


Moab is a Workload Manager product of Adaptive Computing, Inc. SLURM is the native scheduler software that runs on all LC clusters. Both of these schedulers are used to manage jobs running on LC systems. This tutorial presents the essentials for using Moab and SLURM on LC platforms. Basic topics include how to build batch scripts, submit, monitor, change, hold/release, and cancel jobs. Additional topics cover obtaining accounting and system status information, output files, determining when a job will run and when it will terminate, running in standby mode, setting job priority and considerations for parallel jobs. Special instructions for running on specific clusters concludes the tutorial. This tutorial includes both C and Fortran example codes and a lab exercise.

Level/Prerequisites: The material covered in EC3501: Livermore Computing Resources and Environment would be helpful.

What Are Moab and SLURM?

What is Moab?

Meta vs. Native Scheduler:

What is SLURM?

Tri-lab Implementation:

What a "Job" Means to Moab

Simple Definition:

Moab Definition: (slightly more complex)

Moab Grid Configurations

What is a Moab Grid?

Moab Grid Configurations at LC:

Queues and Queue Limits

Queues (also called Pools and/or Partitions):

How Do I Find Out What the Queue Limits Are?

Moab Banks

Bank Hierarchy:

Bank Shares:

Fair Share Job Scheduling

Why in the World Won't My Job Run?
  • Undoubtedly, this is the most commonly asked batch system question.

  • Aside from any "user error" related reasons, there are several other, sometimes complicated, reasons.

  • Probably the most important reason is the underlying mechanism used by the batch system to determine when/if a job should run.

  • At LC, the Moab scheduler has been programmed to use a "Fair Share with Half-Life Decay of Usage" algorithm for determining a job's eligibility to run.
Fair Share with Half-Life Decay of Usage:
  • This is the primary mechanism used to determine job scheduling. It is based upon a dynamically calculated priority for your job that reflects your share allocation within a bank versus your actual usage.

  • Use more than your share, your priority/service degrades; use less than your share, your priority/service improves

  • Your priority can become very low, but you never "run out of time" at LC.

  • Half-Life Decay: Without new usage, your current usage value decays to half its value in two weeks.

  • Resources are not wasted: Even though your allocation and/or job priority may be small your job will run if machine resources are sitting idle.

  • Moab's scheduling is dynamic with job priorities and usage information being recalculated frequently.

  • The details of the Fair Share with Half-Life Decay algorithm are a bit more complex than presented here. See the following documents for detailed information:

Other Considerations:

Basic Moab Functions

Building a Job Script

The Basics:

Usage Notes:

Environment Variables:

Basic Moab Functions

Submitting Jobs and MSUB Options


Usage Notes:

Discussion on the -l Option:

Passing Arguments to Your Job:

Your PATH:

Basic Moab Functions

Monitoring Jobs

Several Choices:

Moab Non-Moab
  • showq
  • checkjob
  • mdiag -j
  • showstart
  • squeue
  • mjstat
  • sview
  • smap
  • ju
  • pstat



mdiag -j:







So Many Choices...

Moab Exercise 1

Getting Started

  • Login to an LC cluster using your workshop username and OTP token
  • Copy the exercise files to your home directory
  • Familiarize yourself with the cluster's batch configuration
  • Familiarize yourself with the cluster's bank allocations
  • Create a Moab batch script
  • Submit and monitor your batch job
  • Check your job's output


Basic Moab Functions

Job States and Exit Status Codes

Basic Moab Functions

Holding and Releasing Jobs

Holding Jobs:

Releasing Jobs:

Basic Moab Functions

Canceling Jobs

Basic Moab Functions

Changing Job Parameters

Basic Moab Functions

Setting Up Dependent Jobs

Basic Moab Functions

Running in Standby Mode

Basic Moab Functions

Setting User Job Priority

Basic Moab Functions

Banks and Usage Information



mdiag -u:


Basic Moab Functions

Guesstimating Jobs



Basic Moab Functions

Output Files


Assigning Unique Output File Names:


Other Moab Functions

Displaying Configuration and Accounting Information

What's Available?



Other Moab Functions

Showing System State

Other Moab Functions

Expediting Jobs

Other Moab Functions

Determining When Your Job's Time is About to Expire

Signaling Method:

Polling Method:

More on yogrt_remaining:

More Information:

Parallel Jobs


Moab and SLURM:

srun Command:

srun options:

Specifying srun options that conflict with equivalent Moab options may cause problems or unexpected behavior.

Parallel Jobs on BG/Q Systems:

Running Multiple Jobs Simultaneously:

Parallel Output:

Running on the Aztec and Inca Clusters

Different than Other Clusters: multi vs. single-node

Use of the Moab -l ttc= (total task count) Option:

Multi-process jobs not using MPI:

Batch Commands Summary

Moab Exercise 2

More Moab Functions

  • Login to an LC workshop cluster, if you are not already logged in
  • Holding and releasing jobs
  • Canceling jobs
  • Running in standyby mode
  • Running parallel and hybrid parallel jobs
  • When will a job start?


This completes the tutorial.

      Please complete the online evaluation form - unless you are doing the exercise, in which case please complete it at the end of the exercise.

Where would you like to go now?

References and More Information

Appendix A: Moab Support for Legacy LCRM

Supported LCRM commands:

Unsupported Commands:

Job States:

Converting LCRM Scripts to Moab: