C H A P T E R  1

Prism Environment

The Prism programming environment is an integrated graphical environment within which you can develop, execute, and debug programs. It provides an easy-to-use, flexible, and comprehensive set of tools for performing all aspects of serial and message-passing programming. Prism software operates on terminals or workstations running the Solaris operating environment under either the OpenWindowstrademark environment or the Sun Common Desktop Environment (CDE). The Prism environment also provides a commands-only option, which enables you to operate on any terminal, but without the graphical interface.

This chapter is organized as follows:


Overview

When you want to debug or analyze a program that already exists, you can simply load the executable code into the Prism environment and immediately begin using the data visualization, performance analysis, and debugging tools built into the Prism environment. If the program does not yet exist, you can start the Prism environment, call up an editor and UNIX shell from within the Prism environment, and then perform all the usual tasks associated with developing a new program. That is, while in the Prism environment, you can:

Once you have produced executable code, you can begin the program analysis and debugging tasks, while staying in the same environment in which you developed the program.

The Prism Environment's Operating Modes

The Prism environment has two modes of operation, MP and scalar. Their respective roles can be summarized as follows:

The Prism environment is intended primarily for use in developing and debugging message-passing programs and multithreaded serial programs. Consequently, the chief focus of this manual is on using the Prism environment in MP mode.

MP Mode Summary

The MP mode provides a superset of Prism features that make it possible to access and control separate processes and threads. Since this capability is at the heart of debugging message-passing and multithreaded code, the Prism environment must be operating in MP mode when debugging programs of these kinds.

When operating MP mode:

Prism's MP mode supports the grouping of program processes into logical sets, called psets (for process sets). When defining a pset, you can specify one or more attributes that distinguish certain MP processes from all other MP processes in the program. The resulting pset can then be used to restrict the effects of Prism operations to those processes within the defined pset. For example, a pset could be defined as all processes in which the value of a variable exceeds some threshold.

The Prism environment also provides several predefined process sets (psets)--that is, psets that have characteristics that are likely to be of interest in most MP mode debugging sessions. For example, three of the predefined psets are:


Look and Feel of the Prism Programming Environment

FIGURE 1-1 shows the main window of the Prism environment with a program loaded. It is within this window that you debug and analyze your program. You can operate with a mouse, use keyboard equivalents of mouse actions, or issue keyboard commands.

 FIGURE 1-1 The Prism Programming Environment's Main Window

Screen shot of the Prism Graphic User Interface showing menu bar, status region, line-number region, source window, and command window.

Clicking on items in the menu bar displays pull-down menus that provide access to most of the Prism environment's functionality.

You can add frequently used menu items and commands to the tear-off region, below the menu bar, to make them more accessible.

The status region displays the program's name and messages about the program's status.

The source window displays the source code for the executable program. You can scroll through this source code and display any of the source files used to compile the program. When a program stops execution, the source window updates to show the code currently being executed. You can select variables or expressions in the source code and print their values or obtain other information about them.

The line-number region is associated with the source window. You can click to the right of a line number in this region to set a breakpoint at that line.

The command window at the bottom of the main Prism environment window displays messages and output from the Prism environment. You can type commands in the command window rather than use the graphical interface menus.

General aspects of using these areas are discussed in Chapter 2.


Loading and Executing Programs

You can load an executable program into the Prism environment when you start it up, or any time afterward. You can also attach to a program that is already running. Once a program is loaded, you can run the program or step through it. You can interrupt execution at any time.

See Loading and Executing a Program for a discussion of these topics.


Debugging

The Prism environment enables you to perform standard debugging operations such as setting breakpoints and tracepoints and displaying and moving through the call stack. Chapter 4 discusses these topics.


Visualizing Data

It is often important to obtain a visual representation of the data elements that make up an array or parallel variable. In the Prism environment, you can create visualizers that provide standard representations of variables or expressions. For example,

A data navigator lets you manipulate the display window relative to the data being visualized. Options are available that let you update a visualizer or save a snapshot of it.

See Chapter 5 for additional discussion, covering aspects of visualization specific to the MP Prism environment.


Editing and Compiling

You can call up the editor of your choice within the Prism environment to edit source code (or any other text files). If you change your source code and want to recompile, the Prism environment also provides an interface to the UNIX make utility. Editing and compiling are described in more detail in Chapter 6.


Obtaining Online Help and Documentation

The Prism environment features a comprehensive online help system. Help is available for each menu, window, and dialog box in the Prism programming environment.

Online help and documentation are described in more detail in Chapter 7.


Customizing the Prism Programming Environment

You can change many aspects of the way the Prism environment operates. You can create customized command buttons in the tearoff region of the main Prism window, create aliases for commands and variables, and change the Prism environment default settings. These customizations are discussed in Chapter 8.