SMP parallel job
The following script is to perform an Abaqus computation. FEM application usually do not scale well and tend to use intensive I/O, so we request 8 cores on a single machine. To avoid performance degradation due to intensive I/O, we use the local storage below /usertemp.
Moreover, we request 5GB RAM per core, i.e. 40GB RAM in total.
#!/bin/bash -l
#SBATCH --ntasks 1
#SBATCH --cpus-per-task 8
#SBATCH --mem-per-cpu 5000
#SBATCH --time=12:00:00
# initialize module system and load Abaqus module
. /etc/profile.d/module.sh
module load abaqus/2021
# Create working directory below $SCRATCH
MYWORKDIR=$SCRATCH/$SLURM_JOBID
mkdir $MYWORKDIR
# Copy input file from the submitting directory to our working directory
cp $SLURM_SUBMIT_DIR/Beispiel.inp $MYWORKDIR
# change to working directory and start computation
cd $MYWORKDIR
abaqus job=Beispiel input=Beispiel cpus=8 interactive
# copy back important results
cp -r Beispiel.* $SLURM_SUBMIT_DIR
# Clean up
rm -rf $MYWORKDIR
exit
Consider that $SCRATCH on the login nodes and the compute nodes are local (i.e. different) directories.
Therefore the input files are first copied during job runtime from a network file system to the SSD and vice-versa after finishing the computation.
MPP parallel job
The following script is to perform a generic MPI-parallel computation with the software my_program. As the software runs on multiple nodes we use the network storage below /work.
#!/bin/bash -l
#SBATCH --ntasks 32
#SBATCH --cpus-per-task 1
#SBATCH --mem-per-cpu 2000
#SBATCH --time=12:00:00
# initialize module system and load module for Intel compiler and MPI
. /etc/profile.d/module.sh
module load intel/2019
# Create working directory below $WORK
MYWORKDIR=$WORK/$SLURM_JOBID
mkdir $MYWORKDIR
# Copy input file from the submitting directory to our working directory
cp ~/my_case/inputfile $MYWORKDIR
cd $MYWORKDIR
# Create host file with the information how to distribute the workload
srun hostname > hostfile_$SLURM_JOBID
# start computation
mpirun -np 32 -machinefile hostfile_$SLURM_JOBID my_program
# copy output files back
cp -r * ~/my_case
# Clean up
rm -rf $MYWORKDIR
exit
GPU-Job
The following script is to perform a computation with the software gromacs on 8 CPU cores and one GPU card. The environment variable GPU_DEVICE_ORDINAL tells us the ID(s) of the assigned GPUs.
#!/bin/bash -l
#SBATCH --ntasks 1
#SBATCH --cpus-per-task 8
#SBATCH --gres gpu:1
#SBATCH --mem-per-cpu 2000
#SBATCH --time 12:00:00
# initialize module system and load Abaqus module
. /etc/profile.d/module.sh
module load gromacs/4.6.5-gpu
# Create working directory below $SCRATCH
MYWORKDIR=$SCRATCH/$SLURM_JOBID
mkdir $MYWORKDIR
# Copy input files from the submitting directory to our working directory
cp ~/gromacs_data/* $MYWORKDIR
# change to working directory and start computation
cd $MYWORKDIR
mdrun_mpi -ntomp 8 -v -s a.tpr -o a.trr -c a.pdb -e a.edr -g a.log
# Copy results back
cp * ~/gromacs_data/
# Clean up
rm -rf $MYWORKDIR
exit