Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) Give the contents of array x after the execution of the following OpenMP code fragment if possible, or give the error if there is

(a) Give the contents of array x after the execution of the following OpenMP code fragment if possible, or give the error if there is one. Assume that there are 5 threads all together:

(b) Give the output of the following OpenMP code fragment if possible, or give the error if there is one. Assume that there are 4 threads all together:

Q2: Consider the loop Is there loop-carried dependence? If there, please identify it occurs. Can you see a way to eliminate this dependence and parallelize the loop?

Q3:

(a) How may as are printed by the program? 1. 10 as

2. 20 as 3. unknown

(b) How may bs are printed by the program? 1. 10 bs

2. 20 bs 3. unknown

Q4: Given the following code fragment, why is this code a faulty MPI program, explain all errors in this program? Assume that it is executed on two processes

Q5:What makes the following code faulty (not producing the apparent desired behavior)? How could it be fixed?

Q6:Given the following code fragment:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

i need help with this please with any question

Assignment 2 cCcs 423 Parallel Computing Second Trimester 2022/2023 Student Name: Student ID: Instructions: Please Turn off your mobile phones Cheating or discussion with calleagues will result in negative marking Including this cover page, this exarn bocklet contains 2 pages. Cherk if pou have missing pages Questions 1 (CLO 2.1, PLO s2-SO2) [2point] (a) Give the contents of array x after the execution of the following OpenMP code fragment Questions 2 (CLO 2.1, PLO S2-SO2) [3poi if possible, or give the error if there is onc. Assume that there are 5 threads all togetber: Consider the loop Int a[8]; a[]8 a Is there lloxlg-carried deperdence? If there, please identify it octurs. Can you see a way to elizinate this dependeoce and parallelize the bop? (b) Give the output of the folloning OpenM1P code fragment if possible, or give the error if there is one. Assume that there are 4 threads all together: (a) How may a's are printed by the program? 1. 10 a's 2. 20 a's 3. unknown (b) How may b's are printed by the program? 1. 10 b's Questions 5 (CLO 2.1, PLO S2-SO2) [3point] 3. unknown What makes the following code fauly (nol groducing the appareat desired behavioty? How cenld it be fixed? Questions 4 (CLO 2.1, PLO S2-SO2) [2point] Given the followring code fragneut, why is this code a faulty MPI progran, explain all errors in this progrum? Assime that it is execcuted an two processes Assuming this application is heing run with 4 processes (mpirun - np 4. thisapplication), determine the values for rank, 1 , array A, array 13 , totulZero after executing loep, and auswer for each processor. Start from MPI_Init in line 13

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_2

Step: 3

blur-text-image_3

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions