0% found this document useful (0 votes)
4 views

Assignment 04 Matrix Multiplication

The assignment requires students to develop parallel computer programs for two tasks: matrix multiplication and calculating the value of PI, using four different technologies: MPI, pThreads, OpenMP, and CUDA. Each program must accept command line arguments for matrix size or number of terms and processes/threads/blocks, and display results accordingly. Students must submit their programs on the HPC server along with a report that includes screenshots and properly commented code, adhering to a zero tolerance policy for plagiarism.

Uploaded by

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

Assignment 04 Matrix Multiplication

The assignment requires students to develop parallel computer programs for two tasks: matrix multiplication and calculating the value of PI, using four different technologies: MPI, pThreads, OpenMP, and CUDA. Each program must accept command line arguments for matrix size or number of terms and processes/threads/blocks, and display results accordingly. Students must submit their programs on the HPC server along with a report that includes screenshots and properly commented code, adhering to a zero tolerance policy for plagiarism.

Uploaded by

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

Parallel and Distributed Programming (CIS-442)

BSCIS – DCIS, PIEAS

Assignment 04: Matrix Multiplications and Calculate Value of PI


For this Assignment you have to solve 2 problems and write parallel computer programs using
technologies learned in this course. This is individual assignment and your programs must be present
on the HPC server we are using in this course, and should be ready to compile and run. You should
include screenshots of your running program in report. Comment and indent your codes properly.

Task 1

Write a parallel computer program to multiply 2 square matrices using parallel technologies studied
in this course. You need to write 4 different programs for all the four technologies given below.

1. Using MPI (Message Passing Interface) for distributed memory systems.


2. Using pThreads (Posix Threads) for Shared Memory systems.
3. Using OpenMP for Shared Memory systems.
4. Using CUDA for GPU based systems.

The program should accept two arguments on command line. The first argument is matrix size and
second argument is number of processes (for MPI) or number of threads (for pThreads / Open MP) or
number of blocks (for CUDA). Program must generate square matrix elements at random and in
parallel. Use suitable parallel random library to complete the task. You need to display top-left 5x5
matrix as result on console for larger matrix size.

Task 2

Write a parallel computer program to calculate the value of PI. Use the formulas discussed in class and
are available on lecture slides. Don’t use the Monte Carlo method. You need to use the mathematical
series discussed in class and sum the individual terms to calculate the value of PI. You need to write 4
different programs for all the four technologies given below.

1. Using MPI (Message Passing Interface) for distributed memory systems.


2. Using pThreads (Posix Threads) for Shared Memory systems.
3. Using OpenMP for Shared Memory systems.
4. Using CUDA for GPU based systems.

The program should accept two arguments on command line. The first argument is number of terms
in series to add and second argument is number of processes (for MPI) or number of threads (for
pThreads / Open MP) or number of blocks (for CUDA). Finally Display the calculated value of PI on
console.

Deliverables

Submit on canvas, see the rubrics there for more details grading of each part.

Zero tolerance policy for plagiarism. Please come with your own code no matter how bad is it.

You might also like