forked from UoB-HPC/advanced-hpc-lbm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_submission.sh
executable file
·65 lines (50 loc) · 1.56 KB
/
check_submission.sh
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#
# This script verifies submission structurefrom the COMS30006 Lattice Boltzmann
# coursework. This script should be run from the directory containing the files
# to be submitted.
#
# This script will unload all modules and source 'env.sh' (if present). It will
# then run `make` and check that there is an executable with the correct name.
set -e
EXE=d2q9-bgk
ENV=env.sh
module list |& tail -n +2
echo "Unloading all modules"
module purge
echo "Loading default languages/intel module"
module load languages/intel
if [ -r "$ENV" ]; then
echo "Sourcing $ENV"
source "$ENV"
else
echo "No $ENV present, skipping"
fi
module list
echo "Cleaning old executable"
rm -f "$EXE"
if [ ! -r Makefile ]; then
echo -e "\nERROR: Makefile not found."
exit 1
fi
echo 'Running `make`:'
if ! make -B; then
echo -e "\nERROR: Build failed. Are you missing any modules from $ENV?"
exit 11
elif [ ! -r "$EXE" ]; then
echo -e "\nERROR: Executable '$EXE' is not present."
echo "If your executable name is different, please change it to '$EXE' in your Makefile."
exit 12
else
make -s clean
cat <<-EOM
Submission check passed.
Please ensure that you submit all source files in the submission directory:
- Makefile
- d2q9-bgk.c
- env.sh (if used)
- Any other files needed to build that you've added, e.g. OpenCL kernel files.
Please also submit your report with the filename 'report.pdf'.
Note: Your code has NOT been run and this does NOT mean that the results validate. You should check correctness separately.
EOM
fi