Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a. Identify the data dependences (which variable? true/flow, anti or output?) b. Describe in words one or more correct parallelizations of the code -- only

a. Identify the data dependences (which variable? true/flow, anti or output?)

b. Describe in words one or more correct parallelizations of the code -- only one is needed, but more versions will test your knowledge.

Example 1: Matrix-vector multiply

for (i=0; i

for (j=0; j

a[i] = a[i] + c[i][j] * b[j];

}

}

Example 2: 1D Jacobi stencil

for (t=0; t

for (i=1; i

B[i] = 0.33 * (A[i-1] + A[i] + A[i+1]);

}

for (i=1; i

A[i] = B[i];

}

}

Example 3: Floyd Warshall

for (k=0; k

for (i=0; i

for (j=0; j

path_old = path[i][j];

path_new = path[i][k] + path[k][j];

if (path_old > path_new) {

path[i][j] = path_new;

}

}

}

}

Example 4: bicg

for (i=0; i

q[i] = 0;

for (j=0; j

s[j] = s[j] + r[i] * A[i][j];

q[i] = q[i] + A[i][j] * p[j];

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

Why do people behave unethically?

Answered: 1 week ago

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago