Chapter 4. Parallel Analyzer View Reference

Figure 4-1. Icon for cvpav


This chapter describes in detail the function of each window, menu, and display in the WorkShopProMPF Parallel Analyzer View's user interface. Figure 4-1 shows the application's icon.

This chapter contains the following sections:

Main View Menu Bar

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.

Figure 4-2. Parallel Analyzer View Menu Bar


Admin Menu

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:

Figure 4-3. Main View Admin Menu


“Save as Text” 


saves the complete loop information for all files and subroutines in the current session into a plain ASCII file. Selecting “Save as Text” brings up the directory and file browser, which lets you select where to save the file and what name to call it (see Figure 4-4). The default directory is the same one the Parallel Analyzer View was invoked from at the shell prompt; the default file name is Text.out. The Parallel Analyzer View will ask for confirmation before overwriting an existing file.

Figure 4-4. Directory and File Browser Window


“Generate Trap File”  


generates a file for use in conjunction with the WorkShop Trap Manager. The trap file specifies sample traps at the entry and exit to each outer loop. See Chapter 3, “A Short Debugger Tutorial,” in the Debugger User's Guide for more information on trap files and the Trap Manager. The default directory is the same one the Parallel Analyzer View was invoked from at the shell prompt; the default file name is cvmpTrapFile. The Parallel Analyzer View will ask for confirmation before overwriting an existing file.

“Icon Legend...” 


opens the Icon Legend dialog box, which provides an explanation of the graphical icons used in the Parallel Analyzer View. See “Icon Legend”. Shortcut: <Ctrl>-S

“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” 

See “Launch Tool Submenu”.

“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.

Launch Tool Submenu

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.

Figure 4-5. Launch Tool Submenu


The applications launchable from the menu are the following:

Build Manager  


Launches the Build Manager, a utility that lets you compile software without leaving the WorkShop environment. See Appendix B, “Using the Build Manager,” in the Developer Magic: Debugger User's Guide for further information.

WorkShop Debugger  


Launches the Debugger, a UNIX source-level debugging tool that provides special windows (views) for displaying program data and execution status. See Chapter 1, “Getting Started with the WorkShop Debugger,” in the Developer Magic: Debugger User's Guide for further information.

Parallel Analyzer  


Launches another session of the parallel analyzer.

Performance Analyzer  


Launches the Performance Analyzer, a utility that collects performance data and allows you to analyze the results of a test run. See Chapter 1, “Introduction to the Performance Analyzer,” in the Developer Magic: Performance Analyzer User's Guide for further information.

Static Analyzer  

Launces the Static Analyzer, a utility which allows you to analyze and display source code written in C, C++, Fortran, or Ada. See Chapter , “Introduction to the WorkShop Static Analyzer,” in the Developer Magic: Static Analyzer User's Guide for further information.

Tester  

Launches the Tester, a UNIX-based software quality assurance toolset for dynamic test coverage over any set of tests. See Chapter 5, “Using Tester,” in the Developer Magic: Performance Analyzer User's Guide for further information.

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.

Project Submenu

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.

Figure 4-6. Project Submenu Commands


The Project submenu commands are as follows:

“Iconify”  

stows all the windows in the current project as icons, as per the window manager you are using.

“Raise”  

brings all open windows in the current project to the foreground of the screen, in front of other windows. The command also opens any previously iconified windows in the current project and brings them to the foreground.

“Remap Paths...” 


lets you modify the set of mappings used to redirect references to file names located in your code to their actual locations in your file system. However, if you compile your code on one tree and mount it on another, you may need to remap the root prefix to access the named files.

“Project View...”  

launches the WorkShop Project View, a tool that helps you manage project windows.

“Exit”  

quits the current project, 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 disregard any changes you've made; otherwise, click on Cancel.

Views Menu

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:

Figure 4-7. Views Menu


“Parallelization Control View” 


