Prism 6.0

  1. Prism 6.0h
  2. Prism 6.07
  3. Prism 6.0 Software
  4. Graphpad Prism 6.01
  5. Prism 6.0 Pro
  6. Graphpad Prism 6.01 Serial Number
  7. Prism 6.0 Free

The green arrow in the diagram on the right indicates eggs in a worm, and the red arrow indicates eggs that are being laid by the worm. The data are shown as the mean ± SD as evaluated by Student's t test using Prism 6.0. Article Snippet: The growth curve was created using GraphPad Prism 6.0 software (GraphPad Software Inc., California. I want to migrate a project written with Prism 4 into Prism 6. In Prism 4 the CompositePresentationEvent type is under Microsoft.Practices.Composite.Presentation.Events namespace. But when I pulled Prism 6 from nugget and removed old Prism 4 references, I could not see this event type anywhere in Prism 6 namespaces. Prism makes it easy to create the graphs you want. Choose the type of graph, and customize any part—how the data is arranged, the style of your data points, labels, fonts, colors, and much more. The customization options are endless. Start a Free Trial.

This chapter describes general aspects of using the Prism environment. Succeeding chapters describe how to perform specific functions within Prism.

The best way to learn how to use Prism is to try it out for yourself as you read this chapter. See the following sections:

This section describes the programming conditions under which you can make use of Prism's features.

Supported Languages and Compilers

You can work on Sun Fortran, C, and C++ programs within Prism. However, support for debugging Fortran 90 and C++ programs is limited. For information on the specifics of Prism support for Fortran 90 and C++, see 'C++ Support in Prism 6.0'.

Prism supports these compilers in Sun(TM) HPC ClusterTools 3.0:

  • SPARCompiler(TM) Fortran 77 4.2, and 5.0

  • SPARCompiler Fortran 90 4.2, and 5.0

  • SPARCompiler C 4.0, 4.2, and 5.0

  • SPARCompiler C++ 4.2, and 5.0

Compiling and Linking Your Program

To use Prism's debugging features, compile and link each program module with the -g compiler option to produce the necessary debugging information.

Note -

The -g option overrides certain optimizations. For example, in C++ the -g option turns on debugging and turns off inlining of functions. The -g0 (zero) option turns on debugging and does not affect inlining of functions. You cannot debug inline functions with this option. For another example, in Fortran 77 the -g conflicts with the -auto-inlining and -depend options.

Combining Compiler Options

If you compile programs with both the debugging option -g and an optimization option such as -xO[1,2,3,4,5], the combined options change the behavior of several Prism commands. For information about the effects of combining the debug option with optimization options, see 'Combining Debug and Optimization Options'.

Setting Up Your Environment

To enter the Prism programming environment, you must be logged in to a terminal or workstation running OpenWindows or the Common Desktop Environment (CDE).

DISPLAY Variable

Make sure that your DISPLAY environment variable is set for the terminal or workstation from which you are running OpenWindows or CDE. For example, if your workstation is named valhalla, you can issue this command (if you are running the C shell):

PATH Variable

Sun HPC ClusterTools 3.0 requires that two directories be set in your PATH variable. The default locations of the two directories are:

PRISM_BROWSER_SCRIPT Variable

Prism uses the default HTML browser on your system to display Prism online help. If launching a browser at a prompt in your local environment calls up a script rather than invoking the browser directly, you must set the environment variable PRISM_BROWSER_SCRIPT to yes before starting Prism:

If you do not set this variable in this situation, once the Prism help system responds the browser may be brought up but may halt without displaying any help entries.

For information about the configuration of Sun HPC ClusterTools 3.0 at your location, see your Sun HPC ClusterTools 3.0 system administrator.

To enter Prism, log into a system running Sun HPC ClusterTools 3.0 and issue the prism command just as you would any program. For example, issuing the prism command at your Solaris prompt,

starts Prism on your login node in a Sun HPC System. Prism executes from /opt/SUNWhpc/bin.

Prism performs the functions of the bsub command without requiring you to specify bsub when launching Prism. In other words, it is unnecessary (and redundant) to launch Prism as an argument to bsub, since Prism invokes bsub internally. Launching Prism as an argument to bsub causes too many instances of Prism to be launched. For complete information on bsub, see the LSF Batch User's Guide.

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

