Skip to content

Instantly share code, notes, and snippets.

@TakashiHarada
Created September 12, 2018 08:49
Show Gist options
  • Save TakashiHarada/c252c36d25d6b53d51dc37e5f2dc020e to your computer and use it in GitHub Desktop.
Save TakashiHarada/c252c36d25d6b53d51dc37e5f2dc020e to your computer and use it in GitHub Desktop.
## script for experiments
#! /bin/bash -
n=5
m=10
for (( i = 1; i <= n; i += 1))
do
for ((j = 1; j <= m; j += 1))
do
### acl ###
./crbt ./rules2/r_acl_${i}_${j} ./headers/h_acl_${i}_${j} > results/acl_crbt${i}_${j}
./mdd ./rules2/r_acl_${i}_${j} '2' ./headers/h_acl_${i}_${j} '104' > results/acl_mdd${i}_${j}
cat results/acl_crbt${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/acl_linear_search_time${i}
cat results/acl_crbt${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/acl_crbt_construction_time${i}
cat results/acl_crbt${i}_${j} | awk 'NR == 4' | awk '{print $NF}' >> results/acl_crbt_memory${i}
cat results/acl_crbt${i}_${j} | awk 'NR == 6' | awk '{print $NF}' >> results/acl_crbt_search_time${i}
cat results/acl_mdd${i}_${j} | awk 'NR == 1' | awk '{print $NF}' >> results/acl_mdd_construction_time${i}
cat results/acl_mdd${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/acl_mdd_memory${i}
cat results/acl_mdd${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/acl_mdd_search_time${i}
sed -e '1i104' ./rules2/r_acl_${i}_${j} > tmp && sed -e 's/\*/\?/g' tmp > tmp_rule
./grouper $((40000*i)) tmp_rule ./headers/h_acl_${i}_${j} > results/acl_grouper${i}_${J}
cat results/acl_grouper${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/acl_grouper_construction_time${i}
cat results/acl_grouper${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/acl_grouper_memory${i}
cat results/acl_grouper${i}_${j} | awk 'NR == 4' | awk '{print $NF}' >> results/acl_grouper_search_time${i}
### fw ###
# ./crbt ./rules2/r_fw_${i}_${j} ./headers/h_fw_${i}_${j} > results/fw_crbt${i}_${j}
# ./mdd ./rules2/r_fw_${i}_${j} '2' ./headers/h_fw_${i}_${j} '104' > results/fw_mdd${i}_${j}
# cat results/fw_crbt${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/fw_linear_search_time${i}
# cat results/fw_crbt${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/fw_crbt_construction_time${i}
# cat results/fw_crbt${i}_${j} | awk 'NR == 4' | awk '{print $NF}' >> results/fw_crbt_memory${i}
# cat results/fw_crbt${i}_${j} | awk 'NR == 6' | awk '{print $NF}' >> results/fw_crbt_search_time${i}
# cat results/fw_mdd${i}_${j} | awk 'NR == 1' | awk '{print $NF}' >> results/fw_mdd_construction_time${i}
# cat results/fw_mdd${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/fw_mdd_memory${i}
# cat results/fw_mdd${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/fw_mdd_search_time${i}
# sed -e '1i104' ./rules2/r_fw_${i}_${j} > tmp && sed -e 's/\*/\?/g' tmp > tmp_rule
# ./grouper $((40000*i)) tmp_rule ./headers/h_fw_${i}_${j} > results/fw_grouper${i}_${J}
# cat results/fw_grouper${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/fw_grouper_construction_time${i}
# cat results/fw_grouper${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/fw_grouper_memory${i}
# cat results/fw_grouper${i}_${j} | awk 'NR == 4' | awk '{print $NF}' >> results/fw_grouper_search_time${i}
### ipc ###
./crbt ./rules2/r_ipc_${i}_${j} ./headers/h_ipc_${i}_${j} > results/ipc_crbt${i}_${j}
./mdd ./rules2/r_ipc_${i}_${j} '2' ./headers/h_ipc_${i}_${j} '104' > results/ipc_mdd${i}_${j}
cat results/ipc_crbt${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/ipc_linear_search_time${i}
cat results/ipc_crbt${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/ipc_crbt_construction_time${i}
cat results/ipc_crbt${i}_${j} | awk 'NR == 4' | awk '{print $NF}' >> results/ipc_crbt_memory${i}
cat results/ipc_crbt${i}_${j} | awk 'NR == 6' | awk '{print $NF}' >> results/ipc_crbt_search_time${i}
cat results/ipc_mdd${i}_${j} | awk 'NR == 1' | awk '{print $NF}' >> results/ipc_mdd_construction_time${i}
cat results/ipc_mdd${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/ipc_mdd_memory${i}
cat results/ipc_mdd${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/ipc_mdd_search_time${i}
sed -e '1i104' ./rules2/r_ipc_${i}_${j} > tmp && sed -e 's/\*/\?/g' tmp > tmp_rule
./grouper $((40000*i)) tmp_rule ./headers/h_ipc_${i}_${j} > results/ipc_grouper${i}_${J}
cat results/ipc_grouper${i}_${j} | awk 'NR == 2' | awk '{print $NF}' >> results/ipc_grouper_construction_time${i}
cat results/ipc_grouper${i}_${j} | awk 'NR == 3' | awk '{print $NF}' >> results/ipc_grouper_memory${i}
cat results/ipc_grouper${i}_${j} | awk 'NR == 4' | awk '{print $NF}' >> results/ipc_grouper_search_time${i}
echo ${i}_${j}
done
cat results/acl_linear_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_linear_search_time
cat results/acl_crbt_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_crbt_construction_time
cat results/acl_crbt_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_crbt_memory
cat results/acl_crbt_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_crbt_search_time
cat results/acl_mdd_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_mdd_construction_time
cat results/acl_mdd_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_mdd_memory
cat results/acl_mdd_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_mdd_search_time
cat results/acl_grouper_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_grouper_construction_time
cat results/acl_grouper_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_grouper_memory
cat results/acl_grouper_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/acl_grouper_search_time
# cat results/fw_linear_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_linear_search_time
# cat results/fw_crbt_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_crbt_construction_time
# cat results/fw_crbt_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_crbt_memory
# cat results/fw_crbt_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_crbt_search_time
# cat results/fw_mdd_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_mdd_construction_time
# cat results/fw_mdd_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_mdd_memory
# cat results/fw_mdd_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_mdd_search_time
# cat results/fw_grouper_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_grouper_construction_time
# cat results/fw_grouper_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_grouper_memory
# cat results/fw_grouper_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/fw_grouper_search_time
cat results/ipc_linear_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_linear_search_time
cat results/ipc_crbt_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_crbt_construction_time
cat results/ipc_crbt_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_crbt_memory
cat results/ipc_crbt_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_crbt_search_time
cat results/ipc_mdd_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_mdd_construction_time
cat results/ipc_mdd_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_mdd_memory
cat results/ipc_mdd_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_mdd_search_time
cat results/ipc_grouper_construction_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_grouper_construction_time
cat results/ipc_grouper_memory${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_grouper_memory
cat results/ipc_grouper_search_time${i} | awk '{m+=$NF} END{print m/NR;}' >> results/ipc_grouper_search_time
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment