PDS/homework_1/matlab/measurements_over_th.m

76 lines
2.2 KiB
Matlab
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

% Plot measurements
threads = [1 2 4 6 8 10 12];
ser_sift_threads = [ 4418 4418 4418 4418 4418 4418 4418 ];
ser_mnist_ser_threads = [ 7924 7924 7924 7924 7924 7924 7924 ];
omp_sift_th = [
4374 2194 1148 751 724 637 596
];
omp_mnist_th = [
7918 3941 2031 1395 1415 1330 1292
];
cilk_sift_th = [
4183 2076 1114 886 706 742 636
];
cilk_mnist_th = [
7745 3883 2020 1454 1436 1342 1292
];
pth_sift_th = [
4254 2155 1133 877 724 640 682
];
pth_mnist_th = [
7889 3963 2058 1445 1496 1379 1352
];
% 1ο Διάγραμμα: OMP
figure;
set(gcf, 'Position', [100, 100, 1280, 720]); % Set the figure size to HD
plot(threads, ser_sift_threads, '-o', 'DisplayName', 'Serial SIFT');
hold on;
plot(threads, ser_mnist_ser_threads, '-s', 'DisplayName', 'Serial MNIST');
plot(threads, omp_sift_th, '-^', 'DisplayName', 'OMP SIFT');
plot(threads, omp_mnist_th, '-d', 'DisplayName', 'OMP MNIST');
hold off;
title('OMP');
xlabel('Threads');
ylabel('Execution Time [msec]');
legend('Location', 'northeast');
grid on;
print(gcf, 'OMP_over_threads.png', '-dpng', '-r300');
% 2ο Διάγραμμα: CILK
figure;
set(gcf, 'Position', [100, 100, 1280, 720]); % Set the figure size to HD
plot(threads, ser_sift_threads, '-o', 'DisplayName', 'Serial SIFT');
hold on;
plot(threads, ser_mnist_ser_threads, '-s', 'DisplayName', 'Serial MNIST');
plot(threads, cilk_sift_th, '-^', 'DisplayName', 'CILK SIFT');
plot(threads, cilk_mnist_th, '-d', 'DisplayName', 'CILK MNIST');
hold off;
title('CILK');
xlabel('Threads');
ylabel('Execution Time [msec]');
legend('Location', 'northeast');
grid on;
print(gcf, 'CILK_over_threads.png', '-dpng', '-r300');
% 3ο Διάγραμμα: Pthreads
figure;
set(gcf, 'Position', [100, 100, 1280, 720]); % Set the figure size to HD
plot(threads, ser_sift_threads, '-o', 'DisplayName', 'Serial SIFT');
hold on;
plot(threads, ser_mnist_ser_threads, '-s', 'DisplayName', 'Serial MNIST');
plot(threads, pth_sift_th, '-^', 'DisplayName', 'Pthreads SIFT');
plot(threads, pth_mnist_th, '-d', 'DisplayName', 'Pthreads MNIST');
hold off;
title('Pthreads');
xlabel('Threads');
ylabel('Execution Time [msec]');
legend('Location', 'northeast');
grid on;
print(gcf, 'Pthreads_over_threads.png', '-dpng', '-r300');