reproduce_plots_bw 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #!/bin/bash
  2. # Replace "python3" with your Python interpreter if needed
  3. DS="Heap"
  4. Operation="Extract"
  5. cd ..
  6. touch "repro/experimentaldata_preproc_bw" "repro/experimentaldata_bw"
  7. rm "repro/experimentaldata_preproc_bw" "repro/experimentaldata_bw"
  8. touch "repro/experimentaldata_preproc_bw" "repro/experimentaldata_bw"
  9. nitrs=2
  10. minsize=16
  11. maxsize=26
  12. stepsize=2
  13. for itr in $(seq 1 $nitrs); do
  14. for heapsize in $(seq $minsize $stepsize $maxsize); do
  15. input_file="repro/data/log_basic_heap_extract_online_${heapsize}_itr_${itr}"
  16. echo $input_file
  17. output=$(python3 repro/extract_data.py "$input_file")
  18. # Read the output into an array
  19. IFS=$'\n' read -d '' -r -a values <<< "$output"
  20. # Store each value in different variables
  21. echo ${values[0]}
  22. echo ${values[1]}
  23. echo ${values[2]}
  24. echo ${values[3]}
  25. echo ${values[4]}
  26. echo ${values[5]}
  27. echo "------"
  28. heapsize=${values[0]}
  29. optimization_flag=${values[1]}
  30. bytes=${values[5]}
  31. #seconds=$((milliseconds / 1000))
  32. KiB=$(echo "scale=3; $bytes / 1024" | bc) # Use bc for decimal division
  33. bw=$KiB
  34. datafile="repro/experimentaldata_bw"
  35. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $bw
  36. input_file="repro/data/log_opt_heap_extract_online_${heapsize}_itr_${itr}"
  37. echo $input_file
  38. output=$(python3 repro/extract_data.py "$input_file")
  39. # Read the output into an array
  40. IFS=$'\n' read -d '' -r -a values <<< "$output"
  41. # Store each value in different variables
  42. bytes=${values[5]}
  43. KiB=$(echo "scale=3; $bytes / 1024" | bc) # Use bc for decimal division
  44. heapsize=${values[0]} optimization_flag=${values[1]} bw=$KiB
  45. datafile="repro/experimentaldata_bw"
  46. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $bw
  47. done
  48. done
  49. echo "OnlineTable"
  50. cat $datafile
  51. echo -e "\n\n"
  52. nitrs=2
  53. for itr in $(seq 1 $nitrs); do
  54. for heapsize in $(seq $minsize $stepsize $maxsize); do
  55. input_file="repro/data/log_basic_heap_extract_preproc_${heapsize}_itr_$itr"
  56. output=$(python3 repro/extract_data_from_preproc.py "$input_file")
  57. # Read the output into an array
  58. IFS=$'\n' read -d '' -r -a values <<< "$output"
  59. # Store each value in different variables
  60. heapsize=${values[0]} optimization_flag=${values[1]} preproc_wc=${values[2]}
  61. bytes=${values[3]}
  62. KiB=$(echo "scale=3; $bytes / 1024" | bc) # Use bc for decimal division
  63. bw=$KiB
  64. echo ${values[0]}
  65. echo ${values[1]}
  66. echo ${values[2]}
  67. echo ${values[3]}
  68. echo "-------"
  69. datafile="repro/experimentaldata_preproc_bw"
  70. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $bw
  71. input_file="repro/data/log_opt_heap_extract_preproc_${heapsize}_itr_$itr"
  72. output=$(python3 repro/extract_data_from_preproc.py "$input_file")
  73. # Read the output into an array
  74. IFS=$'\n' read -d '' -r -a values <<< "$output"
  75. # Store each value in different variables
  76. heapsize=${values[0]} optimization_flag=${values[1]} preproc_wc=${values[2]}
  77. bytes=${values[3]}
  78. KiB=$(echo "scale=3; $bytes / 1024" | bc) # Use bc for decimal division
  79. bw=$KiB
  80. datafile="repro/experimentaldata_preproc_bw"
  81. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $bw
  82. done
  83. done
  84. echo "Preproc Table"
  85. cat $datafile
  86. echo -e "\n\n"
  87. nitrs=0
  88. # Replace "python3" with your Python interpreter if needed
  89. DS="Heap"
  90. Operation="Insert"
  91. for itr in $(seq 1 $niters); do
  92. for heapsize in $(seq $minsize $stepsize $maxsize); do
  93. input_file="repro/data/log_basic_heap_insert_online_${heapsize}_itr_$itr"
  94. output=$(python3 repro/extract_data.py "$input_file")
  95. # Read the output into an array
  96. IFS=$'\n' read -d '' -r -a values <<< "$output"
  97. # Store each value in different variables
  98. heapsize=${values[0]} optimization_flag=${values[1]} insert_wc=${values[2]}
  99. datafile="repro/experimentaldata_bw"
  100. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $insert_wc
  101. input_file="repro/data/log_opt_heap_insert_online_${heapsize}_itr_$itr"
  102. output=$(python3 repro/extract_data.py "$input_file")
  103. # Read the output into an array
  104. IFS=$'\n' read -d '' -r -a values <<< "$output"
  105. # Store each value in different variables
  106. heapsize=${values[0]} optimization_flag=${values[1]} insert_wc=${values[2]}
  107. datafile="repro/experimentaldata_bw"
  108. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $insert_wc
  109. done
  110. done
  111. echo "Online Table"
  112. cat $datafile
  113. echo -e "\n\n"
  114. for itr in $(seq 1 $niters); do
  115. for heapsize in $(seq $minsize $stepsize $maxsize); do
  116. input_file="repro/data/log_basic_heap_insert_preproc_${heapsize}_itr_$itr"
  117. output=$(python3 repro/extract_data_from_preproc.py "$input_file")
  118. # Read the output into an array
  119. IFS=$'\n' read -d '' -r -a values <<< "$output"
  120. # Store each value in different variables
  121. heapsize=${values[0]} optimization_flag=${values[1]} preproc_wc=${values[2]}
  122. datafile="repro/experimentaldata_preproc_bw"
  123. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $preproc_wc
  124. input_file="repro/data/log_opt_heap_insert_preproc_${heapsize}_itr_$itr"
  125. output=$(python3 repro/extract_data_from_preproc.py "$input_file")
  126. # Read the output into an array
  127. IFS=$'\n' read -d '' -r -a values <<< "$output"
  128. # Store each value in different variables
  129. heapsize=${values[0]} optimization_flag=${values[1]} preproc_wc=${values[2]}
  130. datafile="repro/experimentaldata_preproc_bw"
  131. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $preproc_wc
  132. done
  133. done
  134. echo "Preproc Table"
  135. cat $datafile