Project-4/slurm_scripts/execute.script
2023-12-03 13:33:48 +01:00

65 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
usage() {
>&2 cat << EOF
Usage: $0
[ -h | --help ]
[ --start-temp input ]
[ --end-temp input ]
[ --points input ]
[ --samples input ]
EOF
exit 1
}
# Defaults
start_temp=2.1
end_temp=2.4
points_temp=40
samples=1000000
array_arg=20
time_arg="0-00:30:00"
VALID_ARGS=$(getopt -o h --long help,start-temp:,end-temp:,points:,samples:,array:,time: -- "$@")
if [[ $? -ne 0 ]]; then
usage
fi
eval set -- ${VALID_ARGS}
while :
do
case "$1" in
-h | --help)
usage
shift
;;
--start-temp)
start_temp=$2
shift 2
;;
--end-temp)
end_temp=$2
shift 2
;;
--points)
points=$2
shift 2
;;
--samples)
samples=$2
shift 2
;;
--array)
array_arg=$(echo "${2// /}")
shift 2
;;
--time)
time_arg=$2
shift 2
;;
--) shift; break ;;
esac
done
sbatch --array=$array_arg --time=$time_arg ./jobs/pt.script $start_temp $end_temp $points_temp $samples