Unless you specify additional arguments, such as -C for the non-graphical commands-only mode of Prism, when Prism starts you see the main window shown in Figure 1-1 in Chapter 1, The Prism Environment.

Prism Options

This section describes several aspects of using Prism's commands from the Solaris command line.

Loading Programs

If you specify the name of an executable (single process) program on the command line, that program is automatically loaded into Prism. For example,

When you execute the program, it will execute on the node on which Prism is running.

If you are loading a message-passing program, you must specify a number of processes to run, even when the message-passing program runs on a single process. Use the -n option to specify the number of processes. For example,

See ' Methods of Specifying MP Prism Options', for more information about launching MP Prism. See ' Loading a Program', for more information about loading a program.

Attaching to a Process

You can also attach to a process or message-passing job that is currently running. However, Prism must run on the same system on which the process is running (or the same cluster on which the job is running).

See ' Attaching to a Running Process' for more information about attaching to and detaching from a running serial process or a message-passing job.

Working With a Core File

You can associate a core file with a program. Add the name of the core file after the name of the executable program.

See ' Associating a Core File With a Loaded Program' for more information about core files.

Specifying Commands-Only Prism

Use the -C option to bring up Prism in commands-only mode. This allows you to run Prism on a terminal with no graphics capability.

Use the -CX option to bring up a commands-only Prism that lets you redirect the output of certain Prism commands to X windows.

See Appendix A, Commands-Only Prism for information about commands-only Prism.

Specifying X Toolkit Options

You can include most standard X toolkit command-line options when you issue the prism command; for example, you can use the -geometry option to change the size of the main Prism window. See your X documentation for information on these options. Also, note these limitations:

  • The -font, -title, and -rv options have no effect.

  • The -bg option is overridden in part by the setting of the Prism.textBgColor resource, which specifies the background color for text in Prism; see ' Changing Colors'.

X toolkit options are ignored if you use -C to run Prism in commands-only mode.

Prism 6.0h

Specifying Input and Output Files

You can use the form

to specify a file from which Prism is to read and execute commands upon startup. Similarly, use the form

to specify a file to which Prism commands and their output are to be logged.

Prism 6.07

If you have created a .prisminit initialization file, Prism automatically executes the commands in the file when it starts up. See ' Initializing Prism' for information on .prisminit.

To enter MP Prism, issue the prism command with the -n option, specifying the number of client MP Prism processes you want to start. Use the value 0 to specify that you want to run on all available nodes, one process per node.

Methods of Specifying MP Prism Options

The major differences between starting Prism to work on a serial program and starting MP Prism are:

  1. You must specify a number of processes to run, even when the message-passing program runs on a single process. Use the -n option to specify the number of processes.

  2. You are actually starting multiple Prism processes, in a client/server model:

  • There is one client MP Prism process for each process in the message-passing program. The MP Prism process attaches itself to the message-passing process to collect information about it.

  • There is a single server Prism process that communicates with the MP Prism processes and provides the interface to the user. This process is referred to as Host Prism.

  • The multiple MP Prism processes run on the nodes on which the message-passing processes are running.

You can specify where you want both Host Prism and the message-passing processes (along with their associated MP Prism processes) to run. You can do this either explicitly or by using defaults.

Specifying Where Host Prism Is to Run

If you simply issue the prism command with the -n argument and an integer value, MP Prism starts Host Prism on the node to which you are logged in. For example:

See 'Entering Prism' for more information on starting Prism, and see the Sun MPI 4.0 Programming and Reference Guide for more information on starting Sun HPC programs in general.

Specifying MP Prism Command-line Options

If you are in MP Prism, you can also use the Prism options listed below to specify where you want the message-passing processes and their associated MP Prism processes to run.

  • Use the -W argument to instruct Prism to start the specified number of processes, even when that number exceeds the number of processors. By default, Prism launches one process per processor. For example:

%prism -n 4 -W a.x

starts four processes, regardless of the number of processors.

  • Use the Prism command-line arguments that support environment-specific options. For example:

    • Use the -bsubargs argument to provide Prism (when using the LSF environment) with bsub arguments. For example, using the C shell (csh), you can specify a preferred host by name.

%prism -n 4 -W -bsubargs '-m argos' a.x

Here, you requested four processes to be launched on host argos, wrapping if necessary.

  • Use the -mprunargs argument to provide Prism (when using the CRE environment) with mprun arguments. For example, using the C shell (csh), you can specify a preferred host by name.

