#!/bin/bash --login
#SBATCH --job-name=[name_of_job]
#SBATCH --partition=work
#SBATCH --ntasks=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=[neededMemory] #It's important to assign enough memory
#SBATCH --time=[neededTime]
#--- Load neccessary modules and list them:
module load openfoam-org-container/7
module list
#--- Specific settings for the cluster you are on
#(Check the specific guide of the cluster for additional settings)
#--- Automating the list of IORANKS for collated fileHandler
echo "Setting the grouping ratio for collated fileHandling"
nProcs=1152 #Number of total processors in decomposition for this case
mGroup=32 #Size of the groups for collated fileHandling (32 is the initial recommendation for Setonix)
of_ioRanks="0"
iC=$mGroup
while [ $iC -le $nProcs ]; do
of_ioRanks="$of_ioRanks $iC"
((iC += $mGroup))
done
export FOAM_IORANKS="("${of_ioRanks}")"
echo "FOAM_IORANKS=$FOAM_IORANKS"
#--- Execute tools:
srun -N 1 -n 1 -c 1 blockMesh
srun -N 1 -n 1 -c 1 setFields
srun -N 1 -n 1 -c 1 decomposePar |