This chapter discusses ways in which you can change various aspects of Prism's appearance and the way Prism operates.
See the following sections:
You can customize MP Prism just as you customize scalar Prism. Both MP Prism and scalar Prism use the same .prisminit file. This could lead to error messages if you bring up scalar Prism and the file contained MP Prism-specific commands. Therefore, Prism lets you specify that commands in your .prisminit file are for MP Prism only by bracketing them with #ifdef MP and #endif. For example,
alias c cont #ifdef MP pset 0 alias c "cont; wait every" #endif
These commands define c to aliases differently in scalar Prism and MP Prism, and set the initial pset to 0 in MP Prism.
To provide this feature, Prism must preprocess the .prisminit file; by default it does not do this. To tell Prism to preprocess the file, use the Prism resource Prism.cppPath, specifying the path to your C preprocessor as its setting; typically, this is /lib. Thus, you would set the resource as follows:
Prism.cppPath: /lib
See " Changing Prism Defaults" for information on setting Prism resources. Note, however, that commands-only Prism is not aware of the settings of Prism resources such as Prism.cppPath, unless the settings are contained in the system-wide Prism app-defaults file.
You can place frequently used menu selections and commands in the tear-off region below the menu bar; in the tear-off region, they become buttons that you can click on to execute functions. Figure 10-1 shows the buttons that are there by default.
Putting menu selections and commands in the tear-off region lets you access them without having to pull down a menu or issue a command from the command line.
Changes you make to the tear-off region are saved when you leave Prism; see " Where Prism Stores Your Changes".
You can add menu selections to the tear-off region from either the menu bar or the command line.
From the menu bar - To add a menu selection to the tear-off region, first enter tear-off mode by choosing Tear-off from the Utilities menu. A dialog box appears that describes tear-off mode; see Figure 10-2.
While the dialog box is on the screen, choosing any selection from a menu adds a button for this selection to the tear-off region. Clicking on a button in the tear-off region removes that button. If you fill up the region, you can resize it to accommodate more buttons. To resize the region, drag the small resize box at the bottom right of the region.
Click on Close or press the Esc key while the mouse pointer is in the dialog box to close the box and leave tear-off mode.
When you are not in tear-off mode, clicking on a button in the tear-off region has the same effect as choosing the equivalent selection from a menu.
From the command window - Use the tearoff and untearoff commands from the command window to add menu selections to and remove them from the tear-off region. Put the selection name in quotation marks; case doesn't matter, and you can omit spaces and the ellipsis (...) that indicates the selection displays a window or dialog box. If the selection name is ambiguous, put the menu name in parentheses after the selection name. For example,
tearoff "print (events)"
adds a button for the Print selection from the Events menu to the tear-off region.
To add a Prism command to the tear-off region, issue the pushbutton command, specifying the label for the tear-off button and the command it is to execute. The label must be a single word. The command can be any valid Prism command, along with its arguments. For example,
pushbutton printa print a on dedicated
adds a button labeled printa to the tear-off region. Clicking on it executes the command print a on dedicated.
To remove a button created via the pushbutton command, you can either click on it while in tear-off mode, or issue the untearoff command as described above.
Prism provides commands that let you create alternative names for commands, variables, and expressions.
Use the alias command to set up an alternative name for a Prism command. For example,
alias ni nexti
makes ni an alias for the nexti command. Prism provides some default aliases for common commands. Issue alias with no arguments to display a list of the current aliases. Issue the unalias command to remove an alias. For example,
unalias ni
removes the alias created above.
Use the set command to set up an alternative name for a variable or expression. For example,
set alan = annoyingly_long_array_name
abbreviates the annoyingly long array name to alan. You can use this abbreviation subsequently in your program to refer to this variable. Use the unset command to remove a setting. For example,
unset alan
removes the setting created above.
Changes you make via alias and set last for your current Prism session. To make them permanent, you can add the appropriate commands to your .prisminit file; see " Initializing Prism".
Many aspects of Prism's behavior and appearance--for example, the colors it displays on color workstations, and the fonts it uses for text--are controlled by the settings of Prism resources. The default settings for many of these resources appear in the file Prism in the X11 app-defaults directory for your system. Your system administrator can change these system-wide defaults. You can override these defaults in two ways:
For many of them, you can use the Customize selection from the Utilities menu to display a window in which you can change the settings. This section describes this method.
A more general method is to add an entry for a resource to your X resource database, as described in the next section. Using the Customize utility is much more convenient, however.
Choosing Customize from the Utilities menu displays the window shown in Figure 10-3.
On the left of the Customize window are the names of the resources. Next to each resource is a text-entry box that contains the resource's setting (if any). To the right of the fields are Help buttons. Clicking on a Help button or anywhere in the text-entry field displays help about the associated resource in the box at the top of the window.
The way you set a value for a resource differs depending on the resource:
For Edit Geometry, Menu Threshold, Text Font, and Visualizer Color File, you enter the setting in the resource's text-entry box.
For Editor, Error Window, and Make, you can left-click on the button labeled with the resource's name. This displays a menu of choices for the resource. Clicking on one of these choices displays it in the resource's text-entry box. For Editor and Make, you can also enter the setting directly in the text-entry box.
For Error Bell, Procedure Menu, Mark Stale Data, and Use Xterm, there are only two possible settings, true and false; clicking on the button labeled with the resource's name toggles the current setting.
Whenever you make a change in a text-entry box, Apply and Cancel buttons appear to the right of it. Click on Apply to save the new setting; it takes effect immediately. Click on Cancel to cancel it; the setting changes back to its previous value.
Click on Close or press the Esc key to close the Customize window.
You can customize the X Window System resources that Prism (and other X applications) uses.
Edit Geometry - Use this resource to specify the X geometry string for the editor created by the Edit and Email selections from the Utilities menu. The geometry string specifies the number of columns and rows, and optionally the left and right offsets from the corner of the screen. The Prism default is 80x24 (that is, 80 rows and 24 columns). See your X documentation for more information on X geometries.
Editor - Use this resource to specify the editor that Prism is to invoke when you choose the Edit selection from the Utilities menu. Click on the Editor box to display a menu of possible choices. If you leave this field blank, Prism uses the setting of your EDITOR environment variable to determine which editor to use.
Error Bell - Use this resource to specify how Prism is to signal errors. Choosing true tells Prism to ring the bell of your workstation. Choose false (the Prism default) to have Prism flash the screen instead.
Error Window - Use this resource to tell Prism where to display Prism error messages. Choose command (the Prism default) to display them in the command window. Choose dedicated to send the messages to a dedicated window; the window will be updated each time a new message is received. Choose snapshot to send each message to a separate window.
Make - Use this resource to tell Prism which make utility to use when you choose the Make selection from the Utilities menu. The Prism default is the standard Solaris make utility, /usr/ccs/bin/make. Click on the Make box to display a menu of possible choices.
Mark Stale Data - Use this resource to tell Prism how to treat the data in a visualizer that is out-of-date (because the program has continued execution past the point at which the data was displayed). Choose true (the default) to have Prism draw diagonal lines over the data; choose false to leave the visualizer's appearance unchanged.
Procedure Menu - Use this resource to specify whether a menu is to be displayed when you set a breakpoint in a Fortran 90 generic procedure. If you choose true (the default), a menu of possible procedures is displayed, from which you can choose the procedure(s) in which the breakpoint is to be set. Choose false if you want to set the breakpoint automatically in all the generic procedures.
Menu Threshold - Use this resource to specify the maximum number of procedures that are to be displayed in a menu when you perform an action (for example, setting a breakpoint) on a Fortran 90 generic procedure. The default is 22. Enter 0 to indicate that there should be no maximum. If the number of procedures exceeds the specified threshold, you are prompted to either enter the procedure name or display the menu.
Text Font - Use this resource to specify the name of the X font that Prism is to use in displaying the labels of histogram bars and text in visualizers. The default, 8x13, is a 12-point fixed-width font. To list the fonts available on your system, issue the Solaris command xlsfonts. Specifying a font much larger than the default can cause display problems, because Prism doesn't resize windows and buttons to accommodate the larger font.
Use Xterm - Use this resource to tell Prism what to do with the I/O of a program. Specify true (the Prism default) to tell Prism to create an Xterm in which to display the I/O. Specify false to send the I/O to the Xterm from which you started Prism.
Visualizer Color File - Use this resource to tell Prism the name of a file that specifies the colors to be used in colormap visualizers. If you leave this field blank, Prism uses gray for elements whose values are not in the context you specify; for elements whose values are in the context, it uses black for values below the minimum, white for values above the maximum, and a smooth spectral map from blue to red for all other values.
The file must be in ASCII format. Each line of the file must contain three integers between 0 and 255 that specify the red, green, and blue components of a color.
The first line of the visualizer color file contains the color that is to be displayed for values that fall below the minimum you specify in creating the visualizer. The next-to-last line contains the color for values that exceed the maximum. The last line contains the color used to display the values of elements that are not in the context specified by the user in a where statement. Prism uses the colors in between to display the values falling between the minimum and the maximum. See Table 10-1 for an example.
Table 10-1 Sample Visualizer Colors
Red |
Green |
Blue |
---|---|---|
0 |
0 |
0 |
255 |
0 |
0 |
255 |
255 |
0 |
0 |
255 |
0 |
0 |
255 |
255 |
0 |
0 |
255 |
255 |
0 |
255 |
255 |
255 |
255 |
100 |
100 |
100 |
Like the default settings, this file specifies black for values below the minimum, white for values above the maximum, and gray for values outside the context. But the file reverses the default spectral map for other values: from lowest to highest, values are mapped red-yellow-green-cyan-blue-magenta.
Prism maintains a file called .prism_defaults in your home directory. In it, Prism keeps:
Changes you make to Prism via the Customize utility
Changes you make to the tear-off region
Changes you make to the size of the panes within the main Prism window
Do not attempt to edit this file; make all changes to it through Prism itself. If you remove this file, you get the default configuration the next time you start Prism.
As mentioned in the previous section, you can change the settings of many Prism resources either by using the Customize utility or by adding them to your X resource database. This section describes how to add a Prism resource to your X resource database.
An entry is of the form
resource-name: value
where resource-name is the name of the Prism resource, and value is the setting. Table 10-2 lists the Prism resources.
Table 10-2 Prism Resources
Resource |
Use |
---|---|
Specifies the color of the first communicator displayed in the MPI queue visualizer. |
|
Specifies the color of the second communicator displayed in the MPI queue visualizer. |
|
Specifies the color of the third communicator displayed in the MPI queue visualizer. |
|
Specifies the color of the fourth communicator displayed in the MPI queue visualizer. |
|
Specifies the path to your C preprocessor. |
|
Specifies the color for dialog boxes. |
|
Specifies the size and placement of the editor window. |
|
Specifies the editor to use. |
|
Specifies whether the error bell is to ring. |
|
Specifies the window to use for error messages. |
|
Specifies the font for labels, menu selections, etc. |
|
Specifies the background color of all graphics windows, such as the structure browser, Where graph, and visualizer. |
|
Specifies the interior fill color for objects in graphics windows that have 3-D shadow borders. |
|
Specifies the browser to use for displaying help. |
|
Specifies whether to use a currently running browser for displaying help. |
|
Specifies the main background color for Prism. |
|
Specifies the make utility to use. |
|
Specifies how Prism is to mark stale data in visualizers. |
|
Specifies whether a menu is displayed when setting a breakpoint in a Fortran 90 generic procedure. |
|
Changes the maximum number of specific procedures automatically shown when performing an action on a Fortran 90 generic procedure. |
|
Specifies the size of the default spectral color map for color visualizers. |
|
Specifies the background color for widgets containing text. |
|
Specifies the text font to use for certain labels. |
|
Specifies the keyboard translations for dialog boxes that contain several text fields. |
|
Specifies the color used to highlight the master pane in a split source window. |
|
Specifies the keyboard translations for dialog boxes that contain one text field. |
|
Specifies whether to use a new Xterm for I/O. |
|
Specifies the colors to be used in colormap visualizers. |
|
Specifies the text font to use for most running text. |
Note that the defaults mentioned in the sections below are the defaults for Prism as shipped; your system administrator can change these in Prism's file in your system's app-defaults directory.
Note also that commands-only Prism is not aware of the settings of any Prism resources, unless they are contained in Prism's app-defaults file. This matters only for the resource Prism.cppPath.
The X resource database keeps track of default settings for programs running under X. Use the xrdb program to add a Prism resource to this database. An easy way to do this is to use the -merge option and to specify the resource and its setting from the standard input. For example, the following command specifies a default editor (the resource is described below):
% xrdb -merge Prism.editor: emacs
Type Ctrl-d to signal that there is no more input. Note that you must include the -merge option; otherwise, what you type replaces the contents of your database. The new settings take effect the next time you start Prism.
Another way to add your changes is to put them in a file, then merge the file into the database. For example, if your changes are in prism.defs, you could issue this command:
% xrdb -merge prism.defs
Consult your X documentation for more information about xrdb.
Use the Prism.editor resource to specify the editor that Prism is to invoke when you choose the Edit or Email selection from the Utilities menu (or issue the corresponding commands).
Use the resource Prism.editGeometry to specify the X geometry string for the editor created by the Edit selection from the Utilities menu. The geometry string specifies the number of columns and rows, and the left and right offsets from the corner of the screen.
You can also change the settings of these resources via the Customize utility; see " Using the Customize Utility" for more information.
Use the Prism.errorwin resource to specify the window to which Prism is to send error messages. Predefined values are command, dedicated, and snapshot. You can also specify your own name for the window.
You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
You may need to change the fonts Prism uses if, for example, its fonts aren't available on your system. Use the resources described below to do this. To list the names of the fonts available on your system, issue the Solaris xlsfonts command. You should try to substitute a font that is about the same size as the Prism default; substituting a font that is much larger can cause display problems, since Prism does not resize windows and buttons to accommodate the larger font.
Use the Prism.textFont resource to specify the font that Prism is to use in displaying the labels of histograms and text in visualizers. By default, Prism uses a 12-point fixed-width font for this text.
You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
Use the Prism*XmText.fontList resource to change the font used to display most of the running text in Prism, such as the source code in the source window. By default, Prism uses a 12-point fixed-width font for this text.
Use the Prism*fontList resource to change the font used for everything else (for example, menu selections, pushbuttons, and list items). By default, Prism uses a 14-point Helvetica font for this text.
Prism provides several resources for changing the default colors it uses when it is run on a color workstation.
Use the Prism.vizColormap resource to specify a file that contains the colors to be used in colormap visualizers. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility". See " Resources" for a discussion of how to create a visualizer color file.
Use the resource Prism.spectralMapSize to specify how large the default spectral color map is to be for colormap visualizers. The default is 100 entries. You would typically use this resource to specify fewer entries, if this number causes problems on your workstation. To set the default to 50, for example, set the resource in your X resource database as follows:
Prism.spectralMapSize: 50
Use the Prism.dialogColor resource to change the background color of dialog boxes.
Use the Prism.textBgColor resource to change the background color for text in buttons, dialog boxes, etc. Note that this setting overrides the setting of the X toolkit -bg option.
Use the Prism.textMasterColor resource to change the color used to highlight the master pane when the source window is split.
Use Prism.graphFillColor to specify the interior fill color for objects in graphics windows that have 3-D shadow borders.
Use Prism.graphBGColor to specify the background color of all graphics windows, such as the structure browser, where graph, and visualizer.
Use the Prism.mainColor resource to change the color used for just about everything else.
The defaults are:
Prism.dialogColor: Thistle Prism.textBgColor: snow2 Prism.textMasterColor: black Prism.graphFillColor: grey Prism.graphBGColor: light grey Prism.mainColor: light sea green
Use the Prism.comm1Color resource to change the color of the first communicator displayed in the MPI queue visualizer.
Use the Prism.comm2Color resource to change the color of the second communicator displayed in the MPI queue visualizer.
Use the Prism.comm3Color resource to change the color of the third communicator displayed in the MPI queue visualizer.
Use the Prism.commOtherColor resource to change the color of the fourth communicator displayed in the MPI queue visualizer.
The defaults are:
Prism.comm1Color: chartreuse2 Prism.comm2Color: cyan2 Prism.comm3Color: magenta2 Prism.commOtherColor: purple
You can change the keys and key combinations that Prism translates into various actions. In general, doing this requires an understanding of X and Motif programming. You may be able to make some changes, however, by reading this section and studying the defaults in Prism's file in your system's app-defaults directory.
Use the Prism.textOneFieldTranslations resource to change the default keyboard translations for dialog boxes that contain only one text field. Its default definition is:
Prism.textOneFieldTranslations: <Key>osfDelete: delete-previous-character() <Key>osfBackSpace: delete-previous-character() Ctrl<Key>u: erase_to_beginning() Ctrl<Key>k: erase_to_end() Ctrl<Key>d: delete_char_at_cursor_position() ctrl<Key>f: move_cursor_to_next_char() Ctrl<Key>h: move_cursor_to_prev_char() Ctrl<Key>b: move_cursor_to_prev_char() Ctrl<Key>a: move_cursor_to_beginning_of_text() Ctrl<Key>e: move_cursor_to_end_of_text()
(The definitions with osf in them are special Motif keyboard symbols.)
Use the Prism.textManyFieldTranslations resource to change the default keyboard translations for dialog boxes that contain several text fields. Its default definition is:
Prism.textManyFieldTranslations: <Key>osfDelete: delete-previous-character() <Key>osfBackSpace: delete-previous-character() <Key>Return: next-tab-group() <Key>KP_Enter: next-tab-group() Ctrl<Key>u: erase_to_beginning() Ctrl<Key>k: erase_to_end() Ctrl<Key>d: delete_char_at_cursor_position() Ctrl<Key>f: move_cursor_to_next_char() Ctrl<Key>h: move_cursor_to_prev_char() Ctrl<Key>b: move_cursor_to_prev_char() Ctrl<Key>a: move_cursor_to_beginning_of_text() Ctrl<Key>e: move_cursor_to_end_of_text()
If you make a change to any field in one of these resources, you must copy all the definitions.
Prism uses the standard Motif translations that define the general mappings of functions to keys. They are shown below.
*defaultVirtualBindings: osfActivate : <Key>Return osfAddMode : Shift <Key>F8 osfBackSpace : <Key>BackSpace osfBeginLine : <Key>Home osfClear : <Key>Clear osfDelete : <Key>Delete osfDown : <Key>Down osfEndLine : <Key>End osfCancel : <Key>Escape osfHelp : <Key>F1 osfInsert : <Key>Insert osfLeft : <Key>Left osfMenu : <Key>F4 osfMenuBar : <Key>F10 osfPageDown : <Key>Next osfPageUp : <Key>Prior osfRight : <Key>Right osfSelect : <Key>Select osfUndo: <Key>Undo osfUp : <Key>Up
To change any of these, you must edit its entry in this resource. For example, if your keyboard doesn't have an F10 key, you could edit the osfMenuBar line and substitute another function key.
Note these points in changing this resource:
All entries in the resource must be included in your resource database if you want to change any of them; otherwise the omitted entries are undefined.
The entries in this resource apply to all Motif-based applications. If you want your changes to apply only to Prism, change the first line of the resource to Prism*defaultVirtualBindings.
By default, Prism creates a new Xterm for input to and output from a program. Set the Prism.useXterm resource to false to tell Prism not to do this. Instead, I/O will go to the Xterm from which you invoked Prism. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
By default, Prism flashes the command window when there is an error. Set the resource Prism.errorBell to true to tell Prism to ring the bell of your workstation instead. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
By default, Prism uses the standard Solaris make utility, /bin/make. Use the resource Prism.make to specify the path name of another version of make to use. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
By default, Prism prints diagonal lines over data in visualizers that has become "stale" because the program has continued execution from the spot where the data was collected. Set the resource Prism.markStaleData to false to tell Prism not to draw these diagonal lines. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
There are several resources you can use to affect the way help is displayed.
By default, graphical Prism uses the Netscape browser to display help information; see " Using the Browser-based Help System". Set the Prism.helpBrowser resource to the executable name of another browser to start; the name must be on your path. Graphical Prism supports Mosaic and Netscape browsers. You can include in the setting any browser-specific options that you want passed to the browser when Prism starts it up. (Note that these options do not take effect if Prism uses an existing browser; see below.)
If you already have a browser running when you request help from Prism, by default Prism displays the help information in this browser. Set the resource Prism.helpUseExisting to false if you want Prism to start a new browser. Set it to true to return to the default behavior.
There are two resources you can use to change the way Prism handles Fortran 90 generic procedures.
By default, Prism displays a menu (in commands-only Prism) or a dialog box when you attempt to set a breakpoint in a Fortran 90 generic procedure. Set the Prism resource Prism.procMenu to false to specify that Prism is to set the breakpoint in every one of these procedures, without displaying a menu or dialog box. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".
By default, commands-only Prism displays a maximum of 22 procedures in a menu when you attempt to perform an action (like setting a breakpoint) on a Fortran 90 generic procedure. If there are more than this number of specific procedures, Prism asks you whether you want to specify the name of a specific procedure or to view a menu. Use the Prism.procThresh resource to specify a different maximum. Set the resource to 0 to specify that there is to be no maximum.
Use the .prisminit file to initialize Prism when you start it up. You can put any Prism commands into this file. When Prism starts, it executes these commands, echoing them in the history region of the command window.
When starting up, Prism first looks in the current directory for a file called .prisminit. If the file is there, Prism uses it. If the file isn't there, Prism looks for it in your home directory. If the file isn't in either place, Prism starts up without executing a .prisminit file.
The .prisminit file is useful if there are commands that you always want to execute when starting Prism. For example,
If you always want to log command output, put a log command in the file; see Section " Logging Commands and Output".
If you want to use your own aliases for Prism commands, put the appropriate alias commands in the file; see " Creating Aliases for Commands and Variables".
Note that you don't need to put pushbutton or tearoff commands into the .prisminit file, because changes you make to the tear-off region are automatically saved when you leave Prism; see " Customizing Different Versions of Prism".
In the .prisminit file, Prism interprets lines beginning with # as comments. If \ is the final character on a line, Prism interprets it as a continuation character.