1 | #!/bin/bash |
---|
2 | |
---|
3 | # archi1 archi2 archi3 archi4 |
---|
4 | archi_name=( "00512" "16384" "01024" "02048"); |
---|
5 | iways=( "1" "4" "16" "4" ); |
---|
6 | isets=( "8" "64" "1" "8" ); |
---|
7 | iwords=( "16" "16" "16" "16" ); |
---|
8 | dways=( "1" "4" "16" "4" ); |
---|
9 | dsets=( "8" "64" "1" "8" ); |
---|
10 | dwords=( "16" "16" "16" "16" ); |
---|
11 | memc_nways=( "4" "16" "8" "2" ); |
---|
12 | memc_nsets=( "4" "256" "64" "32" ); |
---|
13 | memc_words=( "16" "16" "16" "16" ); |
---|
14 | memc_heap_size=("4096" "4096" "4096" "4096" ); |
---|
15 | |
---|
16 | nb_proc=( "1" "15" "+1" "4"); |
---|
17 | wnwords=( "1" "16" "*2" "8"); |
---|
18 | wnlines=( "1" "8" "*2" "8"); |
---|
19 | wtimeout=("1" "1024" "*4" "16"); |
---|
20 | |
---|
21 | archi_default="1"; |
---|
22 | |
---|
23 | function gen_file () |
---|
24 | { |
---|
25 | filename=$(printf "x%.2d-xcache_%s-wbuf_%.2d_%.2d_%.4d.cfg" ${1} ${archi_name[${2}]} ${3} ${4} ${5}); |
---|
26 | |
---|
27 | echo ${filename}; |
---|
28 | |
---|
29 | echo "${1}" > ${filename}; |
---|
30 | echo "${iways[${2}]} ${isets[${2}]} ${iwords[${2}]}" >> ${filename}; |
---|
31 | echo "${dways[${2}]} ${dsets[${2}]} ${dwords[${2}]}" >> ${filename}; |
---|
32 | echo "${3} ${4} ${5}" >> ${filename}; |
---|
33 | echo "${memc_nways[${2}]} ${memc_nsets[${2}]} ${memc_words[${2}]} ${memc_heap_size[${2}]}" >> ${filename}; |
---|
34 | } |
---|
35 | |
---|
36 | function gen_default () |
---|
37 | { |
---|
38 | filename="default.cfg"; |
---|
39 | archi=${1}; |
---|
40 | |
---|
41 | echo ${filename}; |
---|
42 | |
---|
43 | echo "${nb_proc[3]}" > ${filename}; |
---|
44 | echo "${iways[${archi}]} ${isets[${archi}]} ${iwords[${archi}]}" >> ${filename}; |
---|
45 | echo "${dways[${archi}]} ${dsets[${archi}]} ${dwords[${archi}]}" >> ${filename}; |
---|
46 | echo "${wnwords[3]} ${wnlines[3]} ${wtimeout[3]}" >> ${filename}; |
---|
47 | echo "${memc_nways[${archi}]} ${memc_nsets[${archi}]} ${memc_words[${archi}]} ${memc_heap_size[${archi}]}" >> ${filename}; |
---|
48 | } |
---|
49 | |
---|
50 | gen_default ${archi_default}; |
---|
51 | |
---|
52 | nb_archi=${#iways[*]}; |
---|
53 | |
---|
54 | num_archi=0; |
---|
55 | while test ${num_archi} -lt ${nb_archi}; do |
---|
56 | num_proc=${nb_proc[0]}; |
---|
57 | while test ${num_proc} -le ${nb_proc[1]}; do |
---|
58 | num_words=${wnwords[0]}; |
---|
59 | while test ${num_words} -le ${wnwords[1]}; do |
---|
60 | num_lines=${wnlines[0]}; |
---|
61 | while test ${num_lines} -le ${wnlines[1]}; do |
---|
62 | num_timeout=${wtimeout[0]}; |
---|
63 | while test ${num_timeout} -le ${wtimeout[1]}; do |
---|
64 | |
---|
65 | gen_file ${num_proc} ${num_archi} ${num_words} ${num_lines} ${num_timeout}; |
---|
66 | |
---|
67 | num_timeout=$((${num_timeout} ${wtimeout[2]})); |
---|
68 | done; |
---|
69 | num_lines=$((${num_lines} ${wnlines[2]})); |
---|
70 | done; |
---|
71 | num_words=$((${num_words} ${wnwords[2]})); |
---|
72 | done; |
---|
73 | num_proc=$((${num_proc} ${nb_proc[2]})); |
---|
74 | done; |
---|
75 | num_archi=$((${num_archi}+1)); |
---|
76 | done; |
---|
77 | |
---|
78 | |
---|