-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingleSolve.sh
More file actions
64 lines (50 loc) · 1.74 KB
/
singleSolve.sh
File metadata and controls
64 lines (50 loc) · 1.74 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
#!/bin/bash
#
#SBATCH --job-name=single_solve
#SBATCH --time=01:00:00
#SBATCH --ntasks=1
#SBATCH --nodes=1
#SBATCH --partition=skylake,skylake_mpi
#SBATCH --mem-per-cpu=16g
module purge
module load Boost/1.76.0-GCC-10.3.0
module load GCC/10.3.0
cd ..
TMPDIR=$VSC_SCRATCH_VO_USER
home=$VSC_DATA/BreakID_testScripts
results=$home/LOC
instances=INSTANCES
filename=FILENAME
config=CONFIG
extension="${filename##*.}"
filename="${filename%.*}"
FOUND_OPT="NA"
RUNTIME_ROUNDINGSAT="NA"
CONFLICTS="NA"
STATUS="NA"
OUTPUT_CODE_ROUNDINGSAT="NA"
writeback() {
echo "${filename}, ${config}, $RUNTIME_ROUNDINGSAT, $STATUS, $FOUND_OPT, $CONFLICTS, $OUTPUT_CODE_ROUNDINGSAT" >> "$results"/"$filename"_"$config"_result.csv
FOUND_OPT="NA"
RUNTIME_ROUNDINGSAT="NA"
STATUS="NA"
CONFLICTS="NA"
OUTPUT_CODE_ROUNDINGSAT="NA"
}
{ time cat $TMPDIR/${filename}_${config}_opb.opb | $home/roundingsat --lp=1 --opt-mode=linear 1>$TMPDIR/${filename}_${config}_rs.txt ; } 2>$TMPDIR/${filename}_${config}_rstime.txt
OUTPUT_CODE_ROUNDINGSAT=$(echo $?)
FOUND_OPT=$(grep '^o ' $TMPDIR/${filename}_${config}_rs.txt | grep -Eo '[+-]?[0-9]{1,}')
RUNTIME_ROUNDINGSAT=$(grep 'real' $TMPDIR/${filename}_${config}_rstime.txt | grep -Eo '[0-9]{1,}[m][0-9]{1,}[.][0-9]{1,}')
CONFLICTS=$(grep '^c conflicts' $TMPDIR/${filename}_${config}_rs.txt | grep -Eo '[0-9]{1,}')
STATUS=$(grep '^s ' $TMPDIR/${filename}_${config}_rs.txt | grep -Po 's\s\K.*')
echo "$filename with $config"
echo "conflicts: $CONFLICTS"
echo "roundingsat status: $STATUS"
echo "found optimum: $FOUND_OPT"
echo "total runtime Roundingsat: $RUNTIME_ROUNDINGSAT"
writeback $config
rm $TMPDIR/${filename}_${config}_rs.txt
rm $TMPDIR/${filename}_${config}_rstime.txt
#rm $TMPDIR/${filename}_${config}_opb.opb
cd $VSC_DATA
rm core.*