[10 marks] Download zip file from Canvas. Unzip and copy contents to a new C project. Read the “readme.txt” for copyright info and for some background about the library used.
The first three statement in the main function define the input and output images and the required processing. Play with the values of these constants and check the output.
Your goal is to reduce the processing time by dividing the workload among several threads (e.g., 4 threads) using OpenMP (but don’t use parallel for: i.e., neither #pragma omp parallel for nor #pragma omp for). To verify the correctness of your code, check the output image as well as the processing time (printed out in the console). Report the processing times for 2, 4, 8, 16 threads as a comment in your code.
For both (a) and (b), compare the execution time of the parallel block using omp_get_wtime() which returns the number of seconds that have passed since some time in the past. For details on taking timings, see Section 2.6.4 of the textbook PACHECO-11.
For this assignment, you need to do the following:
Note that you can resubmit an assignment, but the new submission overwrites the old submission and receives a new timestamp.
C command line arguments in Eclipse
The omp_trap_1.c program in Q2 above requires passing an argument when running the program (see Usage in the comments part). In order to pass an argument, you can either use command line (i.e. the one in Usage), or you can do this in Eclipse IDE as seen below. Other IDEs usually have a similar way of passing arguments to the execution statement.

![[SOLVED] Cosc407 a3 (20 marks) focus: openmp (b,c,d)](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[SOLVED] POSIX Standards and Bindings](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.