Prism 6.0 User's Guide

Executing a Program in Scalar Prism

To execute a program, you must first load it, as described in " Loading a Program". Once you start the program running, you can step through it, and interrupt and continue execution.

See " Loading a Program" for information on executing a program in MP Prism.

Running a Program

To run a program:

If you have command-line arguments, choose the Run (args) selection from the Execute menu. A dialog box is displayed, in which you can specify any command-line arguments for the program; see Figure 3-2. If you have more arguments than fit in the input box, they scroll to the left. Click on the Run button to start execution.

Figure 3-2 Run (args) Dialog Box

Graphic

When the program starts executing, the status region displays the message running.

You can continue to interact with Prism while a program is running, but many features will be unavailable. Unavailable selections are grayed out in menus. If you issue a command that cannot be executed while the program is running, it is queued until the program stops.

Program I/O

Prism by default creates a new window for a program's I/O. This window persists across multiple executions and program loads, giving you a complete history of your program's input and output. If you prefer, you can display I/O in the Xterm from which you invoked Prism; see " Resources".

Stepping Through a Program

You must begin execution by choosing Run or Run (args) (or issuing run from the command line). If execution stops before the program finishes (for example, because you have set a breakpoint), you can then step through the program, as described in this section. To step through the entire program, set a breakpoint at the first executable line, and then run to it. (See " Setting Breakpoints" for information on setting breakpoints.)

From the menu bar:

The execution pointer moves to indicate the next line to be executed.

From the command window:

If execution takes considerable time--for example, because Next calls a long-running function--the status changes to running. You can use Prism, but many commands will be unavailable. Unavailable selections are grayed out in menus.

Interrupting and Continuing Execution

To interrupt execution, choose Interrupt from the Execute menu or type Control-c. The status changes to interrupted, and the source window updates to show the point at which execution stopped.

To continue execution after a program has been interrupted, choose Continue from the Execute menu, or issue the cont command from the command line. (Or you can step through the program, as described above.)

Continue and Interrupt are available by default in the tear-off region.

Status Messages

Prism displays the status messages before, during, and after the execution of a program, as listed in Table 3-1.

Table 3-1 Status Messages

Message  

Meaning 

error

Prism has encountered an internal error. 

connected

Prism has connected to other nodes to work on a message-passing program. 

connecting

Prism is connecting to other nodes in order to work on a message-passing program. 

initial

Prism is starting up without a program loaded. 

interrupted

The program has been interrupted. 

loading

Prism is loading a program. 

not started

The program is loaded but not yet started. 

running

The program is running. 

stopped

The program has stopped at a breakpoint or signal. 

terminated

The program has run to completion and the process has gone away.