Working Summary: In this assignment, you will do:

  • matrix multiplication parallelly as well as sequentially.
  • and, you will compare the execution times of both the versions (i.e., sequential vs. parallel).

Specifications:

There will be two different aspects of this programming assignment:

(a) You will develop and submit a program, named matrixmul, which will accept n number of processes and will read two matrices from an input file, named input.txt. Here, n is defined as: 1 <= n <= N, where N is the number of elements in the final (resultant) matrix.

If n = 1, then you have one process allocated and you need to execute matrix multiplication sequentially. And, if n > 1 then the computation must be in parallel, utilizing all processes allocated your program will be judged based on how well you have distributed the load using your own algorithm. You need to describe your load balancing algorithm in the report file named, myreport (preferably a .doc file). Well distributed /well-balanced tasks will be regarded as a better algorithm.

You need to print (on screen) the internal details while the program is computing the multiplications such as: how many processes allocated, which processes will do what job or how many multiplication (i.e., the job distribution), execution steps, intermediate results done by each process (print process_id versus intermediate_result). Finally, the resultant matrix must be printed. Also, provide an output file generated by the redirect (>) output into Output.txt for the sample input file (see attachment: input0.txt).

Setting the upper limit (Optional): The maximum size of a row or a column in a matrix can be 100.

(b) Here, you run a different version of the matrix multiplication parallelly as well as sequentially however, here you will compare their performance: parallel versus sequential execution. The name of the program will be matmulperform. You will compute the randomly generated n by n (square) matrix of real numbers, numbers can be both negative and positive. You need to measure the execution time by recording the start and end time, where n = 2 to 50. You must take average execution time from (minimum) 100 iterations for each individual case for n = 2 to 50. You need to execute the task for 1 process for sequential execution as well as for n processes for parallel execution. Save your computed results in comma separated vector (CSV) file(s) named Seq_exe.csv and Paral_exe.csv, which will contain the average execution time for sequential as well as parallel execution respectively for n = 2 to 50. You can open such ~.csv file to be processed by Excel to generate graphs. Anyway, you will generate a graph: Sequential versus Parallel execution, where x-axis indicates n = 2 to 50 and the y-axis indicates the corresponding average processing time. Place the graph in myreport (i.e., the report file, which is generated in section #(a)), explain the graph if there is an anomaly, also explain that. Further, describe your algorithm in pseudocode and place it in myreport.

In the report, you must describe the machine you are using in terms of the available number of cores/processors or, clock-rate, etc.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.