-1

I've been pulling my hair for about a week to get the sbatch job script to submit to multiple nodes. I have two compute nodes with (2)sockets (12)cores/socket (2)threads/core. I have a simple c program which calculates the Fibonacci series (no multi thread or mpi just a single process single core program).

Now I have script fib.sh which contains 30 lines of "srun ./fibonacci &" and i do ./fib.sh the 1st 12 jobs run on the first node1, the next 12 run on another node2 and the rest are in waiting state which is what i want.

But when I try to get this same behavior with sbatch all the tasks run on node1 which is not what I want. I tweaked around with the #SBATCH flags using -n1 -N2, --cpus-per-task=1, but not getting the desired result. I appreciate it if someone can shed some light on this.

Below is part of my slurm.conf if needed

# SCHEDULING 
FastSchedule=1
SchedulerType=sched/backfill
SelectType=select/cons_res
SelectTypeParameters=CR_Core

NodeName=node[1-2] Sockets=2 CoresPerSocket=12 ThreadsPerCore=2 State=UNKNOWN
PartitionName=debug Nodes=node[1-2] Default=YES MaxTime=INFINITE State=UP

Below is the sbatch script

#!/bin/bash
# SBATCH --cpus-per-task=30
#SBATCH --ntasks-per-core=1
#run ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
srun ./fib 3 &
wait
Bhargav
  • 43
  • 8

1 Answers1

2

If I've understood correctly you want to run 30 identical copies of fib? (First off, you don't want 30 srun lines (or the &) - SLURM handles the multiple copies.)

If this is the case, you probably just want something like this in your submit script:

#!/bin/bash
#SBATCH --ntasks=30
srun ./fib 3
ciaron
  • 1,089
  • 7
  • 15