Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. library(data.table)
  2. library(ggplot2)
  3. amd_dt = fread("./amd_dt.csv")
  4.  
  5. make_time_plot = function(amd_dt, timing_type) {
  6. amd_real = amd_dt[type == timing_type]
  7. amd_real[, time := minutes * 60 + seconds]
  8. ggplot(amd_real, aes(threads, time,
  9. colour=branch, shape=branch)) +
  10. geom_point() + geom_line() +
  11. geom_abline(slope=1, intercept=0, linetype=2) +
  12. ggtitle(paste0("Warfarin Model Timings:", timing_type), "TBB vs. Old map_rect") +
  13. ylab("Time") +
  14. xlab("Threads") +
  15. scale_x_log10(breaks=c(1, 1:8*4)) +
  16. theme(legend.position = "bottom") +
  17. theme_bw()
  18.  
  19. }
  20. make_time_plot(amd_dt, "user")
  21.  
  22. amd_dt[, time := minutes * 60 + seconds]
  23. amd_real_dt = amd_dt[type == "real", .(branch, threads, time)]
  24. amd_real_sum_dt = amd_dt[, .(time = median(time)), .(branch, threads)]
  25. amd_real_cast_dt = dcast(amd_real_sum_dt, threads~branch, value.var = "time")
  26. amd_real_cast_dt[, speedup := 1 - (new/old)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement