0% found this document useful (0 votes)
6 views1 page

Lab Assignment 3 - Write A Program For Parallel Vector Addition by Using Multithreading

The assignment focuses on implementing parallel vector addition using multithreading, aiming to reduce execution time through load balancing. Students are required to create a program that processes vectors of varying lengths and thread counts, measuring execution time and presenting results in tables and graphs. The final submission must include code, output snapshots, and a comparison of execution times based on different configurations.

Uploaded by

Murtaza Tunio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Lab Assignment 3 - Write A Program For Parallel Vector Addition by Using Multithreading

The assignment focuses on implementing parallel vector addition using multithreading, aiming to reduce execution time through load balancing. Students are required to create a program that processes vectors of varying lengths and thread counts, measuring execution time and presenting results in tables and graphs. The final submission must include code, output snapshots, and a comparison of execution times based on different configurations.

Uploaded by

Murtaza Tunio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CSE-467 - Parallel and Distributed Computing

Assignment No 3
Objective: Write a program for parallel vector addition by using multithreading.
The complexity of vector addition is O(N) and the execution time depends on the vector length.
In this assignment you will learn how to pass and return values from a thread and how logically
work can be divided into multiple threads to be performed in parallel and reduce total
execution time. You need do device some logic for load balancing.
Submit a word file containing all code, output snapshots and the comparison table and graph.
-------------------------------------------------------------------------------------------------------------------------------
Input:
1. Vector Length: N (to be used to create and initialize 3 vectors)
2. No of Threads: T
Processing: Determine the execution time of vector addition with various values of T and N
given in the table.
T0 = get clock cycle/system time
Perform V1 = V2 + V3 with load balancing among T threads.
T1 = get clock cycle/system time
Time elapsed = T1 – T0
Output: Time elapsed - Tables show the comparison

N (vector size in thousands)


50 100 150 200 250 300 350 400
1
T (no of threads)

5
10
15
20
25
30

Draw the Graph for above table.

You might also like