Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C# Parallel output should be close to 1.99 x 10^23 Your parallel program will calculate the expression: i=1100000000(.9999999)i2(.9999999)112+(.9999999)222 (i is going from 1

Code in C#
Parallel output should be close to 1.99 x 10^23 image text in transcribed
Your parallel program will calculate the expression: i=1100000000(.9999999)i2(.9999999)112+(.9999999)222 (i is going from 1 to 100 million (unlike the Chapter 4 slides where the size is 1 billion) there are seven 9's in the base, preceded by a decimal point.) The fast sequential algorithm to do this is: Verify that it does what it is supposed to do, placing the result in sum. Placing Visual Studio in Release mode instead of Debug mode (which takes much longer), write code to time the sequential algorithm. Then, write a timed parallel program that will beat the time. You should model your parallel program after faulty program 5 in the chapter 4 slides. (You will find faulty program 5 on D2L.) This means the granularity for your program will be coarse, which is ideal. (In the next assignment, we'll study the result of fine granularity.) Your parallel program should use 4 cores (Becker lab has quadcore computers) and should be at least 3 times faster than the sequential program. Note: After you figure out the work each core will do, you may need to start off the core with the time-consuming Pow function. For example, Math.Pow (x,y) only use once would give the result of x to the y power. However, it is a time-consuming function. Using this function in the sequential program loop would have made it run 10 times longer. Don't use the Pow function on each iteration for your parallel code, because you won't beat the time. Just start off the work of each core with the Pow function, then use a loop with the sequential algorithm style. Compare the result of the sequential algorithm to the parallel algorithm to make sure you have it right. There may be a little error from roundoff accumulating, but the results should be close

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions