Lab 3: Circuit Satisfiability

This lab session is intended to introduce you to parallel programming with MPI on the NERSC machines. We will be using the machine named Bassi for this course.

NERSC Account Information

At this point, you should have your sent your TA (Tomofumi for the on campus course, and Nissa for online) the information requested to create your account. If you have received an email from NERSC about your account but you have not signed and faxed the usage policy form, download the form from the NERSC accounts webpage, sign it and fax it to (+1) 510-486-4248. After you have faxed the form, call NERSC at 1-800-66-NERSC menu option 2 to get your username and initial password.

After you have your account information from NERSC, try logging in to bassi.nersc.gov:

ssh bassi.nersc.gov -l <username>

where username is the username assigned to you by NERSC.

Running Jobs on Bassi

Bassi uses a system called LoadLeveler to run jobs in parallel. Jobs can be submitted to LoadLeveler using the llsubmit command. The llsubmit command expects a script name as an argument. The script contains commands and LoadLeveler keywords. A sample script is available here. The important variables declared in the script are:

  1. #@ account_no = m853
    We will be using the same account number for all programs done in this class.
  2. #@ output = myjob.out
    This variable tells LoadLeveler where to write the output of your code.
  3. #@ error = myjob.err
    This variable tells LoadLeveler where to write error messages (if any).
  4. #@ tasks_per_node = 2
    This sets the number of processes to run on each node.
  5. #@ node = 1
    This sets the number of nodes to use. For this excercise, keep this value as 1.
  6. #@ queue
    This must be the last variable in the script.

The last line of the script is the executable to be executed.

Use the llqs command to check the status of your job. Use the -u option to see only jobs that you have submitted:

llqs -u <username>
A more complete description of LoadLeveler is available at the NERSC website.

Lab assignment

A short description of the circuit satisfiability problem can be found in the lab presentation.

The C code for the lab is here. To run the code:

  1. Login to bassi
    ssh -l <username> bassi.nersc.gov
  2. Copy the given code to your account on bassi.
  3. Compile the code:
    mpcc -o <nameofexecutable> <filename.c>
  4. Use this sample script to run your program:
    llsubmit myjob
  5. Check the results in myjob.out, and the errors (if any) in myjob.err.
  6. Try changing the number of tasks per node. Do not increase the number of nodes at this time. You may deplete your account.