forked from alpha-unito/pico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_wordcount.sh
34 lines (33 loc) · 1.12 KB
/
run_wordcount.sh
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
#!/bin/bash
##
## Copyright (c) 2019 alpha group, CS department, University of Torino.
##
## This file is part of pico
## (see https://github.com/alpha-unito/pico).
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
B=512
N=20
for j in 42 #1 2 4 8 16 32 48
do
fname=times_wordcount_w$j"_"b$B
echo "[-w $j -b $B]"
rm -rf $fname
for i in `seq 1 $N`
do
echo $i / $N
./pico_wc -w $j -b $B testdata/words1m foo.txt 2> /dev/null | awk '{for (i=0; i<=NF; i++){if ($i == "in"){print $(i+1);exit}}}' >> $fname
done
done