Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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! image text in transcribed
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

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

Students also viewed these Databases questions