← 返回命令列表

Linux command

sbatch 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Submit

sbatch [job.sh]

Example

sbatch --job-name=[myjob] [job.sh]

Example

sbatch --time=[00:30:00] [job.sh]

Example

sbatch --nodes=[3] [job.sh]

说明

sbatch submits batch job scripts to the SLURM workload manager. Jobs are queued and executed when requested resources become available on the cluster. Job scripts contain SLURM directives (lines starting with #SBATCH) specifying resource requirements, followed by commands to execute. SLURM handles job scheduling and resource allocation.

参数

--job-name _name_
Job name
--time _time_
Time limit (HH:MM:SS)
--nodes _n_
Number of nodes
--ntasks _n_
Number of tasks
--cpus-per-task _n_
CPUs per task
--mem _size_
Memory per node
--partition _name_
Partition/queue to use
--output _file_
Output file (%j for job ID)
--error _file_
Error file
--mail-type _type_
Email notifications (BEGIN, END, FAIL)

FAQ

What is the sbatch command used for?

sbatch submits batch job scripts to the SLURM workload manager. Jobs are queued and executed when requested resources become available on the cluster. Job scripts contain SLURM directives (lines starting with #SBATCH) specifying resource requirements, followed by commands to execute. SLURM handles job scheduling and resource allocation.

How do I run a basic sbatch example?

Run `sbatch [job.sh]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --job-name _name_ do in sbatch?

Job name