|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# HACK: This will not wait for other tasks on the node to complete |
| 4 | +if [[ "$SLURM_LOCALID" == 0 ]]; then |
| 5 | + monitorFile=monitor-$SLURM_JOBID.$SLURM_NODEID.txt |
| 6 | + ./monitor.sh >logs/"$ARCUBE_OUT_NAME"/"$SLURM_JOBID"/"$monitorFile" & |
| 7 | +fi |
| 8 | + |
| 9 | +# Just in case, to avoid a rush for the lockfile |
| 10 | +sleep $((RANDOM % 20)) |
| 11 | + |
| 12 | +source venv/bin/activate |
| 13 | + |
| 14 | +outDir=../run-edep-sim/output/${ARCUBE_OUT_NAME}/LARNDSIM |
| 15 | +mkdir -p "$outDir" |
| 16 | + |
| 17 | +inFile=input/${ARCUBE_OUT_NAME}/input.list |
| 18 | + |
| 19 | +dotlockfile=liblockfile/dotlockfile |
| 20 | + |
| 21 | +while read -r input; do |
| 22 | + outName=$(basename "$input" .EDEPSIM.h5) |
| 23 | + |
| 24 | + [[ -e "$outDir/$outName.lock" ]] && continue |
| 25 | + [[ -e "$outDir/$outName.time" ]] && continue |
| 26 | + $dotlockfile -r 0 "$outDir/$outName.lock" || continue |
| 27 | + |
| 28 | + echo FILE-START "$(date)" |
| 29 | + |
| 30 | + /usr/bin/time -f "%P %M %E" -o "$outDir/$outName.time" \ |
| 31 | + simulate_pixels.py --input_filename "$input" \ |
| 32 | + --output_filename "$outDir/$outName.LARNDSIM.h5" \ |
| 33 | + --detector_properties larnd-sim/larndsim/detector_properties/2x2.yaml \ |
| 34 | + --pixel_layout larnd-sim/larndsim/pixel_layouts/multi_tile_layout-2.3.16.yaml \ |
| 35 | + --response_file larnd-sim/larndsim/bin/response_44.npy \ |
| 36 | + --light_lut_filename larnd-sim/larndsim/bin/lightLUT.npz \ |
| 37 | + --light_det_noise_filename larnd-sim/larndsim/bin/light_noise-2x2-example.npy |
| 38 | + |
| 39 | + echo FILE-END "$(date)" |
| 40 | + |
| 41 | + rm -f "$outDir/$outName.lock" |
| 42 | +done < "$inFile" |
0 commit comments