Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
#BATCH --job-name=mc
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=4480
#SBATCH --time=8:00:00
#SBATCH --account=pi-lgrandi
#SBATCH --partition=xenon1t,dali
#SBATCH --qos=xenon1t
#SBATCH --output=logs/log-%J.txt
#SBATCH --error=logs/error-log-%J.txt
#SBATCH --mail-user=arianna.rocchetti@physik.uni-freiburg.de
# Number of events per file
NEVENTS=100
# Set these according to how many files you want
FILESTART=0
FILEEND=10
echo "simulating, number of files: " ${FILEEND}
echo "in each file: " ${NEVENTS}
numfile=0 # counter
for (( ifile=${FILESTART}; ifile<=${FILEEND}; ifile++ ))
do
(
echo "file : " ${ifile}
./run_sim_easy.sh ${ifile} G4 Cryostat_K40 ${NEVENTS} v2.5.0 preinit_TPC.mac run_Cryostat_K40.mac XENONnT #this work outside the for loop
)&
# Hold script until existing processes finish
numfile=$(( $numfile + 1 ))
if [[ $numfile == $NUM_FILES ]]; then
numfile=0
wait
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.