%prism -n 4 -W -mprunargs '-p delos' a.x

Here, you requested four processes to be launched on partition delos, wrapping if necessary.

Note -

If the bsub option itself uses quotation marks, refer to the documentation for your shell program for the syntax for handling quotes.

Specifying Environment-Specific Options After Launching Prism

Sun HPC ClusterTools 3.0 supports two run-time environments, Platform Computing's Load Sharing Facility (LSF), and the Cluster Runtime Environment (CRE). Prism runs on both environments. If you want to determine which environment is in effect, execute the script /opt/SUNWhpc/etc/hpc_rte from a shell prompt. For example:

Once you have entered Prism, you can issue environment-specific commands to specify any bsub (when using the LSF environment) or mprun (when using the CRE environment) options that you want to apply to your message-passing program.

Prism stores these options, then applies them when you start up a multiprocess program. Specifying the setting of a bsub option via the bsubargs command, or an mprun option via the mprunargs command, overrides the setting of the same option you have established via the prism command line. If it is an option that has otherwise not been specified, it is added to the existing settings.

Note -

The strings given to bsubargs or mprunargs should not contain the -I, -Ip, or -n flags, because Prism internally generates values for them, and the results will be undefined.

Using bsubargs

To specify a preferred host by name after you have entered Prism in the LSF environment, use the bsubargs command. For example:

To remove any existing bsub options you have specified, issue the command

Within Prism, this removes options you have set via the command line.

Issuing the bsubargs command with no options shows the current bsub options.

Note -

The bsubargs command accepts a single string argument. Since this argument is issued within Prism, using the shell-specific syntax appropriate for the -bsubargs option causes errors. Also, each time that you issue the bsubargs command, the previously specified bsub options are replaced. To keep a list of options in effect, you must specify the entire list whenever you change any item in that list.

Using mprunargs

To specify a preferred partition by name after you have entered Prism in the CRE environment, use the mprunargs command. For example:

To remove any existing mprun options you have specified, issue the command

Within Prism, this removes options you have set via the command line.

Issuing the mprunargs command with no options shows the current mprun options.

Note -

The mprunargs command accepts a single string argument. Since this argument is issued within Prism, using the shell-specific syntax appropriate for the -mprunargs option causes errors.

Within Prism, you can perform most actions in one of three ways:

  • By using a mouse; see ' Using the Mouse'

  • By using keyboard alternatives to the mouse; see ' Using Keyboard Alternatives to the Mouse'

  • By issuing commands from the keyboard; see ' Issuing Commands'

Using the Mouse

You can point and click with a mouse in Prism to choose menu items and to perform actions within windows and dialog boxes. Prism assumes that you have a standard three-button mouse.

In any window where you see this mouse icon:

you can left-click on the icon to obtain information about using the mouse in the window.

Using Keyboard Alternatives to the Mouse

You can use the keyboard to perform many of the same functions you can perform with a mouse. This section lists these keyboard alternatives.

In general, to use a keyboard alternative, the focus must be in the screen region where you want the action to take place. The focus is generally indicated by the location cursor, which is a heavy line around the region.

General keyboard alternatives to mouse control are listed below.

Table 2-1 General Keyboard Alternatives to MouseControl

Key Name

Description

Tab

Use the Tab key to move the location cursor from field to field within a window or dialog box. The buttons in a window or box constitute one field. The location cursor highlights one of the buttons when you tab to this field.

Shift-Tab

Use the Shift-Tab key to perform the same function as Tab, but move through the fields in the opposite direction.

Return

Use the Return key to choose a highlighted choice in a menu, or to perform the action associated with a highlighted button in a window or dialog box.

Arrowkeys

Use the up, down, left, and right arrow keys to move within a field. For example, when the location cursor highlights a list, you can use the up and down arrow keys to move through the choices in the list. In some windows that contain text, pressing the Control key along with an up or down arrow key scrolls the text one-half page.

F1

Use the F1 key instead of the Help button to obtain help about a window or dialog box.

F10

Use the F10 key to move the location cursor to the menu bar.

Meta

Use the Meta key along with the underlined character in the desired menu item to display a menu or dialog box (equivalent to clicking on the item with the mouse). The Meta key has different names on different keyboards; on some it is the Left or Right key.

Control-c

Use the Control-c key combination to interrupt command execution.

Esc

Use the Esc key instead of the Close or Cancel button to close the window or dialog box in which the mouse pointer is currently located.

The keys and key combinations described in Table 2-2 work on the command line and in text-entry boxes--that is, fields in a dialog box or window where you can enter or edit text.

Table 2-2 Text-entry Keyboard Alternatives

Key Name

Description

Back Space

Deletes the character to the left of the I-beam cursor.

Delete

Same as Back Space.

Control-a

Moves to the beginning of the line.

Control-b

Moves back one character.

Control-d

Deletes the character to the right of the I-beam cursor.

Control-e

Moves to the end of the line.

Control-f

Moves forward one character.

Control-k

Deletes to the end of the line.

Control-u

Deletes to the beginning of the line.

In addition, you can use keyboard accelerators to perform actions from the menu bar; see ' Keyboard Accelerators'.

Issuing Commands

You can issue commands in Prism from the command line in the command window. Most commands duplicate functions you can perform from the menu bar; it's up to you whether you use the command or the corresponding menu selection. Some functions are only available via commands. See the Prism 6.0 Reference Manual for complete information about Prism commands. ' Using the Command Window' describes how to use the command window.

Many commands have the same syntax and perform the same action in both Prism and the Solaris debugger dbx. There are differences, however; you should check the reference description of a command before using it.

The menu bar is the line of titles across the top of the main Prism window.

Each title is associated with a pulldown menu, from which you can perform actions within Prism.

Keyboard Accelerators

A keyboard accelerator is a shortcut that lets you choose a frequently used menu item without displaying its pulldown menu. Keyboard accelerators consist of the Control key plus a function key; you press both at the same time to perform the action. The keyboard accelerator for a menu selection is displayed next to the name of the selection; if nothing is displayed, there is no accelerator for the selection.

The keyboard accelerators (on a Sun keyboard) are

Table 2-3 Keyboard Acceleratorsfor Main Menu Selections

Accelerator

Function

Control-F1

Run

Control-F2

Continue

Control-F3

Interrupt

Control-F4

Step

Control-F5

Next

Control-F6

Where

Control-F7

Up

Control-F8

Down

listed in Table 2-3.

The source window displays the source code for the executable program loaded into Prism. (Chapter 3, Loading and Executing a Program describes how to load a program into Prism, and how to display the different source files that make up the program.) When you execute the program, and execution then stops for any reason, the source window updates to show the code being executed at the stopping place. The SourceFile: field at the top of the source window lists the file name of the file displayed in the window.

The source window is a separate pane within the main Prism window. You can resize it by dragging the small resize box at the lower right of the window. If you change its size, the new size is saved when you leave Prism.

You cannot edit the source code displayed in the source window. To edit source code within Prism, you must call up an editor; see Chapter 8, Editing and Compiling Programs.

Moving Through the Source Code

As mentioned above, you can move through a source file displayed in the source window by using the scroll bar on the right side of the window. You can also use the up and down arrow keys to scroll a line at a time, or press the Control key along with the arrow key to move half a page at a time. To return to the current execution point, type Control-x in the source window.

To search for a text string in the current source file, issue the /string or ?string command in the command window. The /string command searches forward in the file for the string that you specify and repositions the file at the first occurrence it finds. The ?string command searches backward in the file for the string that you specify.

You can display different files by choosing the File or Func selection from the File menu; see ' Choosing the Current File and Function'. You can also move between files. Prism keeps a list of the files you have displayed. With the mouse pointer in the source window, do this to move through the list:

  • To display the previous file in the list, click the middle mouse button while pressing the left button. You are returned to the location at which you left the file.

  • To display the next file in the list, click the right mouse button while pressing the left button.

Selecting Text

You can select text in the source window by dragging over it with the mouse; the text is then highlighted. Or double-click with the mouse pointer pointing to a word to select just that word. Left-click anywhere in the source window to 'deselect' selected text.

Right-click in the source window to display a menu that includes actions to perform on the selected text, see Figure 2-1. For example, select Print to display a visualizer containing the value(s) of the selected variable or expression at the current point of execution. (See Chapter 5, Visualizing Data, for a discussion of visualizers and printing.) To close the pop-up menu, right-click anywhere else in the main Prism window.

Figure 2-1 Pop-up Menu in Source Window

Prism

