Important assignments and their solutions for the course: Concurrent and Parallel programming (B.Tech, CSE, MNIT (2015-2019))
Week - 2: Q.2 Write a program for matrix multiplication using pthread_join(). No mutex should be used.
Q.3 Write a C program in which a filename is passed as a command line argument. In case a wrong name or no file name is passed is passed using CLA it should print an error message using perror().
Q.4 Write a C program that continuously print(with a sleep time of 1 second) the process id and the total sleep time. This program should send a SIGINT signal using signal() call, when a particular key is pressed.
Q.5 Write a program using pthread to find out the sum of following series: 1+4+9+16+.......+ n. Here main function should write the final output on screen. Main thread will create the child threads and child threads will find out the sum of series.
Week - 4:
Q. 1 Implement all the four attempt of Dekker’s algorithm to solve critical section problem. Q.2 Implement Dekker’s Algorithm for mutual exclusion. Q.3 Implement fisher’s algorithm for mutual exclusion Q.4 Implement Manna-Pnueli algorithm for Mutual exclusion.
Week - 5:
-
Implement solution of Critical Section problem with Semaphores (two processes).
-
Implement solution of Critical Section problem with Semaphores (N processes).
-
Implement solution of Critical Section problem with Semaphores (k out of N processes).
-
Implement producer-consumer problem with Semaphores (infinite buffer).
-
Implement producer-consumer problem with Semaphores (finite buffer).
-
Implement producer-consumer problem with Semaphores (circular buffer).
-
Implement critical section problem with exchange
exchange (a, b) is integer temp Temp <- a a <- b b <- Temp
Week - 6:
-
Implement Critical Section problem using semaphores with a monitor.
-
Implement the solution of producer-consumer bounded buffer problem with a monitor.
-
Implement the solution of Readers and writers with a monitor.
-
Consider a system consisting of processes P1, P2, ..., Pn, each of which has a unique priority number. Write a monitor that allocates three identical line printers to these processes, using the priority numbers for deciding the order of allocation.
Week - 7:
- Write MPI Program (SPMD) to get started.
- Write MPI Program (MPMD) to get started.
- Write MPI program to find sum of n integers on Parallel Processing Platform. You have to use MPI point-to-point blocking communication library calls.
- Write MPI program to find sum of n integers on Parallel Processing Platform. You have to use MPI point-to-point blocking communication library calls.
- Write MPI program to find sum of n integers on a Parallel Computing System in which processors are connected with ring topology and use MPI point-to-point blocking communication library calls.
- Write MPI program to find sum of n integers on a Parallel Computing System in which processors are connected with tree topology (Associative-fan-in rule for tree can be assumed) and use MPI point-to-point blocking communication library calls.
- Write MPI program to compute the value of PI by numerical integration using MPI point-to-point blocking communication library calls.
- Write MPI program for prefix sum (scan operation) calculation using MPI point-to-point blocking communication library calls.
- Write MPI program to find sum of n integers on a Parallel Computing System in which processors are connected with tree topology (Associative-fan-in rule for tree can be assumed) and use MPI point-to-point non-blocking communication library calls.
- Write MPI program to broadcast message "Hello world" to all the process.
Week - 8:
- Write a OpenMP program to print unique identifier.
- Write a "Hello world" Program Using OpenMP pragmas.
- Illustrate a program for loop recurrence using OpenMP PARALLEL FOR directive.
- Write an OpenMP program to find Sum of Natural Numbers using OpenMP Parallel FOR directive.
- Write an OpenMP program to find Sum of Natural Numbers using OpenMP REDUCTION clause.
- Write an OpenMP program for Loop-carried dependence using OpenMP parallel Directive.