# 7.6 Exercises

 Page 1 / 1

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];```

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```

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```

what is a market demand schedule
What is demand curve
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
what is demand
demand is the quantity of commodity that consumers wil be able and wiling to buy at a given price at a given time
Delly
it is the exchange of goods and services across international borders.
Tweneboah
what is taxation
the definition of economic by Adam Smith
Adam Smith define economic as the science of wealth
Hafsat
What is enconomics
mohamed
what is meant by pisp in economics?
payment initiation service provider
Khuselo
what is demand
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
What is economc
nahurira
What is Economic
What's the price index of consumption?
what population
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
the higher the price , the higher the quantity demanded
Ruth
what is economic growth
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
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
Got questions? Join the online conversation and get instant answers!

#### Get Jobilize Job Search Mobile App in your pocket Now! By OpenStax By Melinda Salzer By Jazzycazz Jackson By By OpenStax By OpenStax By By OpenStax By Dakota Bocan By OpenStax