-
Notifications
You must be signed in to change notification settings - Fork 0
/
slurm-download.job
executable file
·44 lines (35 loc) · 1.12 KB
/
slurm-download.job
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
#SBATCH -J nimrodDL
#SBATCH -N 1
#SBATCH -n 55
#SBATCH -o %j.%N.%a.nimrod-download.out.log
#SBATCH -e %j.%N.%a.nimrod-download.err.log
#SBATCH -p ecompute
#SBATCH --time=5-00:00:00
CONFIG="${CONFIG:-$HOME/repos/nimrod-data-downloader/settings-min.custom.toml}";
OUTPUT="${OUTPUT:-$HOME/data/nimrod-all}";
echo ">>> Settings";
echo "CONFIG $CONFIG";
echo "OUTPUT $OUTPUT";
if [[ -z "${CONFIG}" ]]; then
echo "Error: No config file specified in the CONFIG environment variable.";
exit 1;
fi
if [[ -z "${OUTPUT}" ]]; then
echo "Error: No output directory specified in the OUTPUT environment variable.";
exit 2;
fi
if [[ ! -r "${CONFIG}" ]]; then
echo "Error: That config file either doesn't exist or we don't have permission to access it.";
exit 3;
fi
if [[ ! -d "${OUTPUT}" ]]; then
echo "Creating output directory '${OUTPUT}'";
mkdir -p "${OUTPUT}";
fi
export PATH=$HOME/software/bin:$PATH;
echo ">>> Installing dependencies";
npm install;
echo ">>> Downloading data";
/usr/bin/env time -v src/index.mjs download --log-level INFO --verbose --config "${CONFIG}" --output "${OUTPUT}";
echo ">>> exited with code $?";