Running ZPL Programs

This document assumes that you've already compiled a ZPL program and built an executable on a sequential machine. Since ZPL is a language designed with portability and parallel execution in mind, binaries built for a sequential target support more functionality than is necessary.

Running on a Sequential Platform

To run a ZPL-created executable built for a sequential platform, simply type the program's name. For example, if you compiled the Jacobi benchmark, and built an executable named jacobi, you can run it by typing:

jacobi

Specifying Configuration Variables

In general, the configuration variables in your ZPL program will be assigned the default values which you defined for them in your source code. However, you can also assign values to configuration variables on the command line. This can be done in two ways:

To specify a configuration variable's value on the command line, use the -s flag followed by the name of the configuration variable, an equals sign ('='), and the desired value. For instance, Jacobi contains two configuration variables n and delta which are declared as follows:

config var n     : integer = 10;
           delta : float   = 0.0001;
      

If you wanted to change n's default value from 10 to 25 and delta's from 0.0001 to 0.00005, you could use the following command line:

jacobi -sn=25 -sdelta=0.00005

No spaces are allowed within these command line options.

In a program which has several configuration variables, specifying them all on the command-line quickly becomes tedious. For this reason, a file may be supplied on the command line which contains assignments to configuration variables. This configuration file should have a single assignment per line in the same as specified by the -s flag. For instance, if we moved the above assignments to a configuration file named jacobi.cfg, it would contain:

n=25
delta=0.00005
      

You would then direct the executable to parse jacobi.cfg by running:

jacobi -fjacobi.cfg

As with the -s option, no spaces should occur in the -f command line option, or within any assignment in the configuration file.

Note that assignments to configuration variables on the command line always override assignments in configuration files. Thus, in the above examples, if the executable was run using:

jacobi -sn=40 -fjacobi.cfg

n would be assigned the value 40 and delta would be assigned 0.00005. This gives you a quick way to override configuration file values.

Command-Line Help

When the executable is run with the -h option, a summary of the available command-line options is printed to the screen. For example:

jacobi -h

In addition, all configuration variables and their default values will be printed to the screen.

Running on a parallel platform

To run a ZPL-created executable, all you need to do is type the program's name followed by a specification of the number of processors you want to use for the run. This processor set size is specified using the -p option, followed by the number of processors. For example, if you compiled the Jacobi benchmark, resulting in an executable named jacobi, you could run it on a single processor by typing:

jacobi -p1

The processor set can be specified with the -g option. For example, to run on 16 processors arranged in a 2 by 8 mesh, you would write:

jacobi -p16 -g2x8