Using GPH in Practice

This part of the document discusses pragmatic issues of using GPH. It is something like a GPH User's Guide. Here we will talk you through the basics of compiling GPH, running, and profiling GPH programs.

Installation

The most recent version of GUM is available from our FTP server. The file README.GUM discusses details about contents in that directory and about installation. The naming convention of the bundles is "GUM-version-date-id-hwos.type"

Compiling for parallel execution

Use the flag -parallel for compilation. In the simplest case do something like

  gum-4.06 -parallel -fvia-C -fglasgow-exts -o foo_mp foo.hs

If you use strategies in your program (import Strategies) use -syslib concurrent. Don't worry about the `initialization discards `const'' warnings. A set of example programs including makefiles is shipped separately as gum-4.06-test-prgs.tgz.

Running a GPH program

Before executing a GPH program, you must use PVM to configure your parallel virtual machine. A Dummies Guide to GPH is part of the GHC User's Guide.

After that execute your program using the following RTS flags (c stands for a character, n for an integer value):

-qPc0, g, emptyGenerate an execution profile that can be processed with the visualisation tools.
-qpn1,..,256The number of processors to use (there is a hardwired constant in the RTS for the max number of PEs possible).
-qhn0,..Packing scheme (0 means full sub-graph packing; n means pack at most n-1 non-root thunks into a packet). See [IFL00-PAPER] for a discsussion of these notions.
-qgn>0,1Globalisation scheme (0 means full globalisation; 1 means normal-form only globalisation). See [IFL00-PAPER] for a discsussion of these notions.
-qen> Spark pool size.
-qtn> Thread pool size.

There are many more options in the RTS. They really should be documented.

Profiling your GPH programs

Once you have generated a profile from a parallel execution of your program, you can use the profiling tools to make some sense of its dynamic behaviour. The relevant tools are:

The visualisation tools are discussed in more detail in the GranSim Users's Guide.