This chapter contains the following sections:
This section describes the menus found in the menu bar of the Parallel Analyzer View main window as shown in Figure 4-2. By selecting the dashed line (the first item in each of the menus), you can “tear off” the menu from the menu bar, so that it is displayed in its own window, with each menu command visible at all times. Some menus contain submenus, which can also be torn off and displayed in their own window.
The Admin menu contains general administrative commands and commands for launching and manipulating other WorkShop application views as shown in Figure 4-3. The commands are described as follows:
| “Save as Text” |
| |
| “Generate Trap File” |
| |
| “Icon Legend...” |
| |
| “Iconify” | stows all the open windows belonging to a given invocation of the Parallel Analyzer View as icons, as per the window manager you are using. | |
| “Raise” | brings all open windows in the current session to the foreground of the screen, in front of other windows. The command also opens any previously iconified windows belonging to a given invocation of the Parallel Analyzer View and brings them to the foreground. Shortcut: <Ctrl>-R | |
| “Launch Tool” | ||
| “Project” | See “Project Submenu”. | |
| “Exit” | quits the current session of the Parallel Analyzer View, closing all windows. If you have made changes to source files without updating them, a dialog box asks if it is okay to discard the changes. Click on OK only if you want to discard any changes you've made; otherwise, click on Cancel. |
The Launch Tool submenu contains commands for launching other WorkShop applications, as well as new sessions of the Parallel Analyzer (see Figure 4-5). In order to work properly with the other WorkShop applications, the files in the current fileset must have been loaded into the Parallel Analyzer from an executable using either the -e option on the command line (see “Starting the Parallel Analyzer View”) or the “Add Files from Executable” command found in the Fileset menu (see “Fileset Menu”). If launched from a session not based on an executable, the tools will be launched without arguments.
The applications launchable from the menu are the following:
If any of these tools is not installed on your system, the corresponding menu item will be grayed out.
If the file /usr/lib/WorkShop/system.launch is absent (that is, if you are running the Parallel Analyzer View without WorkShop 2.0 installed), the entire Launch Tool submenu will be grayed out.
The Project submenu contains commands that affect all the windows in a WorkShop project, that is, all the windows containing WorkShop or WorkShopProMPF applications that have been launched to manipulate a single executable as shown in Figure 4-6.
The Project submenu commands are as follows:
The Views menu (see Figure 4-7) contains commands for launching a variety of secondary windows, or views, the function each of which is described as follows:
| “Parallelization Control View” |
| |
| “Transformed Loops View” |
| |
| “PFA Analysis Parameters View” |
| |
| “Subroutines and Files View” |
|
The Fileset menu (see Figure 4-8) contains commands for manipulating the files displayed by the Parallel Analyzer View. The selections are as follows:
| “Rescan All Files” |
| |
| “Delete All Files” |
| |
| “Delete Selected File” |
| |
| “Add File” | adds a new source file to the current session of the Parallel Analyzer View. Selecting this command brings up a file and directory browser that lets you select a Fortran source file. Before you can select a given source file, you will need to run PFA on it. If the current session is based on an executable (see the “Add Files from Executable” command, described below), you cannot add files to it until you have deleted the executable's fileset. | |
| “Add Files from Fileset” |
| |
| “Add Files from Executable” |
|
The Operations menu contains commands for undoing changes to source files and for adding assertions and directives to loops as shown in Figure 4-9.
| “Run gdiff After Update” |
See the man page for gdiff(1) for more information on using gdiff. | |||
| “Run Editor After Update” |
If you always wish to run the editor, you can set the resource in your .Xdefaults file:
If you prefer a different window shell or a different editor, you can change the following resource in your .Xdefaults file, changing the xwsh and/or vi as you prefer:
The +%d tells vi at what line to position itself in the file and is replaced with 1 by default (you can also omit the +%d parameter if you wish). The edited file's name will either replace any explicit %s, or if the %s is omitted, the file name will be appended to the command. | |||
| “Update All Files” |
| |||
| “Update Selected File” |
|
The following accelarator keys are available through MPF:
| Ctrl-S | Admin -> Icon Legend... | |
| Ctrl-R | Admin -> Raise | |
| Ctrl-P | Views -> Parallelization Control View | |
| Ctrl-T | Views -> Transformed Loops View | |
| Ctrl-A | Views -> PFA Analyzis Parameters View | |
| Ctrl-F | Views -> Subroutines and Files View | |
| Ctrl-U | Update -> Update All Files |
This section describes the loop list and the various option menus and fields that manipulate the information shown in the loop list display as shown in Figure 4-13.
You may resize the loop list to reduce the number of loops displayed. You might have noticed that many figures in this manual show the loop list focused on the selected loop. The adjustment button is in the lower right hand corner of the loop list display, just above the loop information display. Your screen shows the full list unless you resize it.
The status line displays informative messages about the current status of the loop list, providing feedback on user manipulations of the current fileset.
The performance experiment line displays the name of the current experiment directory and the type of experiment data derived from the WorkShop Performance Analyzer (see “Launch Tool Submenu” for information on invoking the Performance Analyzer from the Parallel Analyzer View), as well as total data for the current caliper setting in the Performance Analyzer. If the Performance Analyzer is not being used, the performance experiment line displays <none>.
The loop list display lets you select and manipulate any Fortran DO loop contained in the source files loaded into the Parallel Analyzer View as part of the current session. The loops themselves are stacked as rows in the list display; information about the loops is displayed in columns, the contents of which are shown in Figure 4-14 and described below.
The columns in the loop list display contain the following information about each loop, from left to right:
| parallelization icon |
| |
| Workload and Perf. Cost (performance cost) |
Perf. Cost replaces Workload when the WorkShop Performance Analyzer is launched on the current fileset (see “Launch Tool Submenu”). Performance experiment data from the Performance Analyzer is then listed in place of workload data. As with Workload, the loops can be sorted by Perf. Cost via the sort option menu. When performance cost is shown, each loop's execution time is displayed as a percentage of the total execution time. This percentage includes all nested loops, subroutines, and function calls. | |
| Nest | ||
| Loop-ID | provides an ID for each loop in the list display. The ID is displayed indented to the right to reflect the loop's nesting level when the list is sorted in source order, and unindented otherwise. | |
| Variable | ||
| Subroutine | provides the name of the Fortran subroutine in which the loop occurs. | |
| Lines | provides the lines in the source file that comprise the body of the loop. | |
| Olid | provides a unique internal identifier for the loops generated by PFA. Please use this value when reporting bugs. | |
| File | provides the name of the Fortran source file that contains the loop. |
Clicking the left mouse anywhere in a given row highlights that loop in the list display, and typing text into the Search field (see “Loop List Search Field”) will do the same. Double-clicking on a row will bring up detailed information in the loop information display below the loop list display (see “Loop Information Display”).
You can use the loop list search field to find a specific loop in the loop list display. The field will match any text typed into it to the first instance of that text in the loop list display, and will highlight the row of the display in which that text occurs. The search field will match its text against the contents of each column in the loop list display.
As you type into the field, the list will highlight the first entry that matches what you have already typed, scrolling the list if necessary. If you type <Enter>, the highlight will move to the next match. If no match is found, the system will beep, and typing <Enter> will position the highlight at the top of the list again.
The sort option menu (see Figure 4-15) controls the order in which the loops are displayed in the loop list display. The choices are as follows:
| Sort In Source Order |
| |
| Sort By Performance Cost |
| |
| Sort By WorkLoad |
|
The show loop types option menu (see Figure 4-16) controls what kind of loops are displayed for each file and subroutine in the loop list display. The choices are as follows:
Show All Loop Types is the default setting.
Show Unparallelizable Loops shows only loops that could not be parallelized.
Show Parallelized Loops shows only loops that are parallelized.
Show Serial Loops shows only loops that are preferably serial.
Show Modified Loops shows only loops with pending changes.
The filtering option menu (see Figure 4-17) lets you display only those loops contained within a given subroutine or source file. The choices are as follows:
Double-clicking on a line in the Subroutines and Files View will cause the name of that subroutine or file to be inserted into the appropriate filter text field. If the appropriate type of filtering is currently selected, the loop list is rescanned.
The Loop List contains the buttons described below.
| Source | opens the Original Source window, with the source file containing the loop currently selected (double-clicked) in the loop list display. The body of the loop is highlighted within the window. For more information on the Original Source window, see “Original and Transformed Source Windows”. If no loop is selected, the last selected file is loaded; if no file is selected, the first file in the fileset will be loaded. | |
| Transformed Source | | |
| Next Loop | selects the next loop in the loop list display. The information in the loop information display and all other windows is updated accordingly. If no loop is currently selected, clicking on the button selects the first loop. | |
| Previous Loop | selects the previous loop in the loop list display. The information in the loop information display and all other windows is updated accordingly. If no loop is currently selected, clicking on the button selects the first loop. |
The loop information display provides detailed information on various loop parameters and allows you to alter those parameters so that the changes can be incorporated into the Fortran source. The display is divided into several information blocks displayed in a scrolling list as shown in Figure 4-18.
Each of these sections and the information it contains is described in detail below. This display is empty when no loop has been selected.
The first section contains controls for altering the parallelization of the selected loop that are described below. See Figure 4-20. On the far right, the first line of the Parallelization Controls section shows how many transformed loops were derived from the selected loop.
The loop status option menu lets you alter a loop's parallelization scheme. To the right of the option menu is a description of the current loop status as implemented in the transformed source. A small highlighting button appears to the left of this description if the status was set by a directive as shown in Figure 4-20. See Chapter 5, “Fine Tuning for PFA,” in the POWER Fortran Accelerator User's Guide for more information on the menu choices.
The menu choices are as follows:
| Default | always selects the parallelization scheme that PFA has picked for the selected loop. | |
| Prefer Parallel | adds the assertion C*$*ASSERT DO PREFER (CONCURRENT), which causes PFA to try to transform the selected loop into a parallel loop. If this is not possible, PFA will try to run each nested loop in parallel. | |
| Force Parallel | adds an assertion C*$*ASSERT DO (CONCURRENT), which causes PFA to ignore assumed data dependencies that would normally be considered obstacles to parallelization on the selected loop and any nested loops. | |
| Prefer Serial | adds the assertion C*$ASSERT DO PREFER (SERIAL), which prevents PFA from trying to parallelize the selected loop. | |
| Force Serial | adds the assertion C*$*ASSERT DO (SERIAL), which prevents PFA from trying to parallelize the selected loop or any loop that surrounds it. | |
| C$DOACROSS... |
| |
| C$PAR PDO... | launches a Parallel DO Dialog, which allows you to manipulate the scheduling clauses for the Parallel-DO and to set each of the referenced variables as either region-default or last-local. A Parallel-DO must be within a Parallel Region, although the tool does not enforce this restriction. If one is added outside of a region, the compiler will report an error. |
A menu choice is grayed out if you are looking at a read-only file, or you invoked cvpav with the -ro True option, or the loop comes from an included file. So in some cases you will not be allowed to change the menu setting.
The MP scheduling option menu lets you alter a loop's scheduling scheme by changing the C$MP_SCHEDTYPE and C$CHUNK directives. These directives affect the current loop and all subsequent loops in a source file. For control over a single loop, see “Parallelization Control View MP Scheduling Option Menu”.
The menu choices are as follows:
See Section 5.3, “Writing Parallel Fortran,” in the Fortran 77 Programmer's Guide for more information on the functions listed above.
To the right of the option menu is a description of the current loop scheduling scheme as implemented in the transformed source. A small highlighting button appears to the left of this description if, and only if, the scheduling scheme was set by a directive.
Below the scheduling description is an input field that allows you to set the CHUNK size for the scheduling scheme you select. When you change an entry in the field, the upper right corner of the field will turn down, indicating the change. To toggle back to the original value, left-click the turned-down corner (changed-entry indicator). The corner will unfold, leaving a fold mark. If you click again on the fold mark, you can toggle back to the changed value. You can enter a new value at any time; the field will always remember the original value, which will always be displayed after you click on the changed-entry indicator. See Figure 4-21.
Your entry should be syntactically correct, although it is not checked. The background color will indicate that you cannot make changes if you are looking at a read-only file, or you invoked cvpav with the -ro True option, or the loop comes from an included file; in some cases you will not be allowed to change the value.
In some cases, PFA asks one or more questions when it encounters a data dependence. The Parallel Analyzer View creates option menus allowing you to answer “Don't Know”, “Assert False”, or “Assert True” to each question as shown in Figure 4-22. When you click on the small highlighting button to the left of a question, an Original Source window opens (if necessary), highlighting the loop and the line that generated the question. For the questions, it also highlights a variable name.
Obstacles to parallelization are listed when PFA discovers aspects of a loop's structure that make it impossible to parallelize. See Figure 4-23. These are listed messages describing an obstacle, and each has a corresponding button directly to its left. When you left-click on one of these buttons, the Parallel Analyzer View highlights the troublesome line in the Original Source window, opening the window if necessary. If appropriate, the referenced variable or function call is highlighted in a contrasting color.
Assertions and directives are special POWER Fortran source comments used to tell PFA how to transform Fortran code. Directives enable, disable, or modify features of PFA when it runs on the source. Assertions provide PFA with additional information about the source code that can sometimes improve optimization. Figure 4-24 shows an assertion block and its option menu.
The Parallel Analyzer View lists assertions and directives along with buttons in the loop information display. Some are also listed with an option menu that allows you to “Keep”, “Delete”, or “Reverse” (if appropriate) the corresponding assertion or directive. When you left-click the small highlighting button to the left of an assertion or directive, an Original Source window shows the selected loop with the assertion or directive highlighted in the code. Assertions and directives that govern loop parallelization or scheduling do not have associated option menus; those functions are controlled by the loop status option menu and the MP scheduling option menu (see “Parallelization Controls”).
The views in this section are launched from the Views menu in the main menu bar of the Parallel Analyzer View. All of the views discussed in this section contain the following in their menu bars:
| Admin menu | contains a single “Close” command that closes the corresponding view | |
| Help menu | provides access to the on-line help system (see “Help Menu” for an explanation of the commands in this menu) |
The Parallelization Control View shows parallelization controls, where applicable, and all the variables referenced in the selected loop/PCF- construct/routine. In addition to being raised when ``C$DOACROSS'' or ``C$PAR PDO'' is selected for a loop, it can be raised from the Views menus, and it need not be closed to move from loop to loop. For loops, the variable list is obtained as in the previous releases, that is, from the analysis file; for other constructs, the variable list is obtained from the WorkShop Static Analyzer. If no response is received from the Static Analyzer, a dialog suggesting that you invoke it is raised. In addition, there is a text field for you to enter a comma-separated list of variables and an ``Add Variable'' button.
You can open this view by one of the following:
pulling down the Views menu of the Parallel Analyzer View and selecting “Parallelization Control View” (see “Views Menu”)
selecting either “C$DOACROSS...” from the loop status option menu in the loop information display
selecting either “C$PAR PDO...” from the loop status option menu in the loop information display
Figure 4-25 displays the view when it is launched from the Views menu, with the loop status option menu set to Default.
Both the C$DOACROSS and C$PAR PDO modes of the Parallelization Control View contain the following items:
| Admin menu | Contains only one selection, “Close,” which closes the View. | |
| MP Scheduling menu |
| |
| “MP chunk size” text field |
| |
| Variable Option menus |
| |
| Add Variable button |
| |
| “List to add” text field |
|
For further details on the C$DOACROSS and C$PAR PDO modes of the Parallelization Control View, see “C$DOACROSS Parallelization Control View” and “C$PAR PDO Parallelization Control View”.
The Parallelization Control View contains an MP scheduling option menu (see Figure 4-26) identical to the one that appears for a selected loop in the loop information display. This option menu affects the MP_SCHEDTYPE and CHUNK clauses in the C$DOACROSS directive, which affect only the currently selected loop.
The menu choices are as follows:
Below the MP scheduling option menu is a display area containing each of the variables found in the selected loop. Each variable name is displayed to the right of a highlighting button. To the left of each button is a variable option menu. An icon to the left of the menu displays the read/write status of the variable; see “Icon Legend” for an explanation of these icons. Clicking on the small highlighting buttons opens an Original Source window that displays each instance of the variable within the loop in highlighted form.
An option menu (see Figure 4-27) allows you to select the variable type. The choices are as follows:
The $DOACROSS Parallelization Control View opens when you select “C$DOACROSS...” from the loop status option menu in the loop information display as shown in Figure 4-28.
The C$DOACROSS Parallelization Control View contains the following items:
| “Condition for parallelization” text field |
| |
| MP Scheduling menu |
| |
| “MP chunk size” text field |
| |
| Variable Option menus |
|
The C$PAR PDO Parallelization Control View opens when “C$PAR PDO...” is selected from the loop status option menu in the loop information display as shown in Figure 4-29.
The C$PAR PDO Parallelization Control View contains the following items:
| MP Scheduling menu |
| |
| “MP chunk size” text field |
| |
| Synchronization Construct menu |
you to set the synchronization at the end of the construct to either “Wait” or “No Wait.” | |
| Variable Option menus |
|
The Transformed Loops View (see Figure 4-31) contains information about how each loop selected from the loop list display is rewritten by PFA into one or more transformed loops. You can open this view by pulling down the Views menu of the Parallel Analyzer View and selecting the “Transformed Loops View” command (see “Views Menu”).
Each transformed loop is displayed in its own section of the scrolling display within the Transformed Loops View. Each transformed loop has a highlighting button associated with it. This button is directly to the right of the parallelization icon describing the loop's parallelization status. Left-clicking on this button opens the Transformed Source window (if necessary), showing the original loop and the selected transformed loop.
The next two lines describe the transformed loop, listing the following information about it:
whether it is a primary loop (directly transformed from the selected original loop) or a secondary loop (transformed from a different original loop but incorporating some code from the selected original loop)
its parallelization status
whether it is an ordinary loop or an interchanged loopits nesting levelits workloadthe corresponding lines in the transformed source
the name of the file in which it is located
In addition to this information, each transformed loop also may list one or more messages, which and are presented with small highlighting buttons to the left of each message. These are messages from PFA describing some aspect of the loop transformation. Left-clicking on a message button opens an Original Source window showing the original, untransformed loop and highlighting the line of the loop to which the message corresponds.
The PFA Analysis Parameters View contains a list of PFA execution parameters accompanied by fields into which you can enter new values for the parameters. When you update a source file, any PFA parameters you alter will be changed for that file. See Figure 4-32. For a description of the changed-entry indicators, see “MP Scheduling Chunk Size Field”.
A full explanation of the PFA parameters listed in this view can be found in Chapter 4, “Customizing PFA Execution,” in the POWER Fortran Accelerator User's Guide.
The Subroutines and Files View contains a list from the file in the current session of the Parallel Analyzer View as shown in Figure 4-33. Below each file listing is an indented list of the Fortran subroutines in each file. You can select any file or subroutine by left-clicking on it. You can delete or save changes to a file selected in this view by subsequently selecting the appropriate item from the Parallel Analyzer View menu bar. If a file has been scanned correctly or a subroutine has no errors, a green check mark appears to the left of the file or subroutine listing. If any changes have been made to loops in the file using the Parallel Analyzer View, a red plus sign is above the green check mark to the left of the file listing. If a file could not be scanned or a subroutine had errors, a red international “not” symbol replaces the check mark, denoting an error.
If filtering by file or by subroutine is selected from the filtering option menu in the Parallel Analyzer View (see “Filtering Option Menu”), double-clicking on a file or subroutine from the Subroutines and Files view will automatically insert the name into the appropriate filtering text field; if that choice is currently selected from the filtering option menu, the loop list is rescanned.
The Search field matches against subroutine and file names listed in the Subroutines and Files View. The matching occurs as you type; the first name in the list that matches what has already been typed is selected. If there is no match, the system will beep in response.
The Original Source window and the Transformed Source window together present a before and after view of the source code. The former is a view of the source before PFA has run on it, the latter is a view of the source after PFA has parallelized it as shown in Figure 4-34. The two windows use the WorkShop Source View interface.
Both the Original Source and Transformed Source windows contain bracket annotations in the left margin that mark the location and nesting level of each loop in the source file. Clicking on a loop bracket selects and highlights the corresponding loop.
In a Transformed Source window, an indicator bar (vertical line in a different color) indicates each loop that was transformed from the selected original loop.
If the source windows are invoked from a session linked to the WorkShop Performance Analyzer (see “Launch Tool Submenu”), any displayed sources files known to the Performance Analyzer will be annotated with performance data.
The Icon Legend dialog box provides a key explaining the meaning of the icons that appear in the Parallel Analyzer View, the Transformed Loops View, the Subroutines and Files View, and Custom DOACROSS Dialog box. See Figure 4-35.