📅  最后修改于: 2023-12-03 15:19:56.076000             🧑  作者: Mango
sbatch
is a command-line tool used to submit batch jobs to a cluster with a Slurm workload manager. It is a powerful and flexible tool for managing and executing large-scale computing jobs.
The basic workflow of using sbatch
involves writing a job script that describes the computation you want to run, and then submitting this script to the cluster. The script can be written in any language that can be executed on the cluster, such as Python or R.
Here is an example of a simple job script:
#!/bin/bash
#SBATCH --job-name=myjob
#SBATCH --output=job.out
#SBATCH --error=job.err
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
echo "Hello, world!"
This script requests a single node and a single task, sets the job name to "myjob", and specifies an output file for standard output and an error file for standard error. It also sets a time limit of 1 hour.
To submit this job script, simply run:
sbatch job.sh
This will submit the job to the cluster, and you can monitor its progress with the squeue
command.
sbatch
is a versatile tool for managing and submitting large-scale computing jobs to a cluster. With its many options and capabilities, it provides a powerful framework for running complex computations on a cluster.