Derive the best value for grain-size to maximize parallelism

Assignment Help Basic Computer Science
Reference no: EM131030904

Implementing parallel loops using nested parallelism

Consider the following multithreaded algorithm for performing pairwise addition on n-element arrays A[1 .. n] and B[1.. n], storing the sums in C[1.. n]:

SUM-ARRAYS(A,B,C)

1 parallel for i = 1 to A. length

2 C[i] = A[i] + B[i]

a. Rewrite the parallel loop in SUM-ARRAYS using nested parallelism (spawn and sync) in the manner of MAT-VEC-MAIN-LOOP.

Analyze the parallelism of your implementation.

Consider the following alternative implementation of the parallel loop, which contains a value grain-size to be specified:
SUM-ARRAYS'(A,B,C)

1 n = A. length

2 grain-size = ? // to be determined

3 r = [n/grain-size]

4 for k = 0 to r - 1

5 spawn ADD-SUBARRAY(A,B,C, k . grain-size + 1, min((k + 1) . grain-size, n))

6 sync

ADD-SUBARRAY(A,B,C, I, j )

1 for k = i to j

2 C[k]= A[k]+ B[k]|

b. Suppose that we set grain-size = 1. What is the parallelism of this implementation?

c. Give a formula for the span of SUM-ARRAYS0 in terms of n and grain-size.

Derive the best value for grain-size to maximize parallelism.

Reference no: EM131030904

Questions Cloud

Discuss the performance differences between fhss and dsss : Discuss the performance differences between FHSS and DSSS - What considerations should be used when determining the chipping rate?
How much fabric does jessi need to buy : Jessi has 9 feet of blue fabric. To finish making her costume she needs one third of that amount of red fabric. The fabric store selld fabric by the yard. How much fabric does Jessi need to buy
Explain why differences between state constitutions : Explain why differences between state Constitutions and the U.S. Constitution made it more controversial for the national government to require all citizens to buy health insurance.
What is the area of the rug : The perimeter of a rectangular rigid 24 fee. The length of the rug is 1 2/5 it's width. What is the area of the rug
Derive the best value for grain-size to maximize parallelism : Suppose that we set grain-size = 1. What is the parallelism of this implementation?
Using media to advocate and influence : The Session Long Project entails you going through the process of influencing policymakers. Under the Connecticut Health Policy toolbox resource, read the section on "Writing to Policymakers." You will notice toward the bottom of that page, "sampl..
Major equipment breakdowns and excessive loss : Studies have shown that DU5 can operate only 3 1/2 years without major equipment breakdowns and excessive loss of efficiency. Therefore, DU5 is shut down every 3 1/2 years for cleaning, inspection, and repairs.
What the aged-payables and aged-receivables reports are : How they might be used to make management decisions from both the view of internal and external users - What the aged-payables & aged-receivables reports are.
What is the value of the chi-square statistic : What were the actual percentages of local high school students in each category? (Round answer to two decimal places) State an appropriate null hypothesis for this analysis. What is the value of the chi-square statistic

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is the next step after creating a virtual hard disk

What is the next step after creating a virtual hard disk (VHD)?

  How can we use both karnaugh maps

How can we use both Karnaugh maps and DeMorgan equivalences to better understand systems we build?

  Determine the mix of cargo

The load master for a freighter wants to determine the mix of cargo to be carried on the next trip. The ship's volume limit for cargo is 100,000 cubic meters, and its weight capacity is 2,310 tons.

  Discuss current or future applications of nanotechnology

Provide at least three examples of real-world applications in use or in development with reliable references.

  Anomalous behaviour of fifo

Describe Belady's anomaly and provide an example that illustrates anomalous behaviour of FIFO.

  Create a web archive file and attach to this assignment

Name your JSP FormPost4 and name the application Week7. Create a Web archive file and attach to this assignment.

  Write a method called wordlengths that accepts a scanner

Write a method called wordLengths that accepts a Scanner for an input file as its parameters. Your method should open the given file, count the number of letters in each taken in the file, and output a result diagram of how many words contain each..

  Students and faculty to stay connected as they roam

Imagine that your university uses 802.11b wireless access points and wireless network cards to allow students and faculty to stay connected as they roam the campus.

  High-level descriptions of customer-s expectations

It needs to have high-level descriptions of the customer's expectations and the criteria for success. You need to describe why these are the best choices and why alternatives will not work as well.

  Suppose fred sees your rsa signature on m1 and m2

Suppose Fred sees your RSA signature on m1 and m2

  Probability and statistics for computer science

Probability and Statistics for Computer Science  - What is the probability that V will get the project and if V gets the project, what is the probability that W did not bid

  Calculate charges to determine the charge for each customer

A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional .50 per hour for each hour or part thereof in excess of three hours.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd