Ask Computer Engineering Expert

Introduction

This project involves an investigation of OpenMP scheduling. You will create a rumble between static scheduling vs. dynamic, and small vs. large chunksize.

You are deliberately giving each thread a very different amount of work to do and testing how OpenMP can best accomplish that.

Requirements

- Use OpenMP for this. Have a global floating-point Array whose size, ARRAYSIZE, is at least 32K (32*1024).
- Use a variety of different numbers of threads. Use at least 1, 2, and 4. You will get better results if you use more, maybe something like 1, 2, 4, 6, 8, 10, 12, 14, and 16. You can also use more if you'd like.
- Fill that array with ARRAYSIZE random floating-point numbers, e.g., Array[i] = Ranf( - 1.f, 1.f ); Why do this if we don't care about the answers? This keeps a smart compiler from trying to figure out what the answers are ahead of time and avoiding the computation altogether. Maybe I'm just paranoid.
- The outer for-loop loops through i = 0 ... ARRAYSIZE-1 iterations. For each of these iterations, an inner for-loop loops through j = 0 ... i and that many of the Array's floating- point numbers are multiplied, e.g., prod *= Array[j]
- #pragma the outer for-loop. You could, instead, #pragma the inner for-loop, but your performance would be slower. (Why?)
- Set the running product to 1. inside the outer for-loop, but outside the inner for-loop. This makes it a private variable for each thread.
- Test both static and dynamic scheduling and chunksizes of 1 and 4096. Thus, you will have 4 test cases and a range of thread numbers for each. Joe Parallel's spreadsheet looked like this:

- You can control static vs. dynamic scheduling and the chunksize by adding a clause to the end of the #pragma line. Use either schedule(static,1) or schedule(static,4096) or schedule(dynamic,1). or schedule(dynamic,4096).
- Record the data in units of something that gets larger as speed increases. Joe Parallel used "MegaMults Per Second".
long int numMuled = (long int)ARRAYSIZE * (long int)(ARRAYSIZE+1) / 2; // count of how many multiplications were done:

fprintf( stderr, "Threads = %2d; ChunkSize = %5d; Scheduling=static ; MegaMults/sec = %10.2lf\n", NUMT, CHUNKSIZE, (double)numMuled/(time1- time0)/1000000. );
but you can use anything that makes sense.
- Your commentary write-up (turned in as a PDF file) should include:

1. Tell what machine you ran this on
2. Create a table with your results.
3. Draw a graph. The X axis will be the number of threads. The Y axis will be the performance in whatever units you sensibly choose. On the same graph, plot 4 curves:
o static,1
o static,4096
o dynamic,1
o dynamic,4096
4. What patterns are you seeing in the speeds?
5. Why does chunksize 1 vs. 4096 matter like this?
6. Why does static vs. dynamic matter like this?

A Random Number Function
#include float
Ranf( float low, float high )
{
float r = (float) rand(); // 0 - RAND_MAX

return( low + r * ( high - low ) / (float)RAND_MAX );
}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92274632
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As