opens a Parallelization Control View for the looper currently selected (double-clicked) from the loop list display. For more information on this view, see “Parallelization Control View”. Shortcut: <Ctrl>-T

“Transformed Loops View” 


opens a Transformed Loops View for the loop currently selected (double-clicked) from the loop list display. For more information on this view, see “Transformed Loops View” Shortcut: <Ctrl>-T

“PFA Analysis Parameters View” 


opens the PFA Analysis Parameters View, which provides a means of modifying a variety of PFA parameters. This view is further described in “PFA Analysis Parameters View”. Shortcut: <Ctrl>-P

“Subroutines and Files View” 


opens the Subroutines and Files View, which provides a complete list of subroutine and file names currently being examined within the current session of the Parallel Analyzer View. This view is further described in “C$DOACROSS Parallelization Control View”. Shortcut: <Ctrl>-F

Fileset Menu

The Fileset menu (see Figure 4-8) contains commands for manipulating the files displayed by the Parallel Analyzer View. The selections are as follows:

Figure 4-8. Fileset Menu


“Rescan All Files” 


causes the Parallel Analyzer View to check and update all the source files loaded into its current session to match the versions of those files in the file system. It will only reread the files it needs to.

“Delete All Files” 


removes all files from the current session of the Parallel Analyzer View. You can then add new files using the “Add File”, “Add Files from Fileset”, or “Add Files from Executable” commands, described below.

“Delete Selected File” 


deletes a selected file from the current session of the Parallel Analyzer View. You can select a file for deletion by double-clicking with the left mouse button within the Subroutines and Files View on the line corresponding to the desired file name.

“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” 


lets you add a list of new source files to the current session of the Parallel Analyzer View. A fileset is a list of source file names contained in an ASCII file, each on a separate line. Selecting the “Add Files from Fileset” command will bring up the file and directory browser as it does for the “Add File” command. If you select a file containing a fileset list, all Fortran source files in the list are loaded into the current session (other files in the list are ignored). If the current session is based on an executable (see “Add Files From Executable”), you cannot add files to it until you have deleted the executable's fileset.

“Add Files from Executable” 


imports all the Fortran source files listed in the symbol table of a compiled Fortran application. This command will only work if there are no files in the current session of the Parallel Analyzer View when the command is selected from the menu. Other WorkShop applications (see “Launch Tool Submenu”) will also be able to operate on files imported from an executable.

Operations Menu

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.

Figure 4-9. Operations Menu and Submenus


“Undo Changes to Loop” 


removes any non-updated changes to the currently selected loop that were made using the option menus in the loop information display. Changes that have already been written to the source file using the Update menu commands cannot be undone.

“Undo All Changes” 


removes any non-updated changes to all the loops in the current fileset. Changes that have already been written to the source file using the Update menu commands cannot be undone.

The Add Assertion Submenu 


contains a set of PFA assertions that you can select in order to add them to the currently selected loop. These assertions are explained in detail in “Appendix C, PFA Assertions” in the POWER Fortran Accelerator User's Guide.

The Add Directive Submenu 


contains a set of PFA directives that you can select in order to add them to the currently selected loop. These directives are explained in detail in “Appendix B, PFA Directives” in the POWER Fortran Accelerator User's Guide.

“Add Parallel Region” 


allows you to add a parallel region PCF construct.

“Add Barrier Synchronization” 


allows you to add a barrier synchronization PCF construct.

The Add Section Submenu 


allows you to add a parallel-, critical- or one- processor-section. To use them, bring up the source on any loop or construct in the file, and using the mouse, sweep out a range of lines for the new construct in the Source View. Then invoke the appropriate menu item to add the new construct.

When you add a new construct, the list is redrawn with the new construct in place, and the new construct is selected. Brackets defining the new constructs are NOT added to the file loop annotations. The Parallel Analyzer does not enforce any of the semantic restrictions on how parallel regions and or sections must be constructed. When you add nested regions or constructs, be careful that they are properly nested: they must each begin and end on distinct lines. For example, if you add a parallel region and a nested critical section that end at the same line, the terminating directives will be not be in the correct order.

