Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need c++ code for this. Objectives: To design and implement an efficient multithreaded version of the Game of Life program using OpenMP. Problem Statement: The

need c++ code for this. image text in transcribed
image text in transcribed
image text in transcribed
Objectives: To design and implement an efficient multithreaded version of the "Game of Life" program using OpenMP. Problem Statement: The objectives of this homework are: 1. Design and implement a multithreaded version of the Game of Life program (developed in Homework-1) using OpenMP. The program must take the problem size, maximum number of iterations, and number of threads as command-line arguments. Make sure the program checks if there is a change in the board state between iterations. The program must create a parallel region only once, i.e., you should not create a new thread during each iteration. 2. Test the program for functionality and correctness (the output from the multithreaded version must be identical to the single threaded version). Describe how you tested the multithreaded version for correctness in your report. 3. Measure the performance of the program and optimize the program to improve performance. Please make sure to use the Intel Compilers for best performance. 4. Determine speed and efficiency of the multithreaded version of the program, plot the performance results, analyze the performance results, compare the performance with the sequential version, and include the analysis in the report. 5. Graduate Students only (both CS 632 and CS 732): Implement a two-dimensional data distribution using OpenMP and measure the performance for the following grid sizes (thread mappings): 1x16, 2X8, 4X4, 8X2, and 16X1. Analyze the performance across different grid sizes (thread mappings) and include this analysis in the report Note that the grid size of 16X1 is equivalent to using 16 threads with the one- dimensional data distribution implemented in Step #1 Guidelines and Hints: 1. Review Chapter 5. Shared Memory Programming with OpenMP in the textbook, download the source code from the textbook website, compile and test the programs on a Linux system (you can use Vulcan machines in CS for testing). You can also review the OpenMP Tutorial at https://computing.linl.gov/tutorials/openMP/ and the Introduction to OpenMP Tutorial at https://www.openmp.org/uncategorized/tutorial- introduction-to-openmp/. 2. Test the multithreaded version of the program for small problem sizes (say, 5x5 or 10x10) first by comparing the result with the sequential version (you have to use the same seed in both versions of the program) on the CS Linux systems. After you are convinced that your program is working correctly, execute your program on the ASC Page 1 of 2 Spring 2021: CS 432/632/732 Parallel Computing Homework-3 cluster for 1, 2, 4, 8, 10, 16, and 20 threads and note down the time taken. Use the matrix size 5000x5000 and maximum iterations as 5000 for all the test cases, Compute the speedup and efficiency and plot them separately. Include details on how you computed the speedup and efficiency in the report. Compare the performance on the OpenMP version with the sequential version and include your analysis in the report. 3. Make sure that you use Vulcan machines in the CS department for all development and testing and the ASC cluster for obtaining the performance results. When you are testing, you can initialize the matrix and print the output only in the main thread. 4. Make sure you submit jobs to the compute nodes using run_script. Do NOT run any jobs on the login node or head node. cluster for 1, 2, 4, 8, 10, 16, and 20 threads and note down the time taken. Use the matrix size 5000x5000 and maximum iterations as 5000 for all the test cases. Compute the speedup and efficiency and plot them separately. Include details on how you computed the speedup and efficiency in the report. Compare the performance on the OpenMP version with the sequential version and include your analysis in the report. 3. Make sure that you use Vulcan machines in the CS department for all development and testing and the ASC cluster for obtaining the performance results. When you are testing, you can initialize the matrix and print the output only in the main thread. 4. Make sure you submit jobs to the compute nodes using run_script. Do NOT run any jobs on the login node or head node. 5. Note that you have include "module load intel" in your SLURM job script (i.e., myscript.sh). 6. Make sure you comment out any print statements you might have to print the board when you execute with larger problem sizes. Also, execute the program three times and use the average time taken. 7. Check-in the final version of your program and the output files generated by the job script (i.e., myscriptshSCRIPT.ocjobid> file) to the CS git server and make sure to share your git repository with the Instructor. Please make sure you are not writing the array to stdout, this would result in large job output files. Objectives: To design and implement an efficient multithreaded version of the "Game of Life" program using OpenMP. Problem Statement: The objectives of this homework are: 1. Design and implement a multithreaded version of the Game of Life program (developed in Homework-1) using OpenMP. The program must take the problem size, maximum number of iterations, and number of threads as command-line arguments. Make sure the program checks if there is a change in the board state between iterations. The program must create a parallel region only once, i.e., you should not create a new thread during each iteration. 2. Test the program for functionality and correctness (the output from the multithreaded version must be identical to the single threaded version). Describe how you tested the multithreaded version for correctness in your report. 3. Measure the performance of the program and optimize the program to improve performance. Please make sure to use the Intel Compilers for best performance. 4. Determine speed and efficiency of the multithreaded version of the program, plot the performance results, analyze the performance results, compare the performance with the sequential version, and include the analysis in the report. 5. Graduate Students only (both CS 632 and CS 732): Implement a two-dimensional data distribution using OpenMP and measure the performance for the following grid sizes (thread mappings): 1x16, 2X8, 4X4, 8X2, and 16X1. Analyze the performance across different grid sizes (thread mappings) and include this analysis in the report Note that the grid size of 16X1 is equivalent to using 16 threads with the one- dimensional data distribution implemented in Step #1 Guidelines and Hints: 1. Review Chapter 5. Shared Memory Programming with OpenMP in the textbook, download the source code from the textbook website, compile and test the programs on a Linux system (you can use Vulcan machines in CS for testing). You can also review the OpenMP Tutorial at https://computing.linl.gov/tutorials/openMP/ and the Introduction to OpenMP Tutorial at https://www.openmp.org/uncategorized/tutorial- introduction-to-openmp/. 2. Test the multithreaded version of the program for small problem sizes (say, 5x5 or 10x10) first by comparing the result with the sequential version (you have to use the same seed in both versions of the program) on the CS Linux systems. After you are convinced that your program is working correctly, execute your program on the ASC Page 1 of 2 Spring 2021: CS 432/632/732 Parallel Computing Homework-3 cluster for 1, 2, 4, 8, 10, 16, and 20 threads and note down the time taken. Use the matrix size 5000x5000 and maximum iterations as 5000 for all the test cases, Compute the speedup and efficiency and plot them separately. Include details on how you computed the speedup and efficiency in the report. Compare the performance on the OpenMP version with the sequential version and include your analysis in the report. 3. Make sure that you use Vulcan machines in the CS department for all development and testing and the ASC cluster for obtaining the performance results. When you are testing, you can initialize the matrix and print the output only in the main thread. 4. Make sure you submit jobs to the compute nodes using run_script. Do NOT run any jobs on the login node or head node. cluster for 1, 2, 4, 8, 10, 16, and 20 threads and note down the time taken. Use the matrix size 5000x5000 and maximum iterations as 5000 for all the test cases. Compute the speedup and efficiency and plot them separately. Include details on how you computed the speedup and efficiency in the report. Compare the performance on the OpenMP version with the sequential version and include your analysis in the report. 3. Make sure that you use Vulcan machines in the CS department for all development and testing and the ASC cluster for obtaining the performance results. When you are testing, you can initialize the matrix and print the output only in the main thread. 4. Make sure you submit jobs to the compute nodes using run_script. Do NOT run any jobs on the login node or head node. 5. Note that you have include "module load intel" in your SLURM job script (i.e., myscript.sh). 6. Make sure you comment out any print statements you might have to print the board when you execute with larger problem sizes. Also, execute the program three times and use the average time taken. 7. Check-in the final version of your program and the output files generated by the job script (i.e., myscriptshSCRIPT.ocjobid> file) to the CS git server and make sure to share your git repository with the Instructor. Please make sure you are not writing the array to stdout, this would result in large job output files

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions