Computer Science 338
Parallel Processing

Williams College
Spring 2006


Tutorial Assignment 1: Introduction to Parallel Programming and the Williams CS Clusters
Due: Tuesday, February 7, 2006 at 9:00 AM

As with all tutorial assignments, this document tells you what you will need to read, write, code, and otherwise prepare for the following week's tutorial meeting. It includes some work (in the "Lab Tasks" section) that should be submitted by the deadline in the header. Readings and other preparation for your tutorial meeting must be done before the actual meeting.

Readings

Be prepared to discuss the readings from the text and the notes on this handout during your tutorial meeting on February 7 and 8. In particular, we will discuss some of the questions in this section during the meetings.

Read Quinn Chapter 1.

Why Parallel Computing?

Let's consider a few "real world" examples:

In each of these cases, we have taken what we might normally think of as a sequential process, and taken advantage of the availability of concurrent processing to make use of multiple workers (processing units).

Parallelism adds complexity (as we will see in great detail), so why bother?

Some Basics

Sequential Program: sequence of actions that produce a result (statements + variables), called a process, task, or thread (of control). The state of the program is determined by the code, data, and a single program counter.

Concurrent Program: two or more processes that work together. Big difference: multiple program counters.

To cooperate, the processes need communication and synchronization, which can be achieved through shared variables, or message passing.

Hardware to run concurrent processes:

Computers may be classified as:

Some examples:

See http://www.top500.org/.

How to Achieve Parallelism

Lab Tasks

There are several files to turn in for this assignment. They should all be included in a file named tut01.tar that will extract into a directory tut01 that contains files as specified below. You will submit tut01.tar using the turnin utility. Please use the filenames specified and be sure to include your name in each file. Please ask if you have any questions about creating the tar file or using the turnin utility.

Get started on these as soon as you can. You will need to ask questions. You should feel free to ask for help from and offer help to your classmates on all parts of this week's assignment. However, everyone should submit their own work.

  1. Send me mail at terescoj@cs.williams.edu with a brief (a couple sentences) description of your level of experience with the Unix operating system and its variants. Also include list programming languages you have used and your proficiency in each, any experience you've had with parallel programming, and anything else you'd like me to know about your background.
  2. Log into and familiarize yourself with your CSLab Unix account.
    1. First, make sure you can log into the FreeBSD systems in the lab (see the list of names under "Resources" on the Williams CS web pages if you wish to do this remotely).
    2. Read the links in the FreeBSD section of the "Documentation and FAQ for all platforms" on the Williams CS web page under "Resources." You may ignore the links related to "GJ".
    3. Forward your CSLab electronic mail to an address you read regularly, as I or the queueing systems may sometimes use your @cs.williams.edu address.
    4. Create a directory in your account for work from this class. Change the permissions on the directory so only the only operations permitted are reading and writing by you. Have your tutorial partner verify that he or she cannot access this directory.
    5. Log into the Solaris "Bullpen" cluster (login node: bullpen). This system uses a different password scheme, so you may need to see Mary in TCL 312 to get your account set up to be able to log in. Once you're in, you should find your regular CSLab Unix account files there.
    6. Log into the Linux "Dhanni" cluster (login node: cscluster). This uses the same password scheme as the FreeBSD lab, so you should have no trouble logging in. However, you should be placed in your "cluster home directory" under /dists/cscluster. If you don't, see Mary to get your account set up correctly. Make a directory here for your course work and set appropriate permissions.
  3. Read the web page for the Bullpen cluster here. Don't worry if some of the terminology is not yet familiar.
  4. Copy the C program here that computes the late penalties for this course to your CSLab Unix account. Compile and run it, redirecting your output to a file late.txt. Include this file in the tar file that you submit when you are finished. (1 point)
  5. Copy the file /home/faculty/terescoj/shared/make-example.tar to your directory. It is a "tar file" of a small C program that demonstrates the use of multiple source files and Makefiles. Extract the files (tar xvf make-example.tar) and compile the program with make. Breifly describe in a plain text file tut01.txt how make uses the rules in the Makefile to produce the executable main. (1 point)
  6. The Bullpen web page includes a simple parallel program called mpihello.c.
  7. Read the web page for the "CS Cluster" under "Resources" on the Williams CS web page.
  8. Next, write, compile and run a simple "Hello, World" program hello.c on the Dhanni cluster. To do this, you will need to create and submit a PBS script (compile.pbs) and write an appropriate Makefile to compile the program on a cluster node, then create and submit a PBS script to run the program on one of the nodes of the cluster. Call this script dhanni.pbs and save the output to a file dhanni.out. Submit these two PBS scripts, hello.c, your Makefile, and dhanni.out in a subdirectory dhanni in your tar file.

Remember, your tar file should be named tut01.tar, and when extracted should create a directory tut01 that contains the files you wish to submit. tut01.txt should be in the tut01 directory, and the bullpen-related and dhanni-related files should be in subdirectories bullpen and dhanni, respectively.