#!/bin/bash
#SBATCH -J c17_scf
#SBATCH --nodes=1 --ntasks-per-node=16
#SBATCH -t 144:00:00
#SBATCH --mail-user=euanbassey@ucsb.edu
#SBATCH --mail-type=start,end

export JOB=c17_scf
cd $SLURM_SUBMIT_DIR

#   unlimit the stack size
ulimit -s unlimited

#   What node are we running on?
echo $SLURM_JOB_NODELIST

#   Directory stuff- may be useful if we have to use /scratch
export DIR=$SLURM_SUBMIT_DIR
echo "submit directory: "
echo $SLURM_SUBMIT_DIR

#   Load the relevant modules
module purge
module load intel/18
module load openmpi/2.1.0
module load crystal17

#   Run the job and time it - remove time to ignore that part
time mpirun -np $SLURM_NTASKS Pcrystal < INPUT >& out

#   Remove the cruft
rm fort.*.pe*
