-
Notifications
You must be signed in to change notification settings - Fork 0
/
gantt.R
29 lines (23 loc) · 840 Bytes
/
gantt.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
read_paje_trace <- function(file) {
df <- read.csv(file, header=TRUE, strip.white=TRUE)
df
}
prepare_trace <- function(df) {
#Tasks.rec
df$DisplayState <- df$Name
df$ResourceId <- paste(df$MPIRank,sprintf("%02d",df$WorkerId),sep="_")
#paje2csv trace
#df$DisplayState <- df$Value
df
}
print_trace <- function(df,size_geom=2) {
ggplot(df, aes(x=StartTime,xend=EndTime, y=factor(ResourceId), yend=factor(ResourceId), color=DisplayState)) + theme_bw() + geom_segment(size=size_geom)
}
print_trace_process <-function(df,size_geom=2) {
ggplot(df, aes(x=StartTime,xend=EndTime, y=factor(MPIRank), yend=factor(MPIRank), color=DisplayState)) + theme_bw() + geom_segment(size=size_geom)
}
#useful functions
get_total_duration_by_type <- function(df) {
tmp=aggregate(Duration ~ Name, df, sum)
tmp[order(-tmp$Duration),]
}