Update Menu

Figure 4-10. Update Menu


The Update menu (see Figure 4-10) contains commands for managing changes to PFA directives and assertions made in the Parallel Analyzer View to your Fortran source code.

“Run gdiff After Update” 


sets a toggle switch that will cause a gdiff window to open after you have updated changes to your source file. This window graphically illustrates the differences between the unchanged source and the newly updated source. If you always wish to see the gdiff window, you may set the resource in your .Xdefaults file:

cvpav*gDiff: True

See the man page for gdiff(1) for more information on using gdiff.

“Run Editor After Update” 


sets a toggle switch that will cause an xwsh shell window with the vi editor running it to open the updated source file. See Figure 4-11.

Figure 4-11. Viewing the Updated Source in an Editor


If you always wish to run the editor, you can set the resource in your .Xdefaults file:

cvpav*runUserEdit: True

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:

cvpav*userEdit: xwsh -e vi %s +%d

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” 


writes all changes made to loops in the current session of the Parallel Analyzer View to the appropriate source files. Shortcut: <Ctrl>-U

“Update Selected File” 


writes changes made to loops found within a selected file from the current session of the Parallel Analyzer View. You can select a file for saving by double-clicking with the left mouse button within the Subroutines and Files View on the line corresponding to the desired file name. See “C$DOACROSS Parallelization Control View”.

Help Menu

Figure 4-12. Help Menu


The Help menu contains commands that allow you to access on-line information and documentation for the Parallel Analyzer View as shown in Figure 4-12.

“On Version...” 


opens a window containing version number information for the Parallel Analyzer View.

“On Window...” 


invokes the Help Viewer, which displays a descriptive overview of the current window or view and its graphical user interface.

“On Context” 

invokes context-sensitive help. When you select the “On Context” command, the normal mouse cursor (an arrow) is replaced with a question mark. When you click on graphical features of the application with the left mouse or position the cursor over the feature and press the <F1> key, the Help Viewer displays information on that context.

“Index...” 

invokes the Help Viewer, that displays the list of available help topics, which you can browse alphabetically, hierarchically, or graphically.

Keyboard Shortcuts

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

Loop List

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.

Figure 4-13. Loop List Display and Controls


Status and Performance Experiment Lines

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>.

Loop List Display

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.

Figure 4-14. Column Headings for the Loop List Display


The columns in the loop list display contain the following information about each loop, from left to right:

parallelization icon 


describes the parallelization status of each loop. The meaning of each of these icons is described in the Icon Legend dialog box (see “Icon Legend”). When a loop is displayed in the loop information display (by double-clicking with the left mouse button elsewhere in the loop's row), a green check mark is placed to the left of the icon to indicate that it has been examined. If any changes are made from within the loop information display, a red plus sign is placed above the check mark.

Workload and Perf. Cost (performance cost) 


allow you to gauge loop performance. Workload provides a means of roughly determining the relative amount of work done in each iteration of the loop. The loops can be sorted in the loop list display by the workload value, instead of by physical ordering in the file. See “Sort Option Menu”. Workload is displayed when no performance data (from the WorkShop Performance Analyzer) is available.

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 

shows the nesting level of the given loop.

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 

provides the name of the loop index 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”).

LoopListSearchField

Loop List Search Field

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.

Sort Option Menu

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:

Figure 4-15. Sort Option Menu


Sort In Source Order  


orders the loops as they appear in the source file. This is the default setting.

Sort By Performance Cost 


orders the loops by their performance cost (from greatest to least) as calculated by the Workshop Performance Analyzer. You need to have invoked the Performance Analyzer from the current session of the Parallel Analyzer View to make use of this option. See “Launch Tool Submenu” for information on how to open the Performance Analyzer from the current session of the Parallel Analyzer View.

