Skip to content

Commit

Permalink
added the abstraction with threshold algo
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillermo A. Perez committed May 12, 2016
1 parent 01aa739 commit 20eaa01
Show file tree
Hide file tree
Showing 15 changed files with 2,154 additions and 43 deletions.
10 changes: 10 additions & 0 deletions scripts/exec_jobs_list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

i=0
cat "jobs.list" | while read line
do
echo "$line &> ./tests/job${i}.log &"
eval "$line &> ./tests/job${i}.log &"
i=$(( $i + 1 ))
[[ $(( $i%10 )) -eq 0 ]] && wait
done
16 changes: 16 additions & 0 deletions scripts/gen4csv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
sort -t';' comp0.csv > sc0.csv
sort -t';' comp1.csv > sc1.csv
sort -t';' comp2.csv > sc2.csv
sort -t';' comp3.csv > sc3.csv

join -t';' sc0.csv sc1.csv > temp0.csv
join -t';' temp0.csv sc2.csv > temp1.csv
join -t';' temp1.csv sc3.csv > temp2.csv

awk -F';' '{m=$2;for(i=2;i<=NF;i++){if($i<m)m=$i;}print $1";"$2";"$3";"$4";"$5";"m}' temp2.csv > all.csv

grep -i 'amba*' all.csv > amba.csv
grep -i 'load*' all.csv > load.csv
grep -i 'gb_*' all.csv > genbuf.csv
awk -F';' '{if($6>30)print $1";"$2";"$3";"$4";"$5";"$6}' all.csv > more30.csv
114 changes: 114 additions & 0 deletions scripts/gen_jobs_list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#!/bin/bash

# This directory:
DIR=`dirname $0`/

# The directory where the benchmarks are located:
BM_DIR="\$HOME/bench-syntcomp14/"

REAL=10
UNREAL=20

# The benchmarks to be used.
# The files have to be located in ${BM_DIR}.

FILES=(
cycle_sched_10_2_1 $REAL
cycle_sched_10_2_2 $REAL
cycle_sched_11_2_1 $REAL
cycle_sched_12_2_1 $REAL
cycle_sched_12_2_2 $REAL
cycle_sched_12_2_3 $REAL
cycle_sched_12_2_4 $REAL
cycle_sched_13_2_1 $REAL
cycle_sched_14_2_1 $REAL
cycle_sched_14_2_2 $REAL
cycle_sched_15_2_1 $REAL
cycle_sched_15_2_3 $REAL
cycle_sched_16_2_1 $REAL
cycle_sched_16_2_2 $REAL
cycle_sched_16_2_4 $REAL
cycle_sched_17_2_1 $REAL
cycle_sched_18_2_1 $REAL
cycle_sched_18_2_3 $REAL
cycle_sched_19_2_1 $REAL
cycle_sched_20_2_4 $REAL
cycle_sched_21_2_3 $REAL
cycle_sched_24_2_3 $REAL
cycle_sched_24_2_4 $REAL
cycle_sched_28_2_4 $REAL
cycle_sched_2_2_1 $REAL
cycle_sched_32_2_4 $REAL
cycle_sched_3_2_1 $REAL
cycle_sched_4_2_1 $REAL
cycle_sched_4_2_2 $REAL
cycle_sched_5_2_1 $REAL
cycle_sched_6_2_1 $REAL
cycle_sched_6_2_2 $REAL
cycle_sched_6_2_3 $REAL
cycle_sched_7_2_1 $REAL
cycle_sched_8_2_1 $REAL
cycle_sched_8_2_2 $REAL
cycle_sched_8_2_4 $REAL
cycle_sched_9_2_1 $REAL
cycle_sched_9_2_3 $REAL
)

DECOMPABLE=(
cycle_sched_10_2_1
cycle_sched_10_2_2
cycle_sched_11_2_1
cycle_sched_12_2_1
cycle_sched_12_2_2
cycle_sched_12_2_3
cycle_sched_12_2_4
cycle_sched_13_2_1
cycle_sched_14_2_1
cycle_sched_14_2_2
cycle_sched_15_2_1
cycle_sched_15_2_3
cycle_sched_16_2_1
cycle_sched_16_2_2
cycle_sched_16_2_4
cycle_sched_17_2_1
cycle_sched_18_2_1
cycle_sched_18_2_3
cycle_sched_19_2_1
cycle_sched_20_2_4
cycle_sched_21_2_3
cycle_sched_24_2_3
cycle_sched_24_2_4
cycle_sched_28_2_4
cycle_sched_2_2_1
cycle_sched_32_2_4
cycle_sched_3_2_1
cycle_sched_4_2_1
cycle_sched_4_2_2
cycle_sched_5_2_1
cycle_sched_6_2_1
cycle_sched_6_2_2
cycle_sched_6_2_3
cycle_sched_7_2_1
cycle_sched_8_2_1
cycle_sched_8_2_2
cycle_sched_8_2_4
cycle_sched_9_2_1
cycle_sched_9_2_3
)

