#!/bin/bash

#SBATCH -J test               # Job name
#SBATCH -o job.%j.out         # Name of stdout output file (%j expands to jobId)
#SBATCH -p normal             # To use the normal queue. There is also a queue called test
#SBATCH -N 1                  # Total number of nodes requested
#SBATCH -n 32                 # Total number of mpi tasks requested
#SBATCH -t 00:15:00           # Run time (hh:mm:ss) - here 5 minutes


# For convenience, You can run a few commands. 
# It helps debug. 

echo "batch script in:"
pwd

echo "Date /time is :"
date

echo

# then run the Matlab script 
module purge
module load matlab/2023b

matlab -batch "testHPC"

echo "Date /time is :"
date

# list files in current folder to check that the text files have been written 
echo ls -ltr
ls -ltr

# remove the text files
echo rm -f temp_*
rm -f temp_*

# list again to show that the files have been removed
echo ls -ltr
ls -ltr


