Advertisement
Guest User

Untitled

a guest
Oct 16th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /usr/bin/gnuplot
  2. #
  3. # purpose:
  4. #        generate data reduction graphs for the multi-threaded list project
  5. #
  6. # input: lab2_list.csv
  7. #       1. test name
  8. #       2. # threads
  9. #       3. # iterations per thread
  10. #       4. # lists
  11. #       5. # operations performed (threads x iterations x (ins + lookup + delete))
  12. #       6. run time (ns)
  13. #       7. run time per operation (ns)
  14. #
  15. # output:
  16. #       lab2_list-1.png ... cost per operation vs threads and iterations
  17. #       lab2_list-2.png ... threads and iterations that run (un-protected) w/o failure
  18. #       lab2_list-3.png ... threads and iterations that run (protected) w/o failure
  19. #       lab2_list-4.png ... cost per operation vs number of threads
  20. #
  21. # Note:
  22. #       Managing data is simplified by keeping all of the results in a single
  23. #       file.  But this means that the individual graphing commands have to
  24. #       grep to select only the data they want.
  25. #
  26.  
  27. # general plot parameters
  28. set terminal png
  29. set datafile separator ","
  30.  
  31. # how many threads/iterations we can run without failure (w/o yielding)
  32. set title "List-1: Cost per Operation vs Iterations"
  33. set xlabel "Iterations"
  34. set logscale x 10
  35. set ylabel "Cost per Operation (ns)"
  36. set logscale y 10
  37. set output 'lab2_list-1.png'
  38.  
  39. # grep out only single threaded, un-protected, non-yield results
  40. plot \
  41.      "< grep 'list-none-none,1,' lab2_list.csv" using ($3):($7) \
  42.         title 'raw' with linespoints lc rgb 'red', \
  43.      "< grep 'list-none-none,1,' lab2_list.csv" using ($3):($7)/(4*($3)) \
  44.         title '/4 x iterations' with linespoints lc rgb 'green'
  45.  
  46.  
  47. set title "List-2: Unprotected Threads and Iterations that run without failure"
  48. set xlabel "Threads"
  49. set logscale x 2
  50. set xrange [0.75:]
  51. set ylabel "Successful Iterations"
  52. set logscale y 10
  53. set output 'lab2_list-2.png'
  54. # note that unsuccessful runs should have produced no output
  55. plot \
  56.      "< grep list-none-none lab2_list.csv" using ($2):($3) \
  57.         title 'w/o yields' with points lc rgb 'green', \
  58.      "< grep list-i-none lab2_list.csv" using ($2):($3) \
  59.         title 'yield=i' with points lc rgb 'red', \
  60.      "< grep list-d-none lab2_list.csv" using ($2):($3) \
  61.         title 'yield=d' with points lc rgb 'violet', \
  62.      "< grep list-il-none lab2_list.csv" using ($2):($3) \
  63.         title 'yield=il' with points lc rgb 'orange', \
  64.      "< grep list-dl-none lab2_list.csv" using ($2):($3) \
  65.         title 'yield=dl' with points lc rgb 'blue'
  66.  
  67. set title "List-3: Protected Iterations that run without failure"
  68. unset logscale x
  69. set xrange [0:5]
  70. set xlabel "Yields"
  71. set xtics("" 0, "yield=i" 1, "yield=d" 2, "yield=il" 3, "yield=dl" 4, "" 5)
  72. set ylabel "successful iterations"
  73. set logscale y 10
  74. set output 'lab2_list-3.png'
  75. plot \
  76.     "< grep 'list-i-none,12,' lab2_list.csv" using (1):($3) \
  77.         with points lc rgb "red" title "unprotected, T=12", \
  78.     "< grep 'list-d-none,12,' lab2_list.csv" using (2):($3) \
  79.         with points lc rgb "red" title "", \
  80.     "< grep 'list-il-none,12,' lab2_list.csv" using (3):($3) \
  81.         with points lc rgb "red" title "", \
  82.     "< grep 'list-dl-none,12,' lab2_list.csv" using (4):($3) \
  83.         with points lc rgb "red" title "", \
  84.     "< grep 'list-i-m,12,' lab2_list.csv" using (1):($3) \
  85.         with points lc rgb "green" title "Mutex, T=12", \
  86.     "< grep 'list-d-m,12,' lab2_list.csv" using (2):($3) \
  87.         with points lc rgb "green" title "", \
  88.     "< grep 'list-il-m,12,' lab2_list.csv" using (3):($3) \
  89.         with points lc rgb "green" title "", \
  90.     "< grep 'list-dl-m,12,' lab2_list.csv" using (4):($3) \
  91.         with points lc rgb "green" title "", \
  92.     "< grep 'list-i-s,12,' lab2_list.csv" using (1):($3) \
  93.         with points lc rgb "blue" title "Spin-Lock, T=12", \
  94.     "< grep 'list-d-s,12,' lab2_list.csv" using (2):($3) \
  95.         with points lc rgb "blue" title "", \
  96.     "< grep 'list-il-s,12,' lab2_list.csv" using (3):($3) \
  97.         with points lc rgb "blue" title "", \
  98.     "< grep 'list-dl-s,12,' lab2_list.csv" using (4):($3) \
  99.         with points lc rgb "blue" title ""
  100. # unset the kinky x axis
  101. unset xtics
  102. set xtics
  103.  
  104. set title "List-4: Scalability of synchronization mechanisms"
  105. set xlabel "Threads"
  106. set logscale x 2
  107. unset xrange
  108. set xrange [0.75:]
  109. set ylabel "Length-adjusted cost per operation(ns)"
  110. set logscale y 10
  111. set output 'lab2_list-4.png'
  112. set key left top
  113. plot \
  114.      "< grep 'list-none-none,1,10000,' lab2_list.csv" using ($2):($7)/(4*($3)) \
  115.         title '(adjusted) unprotected' with linespoints lc rgb 'red', \
  116.      "< grep list-none-m lab2_list.csv" using ($2):($7)/(4*($3)) \
  117.         title '(adjusted) mutex' with linespoints lc rgb 'green', \
  118.      "< grep list-none-s lab2_list.csv" using ($2):($7)/(4*($3)) \
  119.         title '(adjusted) spin-lock' with linespoints lc rgb 'blue', \
  120.      "< grep 'list-none-none,1,10000,' lab2_list.csv" using ($2):($7) \
  121.         title '(adjusted) unprotected' with linespoints lc rgb 'orange', \
  122.      "< grep list-none-m lab2_list.csv" using ($2):($7) \
  123.         title '(raw) mutex' with linespoints lc rgb 'grey', \
  124.      "< grep list-none-s lab2_list.csv" using ($2):($7) \
  125.         title '(raw) spin-lock' with linespoints lc rgb 'violet'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement