A P P E N D I X  C

The Scalar Mode of the Prism Environment

When viewing serial programs, the Prism environment behaves differently than it does when viewing multiprocess programs. In this situation, the Prism environment operates in scalar mode.

The scalar mode of the Prism environment does not support psets, since pset-related features require multiple processes or threads. This appendix provides descriptions of other differences between the MP mode and the scalar mode of the Prism environment. This discussion is organized into the following sections:


Starting the Prism Environment


procedure icon  To Launch the Prism Environment in Scalar Mode

single-step bulletType:

% prism program

This starts the Prism environment for a nonthreaded single-process program, using the scalar mode of the Prism environment.

Do not launch the Prism environment as an argument to the bsub command (LSF) or the mprun command (CRE). It creates redundant instances of the Prism environment. For information on bsub, see the LSF Batch User's Guide. For information about mprun, see the Sun MPI Programming and Reference Guide.

You can specify other options on the prism command line. For example, you can specify the -C option to bring up the Prism environment with the commands-only interface, or the -CX option (from an Xterminal) to bring it up with the commands-only interface, but be able to send the output of certain commands to X windows.


Stepping and Continuing Through a Serial Program

When operating on a serial program, the scalar mode of the Prism environment (like most other debuggers) waits for a step, next, or cont command to finish executing before letting you issue most other commands.

Execution Pointer

In the scalar mode of the Prism environment, the > symbol in the line-number region points to the next line to be executed; see Using the Line-Number Region. In a message-passing program, there can be multiple execution points within the program. The MP mode of the Prism environment marks all the execution points for the processes in the current set by a > in the line-number region (or a * if the current source position is the same as the current execution point). Shift-click on this symbol to display a pop-up window that shows the process(es) for which the symbol is the execution pointer.

Attaching to a Running Serial Process

As described in Attaching to a Running Serial Program, you can load a running process into the Prism environment by specifying the name of the executable program and the process ID of the corresponding running process on the command line of the Prism environment.

You can also attach to a running process from within the Prism environment.



Note - To attach to the running process of a serial program, the process must be running on the same node as the Prism environment.




procedure icon  To Attach To a Running Process From Within the Prism Environment

1. Find out the process's ID by issuing the Solaris command ps.

2. Load the executable program for the process into the Prism environment.

3. Issue the attach command on the command line of the Prism environment, using the process's ID as the argument.

With either method of attaching to the process, the process is interrupted; a message is displayed in the command window giving its current location, and its status is stopped. You can then work with the program in the Prism environment as you normally would. The only difference in behavior is that it does not display its I/O in a special X-terminal window; see Program I/O.

To detach from a running process, issue the command detach from the command line of the Prism environment. The process continues to run in the background from the point at which it was stopped in the Prism environment; it is no longer under the control of the Prism environment. Note that you can detach any process in the Prism environment via the detach command, not just processes that you have explicitly attached.



Note - Use the kill command to terminate the process or job (rather than releasing it to run in the background) currently running within the Prism environment.




Viewing the Call Stack

In the scalar mode of the Prism environment, choosing Where from the Debug menu displays the call stack for the program; see To Display the Call Stack. Note that a multiprocess or multithreaded program can have multiple call stacks, one for each process or thread. To show the relationships among these call stacks, the MP mode of the Prism environment provides a Where graph. For information about the Where graph in the MP mode of the Prism environment, see Displaying the Where Graph.