惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
B
Blog
S
SegmentFault 最新的问题
Vercel News
Vercel News
博客园 - 聂微东
宝玉的分享
宝玉的分享
C
Check Point Blog
有赞技术团队
有赞技术团队
IT之家
IT之家
V
V2EX
爱范儿
爱范儿
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
博客园 - 司徒正美
博客园_首页
Last Week in AI
Last Week in AI
博客园 - 叶小钗
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
F
Fortinet All Blogs
腾讯CDC
J
Java Code Geeks

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
What Actually Happens When You Run sbatch in Slurm
Muhammad Zub · 2026-04-29 · via DEV Community

If you work with HPC clusters, you likely use sbatch every day. You submit a script and expect it to run.

But that single command triggers a full workflow inside Slurm.

Understanding this internal flow helps you debug issues faster, optimize job performance, and better understand how your cluster behaves.

Step 1: Submitting the Job

When you run:

sbatch job.sh

Enter fullscreen mode Exit fullscreen mode

You are not starting the job. You are submitting a request to Slurm.

The script includes:

  • Resource requirements such as CPUs, memory, GPUs
  • Job metadata like name and output paths
  • The actual commands to execute

At this point, Slurm simply accepts the job.

Step 2: Communication with slurmctld

The sbatch command sends the job to the Slurm controller daemon, slurmctld.

This daemon:

  • Assigns a Job ID
  • Stores the job details
  • Marks the job as PENDING

Nothing is running yet.

Step 3: Job Enters the Queue

The job is now placed in the scheduling queue.

evaluates:

  • Job priority
  • Fairshare usage
  • Partition limits
  • Resource availability

This determines when your job will run.

Step 4: Scheduling Decision

The scheduler continuously checks:

  • Free nodes
  • Resource fragmentation
  • Backfill opportunities

If your job fits available resources, it gets selected. Otherwise, it stays pending.

Step 5: Resource Allocation

Once selected, Slurm:

  • Assigns specific compute nodes
  • Reserves CPUs, memory, and GPUs
  • Changes job state to RUNNING

Now your job has allocated resources.

Step 6: Node-Level Communication

Each compute node runs a daemon called slurmd.

The controller sends job details to these nodes. The nodes prepare the execution environment.

Step 7: Job Execution via slurmstepd

On the compute node, slurmstepd is launched.

This process:

  • Starts your application
  • Manages job steps
  • Handles output and error streams
  • Enforces resource limits using cgroups

Your script begins executing here.

Step 8: Monitoring During Execution

While the job runs:

  • Slurm tracks resource usage
  • Logs are written to output files
  • Accounting data is collected

You can monitor the job using:

squeue
scontrol show job <jobid>

Enter fullscreen mode Exit fullscreen mode

Step 9: Job Completion

When the job finishes:

  • slurmstepd exits
  • Resources are released
  • Temporary processes are cleaned up

The job state becomes COMPLETED, FAILED, TIMEOUT, or CANCELLED.

Step 10: Accounting and Logs

Finally:

  • Job statistics are stored
  • Output files remain available
  • Usage data is recorded

You can check this using:

sacct

Enter fullscreen mode Exit fullscreen mode

Full Flow Summary

  1. Submit job using sbatch
  2. slurmctld receives and queues it
  3. Scheduler evaluates priority
  4. Resources are allocated
  5. slurmd prepares nodes
  6. slurmstepd runs the job
  7. Job completes and resources are released

Common Misconceptions

“sbatch runs the job immediately”
It only submits the job.

“Pending means failure”
It usually means waiting for resources.

“Slurm just runs scripts”
It manages scheduling, allocation, execution, and cleanup.

Final Thought

sbatch may look simple, but it triggers a complete orchestration pipeline inside Slurm.

Once you understand this flow, debugging becomes easier, performance tuning improves, and cluster behavior becomes predictable.