Sort By WorkLoad 


orders the loops from largest to smallest workload.

Show Loop Types Option Menu

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:

Figure 4-16. Show Loop Types Menu


  • 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.

Filtering Option Menu

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:

Figure 4-17. Filtering Option Menu


No Filtering 

is the default setting.

Filter By Subroutine 


lets you enter a subroutine name into a filtering text field that appears above the option menu. Only loops contained in that subroutine will be displayed in the loop list display.

Filter By File  

lets you enter a Fortran source file name into a filtering text field that appears above the option menu. Only loops contained in that file will be displayed in the loop list display.

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.

Loop List Buttons

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  


opens a Transformed Source window, with the PFA-processed 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 Transformed 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.

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.

Loop Information Display

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.

Figure 4-18. Loop Information Display


Each of these sections and the information it contains is described in detail below. This display is empty when no loop has been selected.

Figure 4-19. Highlighting Button


A highlighting button (light bulb, see Figure 4-19 and Figure 4-20) appears as a shortcut to related information. Clicking the button opens an Original Source window (if necessary), highlighting the loop and the line that generated the question.

Parallelization Controls

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.

Figure 4-20. Parallelization Controls


Loop Status Option Menu

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...  


adds the directive C$DOACROSS, which tells the Fortran compiler to generate parallel code for the selected loop without any interference by PFA. Selecting this item opens the Custom DOACROSS Dialog box. See “C$DOACROSS Parallelization Control View” for more information.

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.

MP Scheduling Option Menu

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:

Default 

always selects the scheduling scheme that PFA has picked for the selected loop.

Simple  

divides iterations of the selected loop among the processors by dividing them into contiguous pieces, and assigns one to each processor.

Dynamic  

divides iterations of the selected loop among the processors by dividing them into pieces of size CHUNK. As each processor finishes a piece, it enters a critical section to grab the next piece. This scheme provides good load balancing at the price of higher overhead.

Interleaved  

divides the iterations into pieces of size CHUNK and the execution of those pieces is interleaved among the processors. For example, if there are four processors and CHUNK=2, then the first processor executes iterations 1-2, 9-10, 17-18,...; the second processor executes iterations 3-4, 11-12, 19-20,...; and so on.

Guided-Self  

divides the iterations into pieces. The size of each piece is determined by the number of total iterations remaining. By parceling out relatively large pieces to start with and relatively small pieces toward the end, the idea is to achieve good load balancing while reducing the number of entries into the critical section.

Run-time  

lets the user specify the scheduling type at run-time.

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.

MP Scheduling Chunk Size Field

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.

Figure 4-21. MP Chunk Size Input Field Changed


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.

Questions

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.

Figure 4-22. Questions Information Block


Obstacles to Parallelization

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.

Figure 4-23. Obstacles Information Block


Assertions and Directives

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.

Figure 4-24. Assertion Information Block


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”).

PFA Messages

PFA sometimes generates messages describing aspects of the loops it creates by transforming original source loops. The Parallel Analyzer View displays these messages; some also have associated buttons that highlight sections of the selected loop in the Original Source window.

Other Views

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)

Parallelization Control View

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.

Figure 4-25. Parallelization Control View


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 


Allows you to alter a loop's scheduling scheme by changing the C$MP_SCHEDTYPE and C$CHUNK directives. See “Parallelization Control View MP Scheduling Option Menu” for futher information.

“MP chunk size” text field 


Allows you to set the CHUNK size for the scheduling scheme you select.

Variable Option menus 


Allows you to select the variable type. See “Parallelization Control View Variable Option Menus” for further information.

Add Variable button 


Allows you to add new variables to a loop.

“List to add” text field 


Allows you to indicate the variables you wish to add to the loop. You may enter multiple variables, with each variable name separated by a space or comma.

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”.

Parallelization Control View MP Scheduling Option Menu

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.

