Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#!/bin/bash
#SBATCH -N 2 # allocate 2 nodes for the job
#SBATCH --ntasks-per-node=20
##SBATCH --exclusive # no other jobs on the nodes while job is running
#SBATCH -o fluentP_%J.out # the file to write stdout for fluent job
#SBATCH -e fluentP_%J.err # the file to write stderr for fluent job

source /etc/profile.d/modules.sh
module load fluent/$VERSION

if [ -z "$SLURM_NPROCS" ]; then
  N=$(( $(echo $SLURM_TASKS_PER_NODE | sed -r 's/([0-9]+)\(x([0-9]+)\)/\1 * \2/') ))
else
  N=$SLURM_NPROCS
fi

echo -e "N: $N\n";

# run fluent in batch on the allocated node(s)
fluent 2ddp -g -slurm -t$N -pdefault (or infiniband-pinfiniband) -ssh -i foo.txt

Make sure to replace foo.txt in the last line with the name of your job file. Then, submit your job with:

...