**Assignment 07: Cache** In this assignment, you'll learn about the effects of cache on program performance. # Learning Goals - Profile simple C functions. - Understand the impact of cache on program performance. # Grading Walk-Throughs This assignment will be graded as "Nailed It" / "Not Yet" by a TA. To pass ("Nailed It") the assignment, you must 1. Complete the assignment and submit your work to gradescope. + You should start this assignment in class on the day shown on the calendar. + *Complete the assignment as early as possible*. 1. Schedule a time to meet with a TA. You can meet with them after the submission deadline. + You must book a time to meet with a TA + Sign-up on the Google Sheet *with at least 36 hours of notice*. + Contact your TA on Slack after signing up. + All partners must meet with the TA. If you cannot all make it at the same time, then each of you needs to schedule a time to meet with the TAs. 1. Walk the TA through your solutions prior to the deadline. + Walk-throughs should take no more than 20 minutes. + You should be well prepared to walk a TA through your answers. + You may not make any significant corrections during the walk-through. You should plan on making corrections afterward and scheduling a new walk-through time. Mistakes are expected---nobody is perfect. + You must be prepared to explain your answers and justify your assumptions. TAs do not need to lead you to the correct answer during a walk-through---this is best left to a mentor session. 1. The TA will then either + mark your assignment as "Nailed It" on gradescope, or + mark your assignment as "Not Yet" and inform you that you have some corrections to make. 1. If corrections are needed, then you will need to complete them and then schedule a new time to meet with the TA. + You will ideally complete any needed revisions by the end of the day the following Monday. If you have concerns about the grading walk-through, you can meet with me after you have first met with a TA. # Overview It is important that you complete some of the gradescope questions prior to running the program. **Please complete the *Prediction* section before you run any code.** You should open gradescope now and see what you need to submit. You will not write any code for this assignment. Instead, you will run some code and reason about its performance. Materials for the assignment are on the course VM in the `/data` directory. ~~~bash cd ~/cs105/assignments tar xvf /data/A07-Cache.tar ~~~ The archive contains a single file, `mat_mul.c`. Take some time to read through the file and understand the code. You'll see that it implements [Matrix Multiplication](http://matrixmultiplication.xyz/) in six different functions. Each of these functions will produce the same result, but you'll discover that the performance can be quite different from one another. The [Wikipedia article on Matrix multiplication](https://en.wikipedia.org/wiki/Matrix_multiplication) is worth a quick read if you are unfamiliar with the concept. You should compile the program with: ~~~bash cd ~/cs105/assignments/A07-Cache gcc -g -O1 mat_mul.c -o mat_mul ~~~ You will need to provide a program argument to run the program. Read through the main function and find references to `argv[1]` to discover the possible values of the program argument. You should now open gradescope and answer the prompts found for this assignment. # Submitting Your Assignment You will submit your code and/or responses on gradescope. **Only one partner should submit.** The submitter will add the other partner through the gradescope interface. Additional details for using gradescope can be found here: - [Submitting an Assignment](https://help.gradescope.com/article/ccbpppziu9-student-submit-work) - [Adding Group Members](https://help.gradescope.com/article/m5qz2xsnjy-student-add-group-members) - [gradescope Student Help Center](https://help.gradescope.com/category/cyk4ij2dwi-student-workflow)