Name: cs598dhp Parallel Processing Midterm Exam Due in ... - Polaris
Name: cs598dhp Parallel Processing Midterm Exam Due in ... - Polaris
Name: cs598dhp Parallel Processing Midterm Exam Due in ... - Polaris
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
7. OpenMP [5 pts.] For each of the follow<strong>in</strong>g three loop nests, specify whether or notthe outermost loop can be transformed <strong>in</strong>to parallel form without chang<strong>in</strong>g the loopbody. If the answer is no, state the reason(a) do i=1,ndo j=1,na(i,j) = a(i,j-1) + 1b(i,j) = a(i,j) + a(i,j)end doend do(b) do i=1,ndo j=1,na(i,j) = a(i-1,j-1) + 1end doend do(c) do i=1,ndo j=1,na(i,j) = a(i-1,n+1) + 1b(i,j) = a(i-1,j) + a(i,j)end doend do8