Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Draw supply and demand curve to illustrate the following

Draw supply and demand curve to illustrate the following sequences of events. Show changes in one graph. Assume upward sloping for supply curves and downward sloping for demand curves 1. In year 1, the rental apartment m ...

Suppose a countrys real gdp is 18 trillion andnbspthat

Suppose a country's real GDP is $18 trillion and that population is 300 million. Instructions:  Enter your answers as whole numbers. a. What is this country's real GDP per capita? $  Suppose that during the next 10 years ...

System analysis and design1 explain the difference between

System Analysis and Design 1) Explain the difference between too much feedback and too little feedback and provide a scenario for each one (two scenarios are needed - one for a lot of feedback and one for too much) and w ...

Create login form to enter user name and a password textbox

Create login form to enter user name and a password textbox to enter password, and write procedure to simulate the process of triggering the login process after hitting the Enter Key.

Design layout reference mailings review view consolas 105 a

Design Layout Reference Mailings Review View Consolas 10.5 A. A Styles styles H- 1. Report the total payments by date when the total payments are greater than $20,000. 2. List the amount paid by each customer who has pai ...

Structureswrite the program in c onlytask create a seating

Structures Write the Program in C++ only. Task: Create a seating reservation program for Podunk Airlines. The air fleet consists of a single plane with a seating capacity of 12. The plane makes one flight daily. Your pro ...

Question ransomware to pay or not to pay when it comes to

Question: Ransomware: To pay or not to pay? When it comes to corporate data, should corporations pay? Can you trust paying? What can be done to protect against ransomware?Would you pay if it were your own personal data? ...

How can deferred cancellation ensure that thread

How can deferred cancellation ensure that thread termination occurs in an orderly manner as compared to asynchronous cancellation?

Question suppose that a web server has a link speed of

Question : Suppose that a web server has a link speed of 1Gbps. And suppose that each machine in a botnet has a link speed of 1Mbps a. How many botnet machines are needed to send data to the web server in order to fill t ...

Suppose i am designing a personnel database for a

Suppose I am designing a personnel database for a university. The university has three types of personnel: students, staff, and faculty. Here are the characteristics of the three groups: -All three groups have a name and ...

  • 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