<< Chapter < Page Chapter >> Page >

Identify the dependencies (if there are any) in the following loops. Can you think of ways to organize each loop for more parallelism?


  1. DO I=1,N-2 A(I+2) = A(I) + 1.ENDDO

  2. DO I=1,N-1,2 A(I+1) = A(I) + 1.ENDDO

  3. DO I=2,N A(I) = A(I-1) * 2.B = A(I-1) ENDDO

  4. DO I=1,N IF(N .GT. M)A(I) = 1. ENDDO

  5. DO I=1,N A(I,J) = A(I,K) + BENDDO

  6. DO I=1,N-1A(I+1,J) = A(I,K) + B ENDDO

  7. for (i=0; i<n; i++) a[i]= b[i];
Got questions? Get instant answers now!

Imagine that you are a parallelizing compiler, trying to generate code for the loop below. Why are references to A a challenge? Why would it help to know that K is equal to zero? Explain how you could partially vectorize the statements involving A if you knew that K had an absolute value of at least 8.


DO I=1,N E(I,M) = E(I-1,M+1) - 1.0B(I) = A(I+K) * C A(I) = D(I) * 2.0ENDDO
Got questions? Get instant answers now!

The following three statements contain a flow dependency, an antidependency and an output dependency. Can you identify each? Given that you are allowed to reorder the statements, can you find a permutation that produces the same values for the variables C and B ? Show how you can reduce the dependencies by combining or rearranging calculations and using temporary variables.


B = A + C B = C + DC = B + D
Got questions? Get instant answers now!

Questions & Answers

what is a market demand schedule
Blessed Reply
What is demand curve
mohamed Reply
Types of demand curve
mohamed
demand curve is a showing the aggregate of demand whether falling from right to the left in the table above
BULAMA
demand curve is the graphical representation of various quantities of a commodity bought at various prices
Blessed
What is the formula for calculating elasticity
Hafsat Reply
what is demand
Anefor Reply
demand is the quantity of commodity that consumers wil be able and wiling to buy at a given price at a given time
Delly
what is international trade?
Friday Reply
it is the exchange of goods and services across international borders.
Tweneboah
what is taxation
Eunice Reply
the definition of economic by Adam Smith
Geon Reply
Adam Smith define economic as the science of wealth
Hafsat
What is enconomics
mohamed
what is meant by pisp in economics?
Amara Reply
payment initiation service provider
Khuselo
what is demand
Joy Reply
demand
Demand refers to the consumers' desire to purchase goods at given prices. Demand can mean either demand for a specific good or aggregate demand for the total of all goods in an economy.
What is economc
Joseph Reply
What is economc
nahurira
What is Economic
Vicky Reply
What's the price index of consumption?
Pun Reply
what population
Hackman Reply
I think it's the sum total of people in a goegraphical area at a given time
Ruth
it refers to the number of people living in a particular area over a given period of time
Vanessa
decribe law of demand
Lovely Reply
the higher the price , the higher the quantity demanded
Ruth
what is economic growth
Metuge Reply
what is an economic system
Metuge
Economic system is the mechanism which deals with the production, distribution and consumption of good and services in a particular society
Happy
of course
Maesela
what is a weight
Maesela
What is a weight
mohamed
While the American heart association suggests that meditation might be used in conjunction with more traditional treatments as a way to manage hypertension
Beverly Reply
in a comparison of the stages of meiosis to the stage of mitosis, which stages are unique to meiosis and which stages have the same event in botg meiosis and mitosis
Leah Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, High performance computing. OpenStax CNX. Aug 25, 2010 Download for free at http://cnx.org/content/col11136/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'High performance computing' conversation and receive update notifications?

Ask