• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

srun Command Examples in Linux

by Deepika

srun is a command-line tool used to create an interactive job or connect to an existing job on a SLURM-managed HPC cluster. An interactive job is a job that allows the user to directly access the compute nodes, either for debugging or for running interactive programs that require user input.

When used to create an interactive job, srun launches a shell on a compute node, allowing the user to execute commands interactively. This is useful for tasks such as debugging, testing, or running interactive programs that require user input. srun automatically allocates the necessary resources (such as CPU cores, memory, and GPU resources) required for the job and launches the job on the specified partition.

When used to connect to an existing job, srun allows the user to connect to a running job and run commands on the allocated resources. This can be useful for debugging, monitoring job progress, or making modifications to a running job.

srun provides a number of options for customizing the resources allocated for the job, including the number of CPU cores, memory, and GPU resources required. Additionally, srun supports parallel job execution through MPI and OpenMP, allowing users to run parallel applications on the cluster.

srun Command Examples

1. Submit a basic interactive job:

# srun --pty /bin/bash

2. Submit an interactive job with different attributes:

# srun --ntasks-per-node=num_cores --mem-per-cpu=memory_MB --pty /bin/bash

3. Connect to a worker node with a job running:

# srun --jobid=job_id --pty /bin/bash

Summary

In summary, srun is a powerful tool for interacting with the SLURM scheduler on HPC clusters. It provides a way to create interactive jobs and connect to running jobs, allowing users to easily debug, monitor, and modify jobs running on the cluster.

Filed Under: Linux

Some more articles you might also be interested in …

  1. “git stage” Command Examples
  2. qjoypad Command Examples in Linux
  3. CentOS / RHEL : How to find kernel parameters used while booting
  4. How to uninstall cmake package from Ubuntu
  5. Linux Network File System (NFS) interview questions
  6. repquota: command not found
  7. systemd-analyze Command Examples in Linux
  8. How to backup Linux OS using “dd” Command
  9. cpuid: command not found
  10. export: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright