-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathperfModel_analyze.m
137 lines (91 loc) · 2.71 KB
/
perfModel_analyze.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
clc
clear
close all
fileID = fopen('perfModel.txt','r');
v = [16 32 64 128 256 512];
n = length(v)^3;
for ii = 1:n
% Skip Four lines
line = fgetl(fileID); line = fgetl(fileID); line = fgetl(fileID); line = fgetl(fileID);
% Read in the line of interest.
line = fgetl(fileID);
best(ii) = str2num(line(18:27));
worst(ii) = str2num(line(36:45));
mean(ii) = str2num(line(52:61));
end
ctr = 1;
for i = v
for j = v
for k =v
dim(ctr,:) = [i j k];
dimlabel{ctr} = [num2str(i),',',num2str(j)];
ctr = ctr +1;
end
end
end
plot(1:36,best(dim(:,3) == 16))
set(gca,'XTickLabel',dimlabel(dim(:,3)==16),'XTick',1:36)
ylabel('Cycles per DOF')
title('Cycles per DOF for a IxJx16 matrix')
%%
fileID = fopen('perfModel2.txt','r');
n = length(v)^3;
for ii = 1:400
% Skip three lines
line = fgetl(fileID); line = fgetl(fileID); line = fgetl(fileID);
% Read in the line of interest.
line = fgetl(fileID);
best(ii) = str2num(line(18:27));
worst(ii) = str2num(line(36:45));
mean(ii) = str2num(line(52:61));
end
ctr = 1;
for i = v
for j = v
for k =v
dim(ctr,:) = [i j k];
ctr = ctr +1;
end
end
end
best16 = best(1:100);
worst16 = worst(1:100);
mean16 = mean(1:100);
best32 = best(101:200);
worst32 = worst(101:200);
mean32 = mean(101:200);
best64 = best(201:300);
worst64 = worst(201:300);
mean64 = mean(201:300);
best128 = best(301:400);
worst128 = worst(301:400);
mean128 = mean(301:400);
max_it = 50;
figure
plot(1:max_it,best16(1:max_it),1:max_it,worst16(1:max_it), 1:max_it,mean16(1:max_it));
xlabel('Number of iterations')
ylabel('Cycles per DOF')
legend('Best','Worst','Average')
title('Performance vs. Iterations for a 16^3 grid')
set(gca,'FontSize',16)
figure
plot(1:max_it,best32(1:max_it),1:max_it,worst32(1:max_it),1:max_it,mean32(1:max_it));
xlabel('Number of iterations')
ylabel('Cycles per DOF')
legend('Best','Worst','Average')
title('Performance vs. Iterations for a 32^3 grid')
set(gca,'FontSize',16)
figure
plot(1:max_it,best64(1:max_it),1:max_it,worst64(1:max_it),1:max_it,mean64(1:max_it));
xlabel('Number of iterations')
ylabel('Cycles per DOF')
legend('Best','Worst','Average')
title('Performance vs. Iterations for a 64^3 grid')
set(gca,'FontSize',16)
figure
plot(1:max_it,best128(1:max_it),1:max_it,worst128(1:max_it),1:max_it,mean128(1:max_it));
xlabel('Number of iterations')
ylabel('Cycles per DOF')
legend('Best','Worst','Average')
title('Performance vs. Iterations for a 128^3 grid')
set(gca,'FontSize',16)