reproduce_plots 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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=26
  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]} preproc_wc=${values[2]}
  57. datafile="repro/experimentaldata_preproc_wallclock"
  58. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $preproc_wc
  59. input_file="repro/data/log_opt_heap_extract_preproc_${heapsize}_itr_$itr"
  60. output=$(python3 repro/extract_data_from_preproc.py "$input_file")
  61. # Read the output into an array
  62. IFS=$'\n' read -d '' -r -a values <<< "$output"
  63. # Store each value in different variables
  64. heapsize=${values[0]} optimization_flag=${values[1]} preproc_wc=${values[2]}
  65. datafile="repro/experimentaldata_preproc_wallclock"
  66. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $preproc_wc
  67. done
  68. done
  69. echo "Preproc Table"
  70. cat $datafile
  71. echo -e "\n\n"
  72. nitrs=0
  73. # Replace "python3" with your Python interpreter if needed
  74. DS="Heap"
  75. Operation="Insert"
  76. for itr in $(seq 1 $niters); do
  77. for heapsize in $(seq $minsize $stepsize $maxsize); do
  78. input_file="repro/data/log_basic_heap_insert_online_${heapsize}_itr_$itr"
  79. output=$(python3 repro/extract_data.py "$input_file")
  80. # Read the output into an array
  81. IFS=$'\n' read -d '' -r -a values <<< "$output"
  82. # Store each value in different variables
  83. heapsize=${values[0]} optimization_flag=${values[1]} insert_wc=${values[2]}
  84. datafile="repro/experimentaldata_wallclock"
  85. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $insert_wc
  86. input_file="repro/data/log_opt_heap_insert_online_${heapsize}_itr_$itr"
  87. output=$(python3 repro/extract_data.py "$input_file")
  88. # Read the output into an array
  89. IFS=$'\n' read -d '' -r -a values <<< "$output"
  90. # Store each value in different variables
  91. heapsize=${values[0]} optimization_flag=${values[1]} insert_wc=${values[2]}
  92. datafile="repro/experimentaldata_wallclock"
  93. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $insert_wc
  94. done
  95. done
  96. echo "Online Table"
  97. cat $datafile
  98. echo -e "\n\n"
  99. for itr in $(seq 1 $niters); do
  100. for heapsize in $(seq $minsize $stepsize $maxsize); do
  101. input_file="repro/data/log_basic_heap_insert_preproc_${heapsize}_itr_$itr"
  102. output=$(python3 repro/extract_data_from_preproc.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]} preproc_wc=${values[2]}
  107. datafile="repro/experimentaldata_preproc_wallclock"
  108. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $preproc_wc
  109. input_file="repro/data/log_opt_heap_insert_preproc_${heapsize}_itr_$itr"
  110. output=$(python3 repro/extract_data_from_preproc.py "$input_file")
  111. # Read the output into an array
  112. IFS=$'\n' read -d '' -r -a values <<< "$output"
  113. # Store each value in different variables
  114. heapsize=${values[0]} optimization_flag=${values[1]} preproc_wc=${values[2]}
  115. datafile="repro/experimentaldata_preproc_wallclock"
  116. python3 repro/append-experiment-results.py $datafile $DS $Operation $optimization_flag $heapsize $preproc_wc
  117. done
  118. done
  119. echo "Preproc Table"
  120. cat $datafile