1 | #!/bin/sh
|
---|
2 |
|
---|
3 | #/* Author : Rick van der Zwet
|
---|
4 | # * S-number : 0433373
|
---|
5 | # * Version : $Id: memory.h 363 2007-12-03 06:07:31Z rick $
|
---|
6 | # * Copyright : FreeBSD Licence
|
---|
7 | # * Description : Generate results of 15 combinations
|
---|
8 | # */
|
---|
9 |
|
---|
10 | DATAFILE=${1:-./data/lisp.002.din}
|
---|
11 | DINERO='./data/dinero'
|
---|
12 | BUS2='./grep-bus2'
|
---|
13 | COMPU='./compu'
|
---|
14 | RESULT_PRE="./res-"
|
---|
15 | RESULT_SUFFIX=".txt"
|
---|
16 | RESULT_BUS2="./bus2-"
|
---|
17 | MEM_SETTINGS="1 2 3 4 5"
|
---|
18 | CACHE_SETTINGS="a b c"
|
---|
19 |
|
---|
20 | DINERO_ARGS_a="-b1 -u1"
|
---|
21 | DINERO_ARGS_b="-b128 -a1 -ww -An -u64k"
|
---|
22 | DINERO_ARGS_c="-b128 -a1 -wc -Aw -u64k"
|
---|
23 |
|
---|
24 | if [ ! -x $DINERO ]; then
|
---|
25 | echo "$DINERO binary not found" 1>&2
|
---|
26 | echo "Please alter $0 to specifify right constants" 1>&2
|
---|
27 | exit 128;
|
---|
28 | fi
|
---|
29 |
|
---|
30 | if [ ! -r $DATAFILE ]; then
|
---|
31 | echo "$DATAFILE file not found" 1>&2
|
---|
32 | echo "Please alter $0 to specifify right constants or" 1>&2
|
---|
33 | echo "Usage $0 <datafile>" 1>&2
|
---|
34 | exit 128;
|
---|
35 | fi
|
---|
36 |
|
---|
37 | echo "Using datafile $DATAFILE" 1>&2
|
---|
38 | for mem_setting in $MEM_SETTINGS
|
---|
39 | do
|
---|
40 | for cache_setting in $CACHE_SETTINGS
|
---|
41 | do
|
---|
42 | (
|
---|
43 | eval DINERO_ARGS=\$DINERO_ARGS_$cache_setting
|
---|
44 | echo "==============================================="
|
---|
45 | echo "Generated : `date`"
|
---|
46 | echo "Input data : $DATAFILE"
|
---|
47 | echo "Memory setting : $mem_setting"
|
---|
48 | echo "Cache setting : $cache_setting"
|
---|
49 | echo "Dinero args : $DINERO_ARGS"
|
---|
50 | cat $DATAFILE | $DINERO -o2 $DINERO_ARGS |\
|
---|
51 | $BUS2 |\
|
---|
52 | tee -i $RESULT_BUS2$mem_setting$cache_setting$RESULT_SUFFIX |\
|
---|
53 | $COMPU $mem_setting
|
---|
54 | echo "==============================================="
|
---|
55 | ) | tee -i $RESULT_PRE$mem_setting$cache_setting$RESULT_SUFFIX 1>&2
|
---|
56 | done
|
---|
57 | done
|
---|
58 |
|
---|