Department of Computer Science University of San Francisco


Computer Science 220-01
Introduction to Parallel Computing
Fall 2017

MWF 2:15-3:20, LS 307

Announcement: The final exam is Mon, Dec 11, 3-5p in LS 307.

Announcement: My last office hour is Wed, Dec 6. My office hours during finals are Thu, Dec 7, 4-5p, and Mon, Dec 11, 1:30-2:30p.

Announcement: The date for the second midterm that's in the syllabus is incorrect. The correct date is Friday, November 17.

Professor: Peter Pacheco
Office: Harney 540
Phone: 422-6630
Email: domain: cs.usfca.edu, user: peter
Office Hours: MW 4:45-5:45, F 12-1, and by appointment

TA: Mitch McPartland
Email: domain: dons.usfca.edu, user: mbmcpartland
Office Hours: T 1:15-2:15

Class mailing list: There is a class mailing list. You can post to the list by sending email to user: cs220-01 in domain: cs.usfca.edu. Note that this will only work for mail sent from your usfca.edu account.

Course Syllabus (Here's a PDF Version.)


Programming Assignments

  1. Programming Assignment 1, due at 6pm on Wed, Sep 13. Here's a program for generating input data, and here's a program that finds the exact solution when the input data has a specified form.

    Here's a solution, and here is the input data we used when we were grading your program.

  2. Programming Assignment 2, due at 6pm on Wed, Oct 4.

    Here's a solution, and here is the input data we used when we were grading your program.

  3. Programming Assignment 3. Note that the due date has been changed to Monday, Oct 30.

    Here's a link to a serial implementation of the Floyd-Warshall algorithm. Here's a link to a program that can be used to generate input to the Floyd's algorithm program. Here's a link to a function that can be used to print a row of a matrix as a string.

    Here's a solution. Here are the data used to test the programs.

  4. Programming Assignment 4. Note that the due date has been changed to Wednesday, Nov 15.

    Here's a link to a serial implementation of Dijkstra's algorithm. Here's a link to a program that can be used to generate input to the Dijkstra's algorithm program. Here's a link to MPI code that can be used for matrix I/O.

    Here's a solution. Here are the input matrices we used to test your program: mat6 and mat16. Here is sample output.

  5. Programming Assignment 5, due on Monday, Dec 4.

    Here's a link to a serial implementation of the Game of Life. Here's a solution, and here's the data that was used to test your program.


Homework Assignments

  1. Assignment 1, due at 6pm on Wed, Aug 30.

    Here are solutions: simpson.py and Simpson.java. Here's the data we used to test your program.

  2. Assignment 2, due at 6pm on Fri, Sep 8. (Note that the due date is different from the syllabus.) Note that the use of the math library function fabs in the pseudocode isn't necessary since a is always less than b.

    Here's a solution: bisect.c. Here's the data we used to test your program.

  3. Assignment 3, due at 6pm on Fri, Sep 15.

    Here's a solution, and Here's the data we used to test your program.

  4. Assignment 4, due at 6pm on Wed, Sep 20. You should use the search_word.c program from class as your starting point.

    Here's a solution. Here's test I/O. Here's the first input file, and here's the second input file.

  5. Assignment 5, due at 6pm on Wed, Sep 27. This linked list program has a serious bug in the Create_node function. Explain what the problem is, and then fix the program. Note that it is not enough to simply fix the problem. You must also explain what the problem is. Include your explanation in the program's header documentation.

    Here's a solution.

  6. Assignment 6, due at 6 pm on Wed, Oct 11.

    Here's a solution.

  7. Assignment 7, due at 6 pm on Mon, Oct 23. Note the change in due date.

    Here's a solution.

  8. Assignment 8, due at 6 pm on Fri, Oct 27.

    Here's a solution.

  9. Assignment 9, due at 6 pm on Fri, Nov 3. (Note the change in due date.)

    Here's a solution, and here's the test input and output

  10. Assignment 10, due at 6 pm on Fri, Nov 10. (Note the change in due date.)

    Here's a solution.

  11. Assignment 11. Due Wed, 11/22 at 6pm. Modify this pthreads matrix-vector multiplication program so that it uses a cyclic distribution of the rows of A and the entries in y. How does the performance of the cyclic distribution compare to the performance of the block distribution? Run both programs with 1, 2, and 4 threads. Include in your documentation the run-times of the two programs when the input matrix has order 8,000,000 x 8, 8000 x 8000, and 8 x 8,000,000. Here's a solution.

  12. Assignment 12. Due Fri, 12/1 at 6pm. Note the change in due date. Here's a solution.


Other Information

  1. A very brief introduction to GDB, the GNU debugger.
  2. A brief introduction to using the Penguin cluster.
  3. A list of possible topics for the first midterm
  4. Run-times of the MPI implementation of the trapezoidal rule
  5. Keys to the first and second versions of the first midterm.
  6. A list of possible topics for the second midterm
  7. Keys to the first and second versions of the second midterm.
  8. Run-times of the Pthreads matrix-vector multiplication code.
  9. Run-times of three multithreaded implementations of a linked list.
  10. A list of topics covered since the second midterm


Code Examples

USF CS Department home page
USF home page



Peter Pacheco 2017-12-19