reproduce_plots 5.6 KB

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