You can display the definition of a function by pressing the Shift key while selecting the name of the function in the source window. This is equivalent to choosing the Func selection from the File menu and selecting the name of the function from the list; see Chapter 3, Loading and Executing a Program. Do not include the arguments to the function, just the function name.

Splitting the Source Window

You can split the source window to simultaneously display the source code and assembly code of the loaded program. Follow these steps to split the source window:

To split the source window:

  1. Load a program.

  2. Right-click in the source window to display the pop-up menu.

  3. Click on the 'Show source pane' selection in the pop-up menu.

    This displays another menu.

  4. Choose the 'Show .s source' selection from the menu.

    This causes the assembly code for your program to be displayed in the bottom pane of the window, as shown in Figure 2-2.

Figure 2-2 Split Source Window

To return to a single source window, right-click in the pane you want to get rid of, and choose 'Hide this source pane' from the popup menu.

The line-number region shows the line numbers associated with the source code displayed in the source window. Figure 2-3 shows a portion of a line-number region, with a breakpoint set.

Figure 2-3 Line Number Region

You will see the following symbols in the line-number region:

  • The > symbol in the line-number region in Figure 2-2 is the execution pointer. When the program is being executed, the execution pointer points to the next line to be executed, for the most-active function call; or to the call site for functions higher on the stack. If you move elsewhere in the source code, typing Control-x returns to the current execution point.

  • A B appears in the line-number region next to every line at which execution is to stop. You can set simple breakpoints directly in the line-number region; all methods for setting breakpoints are described in ' Setting Breakpoints'.

  • A T appears in the line-number region next to a line for which Prism is tracing execution. See ' Tracing Program Execution' to learn how to trace program execution.

Shift-click on B or T in the line-number region to display the event associated with the breakpoint or tracepoint. See ' Overview of Events' for a discussion of events.

Note -

The display of breakpoints and tracepoints in the line-number region is slightly more complicated in MP Prism; see ' Using the Line-Number Region in MP Prism'.

  • The - symbol is the scope pointer; it indicates the current source position (that is, the scope). Prism uses the current source position to interpret names of variables. When you scroll through source code, the scope pointer moves to the middle line of the code that is displayed. Various Prism commands also change the position of the scope pointer.

  • The * symbol is used when the current source position is the same as the current execution point; this happens whenever execution stops.

If you right-click in the line-number window, you display the source-window pop-up menu discussed in the previous section. Right-click anywhere in the main Prism window to close this menu.

The command window is the area at the bottom of the main Prism window in which you type commands and receive Prism output.

The command window consists of two boxes: the command line, at the bottom, and the history region, above it. Figure 2-4 shows a command window, with a command on the command line and messages in the history region.

Figure 2-4 Command Window With History Region

The command window is a separate pane within the main Prism window. You can resize this window (using the resize box at the top right of the window) and scroll through it. If you don't intend to issue commands in the command window, you may want to make this window smaller, so that you can display more code in the source window. If you use the command window frequently, you may want to make it bigger. If you change the size of the window, the new size is saved when you leave Prism.

Use the set$history command, as described below, to specify the maximum number of lines that Prism is to retain in the history region; the default is 10,000. For example,

reduces the number of lines to 2000.

Prism uses up memory in maintaining a large history region. A smaller history region, therefore, may improve performance and prevent Prism from running out of memory.

Using the Command Line

You type commands on the command line at the bottom of the command window. You can type in this box whenever it is highlighted and an I-shaped cursor, called an I-beam, appears in it. See Table 2-2 for a list of keystrokes you can use in editing the command line. Press Return to issue the command. Type Control-c to interrupt execution of a command (or choose the Interrupt selection from the Execute menu).

You can issue multiple commands on the Prism command line; separate them with a semicolon (;). One exception: If a command takes a file name as an argument, you cannot follow it with a semicolon, because Prism can't tell if the semicolon is part of the file name.

Prism keeps the commands that you issue in a buffer. Type Control-p to display the previous command in this buffer. Type Control-n to display the next command in the buffer. You can then edit the command and issue it in the usual way.

During long-running commands (for example, when you have issued the run command to start a program executing), you may still be able to execute other commands. If you issue a command that requires that the current command complete execution, you receive a warning message and Prism waits for the command to complete.

Using the History Region

Commands that you issue on the command line are echoed in the history region, above the command line. Prism's response appears beneath the echoed command. Prism also displays other messages in this area, as well as command output that you specify to go to the command window. Use the scroll bar at the right of this box to move through the display.

