Activity 2, Does the Compiler/Language/Programmer Matter.

Short Description:

In a group, perform the following activities related to a matrix multiplication program..

Goals

When you finish this homework, you should have:

Formal Description

For this group activity you will construct a document that explains your explorations into the impact of different features on a matrix multiplication program.

Please start a word document and record the following, one per group

  1. Record the names of all members of the group.
    • Only one group member need submit this homework, but at least one must.
    • Record if you employed any outside sources to solve this problem, including all AI use.
  2. Set up your environment for the experiment
    • Log into prog1.cs.pennwest.edu and download the following files:
    • The makefile is somewhat complex and will build four different versions of the c++ program
      • matrixNoOptV - a non-optimized vector based version of the program.
      • matrixNoOptD - a non-optimized dynamic memory based version of the program.
      • matrixOptV - an optimized vector based version of the program.
      • matrixOptD - an optimized dynamic memory based version of the program.
    • Type make to compile these, do not run them yet.
    • Note any problems you have at this stage in your document.
  3. Take a look at MatrixT.h.
    • In your document describe the difference between MatrixDT and MatrixVT. Focus on the member data.
  4. Take a look at MatrixT.cpp.
    • Convince yourself that the matrix-matrix multiply code is
      1. Correct
      2. The same for both classes
    • Describe the performance (Big-O) of this operator.
    • BEFORE you run anything, provide an prediction if there will be a difference in the performance of these two classes. Record this in your document.
  5. Run matrixNoOptV and matrixNoOptD
    • Record your results, and comment.
  6. Provide a prediction of how effective the optimizer might be
  7. Run matrixOptV and matrixOptD
    • Record your results, and comment.
  8. Run java MatrixBenchmark.java
    • Record your results
    • Interpret your results.
  9. run perf stat -e instructions,cycles progname on each program.
    • Set up a spreadsheet, record your results.
    • Compute CPI for each.
    • Compute IPS (instructions/second)
    • I am not sure I trust the results from this, but include the table and record your thoughts.
  10. Perform an experiment where you only compute the time for the matrix matrix multiplication, not the setup.
    • Record, interpret and discuss your results.
  11. Summarize your discoveries about the impact of library/language/compiler choice on program performance.

Note:

I designed this experiment, then asked ChatGPT for refinements.

I used Gemini for a search engine.

Required Files

A single word document containing your answers.

Submission

Submit the assignment to the D2L folder Activity 2 by the due date.