CS 133 Discussion: Week 2


SP2 accounts

Handed out in class were the userids and passwords for your accounts on the SP2. If you missed class, please email me for this information.

About the SP2


Using Parsec/MPC

To login, type:
  
  telnet cluster.oac.ucla.edu
I put a default .cshrc file in each person's directory that initializes the following values. If you change to a different shell (using 'chsh') like bash or ksh, you will have to set these up yourself.

The Parsec compiler will be in the following directory, so add it to your default path:

  /u/data02/ieczmay/parsec/bin
If your default shell is csh or tcsh, you can do this with the following command:
  set path=($path /u/data02/ieczmay/parsec/bin)
In order to run Parsec programs on the SP, you need to set three environmental variables.
  setenv MP_PROCS    4        #or number of processors you wish to use
  setenv MP_HOSTFILE hostfile #hostfile is a list of nodes, see below
  setenv MP_EUILIB   ip
In order to run your program on multiple processors, you need to create a hostfile (a regular text file). You probably should put this in your home directory, and then define MP_HOSTFILE with the absolute path. The contents of the file should be:
  f01n09.sp
  f01n10.sp
  f01n11.sp
  f01n12.sp
  f01n13.sp
  f01n14.sp
  f01n15.sp
  f01n16.sp
These are the names of the SP2's interactive nodes (processors). To use more than 8 processors, you can repeat the names, or you can add alpha, beta, gamma, and delta.

Compilation

To compile your Parsec program to run on one processor, type:
  pcc -o binary_name program_file
To compile your Parsec program for parallel execution, type:
  pcc -sync mpc -o binary_name program_file
To run your program in parallel, type:
  binary_name -procs 4
(if procs is not specified, MP_PROCS processors are used)

Common Problems in the past

  1. Parsec programs must have a .pc extension. Otherwise, they are just passed directly to the C compiler.
  2. You may want to put "." at the head of your path to ensure that you're running your own programs. There are some system commands, like test that won't produce the output you expect.


Simple Parsec Example

If you use this program to test the compiler on the SP2, you probably want to add some printf statements to make sure that it's working.