-
Notifications
You must be signed in to change notification settings - Fork 3
/
MatlabAnalysisPlotter.m
103 lines (80 loc) · 4.55 KB
/
MatlabAnalysisPlotter.m
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
function MatlabAnalysisPlotter(plotID)
%% Figure Parameters
figPosSt=struct('default',[100, 100, 0560, 0420],'small',[100, 100, 0400, 0300],'medium',[100, 100, 0800, 0600],'large',[100, 100, 0960, 0720],'xlarge',[100, 100, 1100, 0825],'x2large',[100, 100, 1200, 0900],'x3larg',[100, 100, 1400, 1050]);
figPos=figPosSt.medium; % fig position identifier
lineWidthSt=struct('thin',1,'normal',3,'thick',4);
lineWidth=lineWidthSt.thin; % line width identifier
saveImage=1; % save image or not
%% Loading Data
tRunTimeMatlab = readtable(fullfile('RunTimeData', 'RunTimeMatlabTable.csv'));
mRunTimeMatlab=table2array(tRunTimeMatlab(2:end,2:end));
vMatrixSizeMatlab=table2array(tRunTimeMatlab(1,2:end));
sFunNameMatlab=table2array(tRunTimeMatlab(2:end,1));
tRunTimeJulia = readtable(fullfile('RunTimeData', 'RunTimeJuliaopenblas64Table.csv'));
mRunTimeJulia=table2array(tRunTimeJulia(2:end,2:end));
vMatrixSizeJulia=table2array(tRunTimeJulia(1,2:end));
sFunNameJulia=table2array(tRunTimeJulia(2:end,1));
tRunTimeJuliaSIMD = readtable(fullfile('RunTimeData', 'RunTimeJuliaopenblas64SIMDTable.csv'));
mRunTimeJuliaSIMD=table2array(tRunTimeJuliaSIMD(2:end,2:end));
vMatrixSizeJuliaSIMD=table2array(tRunTimeJuliaSIMD(1,2:end));
sFunNameJuliaSIMD=table2array(tRunTimeJuliaSIMD(2:end,1));
tRunTimeJulianThreads4 = readtable(fullfile('RunTimeData', 'RunTimeJuliaopenblas64Table_4Thread.csv'));
mRunTimeJulianThreads4=table2array(tRunTimeJulianThreads4(2:end,2:end));
vMatrixSizeJulianThreads4=table2array(tRunTimeJulianThreads4(1,2:end));
sFunNameJulianThreads4=table2array(tRunTimeJulianThreads4(2:end,1));
tRunTimeJuliaSIMDnThreads4 = readtable(fullfile('RunTimeData', 'RunTimeJuliaopenblas64SIMDTable_4Thread.csv'));
mRunTimeJuliaSIMDnThreads4=table2array(tRunTimeJuliaSIMDnThreads4(2:end,2:end));
vMatrixSizeJuliaSIMDnThreads4=table2array(tRunTimeJuliaSIMDnThreads4(1,2:end));
sFunNameJuliaSIMDnThreads4=table2array(tRunTimeJuliaSIMDnThreads4(2:end,1));
tRunTimeJuliamkl = readtable(fullfile('RunTimeData', 'RunTimeJuliamklTable.csv'));
mRunTimeJuliamkl=table2array(tRunTimeJuliamkl(2:end,2:end));
vMatrixSizeJuliamkl=table2array(tRunTimeJuliamkl(1,2:end));
sFunNameJuliamkl=table2array(tRunTimeJuliamkl(2:end,1));
tRunTimeJuliamklSIMD = readtable(fullfile('RunTimeData', 'RunTimeJuliamklSIMDTable.csv'));
mRunTimeJuliamklSIMD=table2array(tRunTimeJuliamklSIMD(2:end,2:end));
vMatrixSizeJuliamklSIMD=table2array(tRunTimeJuliamklSIMD(1,2:end));
sFunNameJuliamklSIMD=table2array(tRunTimeJuliamklSIMD(2:end,1));
%% Displaying Results
warning('off','MATLAB:legend:IgnoringExtraEntries');
folderName=strjoin(plotID,'_');
mkdir(fullfile('Figures',folderName));
figureIdx = 0;
for ii = 1:size(mRunTimeMatlab,1)
figureIdx = figureIdx + 1;
hFigure = figure('Position', figPos);
hAxes = axes();
if ismember('Matlab',plotID)
loglog(vMatrixSizeMatlab,mRunTimeMatlab(ii,:),'-o','LineWidth',lineWidth,'MarkerFaceColor','b'); hold on;
end
if ismember('Julia-1-BLAS-Thread',plotID)
loglog(vMatrixSizeJulia,mRunTimeJulia(ii,:),'-s','LineWidth',lineWidth,'MarkerFaceColor','r'); hold on;
end
if ismember('Julia-4-BLAS-Threads',plotID)
loglog(vMatrixSizeJulianThreads4,mRunTimeJulianThreads4(ii,:),'-x','LineWidth',lineWidth,'MarkerFaceColor','w'); hold on;
end
if ismember('Julia-MKL',plotID)
loglog(vMatrixSizeJuliamkl,mRunTimeJuliamkl(ii,:),'-p','LineWidth',lineWidth,'MarkerFaceColor','g'); hold on;
end
plotJuliaSIMD=ismember( sFunNameJuliamklSIMD, sFunNameMatlab{ii} ); % if 1 will plot Julia-SIMD
if any(plotJuliaSIMD)
if ismember('Julia-SIMD-1-BLAS-Thread',plotID)
loglog(vMatrixSizeJuliaSIMD,mRunTimeJuliaSIMD(plotJuliaSIMD,:),'-d','LineWidth',lineWidth,'MarkerFaceColor',[0.5,0,0.5]); hold on;
end
if ismember('Julia-SIMD-4-BLAS-Threads',plotID)
loglog(vMatrixSizeJuliaSIMDnThreads4,mRunTimeJuliaSIMDnThreads4(plotJuliaSIMD,:),'-^','LineWidth',lineWidth,'MarkerFaceColor','k'); hold on;
end
if ismember('Julia-MKL-SIMD',plotID)
loglog(vMatrixSizeJuliamklSIMD,mRunTimeJuliamklSIMD(plotJuliaSIMD,:),'-h','LineWidth',lineWidth,'MarkerFaceColor',[0.5,0.5,0]); hold on;
end
end
legend(plotID,'Location','southeast');
hold off;
title(num2str(sFunNameMatlab{ii}));
xlabel('Matrix Size');
ylabel('Run Time [micro Seconds]');
if(saveImage == 1)
set(hAxes, 'LooseInset', [0.05, 0.05, 0.05, 0.05]);
saveas(hFigure,fullfile('Figures',folderName,['Figure', num2str(figureIdx), '.png']));
end
end
end