#!/bin/bash #SBATCH --job-name=T0X_MyName #SBATCH --ntasks=1 #SBATCH --cpus-per-task=1 export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK # Set the kernel in the Config.sh file of Gadget and recompile, # then uncomment the corresponding line below. # kernel=cubic # kernel=quintic kernel=wendc2 # kernel=wendc2b # kernel=wendc6 # kernel=wendc8 for ics in grid_10x10x10 packed_12x12x12 glass_10x10x10 do resultsfile=$kernel-$ics test -f $resultsfile && rm $resultsfile boxsize=1 for neighbors in 15 16 17 18 19 20 22 24 26 28 30 35 40 45 50 55 60 70 80 90 100 120 140 160 180 200 250 300 350 400 do echo "$kernel - $ics - $neighbors" # We use double quotes here (and not single quotes) # because we want parameter expansion to still take place. sed -e " s/InitCondFile.*/InitCondFile $ics/ s/BoxSize.*/BoxSize $boxsize/ s/SnapshotFileBase.*/SnapshotFileBase snap/ s/DesNumNgb.*/DesNumNgb $neighbors/ " box.param rm snap* # Make sure the path to your OpenGadget executable is correct. mpirun -np $SLURM_NTASKS --cpus-per-proc $SLURM_CPUS_PER_TASK Hydro-OpenGadget3/P-Gadget3 box.param echo " $neighbors `./meandensity`" >>$resultsfile done done