-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecution_script.sh
More file actions
executable file
·127 lines (114 loc) · 6.77 KB
/
execution_script.sh
File metadata and controls
executable file
·127 lines (114 loc) · 6.77 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
#SBATCH -N 1 # 1 compute node
#SBATCH -n 2 # 2 cores
#SBATCH -t 48:00:00 # 72 hours (max)
#SBATCH -p compute # partition name
#SBATCH [email protected]
#SBATCH --mail-type=ALL
# clear
echo "Starting script at $(date)"
echo "Running on host $(hostname)"
echo "Current directory: $(pwd)"
echo "Version: ${1}"
echo "Data directory: ${2}"
echo "Project's name: ${3}"
echo "Execution index: ${4}"
echo "Scratch directory: ${5}"
echo "Source directory: ${2}/${3}/${6}"
echo "Build directory: ${2}/${3}/${7}"
echo "Compile command: ${8}"
echo "Test command: ${9}"
echo "Clean command: ${10}"
echo "Whitelist file: ${11}"
echo "Java home: ${12}"
echo "Regex pattern: ${13}"
echo "Timeout: ${14}"
echo "Fail string: ${15}"
echo "initial timeout: ${16}"
echo "MediumDarwin path: ${17}"
echo "SLURM_JOB_NAME: $SLURM_JOB_NAME"
echo "SLURM_JOBID: $SLURM_JOBID"
echo "SLURM_JOB_NODELIST: $SLURM_JOB_NODELIST"
echo "SLURM_NODEID: $SLURM_NODEID"
echo "SLURMTMPDIR: $SLURMTMPDIR"
echo "SLURM_SUBMIT_DIR: $SLURM_SUBMIT_DIR"
echo "SLURM_JOB_CPUS_PER_NODE: $SLURM_JOB_CPUS_PER_NODE"
echo "SLURM_JOB_PARTITION: $SLURM_JOB_PARTITION"
echo "SLURM_MEM_PER_NODE: $SLURM_MEM_PER_NODE"
echo "SLURM_MEM_PER_CPU: $SLURM_MEM_PER_CPU"
echo "SLURM_JOB_NUM_NODES: $SLURM_JOB_NUM_NODES"
echo "Loading modules"
module purge
module load maven/3.8.4-gcc-13.1.0-4drl74n
module load python/3.11.6-gcc-13.1.0-rri7oiq py-pip/23.1.2-gcc-13.1.0-k6tgxbx
export JAVA_HOME="${12}"
export PATH="${12}/bin:$PATH"
export PATH="${PATH}"
echo "Modules loaded"
echo "PATH is $PATH"
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
if [[ "${1}" == "-o" ]]; then
# echo "original"
rm -fr "${5}/${3}-original-${4}"
cp -r "${2}/${3}" "${5}/${3}-original-${4}"
echo "Preparing whitelist:"
echo "s/\*/\\${5}\/${3}-original-${4}/g" ${5}/${3}-original-${4}/${11}
sed -i "s/\*/\\${5}\/${3}-original-${4}/g" ${5}/${3}-original-${4}/${11}
cat ${5}/${3}-original-${4}/${11}
echo "Running the original MediumDarwin:"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo python3 -u ${17} --fail_string "${15}" --all -b -m --higher-order 1 -p "${5}/${3}-original-${4}/${6}" -t "${5}/${3}-original-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --whitelist "${5}/${3}-original-${4}/${11}"
time python3 -u ${17} --fail_string "${15}" --all -b -m --higher-order 1 -p "${5}/${3}-original-${4}/${6}" -t "${5}/${3}-original-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --whitelist "${5}/${3}-original-${4}/${11}"
zip -q -r "${2}/${3}-original-${4}" "${5}/${3}-original-${4}/LittleDarwinResults"
rm -fr "${5}/${3}-original-${4}"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
elif [[ "${1}" == "-q" ]]; then
# echo "test selection"
rm -fr "${5}/${3}-test_selection-${4}"
cp -r "${2}/${3}" "${5}/${3}-test_selection-${4}"
echo "Preparing whitelist:"
echo "s/\*/\\${5}\/${3}-test_selection-${4}/g" ${5}/${3}-test_selection-${4}/${11}
sed -i "s/\*/\\${5}\/${3}-test_selection-${4}/g" ${5}/${3}-test_selection-${4}/${11}
cat ${5}/${3}-test_selection-${4}/${11}
echo "Running the test_selection MediumDarwin:"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo python3 -u ${17} --fail_string ${15} --all -q -b -m --higher-order 1 -p "${5}/${3}-test_selection-${4}/${6}" -t "${5}/${3}-test_selection-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --whitelist "${5}/${3}-test_selection-${4}/${11}" --initial-timeout "${16}"
time python3 -u ${17} --fail_string ${15} --all -q -b -m --higher-order 1 -p "${5}/${3}-test_selection-${4}/${6}" -t "${5}/${3}-test_selection-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --whitelist "${5}/${3}-test_selection-${4}/${11}" --initial-timeout "${16}"
zip -q -r "${2}/${3}-test_selection-${4}" "${5}/${3}-test_selection-${4}/LittleDarwinResults"
rm -fr "${5}/${3}-test_selection-${4}"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
elif [[ "${1}" == "-e" ]]; then
# echo "Schemata"
rm -fr "${5}/${3}-schemata-${4}"
cp -r "${2}/${3}" "${5}/${3}-schemata-${4}"
echo "Preparing whitelist:"
echo "s/\*/\\${5}\/${3}-schemata-${4}/g" ${5}/${3}-schemata-${4}/${11}
sed -i "s/\*/\\${5}\/${3}-schemata-${4}/g" ${5}/${3}-schemata-${4}/${11}
cat ${5}/${3}-schemata-${4}/${11}
echo "Running the schemata MediumDarwin:"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo python3 -u ${17} --fail_string "${15}" --all -e -b -m --jobs-no 1 --higher-order 1 -p "${5}/${3}-schemata-${4}/${6}" -t "${5}/${3}-schemata-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --compile_failure_regex "${13}" --whitelist "${5}/${3}-schemata-${4}/${11}" --initial-timeout "${16}" #--cleanup "${10}"
time python3 -u ${17} --fail_string "${15}" --all -e -b -m --jobs-no 1 --higher-order 1 -p "${5}/${3}-schemata-${4}/${6}" -t "${5}/${3}-schemata-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --compile_failure_regex "${13}" --whitelist "${5}/${3}-schemata-${4}/${11}" --initial-timeout "${16}" #--cleanup "${10}"
zip -q -r "${2}/${3}-schemata-${4}" "${5}/${3}-schemata-${4}/LittleDarwinResults"
rm -fr "${5}/${3}-schemata-${4}"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
elif [[ "${1}" == "-eq" ]]; then
# echo "Schemata+Test selection"
rm -fr "${5}/${3}-schemata_test_selection-${4}"
cp -r "${2}/${3}" "${5}/${3}-schemata_test_selection-${4}"
echo "Preparing whitelist:"
echo "s/\*/\\${5}\/${3}-schemata_test_selection-${4}/g" ${5}/${3}-schemata_test_selection-${4}/${11}
sed -i "s/\*/\\${5}\/${3}-schemata_test_selection-${4}/g" ${5}/${3}-schemata_test_selection-${4}/${11}
cat ${5}/${3}-schemata_test_selection-${4}/${11}
echo "Running the schemata test selection MediumDarwin:"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo python3 -u ${17} --fail_string "${15}" --all -e -q -b -m --jobs-no 1 --higher-order 1 -p "${5}/${3}-schemata_test_selection-${4}/${6}" -t "${5}/${3}-schemata_test_selection-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --compile_failure_regex "${13}" --whitelist "${5}/${3}-schemata_test_selection-${4}/${11}" --initial-timeout "${16}" #--cleanup "${10}"
time python3 -u ${17} --fail_string "${15}" --all -e -q -b -m --jobs-no 1 --higher-order 1 -p "${5}/${3}-schemata_test_selection-${4}/${6}" -t "${5}/${3}-schemata_test_selection-${4}/${7}" -c "${8}" --test-command "${9}" --timeout "${14}" --compile_failure_regex "${13}" --whitelist "${5}/${3}-schemata_test_selection-${4}/${11}" --initial-timeout "${16}" #--cleanup "${10}"
zip -q -r "${2}/${3}-schemata_test_selection-${4}" "${5}/${3}-schemata_test_selection-${4}/LittleDarwinResults"
rm -fr "${5}/${3}-schemata_test_selection-${4}"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
else
echo "The version argument is not detected!"
fi