Question: Problem 1. Write an openMP program to initialize an array array of size 32 to all zeros in parallel using 8 threads, using one parallel

Problem 1. Write an openMP program to initialize an array array of size 32 to all zeros in parallel using 8 threads, using one parallel constructor and/or parallel for.

Problem 2. In Problem 1, create another parallel construct that adds i to array[i].

Problem 3. In Problem 2, create another parallel construct that calculates the number of even values in array as follows: it distributes the iterations to each thread using cyclic distribution, each thread computes the number of even values from its iterations and master thread collects and adds the number of even values. Master thread then displays the result.

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!