Question: Please do all tasks correctly, and make sure you write a program in C++. Please do not copy from other answers from Chegg thank you

"Please do all tasks correctly, and make sure you write a program in C++."

"Please do not copy from other answers from Chegg thank you"\

"Please do all tasks correctly, and make sure you write a program

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

serialpi.c code:

in C++." "Please do not copy from other answers from Chegg thank

You have learned the aspects of intrinsic programming and thread programming. In this lab, you are to modify and generalize a serial program. The targetted program is called serialpi.c and is taken from a parallel programming tutorial of Oak Ridge National Laboratory. Task 1: General modification Create a file called pi.c based on serial_pi.c. The new file, pi.c can do the following: - Accept one command line argument. - The first argument is a value between 10 and 10000000 . It provides the number of random points to be generated for the pi estimation process. - The output to screen must print the value of the estimated pi. Task 2: Thread programming Create a file called thread_pi.c based on pi.c. The new file, thread_pi.c can do the following: - Accept two command line argument. - The first argument is a value between 10 and 10000000 . It provides the number of random points to be generated for the pi estimation process. - The second argument is the number of threads to be used for parallel calculation. - The function run by each thread is to be called montecarlo. - The argument array for montecarlo should include two parameters, one representing the number of points to be calculated by each thread, and another representing the random seed to be used by montecarlo - The output to screen must print the value of the estimated pi. Task 3: Intrinsic programming Create a file called intrinsic_pi.c based on pi.c. The new file, intrinsic_pi.c can do the following: - Accept one command line argument. - The first argument is a value between 10 and 10000000 . It provides the number of random points to be generated for the pi estimation process. - The calculation process should be rewritten so that all calculations are to be done via intrinsic. You can assume SSE intrinsic. - The output to screen must print the value of the estimated pi. Important Notes: - To compile programs calling math functions, a flag need to be added. - Pay attention to the random seeds for different threads in thread_pi.c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!