Question: Let us consider a vector addition application. Two vectors of length n can be added in parallel using at most n processors, as shown in

 Let us consider a vector addition application. Two vectors of length

Let us consider a vector addition application. Two vectors of length n can be added in parallel using at most n processors, as shown in the figure. Here, pi denotes ith processor. If we have n processors, then asymptotic run time of a vector addition program can be reduced from (n) to O (1) upon parallelizing. In general, if you have p processors and execution time is ts seconds for a sequential version of an application, then you should see a speed-up (theoretically) of O(ts/p) upon parallelizing the application. Figure 1: Vector addition: Sequential to Parallel example * Please note that all sequential algorithms can't be converted to parallel algorithms and you have to be cautious while taking these design decisions. Task You are asked to write a program for the above application and parallelize it. You can use any programming language (C/C++, Java, Python, etc. ) with which you are familiar. You are allowed to use external libraries such as OpenMP, OpenCL, CUDA, etc. You are required to submit a report containing the code (both sequential version and parallel version)

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!