Submit Jobs
3 Type Jobs
srunis used to submit a job for execution or initiate job steps in real time.- Example
- run shell
srun -N2 bin/hostname- run script
srun -N1 test.sh- exec into slurmd node
srun -w slurm-lensing-slurm-slurmd-cpu-2 --pty /bin/bash
- Example
sbatchis used to submit a job script for later execution. The script will typically contain one or more srun commands to launch parallel tasks.- submit a batch job
sbatch -N2 -w "compute[01-02]" -o job.stdout /data/jobs/batch-job.slurm- submit a parallel task to process differnt data partition
sbatch /data/jobs/parallel.slurm
sallocis used to allocate resources for a job in real time. Typically this is used to allocate resources and spawn a shell. The shell is then used to execute srun commands to launch parallel tasks.- Example
- allocate resources (more like create an virtual machine)
This command will create a job which allocates 2 nodes and spawn a bash shell on each node. and you can execute srun commands in that environment. After your computing task is finsihs, remember to shutdown your job.salloc -N2 bashwhen you exit the job, the resources will be released.scancel <$job_id>
- Example