Skip to content
Permalink
Browse files

ENH: Create ggplot2 graphs

  • Loading branch information
pan14001 committed Mar 20, 2018
0 parents commit b663983fc95f876cff23d54648f85c260ab991ce
Showing with 35 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. BIN sacct-week.psv.gz
  3. +34 −0 sacct.R
@@ -0,0 +1 @@
*.pdf
BIN +122 KB sacct-week.psv.gz
Binary file not shown.
34 sacct.R
@@ -0,0 +1,34 @@
suppressPackageStartupMessages({
library(dplyr)
library(readr)
library(ggplot2)
library(lubridate)
})

priority_partitions <- c("HaswellPreempt", "HaswellPriority",
"SandyBridgePriority", "IvyBridgePriority",
"Haswell192Priority", "Broadwell44Priority")
tbl <- read_delim('sacct-week.psv.gz',
delim = '|',
na = 'Unknown') %>%
na.omit() %>%
filter(Submit >= '2018-03-13',
Partition != 'debug') %>%
mutate(wait_hours= as.numeric(Start - Submit, unit = "hours"),
priority = ifelse(Partition %in% priority_partitions,
"priority", "open access"),
day = date(Submit))

counts <- tbl %>%
group_by(day, priority) %>%
summarize(count = n(), wait_hours = median(wait_hours))

plot <- ggplot(tbl, aes(day, wait_hours)) +
geom_hline(yintercept = 12) +
geom_boxplot(aes(group = day)) +
geom_jitter(aes(size = NCPUS, color = Partition), alpha = 0.3) +
geom_label(data = counts, aes(label = count)) +
facet_grid(~ priority)
ggsave('sacct-week.pdf', plot, width = 15)
plot <- plot + scale_y_log10()
ggsave('log-sacct-week.pdf', plot, width = 15)

0 comments on commit b663983

Please sign in to comment.
You can’t perform that action at this time.