Figure 4-26. MP Scheduling Option Menu


The menu choices are as follows:

Default 

always selects the scheduling scheme that PFA has picked for the selected loop.

Simple  

divides iterations of the selected loop among the processors by dividing them into contiguous pieces, and assigns one to each processor.

Dynamic  

divides iterations of the selected loop among the processors by dividing them into pieces of size CHUNK. As each processor finishes a piece, it enters a critical section to grab the next piece. This scheme provides good load balancing at the price of higher overhead.

Interleaved  

divides the iterations into pieces of size CHUNK and the execution of those pieces is interleaved among the processors. For example, if there are four processors and CHUNK=2, then the first processor executes iterations 1-2, 9-10, 17-18,...; the second processor executes iterations 3-4, 11-12, 19-20,...; and so on.

Guided-Self  

divides the iterations into pieces. The size of each piece is determined by the number of total iterations remaining. By parceling out relatively large pieces to start with and relatively small pieces toward the end, the idea is to achieve good load balancing while reducing the number of entries into the critical section.

Run-time  

lets the user specify the scheduling type at run-time.

Parallelization Control View Variable Option Menus

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:

Figure 4-27. Variable Type Option Menu


Shared  

One copy of the variable is used by all threads of the MP process.

Local  

Each thread has its own copy of the variable.

Last-local  

Similar to Local, except the value of the variable after the loop will be as the logically-last iteration would leave it.

Reduction  

A sum/product/min/max computation of the variable can be done partially in each thread and then combined afterwards.

C$DOACROSS Parallelization Control View

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.

Figure 4-28. C$DOACROSS Parallelization Control View


The C$DOACROSS Parallelization Control View contains the following items:

“Condition for parallelization” text field 


Allows you to enter a Fortran conditional statement (for example, NSIZE .GT. 83). This statement determines the circumstances under which the loop will be parallelized. The upper right corner of the field changes when you type in the field. Your entry must be syntactically correct; it is not checked.

MP Scheduling menu 


Allows you to alter a loop's scheduling scheme by changing the C$MP_SCHEDTYPE and C$CHUNK directives. See “Parallelization Control View MP Scheduling Option Menu” for futher information.

“MP chunk size” text field 


Allows you to set the CHUNK size for the scheduling scheme you select. See “MP Scheduling Chunk Size Field” for further information.

Variable Option menus 


Allows you to select the variable type. See “Parallelization Control View Variable Option Menus” for further information.

C$PAR PDO Parallelization Control View

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.

Figure 4-29. C$PAR PDO Parallelization Control View


The C$PAR PDO Parallelization Control View contains the following items:

MP Scheduling menu 


Allows you to alter a loop's scheduling scheme by changing the C$MP_SCHEDTYPE and C$CHUNK directives. See “Parallelization Control View MP Scheduling Option Menu” for futher information.

“MP chunk size” text field 


Allows you to set the CHUNK size for the scheduling scheme you select. See “MP Scheduling Chunk Size Field” for further information.

Synchronization Construct menu 


Allows

Figure 4-30. Synchronization Construct Menu


you to set the synchronization at the end of the construct to either “Wait” or “No Wait.”

Variable Option menus 


Allows you to select the variable type. See “Parallelization Control View Variable Option Menus” for further information.

Transformed Loops View

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”).

Figure 4-31. Transformed Loops View


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.

PFA Analysis Parameters View

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”.

Figure 4-32. PFA Analysis Parameters View


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.

Subroutines and Files View

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.

Figure 4-33. Subroutines and Files View


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.

Original and Transformed Source Windows

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.

Figure 4-34. Original and Transformed Loop Source Windows


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.

Icon Legend

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.

Icon Legend Buttons

The Icon Legend also contains two buttons, described below.

Close  

closes the Icon Legend.

Help  

opens the WorkShop Help Viewer for on-line help in using the Icon Legend.

Figure 4-35. Parallelization Icon Legend