#!/bin/bash
#SBATCH --job-name=Ast_511
#SBATCH --exclusive  
#SBATCH --export=ALL
#SBATCH -t 0-24:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=128
#SBATCH -C rome
####SBATCH -p gen --qos=gen
####SBATCH -p preempt --qos=preempt
#SBATCH -p cmbas --qos=cmbas

module purge
module load slurm
module load gcc
module load openmpi
module load fftw/mpi-2
module load lib/openblas
module load lib/gsl
module load lib/hdf5

folder="/mnt/ceph/users/camels/Sims/Astrid_DM/LH_511"
ICs="/mnt/ceph/users/camels/Codes/2lpt/2LPTic"
G3="/mnt/ceph/users/camels/Codes/Gadget_III/P-Gadget3"

export OMPI_MCA_btl=self,vader

cd $folder
if [ ! -f snap_090.hdf5 ]
then
    cd ICs
    mpirun -np 8 $ICs 2LPT.param > logIC
    cd ..
    mpirun -np 128 $G3 G3.param > logfile
fi
    