Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
syhlalala committed Jan 11, 2018
1 parent 97ad42f commit 8199ae1
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 9 deletions.
4 changes: 3 additions & 1 deletion aug_sum/run_aug_sum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -29,3 +29,5 @@ then
else
./runall -r 3 -p 1
fi

python comp.py
7 changes: 7 additions & 0 deletions aug_sum/runall
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
30 changes: 30 additions & 0 deletions index/comp.py
Original file line number Diff line number Diff line change
@@ -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()




6 changes: 4 additions & 2 deletions index/run_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions interval/comp.py
Original file line number Diff line number Diff line change
@@ -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()




2 changes: 2 additions & 0 deletions interval/run_interval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
42 changes: 42 additions & 0 deletions range_query/comp.py
Original file line number Diff line number Diff line change
@@ -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()
4 changes: 2 additions & 2 deletions range_query/rt_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pair<double,double> run_all(vector<point_type>& 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());
}
Expand All @@ -119,7 +119,7 @@ pair<double,double> run_sum(vector<point_type>& 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());
}
Expand Down
10 changes: 6 additions & 4 deletions range_query/run_range.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8199ae1

Please sign in to comment.