I need to run 3 tasks in parallel, using SLURM array. This is mu bash script :
#!/bin/bash
#SBATCH --job-name=test
#SBATCH --mem=550G
#SBATCH --cpus-per-task=128
#SBATCH --nodes=1
#SBATCH --partition=smp
#SBATCH --time=3-00:00:00
#SBATCH --export=all
#SBATCH --array=1-3
(...)
#create array to store the 3 directories I need to work on
IFS=$'n'
paths=($(find . -maxdepth 2 -name '*.txt' -printf '%hn' | sort -u))
unset IFS
#run command
for i in "${paths[$SLURM_ARRAY_TASK_ID-1]}"; do
mycommand -t ${SLURM_CPUS_PER_TASK} -o ./$(basename $i)/$(basename $i)_test $i/*.txt
done
The “smp” partition has only one node with enough ressources to run this script.
$ scontrol show node hpcsmp01
CPUAlloc=446 CPUTot=768 CPULoad=116.86
(...)
RealMemory=11498000 AllocMem=6952960 FreeMem=7739652 Sockets=16 Boards=1
I need to allocate 550G and 128 cpus for each array (I appreciate it is a very memory-consuming process) :
- Is
--mem=550G
allocate 550G per array ? or 550G for the 3 arrays (then, 550/3=183G) which won’t be enough --cpus-per-task=128
will correctly attribute 128 cpus / array?
Best