You can select text in the history region, using one of these methods:

  • Double-click to select the word to which the mouse pointer is pointing.

  • Triple-click to select the line on which the mouse pointer is located.

  • Press the left mouse button and drag the mouse over the text to select it.

You can then paste the selected text into other text areas within Prism by clicking the middle mouse button.

To re-execute a command, triple-click on a line in the history region to select it, then click the middle mouse button with the mouse pointer still in the history region. If you middle-click with the mouse pointer on the command line, the selected text appears on the command line but is not executed. This gives you a way to edit the text before executing it.

Redirecting Output

You can redirect the output of most Prism commands to a file by including an 'at' sign (@) followed by the name of the file on the command line. For example,

puts the output of a where command (a stack trace) into the file where.output, in your current working directory within Prism.

You can also redirect output of a command to a window by using the syntax on window, where window can be:

  • command (abbreviated com) - This sends output to the command window; this is the default.

  • dedicated (abbreviated ded) - This sends output to a window dedicated to output for this command. If you subsequently issue the same command (no matter what its arguments are) and specify that output is to be sent to the dedicated window, this window will be updated. For example,

list on ded

displays the output of the list command in a dedicated window. (Some commands that have equivalent menu selections display their output in the standard window for the menu selection.)

  • snapshot(abbreviated sna) - This creates a window that provides a snapshot of the output. If you subsequently issue the same command and specify that output is to be sent to the snapshot window, Prism creates a separate window for the new output. The time each window was created is shown in its title. Snapshot windows let you save and compare outputs.

Prism

Prism 6.0 Software

You can also make up your own name for the window; the name appears in the title of the window. This is useful if you want a particular label for a window. For example, if you were doing a stack trace at line 22, you could issue this command:

to label the window with the location of the stack trace.

The commands whose output you cannot redirect are run,edit, make, and sh.

Note -

Although the run command cannot be redirected using on or @, run can be redirected using > and other shell redirections.

Logging Commands and Output

You can specify on the Prism command line the name of a file to which commands and output are to be logged. You can also do this from within Prism, by issuing the log command.

Use the log command to log Prism commands and output to a file. The log file will be located in the current directory. This can be helpful in saving a record of a Prism session. For example,

logs output to the file prism.log. Use @@ instead of @ to append the log to an already existing file. Issue the command

to turn off logging.

You can use the log command along with the source command to replay a session in Prism; see the next section. If you want to do this, you must edit the log file to remove Prism output.

Executing Commands From a File

As mentioned in ' Specifying Input and Output Files', you can specify on the Prism command line the name of a file from which commands are to be read in and executed. You can also do this from within Prism by issuing the source command.

Using the source command lets you rerun a session you saved via the log command. You might also use source if, for example, your program has a long argument list that you don't want to retype constantly.

For example,

