CSE logo University of Washington Computer Science & Engineering
 CSEP524: Parallel Computation - Winter 2005
  CSE Home     Other Quarters    ZPL  About Us    Search    Contact Info 

 Programming in ZPL
 Assignment 1CSE only
 Assignment 2CSE only
 Assignment 3CSE only
 DescriptionCSE only
Email list

Programming in ZPL

We're using the parallel programming language, ZPL, for some programming assignments. The ZPL home page has links to updated documentation or buy the book from MIT Press.

Setting up ZPL for newport.cs.washington.edu

On this machine is an installation of ZPL and MPI-LAM, which is the communcation package that the compiled ZPL binaries will be using.

In your .cshrc, .profile or whatever login script your shell uses, set the following variables using the appropriate idiom for your shell (setenv for csh derivatives, export for sh derivatives):
  • ZPLHOME = /home/douglas/zpl
  • ZPLMPITYPE = lam
    This determines the type of MPI used.
  • ZPLTARGET = x86-linux
  • LAMHOME = /home/douglas/lam
  • Add to your PATH variable: ${ZPLHOME}/bin and ${LAMHOME}/bin
You may have to wrangle with Emacs automatic file compression.

The computation cluster nodes are named ns100 to ns131. However ns110 and ns125 are broken and therefore unavailable. The ns nodes can only be logged into from newport.cs.washington.edu (see below) but newport itself is accessible from outside CSE. We provide two sets of hosts in the following configuration files:
  • $LAMHOME/etc/hostfile-testing (10 nodes, ns100 to ns109)
  • $LAMHOME/etc/hostfile-performance (20 nodes, ns111 to ns124 and ns126 to ns131)
The former set of hosts should be used for small scale testing of your parallel programs, while the latter should be used to generate performance numbers. If load balance becomes an issue, we will supply additional configuration files to spread the load.

Running parallel programs

  1. ssh to newport.cs.washington.edu
  2. Compile your ZPL programs on this machine, newport. You can compile your programs elsewhere while doing (sequential) testing on them. Use secure file transfer to move the source files to newport.
  3. ssh to the first node in the host configuration file you're using. This is currently ns100 for hostfile-testing and ns111 for hostfile-performance. Your home directories are shared between newport and the ns nodes and they're all running the same version of Linux. Thus there is no need to recompile programs on each ns node.
  4. Type lamboot path to host file. There will be a short pause but should be under a minute depending on server load.
  5. Run your ZPL programs.
  6. Type lamhalt before logging out.

Setting up ZPL for attu.cs.washington.edu

There is an installation of ZPL set up for the class. It is accessible from the instructional Linux server (attu.cs.washington.edu). You must set some environment variables to use ZPL. In your .cshrc, .profile or whatever login script your shell uses, set the following variables using the appropriate idiom for your shell (setenv for csh derivatives, export for sh derivatives):
  • ZPLHOME = /projects/.instr/zpl/alpha/zpl
    This determines what type of communication model is used. The options for this installation are seq, pvm and mpi-lam, but for attu just use seq
  • ZPLTARGET = x86-linux
  • Add to your PATH variable: ${ZPLHOME}/bin

Wrangling with Emacs automatic file compression

ZPL uses the file suffix .z to denote ZPL source files. If you are using Emacs as your text editor, the default behavior might be to automatically (de)compress files with certain extensions (such as .gz and .z). To have automatic file compression off by default (if not already off), edit your .emacs configuration file to include these lines:

; Stop the default.el file from being loaded after .emacs
(setq inhibit-default-init t)

; Always end a file with a newline - enable if you want
;(setq require-final-newline 'query)

(when window-system
  ;; enable wheelmouse support by default

; Disable automatic file decompression and compression
(setq auto-compression-mode nil)

To manually toggle automatic compression mode, there is an auto-compression mode item under the Options menu or you can invoke this Emacs command:

M-x auto-compression-mode

Rolling your own

Download ZPL from the distribution page. Go for the cutting edge release.

To build the compiler, follow these steps:

  • Unpack the .tar.gz file using gunzip and using tar -xf on the resulting .tar file.
  • Ensure your environment variables are configured as above except that ZPLHOME should be the newly created zpl directory
  • Change to the new zpl directory and type make all.
  • If the build fails, check that the environment variables were set correctly.
Check that the install worked by executing these commands:

bin/zc examples/jacobi.z

The expected output is:

Using 1 processors
Using a 1 x 1 processor grid
Jacobi completed in 44 iterations.
Your zpl program has completed running.

OpenBSD 3.5 tips

Thanks to Ian King (isking AT u DOT washington DOT edu) we have some caveats:
  • Do not perform the install as root, there are some compile-time dependencies that fail on permissions.
  • Use the ZPLTARGET=x86-linux option, the x86-freebsd option appears to be unsupported: some subdirectories required for building are missing.
  • The header file include/$ZPLCOMMLAYER/x86-linux/md_zinc.h #undefs stdin, stdout and stderr, causing the build to fail. Commenting out the #undefs appears to allow compilation to succeed.
  • Only the ZPLCOMMLAYER=seq option has had a successful build. MPI/LAM seems to be unsupported under Linux with the current release. MPICH may work but requires modifying the install script (Ian hasn't completed investigating this).

Windows XP tips (may apply to older versions of Windows)

Thanks to Lars Bergstrom (lars AT lars DOT com) Windows machines can join the party:
  • Expand the .tar.gz file using WinZip or some other program.
  • Install Cygwin. You will need the development node, though Emacs (see the note about auto-compression mode above) from the editor node might be handy. The development tools are quite large, so this installation may take some time.
  • Create the file c:\cygwin\home\username\.bash_profile (replace username with your Windows login name) to set up some environment.variables:



    Replace c/data/code/parallel/zpl with the full path to where you expanded the .tar.gz file.
  • Open a Cygwin shell. Again using the full path to the expanded .tar.gz file, type the following commands:

    cd /cygdrive/c/data/code/parallel/zpl
    mkdir bin
    mkdir -p lib/seq/x86-cygwin
    make all

    You might need the mkdir commands as workarounds.

CSE logo Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA  98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to douglas]