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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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