reads in the commands in the file prism.cmds. They are executed as if you had actually typed them in the command window. When reading the file, Prism interprets lines beginning with a pound sign (#) as comments.

The .prisminit file is a special file of commands; if it exists, Prism executes this file automatically when it starts up. See ' Initializing Prism' for more information.

While working in Prism, there are circumstances in which you may want to write expressions that Prism will evaluate. For example, you can print or display expressions, and you can specify an expression as a condition under which an action is to take place. You can write these expressions in the language of the program you are working on. This section discusses additional aspects of writing expressions.

How Prism Chooses the Correct Variable or Procedure

Multiple variables and procedures can have the same name in a program. This can be a problem when you specify a variable or procedure in an expression. To determine which variable or procedure you mean, Prism tries to resolve its name by using these rules:

  • It first tries to resolve the name using the scope of the current function. For example, if you use the name x and there is a variable named x in the current function or the current file, Prism uses that x. The current function is ordinarily the function at the program's current stopping point, but you can change this. See ' Choosing the Current File and Function'.

  • If this fails to resolve the name, Prism goes up the call stack and tries to find the name in the caller of the current function, then its caller, and so on, following the scoping and visibility rules of the current language.

  • If no match is found in any routine active on the stack, Prism searches the static and global name spaces. If no match is found, Prism prints an error.

  • If the name is not found in the call stack, Prism arbitrarily chooses one of the variables or procedures with the name in the source code. When Prism prints out the information, it adds a message of the form '[using qualified name]'. Qualified names are discussed below.

Issue the which command to find out which variable or procedure Prism would choose; the command displays the fully qualified name, as described below.

Using Qualified Names

You can override Prism's procedure for resolving names by qualifying the name.

A fully qualified name starts with a back-quotation mark (`). The symbol farthest to the left in the name is the load object, followed optionally by the file, followed optionally by the procedure, followed by the variable name. Each is preceded by a backquote (`). Examples of Prism's identifier syntax are shown in Table 2-4.

Table 2-4 Prism Identifier Syntax

Syntax

Description

a

Specifies the variable a in the current scope. An error will be reported if no variable a exists in the current scope.

`a

Specifies the variable a in the global scope.

``a

Specifies the variable a in the global or file-static scope.

`foo.c`a

Specifies the variable a in file foo.c.

`foo.c`foo`a

Specifies the a in the procedure foo in the file foo.

`foo`a

Specifies the variable a in function foo (if foo is active).

`a.out`foo.c`foo`a

Specifies the variable a in function foo in file foo.c in load object a.out.

`a.out`foo.c`foo:line`a

Specifies the variable a in function foo at line number line in file foo.c in load object a.out.

`foo.x`foo.cc`Bar::print:71`dummy

Specifies the variable dummy in member function print of class Symbol at line number 71 in file foo.cc in load object foo.x.

'foo.c':line

Specifies the line number line in the file foo.c. Note the use of double quotes.

Partially qualified names do not begin with `, but have a ` in them. For example,

In this case, Prism looks up the function name on the left first and picks the innermost symbol with that name that is visible from your current location. This is useful primarily in referring to variables in routines on the call stack.

Use the whereis command to display a list of all the fully qualified names that match the identifier you specify.

Prism assigns its own names (using the function:line syntax, where function is the function and line is the line number where the variable declaration appeared) to variables in local blocks of C code. This disambiguates variable names, in case you reuse a variable name in more than one of these local blocks.

When debugging Fortran, Prism attempts to be case-insensitive in interpreting names, but will use case to resolve ambiguities.

Using Fortran Intrinsic Functions in Expressions

Prism supports the use of a subset of Fortran intrinsic functions in writing expressions; the intrinsics work for all languages that Prism supports, except as noted below.

The intrinsics, along with the supported arguments, are

  • ALL(logical array) - Determines whether all elements are true in a logical array. Works for Fortran only.

  • ANY(logical array) - Determines whether any elements are true in a logical array. Works for Fortran only.

  • CMPLX(numeric-arg, numeric-arg) - Converts the arguments to a complex number. If the intrinsic is applied to Fortran variables, the second argument must not be of type complex or double (double-precision complex).

  • COUNT(logical array) - Counts the number of true elements in a logical array. Works for Fortran only.

  • SIZE(array) - Counts the total number of elements in the array.

  • ILEN(I) - Returns one less than the length, in bits, of the two's-complement representation of an integer. If I is nonnegative, ILEN(I) has the valuelog2(I + 1); if I is negative, ILEN(I) has the value log2(-I).

  • IMAG(complex number) - Returns the imaginary part of a complex number. Works for Fortran only.

  • MAXVAL(array) - Computes the maximum value of all elements of a numeric array.

  • MINVAL(array) - Computes the minimum value of all elements of a numeric array.

  • PRODUCT(array) - Computes the product of all elements of a numeric array.

  • RANK(scalar or array) - Returns the rank of the array or scalar.

  • REAL(numeric argument) - Converts an argument to real type. Works for Fortran only.

  • SUM(array) - Computes the sum of all elements of a numeric array.

The intrinsics can be either upper- or lowercase.

Using C Arrays in Expressions

Prism handles arrays slightly differently from the way C handles them.

In a C program, if you have the declaration

and you use a in an expression, the type of a converts from 'array of ints' to 'pointer to int'. Following the rules of C, therefore, a Prism command like

should print a hexadecimal pointer value. Instead, it prints two more than each element of a (that is, a[0] + 2, a[1] + 2, etc.). This allows you to do array operations and use visualizers on C arrays in Prism. (The print command and visualizers are discussed in Chapter 5, Visualizing Data.)

To get the C behavior, issue the command as follows:

Using Array-Section Syntax in C arrays

You can use Fortran 90 array-section syntax when specifying C arrays. This syntax is useful, for example, if you want to print the values of only a subset of the elements of an array. The syntax is:

where

  • lower-bound is the lowest-numbered element you choose along a dimension; it defaults to 0.

  • upper-bound is the highest-numbered element you choose along the dimension; it defaults to the highest-numbered element for the dimension.

  • stride is the increment by which elements are chosen between the lower bound and upper bound; it defaults to 1.

You must enclose the values in parentheses (rather than brackets), as in Fortran. If your array is multidimensional, you must separate the dimension specifications with commas within the parentheses, once again as in Fortran.

For example, if you have this array:

then you can issue this command in Prism to print the values of elements 2-4 of the first dimension and 2-10 of the second dimension:

Hints for Detecting NaNs and Infinities

Prism provides expressions that you can use to detect NaNs (values that are 'not a number') and infinities in your data. These expressions derive from the way NaNs and infinities are defined in the IEEE standard for floating-point arithmetic.

To find out if x is a NaN, use the expression:

For example, if x is an array, issue the command

to print only the elements of x that are NaNs. (The print command is discussed in Chapter 5, Visualizing Data.)

Also, note that if there are NaNs in an array, the mean of the values in the array will be a NaN. (The mean is available via the Statistics selection in the Options menu of a visualizer--see Chapter 5, Visualizing Data.)

To find out if x is an infinity, use the expression:

Graphpad Prism 6.01

You can use Fortran 90 generic procedures in any Prism command or dialog box that asks for a procedure. If you do so, Prism will prompt you for the name(s) of the specific procedure(s) you want to use.

For example, you use the syntax stopinprocedure to set a breakpoint in a procedure. If you use this syntax for a generic procedure, in graphical Prism a dialog box like the one shown in Figure 2-5 would be displayed.

Figure 2-5 Generic Procedure Dialog Box

Commands-only Prism would prompt you as in this example:

If you press the Return key, you would see a menu like this:

If you choose 0 or press Return, the command is cancelled. If you choose other numbers, Prism sets the breakpoint(s) in the specified procedure(s). For example,

You can issue Solaris commands from within Prism.

  • From the menu bar - Choose the Shell selection from the Utilities menu. Prism creates a Solaris shell. The shell is independent of Prism; you can issue Solaris commands from it just as you would from any Solaris shell. The type of shell that is created depends on the setting of your SHELL environment variable.

  • From the command window - Issue the sh command on the command line. With no arguments, it creates a Solaris shell. If you include a Solaris command line as an argument, the command is executed, and the results are displayed in the history region.

Some Solaris commands have Prism equivalents, as described below.

Changing the Current Working Directory

By default your current working directory within Prism is the directory from which you started Prism. To change this working directory, use the cd command, just as you would in the Solaris environment. For example,

changes your working directory to /sistare/bin.

changes your working directory to the parent of the current working directory. Issue cd with no arguments to change the current working directory to your login directory.

Prism interprets all relative file names with respect to the current working directory. Prism also uses the current working directory to determine which files to show in file-selection dialog boxes.

To find out what your current working directory is, issue the pwd command, just as you would in the Solaris environment.

Setting and Displaying Environment Variables

You can set, unset, and display the settings of environment variables from within Prism, just as you do in the Solaris environment.

Prism

Use the setenv command to set an environment variable. For example,

sets your EDITOR environment variable to emacs.

Use the unsetenv command to remove the setting of an environment variable. For example,

Number

removes the setting of the EDITOR environment variable.

Use the printenv command to print the setting of an individual environment variable. For example,

prints the current setting of the EDITOR environment variable. Or, issue printenv or setenv with no arguments to print the settings of all your environment variables.

To leave Prism:

  • From the menu bar - Choose the Quit selection from the File menu. You are asked if you are sure you want to quit. Click on OK if you're sure; otherwise, click on Cancel or press the Esc key to stay in Prism.

  • From the command window - Issue the quit command on the command line. (You aren't asked if you're sure you want to quit.)

Prism 6.0 Pro

If you have created subprocesses while in Prism (for example, a Solaris shell), Prism displays this message before exiting:

Graphpad Prism 6.01 Serial Number

Figure 2-6 Sub-process Warning

Prism 6.0 Free


Choose Yes (the default) to leave Prism and terminate the subprocesses. Choose No to leave Prism without terminating the subprocesses. Choose Cancel to stay in Prism.