-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingleBreak.sh
More file actions
77 lines (67 loc) · 3.84 KB
/
singleBreak.sh
File metadata and controls
77 lines (67 loc) · 3.84 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
#!/bin/bash
#
#SBATCH --job-name=single_break
#SBATCH --time=00:30:00
#SBATCH --ntasks=1
#SBATCH --nodes=1
#SBATCH --partition=skylake,skylake_mpi
#SBATCH --mem-per-cpu=16g
cd ../..
TMPDIR=$VSC_SCRATCH_VO_USER
home=$VSC_DATA/BreakID_testScripts
results=$home/LOC
instances=INSTANCES
filename=FILENAME
config=CONFIG
arguments="ARGS"
extension="${filename##*.}"
filename="${filename%.*}"
RUNTIME_BREAKID="NA"
TOTAL_SYMM_GENS="NA"
STRONG_SYMM_GENS="NA"
WEAK_SYMM_GENS="NA"
SYMM_GROUPS="NA"
TOTAL_CONSTR_BEGIN="NA"
TOTAL_VARS_BEGIN="NA"
TOTAL_VARS_ADDED="NA"
TOTAL_CONSTR_ADDED="NA"
REG_CONSTR_ADDED="NA"
BIN_CONSTR_ADDED="NA"
ROW_CONSTR_ADDED="NA"
MATRICES="NA"
ROW_SWAPS="NA"
OUTPUT_CODE_BREAKID="NA"
{ time cat $instances/${filename}.${extension} | $home/BreakID $arguments -v 1 -t 300 -s 100 2>$TMPDIR/${filename}_${config}_breakinfo.txt 1>$TMPDIR/${filename}_${config}_opb.opb ; } 2>$TMPDIR/${filename}_${config}_brtime.txt
OUTPUT_CODE_BREAKID=$(echo $?)
RUNTIME_BREAKID=$(grep 'real' $TMPDIR/${filename}_${config}_brtime.txt | grep -Eo '[0-9]{1,}[m][0-9]{1,}[.][0-9]{1,}')
TOTAL_SYMM_GENS=$(grep '**** total symmetry generators detected:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
STRONG_SYMM_GENS=$(grep '**** strong symmetry generators detected:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
WEAK_SYMM_GENS=$(grep '**** weak symmetry generators detected:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
SYMM_GROUPS=$(grep '**** subgroups detected:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
TOTAL_CONSTR_BEGIN=$(grep '* #variable= ' $instances/${filename}.${extension} | grep -Eo '#constraint= [0-9]{1,}' | grep -Eo '[0-9]{1,}')
TOTAL_VARS_BEGIN=$(grep -Eo '* #variable= [0-9]{1,}' $instances/${filename}.${extension} | grep -Eo '[0-9]{1,}')
REG_CONSTR_ADDED=$(grep '**** regular symmetry breaking clauses added:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
BIN_CONSTR_ADDED=$(grep '**** extra binary symmetry breaking clauses added:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
ROW_SWAPS=$(grep '**** row swaps detected:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
MATRICES=$(cat $TMPDIR/${filename}_${config}_breakinfo.txt | grep '**** matrices detected:' | grep -Eo '[0-9]{1,}')
ROW_CONSTR_ADDED=$(grep '**** row interchangeability breaking clauses added:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
TOTAL_CONSTR_ADDED=$(($REG_CONSTR_ADDED + $BIN_CONSTR_ADDED + $ROW_CONSTR_ADDED))
TOTAL_VARS_ADDED=$(grep '**** auxiliary variables introduced:' $TMPDIR/${filename}_${config}_breakinfo.txt | grep -Eo '[0-9]{1,}')
echo "$filename with $config"
echo "total variables beginning: $TOTAL_VARS_BEGIN"
echo "total constraints beginning: $TOTAL_CONSTR_BEGIN"
echo "total symmetry generators found: $TOTAL_SYMM_GENS"
echo "strong symmetry generators found: $STRONG_SYMM_GENS"
echo "weak symmetry generators found: $WEAK_SYMM_GENS"
echo "symmetry subgroups found: $SYMM_GROUPS"
echo "regular constraints added: $REG_CONSTR_ADDED"
echo "binary constraints added: $BIN_CONSTR_ADDED"
echo "row swaps added: $ROW_SWAPS"
echo "matrices found: $MATRICES"
echo "total row interchangeability breaking constraints added: $ROW_CONSTR_ADDED"
echo "total constraints added: $TOTAL_CONSTR_ADDED"
echo "total auxiliary variables added: $TOTAL_VARS_ADDED"
echo "total runtime BreakID: $RUNTIME_BREAKID"
echo "${filename}, ${config}, $RUNTIME_BREAKID, $TOTAL_CONSTR_BEGIN, $TOTAL_VARS_BEGIN, $TOTAL_SYMM_GENS, $STRONG_SYMM_GENS, $WEAK_SYMM_GENS, $SYMM_GROUPS, $MATRICES, $ROW_SWAPS, $REG_CONSTR_ADDED, $BIN_CONSTR_ADDED, $ROW_CONSTR_ADDED, $TOTAL_VARS_ADDED, $TOTAL_CONSTR_ADDED, $OUTPUT_CODE_BREAKID" >> "$results"/"$filename"_"$config"_result.csv
rm $TMPDIR/${filename}_${config}_breakinfo.txt
rm $TMPDIR/${filename}_${config}_brtime.txt