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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started