[SOLVED] CMSC257-Assignment 3

24.99 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

Rate this product

You are to write some variations of matrix multiplications which will examine the effects of cache and memory utilization..  1) Normal Multiplication vs Multiplying by the Transpose 

The first test will be comparison of matrix multiplication where both input matrices are indexed as [row][column] versus matrix multiplication where the second matrix is transposed (meaning [column][row] accesses). I want a report as part of the assignment and a comparison of these 2 tests will be a part of the report.

2)     Normal Multiplication vs Blocked Multiplication

For this comparison you need to write a version of the code which uses 6 nested loops rather than 3. The 3 outer loops will increment through blocks and the 3 inner loops will perform the multiplication of 1 block vs another adding the results to the proper location in the output matrix. Your analysis should try to determine a good block size to speed up the computation. This analysis also needs to be part of your report.

3)     Normal Multiplication vs Forked Block Multiplication

You are to write, test and report on a program to perform blocked matrix multiplication using “fork” to spawn subprocesses.

The basic goal is to allow multiple processes to work on blocks on the output matrix simultaneously. You will probably find the files shmtest.c, shmtest2.c and shmtest3.c to be useful.

You will use the fork system call to create child processes. Note that fork is not a normal Windows system call. Don’t bother trying this under Windows.

You will definitely need to use shm_open and mmap to handle the output matrix. Using a single semaphore for the entire output matrix is not optimal in terms of speed; ideally you want to assign a semaphore for each element of the matrix.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.