Skip to main content

Learning and mastering Slurm commands can be valuable for anyone working with high-performance computing. By comprehensively understanding the basic Slurm commands, both seasoned and new users can greatly enhance efficiency and productivity.
This blog post provides an overview of some essential Slurm commands you can reference daily.

sbatch: Submit a job script.

The sbatch command allows you to submit a job script to the Slurm job scheduler. This script specifies the job’s required resources, the commands it will execute, and any dependencies. Using the sbatch command to easily submit your job to the Slurm workload manager, allowing you to schedule and execute your job on the available compute resources.

srun: Run a command on allocated compute node(s).

When you need to execute a specific command on the allocated compute nodes, you can use the srun command. This command allows you to run a command or a series of commands on the allocated compute nodes, ensuring you have the required resources for execution.

scancel: Delete a job.

Use the scancel command to cancel or delete a job running or in the queue. By specifying the job ID, you can quickly terminate the execution of a job, freeing up resources for other pending jobs.

squeue: Show the state of jobs.

The squeue command provides a comprehensive overview of the current state of all jobs in the Slurm job queue. It displays information such as job ID, user, state, running time, etc. Use this command to monitor the progress of your jobs and get an overview of the entire system workload.

sinfo: Show state of nodes and partitions.

To get detailed information about the nodes and partitions (queues) in the Slurm cluster, you can use the sinfo command. This command provides insights into the compute nodes’ state, availability, and the partitions they belong to. By understanding the current state of the nodes and partitions, you can make informed decisions about job submission and resource allocation.

smap: Show jobs, partitions, and nodes in a graphical network topology.

For a visual representation of the jobs, partitions, and nodes in the Slurm cluster, you can utilize the smap command. This command generates a graphical network topology of the system, allowing you to visualize the relationship between various components. The smap command helps particularly when you need to analyze the current state of the cluster at a glance.

squeue -u: See your jobs running or waiting to run.

Use the squeue -u command to view the jobs running or waiting to run for a particular user. This command filters the output of the squeue command only to display jobs associated with the specified user’s netID. It gives you a focused view of your own jobs, making tracking their progress more manageable.

squeue –start: Report the expected start time for pending jobs.

If you have pending jobs in the queue and want to know their expected start time, use the squeue –start command. This command provides an estimated start time for each pending job, giving you an idea of when your job will likely begin execution.

squeue -j: Show the nodes being used for your running job.

The squeue -j command can be used to obtain information about the compute nodes your running job uses. By specifying the job ID, you can retrieve details about the nodes allocated to your job, ensuring transparency and visibility into your job’s execution environment.

scontrol show jobid: Displays detailed info about a job.

For a detailed overview of a specific job, you can utilize the scontrol show jobid command. This command provides comprehensive information about the specified job, including its state, execution time, resource utilization, and more. It can help trouble or understand the characteristics of a particular job.

sacct: Display accounting data for all jobs and job steps.

The sacct command in Slurm helps you track and report on job activities and resource usage. By utilizing sacct, businesses can access detailed information about job status, start and end times, CPU and memory usage, and more. This data enables organizations to analyze job performance, identify bottlenecks, and optimize resource allocation for future jobs. With sacct, businesses can create comprehensive reports that provide valuable insights into job execution, helping them make informed decisions to improve efficiency and productivity.

sreport: Generate reports from the Slurm accounting data.

The sreport command in Slurm allows businesses to generate detailed reports on resource utilization, job accounting, and billing. By utilizing sreport, organizations can access critical information such as job duration, resource consumption, and allocation usage. This data helps optimize resource allocation, identify cost-saving opportunities, and streamline billing processes.

How Learning Slurm Commands Empowers Businesses, Employees, and Customers

By taking the time to learn and master the basic Slurm commands, organizations can unlock many benefits that can significantly enhance their overall operations and output.

Enhanced Job Management and Resource Utilization

Businesses can streamline their job management processes by effectively understanding and utilizing the Slurm commands. Knowledge of commands like sbatch, srun, scancel, and squeue enables employees to efficiently submit, monitor, and cancel jobs. This saves time and optimizes resource utilization by ensuring that jobs run on the appropriate computer nodes, minimizing idle time and maximizing productivity.

Job Step Monitoring

Utilize advanced job step monitoring tools to efficiently track the progress of individual job steps, identify bottlenecks, and optimize resource utilization. By leveraging commands like scontrol and sacct, employees can monitor job steps in real-time, analyze resource usage, and make informed decisions to ensure jobs are completed on time and within budget. Job step monitoring helps businesses streamline operations, reduce costs, and improve productivity.

Improved Decision-Making and Planning

With access to commands such as sinfo, smap, and squeue –start, organizations gain valuable insights into the current state of their Slurm clusters. This information empowers decision-makers to make strategic choices regarding job submission, resource allocation, and scheduling. By understanding the availability of nodes and the expected start time for pending jobs, businesses can plan their operations effectively, avoiding unnecessary delays and ensuring timely job execution.

Efficient Troubleshooting and Debugging

The squeue -j and scontrol show jobid commands provide detailed information about individual jobs, allowing employees to troubleshoot and debug any issues. By examining the allocated nodes, resource usage, and error messages, staff members can quickly identify and rectify problems, minimizing downtime and achieving faster job completion.

Increased Customer Satisfaction

For businesses that provide high-performance computing services to external customers, mastery of Slurm commands helps deliver exceptional service. By efficiently managing jobs, optimizing resource allocation, and providing accurate information about job status, organizations can meet customer expectations for timely and reliable results. This, in turn, enhances customer satisfaction, builds trust, and encourages repeat business.

Mastering Slurm commands is essential for effective job management and resource utilization in high-performance computing environments.

Investing time in learning and understanding the basic Slurm commands brings numerous advantages to businesses, employees, and customers. From improved job management and resource utilization to better decision-making and troubleshooting capabilities, the mastery of these commands can significantly enhance organizational efficiency, productivity, and customer satisfaction. So delve into the world of Slurm commands and unlock the full potential of your high-performance computing environment.