Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 3 Multiple processors need to share data quickly and efficiently to achieve high performance. One way to do this is through shared memory. However,
QUESTION
Multiple processors need to share data quickly and efficiently to achieve high performance. One
way to do this is through shared memory. However, shared memory can present a problem when
multiple processors try to access the same memory location simultaneously. Figure Q shows
a code segment that updates a shared variable "sum" in a loop written with the OpenMP
programming model.
Figure Q
a Explain in detail the use of OpenMP's "critical" directive to solve the shared memory
problem in an HPC system. Also, identify the problem that might occur by executing
this directive.
marks
b The impact of this overhead can be quantified by measuring the execution time of the
program with and without the "critical" directive. Rewrite the program to measure the
performance impact of the "critical" directive by utilising OpenMP's builtin timers.
Explain in detail about your program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started