Uploaded by madhura.bhat25

Lab2openmp Report.pdf

advertisement
This is a short one page report (pdf) describing your results with a graph showing the processing
time
results of a 1000 x 1000 grid for
o 1 thread
o 2 threads
o 4 threads
o 8 threads
o 16 threads
% Define the number of threads and corresponding processing times
threads = [1, 2, 4, 8, 16];
processing_times = [23824, 11924, 5981, 3371, 3045];
% Plot the graph
figure;
plot(threads, processing_times, 'bo-', 'LineWidth', 2, 'MarkerSize', 10);
xlabel('Number of Threads');
ylabel('Processing Time (microseconds)');
title('Processing Time vs. Number of Threads');
grid on;
set(gca, 'XTick', threads);
legend('Processing Time');
From this we observe that it is similar to the run times shown in the question, as no of threads increases
openmp is reducing the processing time. The graph reduced exponentially till no of threads – 4 and
then reduced linearly. This shows that multithreading reduces processing time.
Download