#!/bin/bash
#SBATCH --nodes=1
#SBATCH --exclusive
#SBATCH --job-name=xxx
#SBATCH --partition=production
#SBATCH --account=xxx
#SBATCH --constraint=farm18
path_to_executable
#!/bin/bash
#SBATCH --ntasks=1
#SBATCH --cpus-per-tasks=numcores
#SBATCH --job-name=xxx
#SBATCH --partition=production
#SBATCH --account=xxx
#SBATCH --constraint=farm18
path_to_userexecutable
Note: if the above script specifies --ntasks = numcores, slurm may allocate multiple nodes to satisfy the request.
#!/bin/bash
#SBATCH --ntasks=12
#SBATCH --nodes=1
#SBATCH --cpu-per-task=1
#SBATCH --job-name=xxx
#SBATCH --partition=production
#SBATCH --account=xxx
#SBATCH --constraint=farm18
srun --nodes=1 --ntasks=8 --cpus-per-task=1 --mem-per-cpu=1000M --exclusive large_prog &srun --nodes=1 --ntasks=2 --cpus-per-task=1 --mem-per-cpu=500M --exclusive small_prog1 &srun --nodes=1 --ntasks=2 --cpus-per-task=1 --mem-per-cpu=200M --exclusive small_prog2 &waitNote: --exclusive enables each run step to be scheduled independently. The last wait has to be there otherwise the job will be finished right away and all steps are killed.