From 8199ae1c00bb693252b93617fbc2de9ef3862599 Mon Sep 17 00:00:00 2001 From: Yihan Date: Thu, 11 Jan 2018 14:34:31 -0500 Subject: [PATCH] changes --- aug_sum/run_aug_sum.sh | 4 +++- aug_sum/runall | 7 +++++++ index/comp.py | 30 ++++++++++++++++++++++++++++ index/run_index.sh | 6 ++++-- interval/comp.py | 30 ++++++++++++++++++++++++++++ interval/run_interval.sh | 2 ++ range_query/comp.py | 42 ++++++++++++++++++++++++++++++++++++++++ range_query/rt_test.cpp | 4 ++-- range_query/run_range.sh | 10 ++++++---- 9 files changed, 126 insertions(+), 9 deletions(-) create mode 100644 index/comp.py create mode 100644 interval/comp.py create mode 100644 range_query/comp.py diff --git a/aug_sum/run_aug_sum.sh b/aug_sum/run_aug_sum.sh index 19e3f2a..2e1cf92 100644 --- a/aug_sum/run_aug_sum.sh +++ b/aug_sum/run_aug_sum.sh @@ -10,7 +10,7 @@ LARGE=$1 printf "${GREEN}test aug_sum${NC}\n" echo "(Results in Table 3)" -echo "All results:" < res.txt +rm res.txt echo $LARGE printf "${BLUE}parallel run${NC}\n" @@ -29,3 +29,5 @@ then else ./runall -r 3 -p 1 fi + +python comp.py diff --git a/aug_sum/runall b/aug_sum/runall index aa9e71f..7823f3c 100644 --- a/aug_sum/runall +++ b/aug_sum/runall @@ -34,6 +34,13 @@ echo rounds=$ROUNDS export CILK_NWORKERS=$THREADS head="numactl -i all" +if (hash numactl ls 2>/dev/null) +then + head="numactl -i all" +else + head="" +fi + if [ $THREADS == 1 ] then head="" diff --git a/index/comp.py b/index/comp.py new file mode 100644 index 0000000..7084ab4 --- /dev/null +++ b/index/comp.py @@ -0,0 +1,30 @@ +f = open("res.txt") +line1 = f.readline() +line2 = f.readline() +line3 = f.readline() +line4 = f.readline() + +items1 = line1.split(', ') +items2 = line2.split(', ') +items3 = line3.split(', ') +items4 = line4.split(', ') + +build_par = float(items1[5][7:]) +build_seq = float(items3[5][7:]) +build_spd = build_seq/build_par + +query_par = float(items2[5][7:]) +query_seq = float(items4[5][7:]) +query_spd = query_seq/query_par + + +fout = open('data.txt','w') +fout.write(items1[0]+', '+items1[3]+', '+items1[4]+', ') +fout.write("sequential time = " + str(build_seq) + ", parallel time = " + str(build_par) + ", speedup = " + str(build_spd)+'\n') +fout.write(items2[0]+', '+items2[3]+', '+items2[4]+', ') +fout.write("sequential time = " + str(query_seq) + ", parallel time = " + str(query_par) + ", speedup = " + str(query_spd)+'\n') +fout.close() + + + + diff --git a/index/run_index.sh b/index/run_index.sh index af42420..f7f1838 100644 --- a/index/run_index.sh +++ b/index/run_index.sh @@ -12,8 +12,10 @@ echo "(Results in Table 5, with smaller inputs)" make printf "${BLUE}parallel run${NC}\n" export CILK_NWORKERS=$THREADS -numactl -i all ./index -f "wiki_small.txt" -q 100000 +numactl -i all ./index -f "wiki_small.txt" -q 100000 | tee res.txt echo printf "${BLUE}sequential run${NC}\n" export CILK_NWORKERS=1 -./index -f "wiki_small.txt" -q 100000 +./index -f "wiki_small.txt" -q 100000 |tee -a res.txt + +python comp.py \ No newline at end of file diff --git a/interval/comp.py b/interval/comp.py new file mode 100644 index 0000000..7084ab4 --- /dev/null +++ b/interval/comp.py @@ -0,0 +1,30 @@ +f = open("res.txt") +line1 = f.readline() +line2 = f.readline() +line3 = f.readline() +line4 = f.readline() + +items1 = line1.split(', ') +items2 = line2.split(', ') +items3 = line3.split(', ') +items4 = line4.split(', ') + +build_par = float(items1[5][7:]) +build_seq = float(items3[5][7:]) +build_spd = build_seq/build_par + +query_par = float(items2[5][7:]) +query_seq = float(items4[5][7:]) +query_spd = query_seq/query_par + + +fout = open('data.txt','w') +fout.write(items1[0]+', '+items1[3]+', '+items1[4]+', ') +fout.write("sequential time = " + str(build_seq) + ", parallel time = " + str(build_par) + ", speedup = " + str(build_spd)+'\n') +fout.write(items2[0]+', '+items2[3]+', '+items2[4]+', ') +fout.write("sequential time = " + str(query_seq) + ", parallel time = " + str(query_par) + ", speedup = " + str(query_spd)+'\n') +fout.close() + + + + diff --git a/interval/run_interval.sh b/interval/run_interval.sh index 6b07ff8..5b1abed 100644 --- a/interval/run_interval.sh +++ b/interval/run_interval.sh @@ -19,3 +19,5 @@ echo printf "${BLUE}sequential run${NC}\n" export CILK_NWORKERS=1 ./interval_tree 100000000 100000000 3 |tee -a res.txt + +python comp.py \ No newline at end of file diff --git a/range_query/comp.py b/range_query/comp.py new file mode 100644 index 0000000..323aa42 --- /dev/null +++ b/range_query/comp.py @@ -0,0 +1,42 @@ +f = open("res.txt") +fout = open('data.txt','w') +line1 = f.readline() +line2 = f.readline() + +items1 = line1.split('\t') +items2 = line2.split('\t') + +build_par = float(items1[7][11:]) +build_seq = float(items2[7][11:]) +build_spd = build_seq/build_par + +query_par = float(items1[8][11:]) +query_seq = float(items2[8][11:]) +query_spd = query_seq/query_par + +fout.write(items1[1]+', '+items1[2]+', '+items1[3]+', '+items1[4]+', ') +fout.write("sequential build=" + str(build_seq) + ", parallel build=" + str(build_par) + ", build speedup=" + str(build_spd)+'\n') +fout.write(items1[1]+', '+items1[2]+', '+items1[3]+', '+items1[4]+', ') +fout.write("sequential query=" + str(query_seq) + ", parallel query=" + str(query_par) + ", query speedup=" + str(query_spd)+'\n') + + +line1 = f.readline() +line2 = f.readline() + +items1 = line1.split('\t') +items2 = line2.split('\t') + +build_par = float(items1[7][11:]) +build_seq = float(items2[7][11:]) +build_spd = build_seq/build_par + +query_par = float(items1[8][11:]) +query_seq = float(items2[8][11:]) +query_spd = query_seq/query_par + +fout.write(items1[1]+', '+items1[2]+', '+items1[3]+', '+items1[4]+', ') +fout.write("sequential build=" + str(build_seq) + ", parallel build=" + str(build_par) + ", build speedup=" + str(build_spd)+'\n') +fout.write(items1[1]+', '+items1[2]+', '+items1[3]+', '+items1[4]+', ') +fout.write("sequential query=" + str(query_seq) + ", parallel query=" + str(query_par) + ", query speedup=" + str(query_spd)+'\n') + +fout.close() diff --git a/range_query/rt_test.cpp b/range_query/rt_test.cpp index d54cbe3..88213dd 100644 --- a/range_query/rt_test.cpp +++ b/range_query/rt_test.cpp @@ -99,7 +99,7 @@ pair run_all(vector& points, size_t iteration, t_query_total.stop(); - if (iteration == 0) r->print_status(); + //if (iteration == 0) r->print_status(); delete r; return make_pair(total_tm.get_total(), t_query_total.get_total()); } @@ -119,7 +119,7 @@ pair run_sum(vector& points, size_t iteration, data_t t_query_total.stop(); - if (iteration == 0) r->print_status(); + //if (iteration == 0) r->print_status(); delete r; return make_pair(total_tm.get_total(), t_query_total.get_total()); } diff --git a/range_query/run_range.sh b/range_query/run_range.sh index 905a53c..bc14944 100644 --- a/range_query/run_range.sh +++ b/range_query/run_range.sh @@ -14,18 +14,20 @@ make printf "${RED}Query-sum:${NC}\n" printf "${BLUE}Parallel run${NC}\n" export CILK_NWORKERS=$THREADS -numactl -i all ./rt_test -n "$N" -q 1000000 -w 1000000000 -t 1 +numactl -i all ./rt_test -n "$N" -q 1000000 -w 1000000000 -t 1 |tee res.txt echo printf "${BLUE}Sequential run${NC}\n" export CILK_NWORKERS=1 -./rt_test -n "$N" -q 1000000 -w 1000000000 -t 1 +./rt_test -n "$N" -q 1000000 -w 1000000000 -t 1 |tee -a res.txt echo printf "${RED}Query-all:${NC}\n" printf "${BLUE}Parallel run${NC}\n" export CILK_NWORKERS=$THREADS -numactl -i all ./rt_test -n "$N" -q 1000 -w 200000000 -t 0 +numactl -i all ./rt_test -n "$N" -q 1000 -w 200000000 -t 0 |tee -a res.txt echo printf "${BLUE}Sequential run${NC}\n" export CILK_NWORKERS=1 -./rt_test -n "$N" -q 1000 -w 200000000 -t 0 +./rt_test -n "$N" -q 1000 -w 200000000 -t 0 |tee -a res.txt + +python comp.py