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

  Edit this java code add the 3 amounts

Can anyone pls edit this Java code? I need to be able to add the 3 amounts listed on the main method public class Money { private Currency currency; private int wholenum; private int decnum; public Money(Currency currency, int wholenum, int decnum..

  Complete the execution of programs

Consider a system that has two CPUs, each CPU having two threads (hyperthreading). Suppose three programs, P0, P1, and P2, are started with run times of 5, 10 and 20 msec, respectively. How long will it take to complete the execution of these progr..

  How does lossy compression help

How does lossy compression help

  Write a plan for analysis and design of an e-commerce site

Write a plan for the analysis and design of an e-commerce site recommending which aspects of process and data analysis should be conducted and explaining how they should be integrated.

  Identity tangible and intangible benefits of the new payroll

suppose you own a travel agency in a large city you have many clients but growth has slowed somewhat. some long term employees are getting discouraged, but feels that there might be a way to make technology work in favor. use your imagination and sug..

  What is an unbreakable uml diagram

What is an "unbreakable" UML diagram and can you give the definition and an example would be awesome.

  Suggest an agile project management framework

Create a project plan for this project based on your proposed framework through the use of MS Project or Excel. Note: List all major milestones, resources, tasks and dependencies. Include tools such as risk log to enhance your project plan.

  How created the conceptual and process view for all

how you created the conceptual and process view for all

  Creating project organization in enterprise business

Organization structures generally used to create a project organization in an enterprise business environment.

  The types of business needs technology-based solution

Describe the types of business needs that can be addressed using information technology-based solutions.

  What are the five different approaches to risk

What are the five different approaches to risk? What are the pros and cons of each strategy? Support your answer with solid reasoning class is cmgt 400

  Own a consulting company that designs installs

Assume you own a consulting company that designs, installs, and maintains wide area networks. You currently have two companies requesting bids for their wide area networks to be installed. You must provide all of the relevant information to the..

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