Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Ansys fluent in HPC Error at host: › Reply To: Ansys fluent in HPC Error at host:
#!/bin/bash -l
# use bash as shell
# the -l option is necessary to make the local enviroment equal to the login environment
# slurm commands start with #SBATCH
# all other stuff behind a # on the same line is commentÂ
Â
#SBATCH -D ./ Â Â Â Â Â Â Â Â Â Â Â # directory where the mpiexec command is ran
#SBATCH -J HPC_Sim_01 Â Â Â Â Â Â Â Â Â # name of the job (can be changed to whichever name you like)
#SBATCH --get-user-env       # to set environment variables
#SBATCH -o output.log        # output file
#SBATCH -e output.log        # error file
#SBATCH --mem-per-cpu=2GB Â Â Â Â Â Â Â Â Â # memory per node in megabytes
#SBATCH --time=0-20:00:00 Â Â Â Â Â # simulation time in d-hh:mm:ss
#SBATCH --nodes=1 Â Â Â Â Â Â Â Â Â Â Â # number of nodes
#SBATCH --ntasks-per-node=32 Â Â Â Â Â Â # number of MPI processes on the node (^= cores to be used)
#SBATCH --account=--Â Â # replace with your education/research/project account if applicable
Â
# get the jobid for later reference
myjobid=$SLURM_JOB_ID
echo "myjobid = " $myjobid
Â
# load modules
module load ansys/2021R2
Â
if [ "$SLURM_PROCID" == "0" ]; then
# set up  hostfile containing the list of nodes/cores used
    scontrol show hostname $SLURM_JOB_NODELIST >  hostfile.txt
    fluent  2ddp -t$SLURM_NTASKS -rsh  -g  -i microchannel.script -cnf=hostfile.txt -pib.ofed
fi
exit 0