for element in $(seq 0 2 $((${#FILES[@]} - 1)))
do
for de in $(seq 0 1 $((${#DECOMPABLE[@]} - 1)))
do
if [[ ${FILES[$element]} == ${DECOMPABLE[$de]} ]]; then
file_name=${FILES[$element]}
infile_path=${BM_DIR}${file_name}.aag
correct_real=${FILES[$element+1]}
for solver in $(seq 0 1 4)
do
echo "\$HOME/AbsSynthe/start_co"$solver".sh" $infile_path $correct_real >> ${DIR}"jobs.list"
done
break
fi
done
done
74 changes: 74 additions & 0 deletions scripts/log_to_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import sys
import re

# in which lines are the numbers you want in your column?
# arbirary order allowed (gives order of columns in table)
# can take lines several times -> several identical columns
# use illegal lines (e.g. 1000) to produce blank columns
read_rel_lines = []
read_line_wtxt = ["CPU time", "CPU time", "Raw AIGER"]
# which number to take from a line (0 for first number in line ...)
take_nr_nr = [0, 1, 4]
SPACES_FILL = 20
DELIMITER = ";"


if len(sys.argv) != 3:
print "2 Arguments: input_file and output_file"
exit(0)

in_filename = sys.argv[1]
out_filename = sys.argv[2]
in_file = open(in_filename, 'r')
rel_line_count = 0
table = []

for line in in_file.readlines():
rel_line_count += 1
if line.find("=======") >= 0:
rel_line_count = 0
pos = line.find(".aag") - 1
if pos < 0:
print "Warning: header line must contain 'filename.aag'"
name = ""
while(pos >= 0 and line[pos] != ' '):
name = line[pos] + name
pos -= 1
table.append([])
table[-1].append(name)
for pos in read_rel_lines + read_line_wtxt:
table[-1].append("")

if read_rel_lines and rel_line_count in read_rel_lines:
occ = re.compile('[0-9.]+').findall(line)
if not occ:
print "Warning: line %d contains no number" % rel_line_count
else:
for col_count in range(0, len(read_rel_lines)):
if read_rel_lines[col_count] == rel_line_count and\
len(occ) > take_nr_nr[col_count]:
table[-1][col_count + 1] = occ[take_nr_nr[col_count]]

if read_line_wtxt and any(word in line for word in read_line_wtxt):
occ = re.compile('[0-9.]+').findall(line)
if not occ:
print "Warning: line %d contains no number" % rel_line_count
else:
for col_count in range(0, len(read_line_wtxt)):
if read_line_wtxt[col_count] in line and\
len(occ) > take_nr_nr[col_count]:
table[-1][col_count + 1] = occ[take_nr_nr[col_count]]
in_file.close()

out_string = ""
for row in table:
row_string = row[0]
for elem_nr in range(1, len(row)):
row_string += " " * ((elem_nr * SPACES_FILL) - len(row_string))
row_string += DELIMITER + row[elem_nr]
out_string += row_string + "\n"


out_file = open(out_filename, 'a')
out_file.write(out_string)
out_file.close()
74 changes: 74 additions & 0 deletions scripts/logscan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import sys
import re

# in which lines are the numbers you want in your column?
# arbirary order allowed (gives order of columns in table)
# can take lines several times -> several identical columns
# use illegal lines (e.g. 1000) to produce blank columns
read_rel_lines = []
read_line_wtxt = ["after incl"]
# which number to take from a line (0 for first number in line ...)
take_nr_nr = [0]
SPACES_FILL = 20
DELIMITER = ";"


if len(sys.argv) != 3:
print "2 Arguments: input_file and output_file"
exit(0)

in_filename = sys.argv[1]
out_filename = sys.argv[2]
in_file = open(in_filename, 'r')
rel_line_count = 0
table = []

for line in in_file.readlines():
rel_line_count += 1
if line.find("=======") >= 0:
rel_line_count = 0
pos = line.find(".aag") - 1
if pos < 0:
print "Warning: header line must contain 'filename.aag'"
name = ""
while(pos >= 0 and line[pos] != ' '):
name = line[pos] + name
pos -= 1
table.append([])
table[-1].append(name)
for pos in read_rel_lines + read_line_wtxt:
table[-1].append("")

if read_rel_lines and rel_line_count in read_rel_lines:
occ = re.compile('[0-9.]+').findall(line)
if not occ:
print "Warning: line %d contains no number" % rel_line_count
else:
for col_count in range(0, len(read_rel_lines)):
if read_rel_lines[col_count] == rel_line_count and\
len(occ) > take_nr_nr[col_count]:
table[-1][col_count + 1] = occ[take_nr_nr[col_count]]

if read_line_wtxt and any(word in line for word in read_line_wtxt):
occ = re.compile('[0-9.]+').findall(line)
if not occ:
print "Warning: line %d contains no number" % rel_line_count
else:
for col_count in range(0, len(read_line_wtxt)):
if read_line_wtxt[col_count] in line and\
len(occ) > take_nr_nr[col_count]:
table[-1][col_count + 1] = occ[take_nr_nr[col_count]]
in_file.close()

out_string = ""
for row in table:
row_string = row[0]
for elem_nr in range(1, len(row)):
row_string += " " * ((elem_nr * SPACES_FILL) - len(row_string))
row_string += DELIMITER + row[elem_nr]
out_string += row_string + "\n"


out_file = open(out_filename, 'a')
out_file.write(out_string)
out_file.close()
Loading

0 comments on commit 20eaa01

Please sign in to comment.