Question: from my practice final, thanks! In this task you are asked to use OpenMp but you aren't allowed to use tasks or the OMP parallel

from my practice final, thanks! from my practice final, thanks! In this task you are asked to

In this task you are asked to use OpenMp but you aren't allowed to use tasks or the OMP parallel for work-share construct. Instead you are supposed to manually divide the task across the different threads. We did this in the review and in Funz.c You can use omp_get_thread_num() // to get the the read id number omp_get_num_threads() //to get the total number of threads You can also use things like Atomic or single for when the thread need to reduce or compare Hint: intArray is not a type. Arrays are either written with [] at the end or as pointertypes. Question 1 10pts Find the sum of the first half of an array and the product of the second half Write a function that takes an int array reference and the size of said reference as input parameters. Have the function calculate two numbers, the first number would be the sum of the first half of the array. if the array size is odd, then have the sum be the larger of two halves. The second number you should then calculate would be the product of the second half. Once you have the two numbers, return their average

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!