Frequently Asked Question
How to launch multiple single core jobs on one compute node
Last Updated 2 years ago
If you need to run multiple single core jobs, and don't want to waste your budget or computing resources by running a single core job on a whole compute node, you can create a slurm batch script something like this. In this case we are going to run a serial python spplications, with every python app in its own directory.
!/bin/bash #SBATCH --job-name=calculation # job name #SBATCH -o calc.out # output file name for all the single core jobs #SBATCH -n 4 # 4 cores #SBATCH --ntasks-per-node=4 module load Python srun -n1 --exclusive python directory1/calculation1.py & srun -n1 --exclusive python directory2/calculation2.py & srun -n1 --exclusive python directory3/calculation3.py & srun -n1 --exclusive python directory4/calculation4.py & wait