#!/bin/bash
#SBATCH --nodes=1            # Number of nodes
#SBATCH --gres=gpu:4        # Allocate 4 GPUs per node
#SBATCH --ntasks-per-node=40 # Number of tasks per node
#SBATCH --cpus-per-task=1    # Number of OpenMP threads per task
#SBATCH --hint=nomultithread # Disable hyperthreading
#SBATCH --job-name=ADF               # Jobname
#SBATCH --output=ADF.o%j           # Output file
#SBATCH --error=ADF.o%j           # Error file
#SBATCH --time=10:00:00      # Expected runtime HH:MM:SS (max 100h for V100, 20h for A100)
##
## Please, refer to comments below for
## more information about these 4 last options.
##SBATCH --account=<account>@v100      # To specify gpu accounting: <account> = echo $IDRPROJ
##SBATCH --partition=<partition>       # To specify partition (see IDRIS web site for more info)
##SBATCH --qos=qos_gpu-dev      # Uncomment for job requiring less than 2 hours
##SBATCH --qos=qos_gpu-t4      # Uncomment for job requiring more than 20h (up to 16 GPU, V100 only)
# Cleans out the modules loaded in interactive and inherited by default
module purge

# Load the necessary modules 
module load adf/2019.104-mpi-cuda cuda/10.1.1

# JOBSCRATCH is automatically deleted at the end of the job
export SCM_TMPDIR=$JOBSCRATCH

# Execution
./opt.inp