HW3: RC4 - Final results and plots added to report
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
% MATLAB script to plot Sort execution times
|
||||
|
||||
% Define Q values
|
||||
Q = 20:30;
|
||||
|
||||
% Define Sort execution times (converted to milliseconds)
|
||||
sort_times = [
|
||||
3.134, 4.105, 6.074, 14, 29, 59, 120, 256, 554, 1164, 2453; % V0 - ampere
|
||||
1.417, 2.193, 3.699, 8.329, 17, 37, 71, 153, 351, 742, 1556; % V1 - ampere
|
||||
1.574, 2.411, 4.134, 8.94, 19, 40, 76, 163, 372, 788, 1650; % V2 - ampere
|
||||
5.419, 10, 19, 40, 85, 181, 385, 826, 1762, 3765, 8034; % V0 - tesla
|
||||
3.418, 6.995, 14, 30, 64, 139, 300, 648, 1394, 2992, 6411; % V1 - tesla
|
||||
3.264, 6.728, 13, 29, 60, 129, 280, 606, 1308, 2815, 6048; % V2 - tesla
|
||||
15, 30, 66, 142, 305, 654, 1408, 3009, 6445, 13750, NaN; % V0 - gtx1650
|
||||
6.666, 14, 31, 67, 139, 311, 689, 1539, 3358, 7428, NaN; % V1 - gtx1650
|
||||
7.294, 15, 33, 70, 148, 328, 726, 1609, 3527, 7749, NaN % V2 - gtx1650
|
||||
];
|
||||
|
||||
% Plot in log scale
|
||||
figure('Name', 'Results-SortTime', 'Position', [100, 100, 1600, 900]);
|
||||
semilogy(Q, sort_times', '-o', 'LineWidth', 1.5);
|
||||
grid on;
|
||||
xlabel('Q (Memory Size)');
|
||||
ylabel('Sort Execution Time (ms)');
|
||||
title('Sort time over memory size');
|
||||
legend({'V0 ampere', 'V1 ampere', 'V2 ampere', 'V0 tesla', 'V1 tesla', 'V2 tesla', 'V0 gtx1650', 'V1 gtx1650', 'V2 gtx1650'}, 'Location', 'northwest');
|
||||
saveas(gcf, 'sort_time_plot.png');
|
||||
@@ -0,0 +1,34 @@
|
||||
% MATLAB script to plot Speedup (Serial Time / Total Time)
|
||||
|
||||
% Define Q values
|
||||
Q = 20:30;
|
||||
|
||||
% Define Serial execution times (converted to milliseconds)
|
||||
serial_times = [
|
||||
74, 154, 328, 689, 1441, 3028, 6293, 13700, 27170, 55340, 115580];
|
||||
|
||||
% Define Total execution times (converted to milliseconds)
|
||||
total_times = [
|
||||
8.733, 12, 59, 37, 56, 98, 229, 420, 976, 1910, 3971; % V0 - ampere
|
||||
2.676, 6.308, 10, 18, 34, 83, 134, 331, 664, 1364, 2938; % V1 - ampere
|
||||
2.883, 5.861, 12, 21, 34, 86, 135, 331, 749, 1459, 3063; % V2 - ampere
|
||||
6.559, 12, 23, 49, 101, 210, 442, 939, 1986, 4211, 9071; % V0 - tesla
|
||||
4.559, 9.014, 18, 39, 80, 169, 358, 761, 1618, 3440, 7326; % V1 - tesla
|
||||
4.407, 8.751, 17, 38, 75, 159, 338, 719, 1533, 3262, 6932; % V2 - tesla
|
||||
16, 33, 71, 153, 327, 696, 1493, 3177, 6782, 14420, NaN; % V0 - gtx1650
|
||||
8.271, 17, 37, 78, 161, 353, 774, 1709, 3701, 8106, NaN; % V1 - gtx1650
|
||||
8.985, 18, 38, 81, 169, 370, 810, 1779, 3864, 8424, NaN % V2 - gtx1650
|
||||
];
|
||||
|
||||
% Compute Speedup
|
||||
speedup = serial_times ./ total_times;
|
||||
|
||||
% Plot in log scale
|
||||
figure('Name', 'Results-SpeedUp', 'Position', [100, 100, 1600, 900]);
|
||||
plot(Q, speedup', '-o', 'LineWidth', 1.5);
|
||||
grid on;
|
||||
xlabel('Q (Memory Size)');
|
||||
ylabel('Speedup (Serial / Total)');
|
||||
title('Speed up over memory size');
|
||||
legend({'V0 ampere', 'V1 ampere', 'V2 ampere', 'V0 tesla', 'V1 tesla', 'V2 tesla', 'V0 gtx1650', 'V1 gtx1650', 'V2 gtx1650'}, 'Location', 'northwest');
|
||||
saveas(gcf, 'speedup_plot.png');
|
||||
@@ -0,0 +1,29 @@
|
||||
% MATLAB script to plot Total execution times
|
||||
|
||||
% Define Q values
|
||||
Q = 20:30;
|
||||
|
||||
% Define Total execution times (converted to milliseconds)
|
||||
total_times = [
|
||||
74, 154, 328, 689, 1441, 3028, 6293,13700,27170,55340,115580; % Serial
|
||||
8.733, 12, 59, 37, 56, 98, 229, 420, 976, 1910, 3971; % V0 - ampere
|
||||
2.676, 6.308, 10, 18, 34, 83, 134, 331, 664, 1364, 2938; % V1 - ampere
|
||||
2.883, 5.861, 12, 21, 34, 86, 135, 331, 749, 1459, 3063; % V2 - ampere
|
||||
6.559, 12, 23, 49, 101, 210, 442, 939, 1986, 4211, 9071; % V0 - tesla
|
||||
4.559, 9.014, 18, 39, 80, 169, 358, 761, 1618, 3440, 7326; % V1 - tesla
|
||||
4.407, 8.751, 17, 38, 75, 159, 338, 719, 1533, 3262, 6932; % V2 - tesla
|
||||
16, 33, 71, 153, 327, 696, 1493, 3177, 6782, 14420, NaN; % V0 - gtx1650
|
||||
8.271, 17, 37, 78, 161, 353, 774, 1709, 3701, 8106, NaN; % V1 - gtx1650
|
||||
8.985, 18, 38, 81, 169, 370, 810, 1779, 3864, 8424, NaN % V2 - gtx1650
|
||||
];
|
||||
|
||||
% Plot in log scale
|
||||
figure('Name', 'Results-TotalTime', 'Position', [100, 100, 1600, 900]);
|
||||
|
||||
semilogy(Q, total_times', '-o', 'LineWidth', 1.5);
|
||||
grid on;
|
||||
xlabel('Q (Memory Size)');
|
||||
ylabel('Total Execution Time (ms)');
|
||||
title('Total time over memory size');
|
||||
legend({'Serial', 'V0 ampere', 'V1 ampere', 'V2 ampere', 'V0 tesla', 'V1 tesla', 'V2 tesla', 'V0 gtx1650', 'V1 gtx1650', 'V2 gtx1650'}, 'Location', 'northwest');
|
||||
saveas(gcf, 'total_time_plot.png');
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 156 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 143 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 167 KiB |
Reference in New Issue
Block a user