COMSATS UNIVERSITY ISLAMABAD
Lahore Campus
Department of Computer Science
■ Assignment#01
Credit
Course Title: Parallel and Distributed Computing Course Code: CSC334 3(2,1)
Hours:
Course Instructor: Muntha Amjad Program Name: BCS
Semester: Batch: Section: Date: 6-3-2025
Time Allowed: Maximum Marks: 30
Student’s Name: Reg. No.
Question#01: CLO: <2> Apply principles and concepts of parallel and
distributed computing to solve computational problems; Bloom Taxonomy
Level: <Applying>
(A) Suppose you are developing a network intrusion detection system that analyzes vast
amounts of network traffic data in real-time.
Which parallel computing paradigm (SIMD, MIMD, etc.) would be most effective?
(B) Explain the role of Message Passing Interface (MPI) and OpenMP in parallel computing.
Compare their suitability for shared-memory vs. distributed-memory architectures.
(C) A company wants to speed up matrix multiplication on a multi-core CPU.
Which type of parallelism (data, task, or loop-level) is most suitable?
Explain how you would parallelize the matrix multiplication process using OpenMP.
(D) Consider the following C code:
Identify RAW, WAR, and WAW dependencies in this code.
Can this loop be parallelized? Why or why not?
(E) Consider the following C code:
What type of dependency does this code exhibit?
How does speculative execution help in such cases?
(F) Analyze the following loop:
Represent this as a dependency graph.
Can these operations be performed in parallel? Why or why not?
(G) Modify the following code to remove dependencies using scalar expansion:
What was the original dependency issue?
How does scalar expansion help parallelization?
(H) Consider the following code and apply loop fusion and rewrite the code.
(I) Apply loop interchange technique on the following code to improve cache performance:
(J) Consider the following code:
Explain how branch misprediction might impact performance.