
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
I was given to write a parallel computing problem in which a sequential c++ code is to be written and should be made to work as a parallel

Transcribed Image Text:Your task in this assignment is to implement and analyze efficient OMP program for fast application of 2D filters. 2D
filters are frequently used in image and signal processing, and hence their efficient implementations are highly desired.
Let us assume that our input image is represented by n x m array A, and let K be a kernel – a square matrix (for
simplicity we will assume that K is always 3 x 3 matrix). In classic 2D filtering with kernel K, for each pixel A;j we
compute convolution between K and submatrix of A centered around Aij. If you recall our lectures, this falls under the
category of stencil pattern.
In this assignment, we will consider a slightly modified version of the problem. Let A;-1:i+1,j–1:j+1 be submatrix of A
centered at (i, j). Then our filter will be defined as follows. First, Z = A;-1;i+1,j–1:j+1 × K, then we obtain the filtered
value A, = Eab Zab- In other words, first we compute matrix product between submatrix of A centered at (i, j) and
kernel K, then we sum up all elements of the resulting matrix Z. Note that we do not apply the filter to the first and last
row/column of A, i.e., A'; = Aij if i refers to the first/last row, or j refers to the first/last column.
The assignment consists of two parts. In the first question (Q1), starting from the provided backbone (see below) you
have to write a C++/OMP code implementing filter as explained above. In the second question (Q2), you have to analyze
performance of your solution, generate a speedup plot showing scalability of your code, and then provide a brief
discussion summarizing your findings (e.g., do you think your code is scalable, is it always scalable, if it is scalable in
what sense, if it is not scalable what do you think is causing problems.).
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 1 images

Knowledge Booster
Similar questions
- Write a short C program that declares and initializes (to any value you like) a double, an int, and a char. Next declare and initialize a pointer to each of the three variables. Your program should then print the address of, and value stored in, and the memory size (in bytes) of each of the six variables.arrow_forwardAnswer the given question with a proper explanation and step-by-step solution. The function many_params takes an unknown number of int parameters. The C and assembly forms of the function are given below, except we do not know the full signature. int many_params(int param1, (additional int params), int last_param){ return param1 + last_param; } many_params: movl %edi, %eax addl 24(%rsp), %eax ret How many parameters does many_params take?arrow_forwardCould you explain in depth what the question is asking and have clear steps so I can understand the code, which should be in c++ Thank you!arrow_forward
- Write a C++ program incorporating recursion to solve the following problem. The program should compile and execute under the UNIX gcc or g++ environments. (show this please) In this program it needs to accept a sequence of k characters from the user and use the characters to produce a k concentric squares. Also assume that there is an index origin of 1, the outermost square is made up of the letter a[k], the square inside that is made from the letter a[k-1], the square inside that is made from the letter a[k-2], and so on, with the innermost square made from the letter a[1]. For example, if k=5, and the values of a are ("R","O","C","K","Y") then the executed program should display: Y Y Y Y Y Y Y Y Y Y K K K K K K K Y Y K C C C C C K Y Y K C O O O C K Y Y K C O R O C K Y Y K C O O O C K Y Y K C C C C C K Y Y K K K K K K K Y Y Y Y Y Y Y Y Y Y To make this program simpiler to do if you implement it in C++ and write a class; instances of this class can be passed by value. If a class is…arrow_forwardI need this function to be defined using Haskell language. Hailstone sequences are produced by repeatedly applying the following mapping to numbers: an even number n maps to n/2 and an odd number m maps to 3m+1.The function hailmap applies this transformation to a single integer.hailmap :: Integer -> Integerhailmap n = undefined Note: when the function is called using an integer the answer will be given based on the number being odd or even. -- ghci> hailmap 7-- 22-- ghci> hailmap 8-- 4 Note: Use div rather than / for division, to avoid the need for conversion between numeric types.-- ghci> 15 `div` 2-- 7arrow_forwardHelp with this. Solve the Heads-or-Tails problem in C or C++. Read the H-or-T data from either a file or from STDIN. Reportthe result and related statistics to STDOUT. Report any errors to STDERR:a. In an effort to find something to do during self-quarantine, your friend flips a coin many times andcarefully records the result of each flip in a character vector using either H or T. Write a functionprogram called longestRun that reads these characters from a file and then analyzes them to find thelargest number of consecutive heads or tails. It must return/display two values: (1) the numbercorresponding to how many max consecutive heads or tails were thrown in a row and (2) thecharacter H or T depending upon whether it was Heads or Tails that was thrown the most times. Inthe event of a tie for the longest run, return the character B for both the text file is HTHHTTTHHTHHHTHTHTHHHHHTTHHHHHHHHHHHHTTTTTTTTTHarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education