-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCPU Thermal - Data - Intel.r
55 lines (44 loc) · 1.98 KB
/
CPU Thermal - Data - Intel.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
CPUdata = read_csv("Intel-CPU Profile.csv", guess_max = 10, lazy = TRUE, show_col_types = FALSE)
dataFILT = CPUdata[1:(nrow(CPUdata) - 15), pmatch(c(
"Elapsed Time (sec)",
"CPU Frequency_",
"Processor Power_",
"Package Temperature_"), colnames(CPUdata))
]
dataALL = pivot_longer(dataFILT,
cols = -1,
names_to = c(".value", "Socket"),
names_pattern = "(.*)_([:digit:]*)",
names_ptypes = list(Socket = factor(ordered = TRUE))
)
# Each column has an ID number for the processor, and this will remove it from each
# ".value" will get the value from the column itself, with that column named for the first segment
# "Socket" gets the [:digit:]* value in the column name
colnames(dataALL) = c("Time", "Socket", "Frequency", "Socket_Energy", "CPU_Temp")
PERIODS = function(DATA, BREAKS = c(warm, duration), LABELS = levsPER){
out = ifelse(DATA$Time <= BREAKS[1], LABELS[1],
ifelse(BREAKS[1] + BREAKS[2] < DATA$Time, LABELS[3],
LABELS[2]))
out = ordered(out, levels = LABELS)
return(out)
}
# dataALL$Period = PERIODS(dataALL)
dataALL$Period = cut(dataALL$Time, c(min(dataALL$Time), warm, duration, max(dataALL$Time)), labels = levsPER, include.lowest = TRUE, ordered_result = TRUE)
dataALL$Time = dataALL$Time - warm
dataALL$CPU = ordered(CPUname)
dataALL$Cooler = ordered(COOLERname)
dataALL$Test = ordered(TESTname)
dataALL$Core = factor(0)
dataALL$Thread = factor(0)
dataALL$Socket_Energy = dataALL$Socket_Energy*1000
# to convert to mW, matching AMD data
dataALL$Core_Energy = dataALL$Socket_Energy
dataALL$Uncore_Energy = 0
diff.CONS = function(DATA, DIR = "Forward", lag = 1) {
if (DIR == "Forward") return(c(diff(DATA, lag = lag), rep(0, lag)))
if (DIR == "Backward") return(c(rep(0, lag), diff(DATA, lag = lag)))
}
dataALL$CPU_Temp_Diff = diff.CONS(dataALL$CPU_Temp, lag = length(unique(dataALL$Thread)))
dataALL = dataALL[order(dataALL$Time, dataALL$Socket, dataALL$Core, dataALL$Thread),]
assign("dataALL", dataALL, envir = .GlobalEnv)
# write_csv(dataALL, "Combined.csv.bz2")