Chapter 6. Parallel Analyzer View Reference

This chapter describes in detail the function of each window, menu, and display in the ProDev ProMP Parallel Analyzer View's user interface. It contains the following main sections:

Parallel Analyzer View Main Window

The main window is displayed when the Parallel Analyzer View begins. It consists of the following elements, shown in Figure 6-1:

Parallel Analyzer View Menu Bar

This section describes the menus found in the menu bar located at the top of the Parallel Analyzer View main window.

Within each menu, the names of some options are followed by keyboard shortcuts, which you can use instead of the mouse for faster access to these options. For a summary, see “Keyboard Shortcuts”.

You can tear off a menu from the menu bar, so that it is displayed in its own window with each menu command visible at all times, by selecting the dashed line at the top of the menu (the first item in each of the menus). Submenus can also be torn off and displayed in their own window.

Admin Menu

The Parallel Analyzer View Admin menu contains file-writing commands, other administrative commands, and commands for launching and manipulating other WorkShop application views.

The commands in the Admin menu have the following effects:

  • Save as Text: saves the complete loop information for all files and subroutines in the current session in a plain ASCII file. Choosing Admin -> Save as Text brings up a File Selection dialog, which lets you choose where to save the file and what name to call it. (See Figure 6-2.)

    The default directory is the one from which you invoked the Parallel Analyzer View; the default filename is Text.out. The Parallel Analyzer View asks for confirmation before overwriting an existing file.

    Figure 6-2. Output Text File Selection Dialog

    Output Text File Selection Dialog

  • Icon Legend: provides an explanation of the graphical icons used in several of the views. Shortcut: Ctrl+S. See “Icon Legend... Option”.

  • Iconify: stows all the open windows belonging to a given invocation of the Parallel Analyzer View as icons in the style of 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 the invocation of the Parallel Analyzer View and brings them to the foreground. Shortcut: Ctrl+R.

  • Launch Tool: opens various WorkShop tools. See “Launch Tool Submenu”.

  • Project: controls project windows. See “Project Submenu”.

  • Exit: quits the current session of the Parallel Analyzer View, closing all windows.

    If you have not updated source files and have pending requests for changes, a dialog box asks if it is OK to discard the changes. Click OK only if you want to discard any changes; otherwise, click Cancel to update the files.

Icon Legend... Option

This Admin menu option opens the Parallelization Icon Legend which provides the meanings of the icons that appear in various views, such as the following:

Launch Tool Submenu

The Admin menu's Launch Tool submenu contains commands for launching other WorkShop tools, as well as new sessions of the Parallel Analyzer.

To work properly with the other WorkShop tools, the files in the current fileset must have been loaded into the Parallel Analyzer from an executable. There are two ways to do this:

  • Use the -e option on the command line.

  • Choose the Fileset -> Add File menu option.

If you launch Workshop tools from a session not based on an executable, the tools start without arguments.

The following options launch applications from the Launch Tool submenu:

  • Build Analyzer: launches the Build Manager, a utility that lets you compile software without leaving the WorkShop environment. For more information, see the ProDev WorkShop: Debugger User's Guide.

  • Debugger: launches the WorkShop Debugger, a source-level debugging tool that provides special windows for displaying program data and execution status. For more information, see the ProDev WorkShop: Debugger User's Guide

  • 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. For more information, see the ProDev WorkShop: Performance Analyzer User's Guide.

  • Static Analyzer : launches the Static Analyzer, a utility that allows you to analyze and display source code written in C, C++, or Fortran. For more information, see the ProDev WorkShop: Static Analyzer User's Guide.

  • Tester: launches the Tester, a UNIX-based software quality assurance tool set for dynamic test coverage over any set of tests. For more information, see the ProDev WorkShop: Tester User's Guide.

If any of these tools is not installed on your system, the corresponding menu item is 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 is grayed out.

Project Submenu

The Project submenu of the Admin menu contains commands that affect all the windows containing WorkShop or ProDev ProMP applications that have been launched to manipulate a single executable. The set of windows is a WorkShop project. The Project submenu and windows that you can open from it are shown in Figure 6-3.

The Project submenu commands are as follows:

  • Iconify: stows all the windows in the current project as icons, in the style of 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 filenames 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, including those of related open applications. Thus the Source View closes, as well as, for example, the Parallel Analyzer.

    If you have not updated source files and have pending requests for changes, a dialog box asks if it is OK to discard the changes. Click OK only if you want to discard any changes; otherwise, click Cancel and update the files.

Figure 6-3. Project Submenu and Windows

Project Submenu and Windows

Views Menu

The Views menu of the Parallel Analyzer View contains commands for launching a variety of secondary windows, or views, that provide specific sets of information about, and tools to apply to, selected loops.

The options in the Views menu have the following effects:

  • Parallelization Control View: opens a Parallelization Control View for the loop currently selected from the loop list display. Shortcut: Ctrl+P. For more information on this view, see “Parallelization Control View”.

  • Transformed Loops View: opens a Transformed Loops View for the loop currently selected from the loop list display. Shortcut: Ctrl+T. For more information on this view, see “Transformed Loops View”.

  • PFA Analysis Parameters View: opens the PFA Analysis Parameters View, which provides a means of modifying a variety of PFA parameters. Shortcut: Ctrl+A. This view is further described in “PFA Analysis Parameters View”.

  • Subroutines and Files View: opens the Subroutines and Files View, which provides a complete list of subroutine and file names being examined within the current session of the Parallel Analyzer View. Shortcut: Ctrl+F. This view is further described in “Subroutines and Files View”.

Fileset Menu

The Fileset menu contains commands for manipulating the files displayed by the Parallel Analyzer View. A fileset is a list of source filenames contained in an ASCII file, each on a separate line.

The options in the Fileset menu have the following effects:

  • Rescan All Files: the Parallel Analyzer View checks and updates all the source files loaded into its current session so they match the versions of those files in the file system. The Parallel Analyzer View rereads only 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 options, described below.

  • Delete Selected File: deletes a selected file from the current session of the Parallel Analyzer View. To select a file for deletion, open the Subroutines and Files View and double-click the desired filename.

  • Add File: adds a new source file to the current session of the Parallel Analyzer View. Selecting this command brings up a File Selection dialog that lets you select a Fortran source file.

    Before you can select a given source file, you must compile it to create the .anl file needed by the Parallel Analyzer View. (See “Compiling a Program for ProMP Use” in Chapter 1.)

    If the current session is based on an executable, you cannot add files to it until you have deleted the executable's fileset. (See the Add Files from Executable option, described below.)

  • Add Files from Fileset: lets you add a list of new source files to the current session of the Parallel Analyzer View. Choosing this command brings up a File Selection dialog as it does for the Add File option. 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, 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 works only if there are no files in the current session of the Parallel Analyzer View when the command is selected from the menu. Selecting this command brings up a File Selection dialog as it does for the Add File option. Other WorkShop applications can also operate on files imported from an executable.

Update Menu

The Parallel Analyzer View Update menu contains commands for placing requested changes to directives and assertions in your Fortran source code.

The options in the Update menu have the following effects:

  • Run gdiff After Update: sets a checkbox that causes a gdiff window to open after you have updated changes to your source file. This window illustrates in a graphical manner 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

    For more information on using gdiff, see the man page for gdiff(1).

  • Run Editor After Update: sets a checkbox that opens an xwsh shell window with the vi editor on the updated source file.

    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 modify the resource in your .Xdefaults file and change from xwsh or vi as you prefer. The following is the default command in the .Xdefaults, which you can edit for your preference:

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

    In the above command, 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 either replaces any explicit %s, or if the %s is omitted, the filename is appended to the command.

  • Update All Files: writes to the appropriate source files all changes to loops requested during the current session of the Parallel Analyzer View. Shortcut: Ctrl+U.

  • Update Selected File: writes to a selected file changes to loops requested during the current session of the Parallel Analyzer View. You choose a file for updating by double-clicking in the Subroutines and Files View the line corresponding to the desired filename. (See also “Subroutines and Files View”.)

  • Force a Build to Start: performs the Update All Files option and starts a build.

Configuration Menu

The Configuration menu allows you to choose between having the Parallel Analyzer View use OpenMP or PCF directives.

The options are the following:

  • OpenMP: causes the Parallel Analyzer View to use OpenMP directives.

  • PCF: causes the Parallel Analyzer View to use PCF directives.

Operations Menu

The Parallel Analyzer View Operations menu contains commands for adding assertions and directives to loops, and removing pending changes to source files (Figure 6-4). The general effects of the Operations menu options are to prepare a set of requested changes to your source code. For information on how these changes are subsequently performed see “Update Menu”.

Figure 6-4. Operations Menu and Submenus

Operations Menu and Submenus

The Operations menu is one of two points in the Parallel Analyzer View where you can add assertions and directives. The other point is discussed in “Loop Parallelization Controls in the Loop Information Display”. These two menus focus on different aspects of the parallelization task:

  • The Operations menu focuses on automatic parallelization directives, which may be inserted in code by the MIPSpro Auto-Parallelizing Option, and memory distribution.

  • The parallelization controls in the loop information display focus on manual (that is, not automatic) parallelization controls, which you can insert to further parallelize your code.

The assertions and directives you can add from the Operations menu are described in the following lists.

  • C*$* ASSERT CONCURRENT CALL: ignore dependences in subroutine calls that would inhibit parallelizing.

  • C*$* ASSERT PERMUTATION (array_name ): Array array_name is a permutation array.

  • C*$* CONCURRENTIZE: selectively override C*$* NOCONCURRENTIZE: typically inserted during automatic parallelization.

  • C*$* NOCONCURRENTIZE: do not parallelize file subroutine (depending on placement). Typically inserted during automatic parallelization.

  • C$SGI DISTRIBUTE, C$SGI REDISTRIBUTE : distribute array storage among processors. For Origin2000 systems.

  • C*$* PREFETCH_REF: load data into cache. May be used with nonconcurrent code.

  • C$SGI DYNAMIC: allow run-time array redistribution. For Origin2000 systems.

  • C$OMP FLUSH: identifies synchronization points at which the implementation is required to provide a consistent view of memory.

The options in the Operations menu have the following specific effects:

  • Undo Changes to Loop: removes pending changes to the currently selected loop. Changes that have already been written to the source file using the Update menu commands cannot be undone.

  • Undo All Changes: removes pending 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.

  • Add Assertion: opens the Add Assertion menu which allows you to add the following assertions:

    • C*$*ASSERT CONCURRENT CALL

    • C*$*ASSERT PERMUTATION

  • Add OMP Directive: opens the Add OMP Directive menu which allows you to add these directives:

    • C*$* CONCURRENTIZE

    • C*$* NOCONCURRENTIZE

    • C$SGI DISTRIBUTE (formerly C*$* DISTRIBUTE)

    • C$SGI REDISTRIBUTE (formerly C*$* REDISTRIBUTE)

    • C*$* PREFETCH_REF

    • C$SGI DYNAMIC (formerly C*$* DYNAMIC)

    • C$OMP FLUSH

  • Add OMP Parallel: allows you to add the C$OMP PARALLEL directive. The directive defines a parallel region, that is a block of code that is to be executed by multiple threads in parallel.

  • Add OMP Barrier: allows you to add the C$OMP BARRIER synchronization directive. This directive causes each thread to wait at the designated point until all have reached it.

  • Add OMP Section: opens the Add OMP Section submenu whose seven options allow you to add the OpenMP synchronization directives shown below.

    • Add OMP Sections: C$OMP SECTIONS specifies that the enclosed sections of code are to be divided among threads in a team.

    • Add OMP Section: C$OMP SECTION: delineates a section within C$OMP SECTIONS.

    • Add OMP Critical: C$OMP CRITICAL: restrict access to enclosed code to one thread at a time.

    • Add OMP Single: C$OMP SINGLE: only one thread executes the enclosed code

    • Add OMP Atomic: C$OMP ATOMIC: update memory location atomically, not simultaneously.

    • Add OMP Ordered: C$OMP ORDERED: execute enclosed code in same order as sequential execution.

    • Add OMP Master: C$OMP MASTER: specify code to be executed by master thread.

To use the Add OMP Section option, do the following:

  1. Bring up the Source View.

  2. Using the mouse, sweep out a range of lines for the new construct.

  3. Invoke the appropriate menu item to add the new construct.

When you add a new OMP Section 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 are not in the correct order.

Help Menu

The Help menu contains commands that allow you to access online information and documentation for the Parallel Analyzer View.

The options in the Help menu have the following effects:

  • 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 choose this option, 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 and displays the list of available help topics, which you can browse alphabetically, hierarchically, or graphically.

Keyboard Shortcuts

Table 6-1, lists the keyboard shortcuts available in the Parallel Analyzer View:

Table 6-1. Parallel Analyzer View Keyboard Shortcuts

Shortcut

Menu

Menu Option

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 Analysis Parameters View

Ctrl+F

Views

Subroutines and Files View

Ctrl+U

Update

Update All Files


Loop List Display

This section describes the loop list display and the various option buttons and fields that manipulate the information shown in the loop list display, shown in Figure 6-5.

Figure 6-5. Loop List Display

Loop List Display

You can resize the loop list to change the number of loops displayed; use the adjustment button: a small square below the Previous Loop button.

Status and Performance Experiment Lines

The Status line displays messages about the current status of the loop list, providing feedback on manipulations of the current fileset.

The Performance experiment line is meaningful if you run the WorkShop Performance Analyzer. The line displays the name of the current experiment directory and the type of experiment data, as well as total data for the current caliper setting in the Performance Analyzer. (See “Launch Tool Submenu”, for information on invoking the Performance Analyzer from the Parallel Analyzer View.) If the Performance Analyzer is not being used, the performance experiment line displays <none>.

Loop List

The loop list lets you select and manipulate any Fortran DO loop contained in the source files loaded into the Parallel Analyzer View. Information about the loops is displayed in columns in the list; the headings of the columns are shown at the top of Figure 6-6 and described below.

Figure 6-6. Loop List with Column Headings

Loop List with Column Headings

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

  • Parallelization icon: Indicates the parallelization status of each loop. The meaning of each icon is described in the Icon Legend dialog box. (See “Icon Legend... Option”.) When a loop is displayed in the loop information display (by double-clicking 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.

  • Perf. Cost (not shown in Figure 6-6): The performance cost is displayed when the WorkShop Performance Analyzer is launched on the current fileset. (See “Launch Tool Submenu”.) The loops can be sorted by Perf. Cost via the sort option button. (See “Sort Option Button”.)

    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: The nesting level of the given loop.

  • Loop-ID: 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: The name of the loop index variable.

  • Subroutine: The name of the Fortran subroutine in which the loop occurs.

  • Lines: The lines in the source file that make up the body of the loop.

  • Olid: Original loop id is a unique internal identifier for the loops generated by the compiler. Use this value when reporting bugs.

  • File: The name of the Fortran source file that contains the loop.

To highlight a loop in the list, click the left mouse anywhere in a loop's row; typing unique text from the row into the Search field does the same thing. (See “Search Loop List Field”.)

To select a loop, double-click on its row; this will bring up detailed information in the loop information display below the loop list display. (See “Loop Information Display”.) Selecting a loop affects other displays.

Loop Display Controls

The loop display controls are shown in Figure 6-7, and are discussed in the next sections.

Figure 6-7. Loop Display Controls

Loop Display Controls

Search Loop List Field

You can use the search loop list editable text field, shown at the top left of Figure 6-7, to find a specific loop in the loop list display. The Parallel Analyzer View matches any text typed into the field to the first instance of that text in the loop list, and highlights the row of the list in which the text occurs. The search field matches its text against the contents of each column in the loop list.

As you type into the field, the list highlights the first entry that matches what you have already typed, scrolling the list if necessary. If you press Enter, the highlight moves to the next match. If no match is found, the system beeps, and pressing Enter positions the highlight at the top of the list again.

Sort Option Button

The sort option button is the left-most option button under the loop list search field shown in Figure 6-7. It controls the order in which the loops are displayed in the loop list display.

The choices in the sort option button have the following effects:

  • Sort in Source Order: orders the loops as they appear in the source file.

  • Sort by Perf.Cost : orders the loops by their performance cost (from greatest to least) as calculated by the Workshop Performance Analyzer. This is the default setting. You must invoke 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.

Show Loop Types Option Button

The show loop types option button is the center option button under the loop list search field shown in Figure 6-7. It controls what kind of loops are displayed for each file and subroutine in the loop list.

The options in the show loop types button have the following effects:

  • Show All Loop Types: default setting.

  • Show Unparallelizable Loops: show only loops that could not be parallelized, and thereby run serially.

  • Show Parallelized Loops: show only loops that are parallelized.

  • Show Serial Loops: show only loops that are preferably serial.

  • Show Modified Loops: show only loops with pending changes.

  • Show OMP Directives: show only loops containing OMP directives.

Filtering Option Button

The filtering option button is the right-most option button under the loop list search field shown in Figure 6-7. It lets you display only those loops contained within a given subroutine or source file.

The button choices have the following effects:

  • No Filtering: the default setting; lists all loops and routines.

  • Filter by Subroutine: lets you enter a subroutine name into a filtering editable text field that appears above the option button. Only loops contained in that subroutine are displayed in the loop list.

  • Filter by File: lets you enter a Fortran source filename into a filtering editable text field that appears above the option button. Only loops contained in that file are displayed in the loop list.

To place the name of a subroutine or file in the appropriate filter text field, you can double-click on a line in the Subroutines and Files View. If the appropriate type of filtering is currently selected, the loop list is rescanned.

Loop Display Buttons

The loop display controls (Figure 6-7) include two control buttons:

  • Source: Opens the Source View window, with the source file containing the loop currently selected (double-clicked) in the loop list. The body of the loop is highlighted within the window. If no loop is selected, the last selected file is loaded; if no file is selected, the first file in the fileset is loaded.

    For more information on the Source View window, see “Source View and Parallel Analyzer View - Transformed Source”.

  • Transformed Source: Opens a Parallel Analyzer View - Transformed Source window, with the compiled source file containing the loop currently selected (double-clicked) in the loop list. The body of the loop is highlighted within the window. If no loop is selected, the last selected file is loaded; if no file is selected, the first file in the fileset is loaded.

    For more information on the Transformed Source window, see “Source View and Parallel Analyzer View - Transformed Source”.

The loop display controls also include two navigation buttons:

  • Next Loop: Selects the next loop in the loop list. 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. 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 to incorporate the changes into the Fortran source. The display is divided into several information blocks displayed in a scrolling list as shown in Figure 6-8.

Figure 6-8. Loop Information Display

Loop Information Display

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

Highlight Buttons

A highlight button (light bulb, see Figure 6-8) appears as a shortcut to more information related to text in the display. Clicking the button does one or both of the following:

If directives or assertions with highlight buttons are also listed below the Loop Parallelization Controls, these buttons highlight the same piece of code as the corresponding button in the Loop Parallelization Controls, but they do not activate the Loop Parallelization Control View.

Loop Parallelization Controls in the Loop Information Display

The first line of the Loop Parallelization Controls section shows the Olid of the selected loop and, on the far right, how many transformed loops were derived from the selected loop.

Controls for altering the parallelization of the selected loop are shown in Figure 6-9. The controls in this section allow you to place parallelization assertions and directives in your code. Recall that you have similar controls available through the Operations menu. (See “Operations Menu”.)

Figure 6-9. Loop Parallelization Controls

Loop Parallelization Controls

Loop Parallelization Status Option Button

The loop parallelization status option button (shown in Figure 6-9) lets you alter a loop's parallelization scheme. To the right of the option button is the Loop parallelization status field, a description of the current loop status as implemented in the transformed source. A small highlight button appears to the left of this description if the status was set by a directive.

The loop parallelization status option button choices are described in the following list:

  • Default: always selects the parallelization scheme that the compiler picked for the selected loop.

  • Prefer Parallel: adds the assertion C*$*ASSERT DO PREFER (CONCURRENT).

  • Force Parallel: adds the assertion C*$*ASSERT DO (CONCURRENT).

  • Prefer Serial: adds the assertion C*$ASSERT DO PREFER (SERIAL).

  • Force Serial: adds the assertion C*$*ASSERT DO (SERIAL).

  • C$OMP PARALLEL DO... : adds the OpenMP directive C$OMP PARALLEL DO. Selecting this item opens the Parallelization Control View. See “Parallelization Control View”, for more information.

  • C$OMP DO...: launches the Parallelization Control View, which allows you to manipulate the scheduling clauses for the OpenMP C$OMP DO directive and to set each of the referenced variables as either region-default or last-local.

    A C$OMP 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 reports an error.

A menu choice is grayed out if you are looking at a read-only file, if you invoked cvpav with the -ro True option, or if the loop comes from an included file. So in some cases you are not allowed to change the menu setting.

The following list describes the assertions and directives that you control from the loop parallelization status option button.

  • C*$* ASSERT DO (CONCURRENT): parallelize the loop; ignore possible data dependences.

  • C*$* ASSERT DO PREFER (CONCURRENT): attempt to parallelize the selected loop. If not possible, try each nested loop.

  • C*$* ASSERT DO (SERIAL): do not parallelize the loop.

  • C*$* ASSERT DO PREFER (SERIAL): do not parallelize the loop.

  • C$OMP PARALLEL DO: parallelize the loop, ignore automatic parallelizer.

  • C$OMP DO: assign each loop iteration to a different thread, ignore automatic parallelizer.

MP Scheduling Option Button: Directives for All Loops

The MP scheduling option button (Figure 6-9) lets you alter a loop's scheduling scheme by changing C$MP_SCHEDTYPE modes and values for C$CHUNK. For those modes that require a chunk size, there is a editable text field to enter the value. (See “MP Chunk Size Field”.)

These directives affect the current loop and all subsequent loops in a source file. For control over a single loop, use the C$OMP PARALLEL DO directive clause. (See “MP Scheduling Option Button: Clauses for One Loop”.)

The button choices are as follows:

  • Default: always selects the scheduling scheme that the compiler picked for the selected loop.

  • Static : divides iterations of the selected loop among the processors by dividing them into contiguous pieces and assigning one to each processor.

  • Dynamic: divides iterations of the selected loop among the processors by dividing them into pieces of size C$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 C$CHUNK and interleaves the execution of those pieces among the processors. For example, if there are four processors and C$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 total number of iterations remaining. The idea is to achieve good load balancing while reducing the number of entries into the critical section by parceling out relatively large pieces at the start and relatively small pieces toward the end.

  • Run-time: lets you specify the scheduling type at run time.

To the right of the MP scheduling option button is the MP scheduling field, a description of the current loop scheduling scheme as implemented in the transformed source. A highlight button appears to the left of this description if the scheduling scheme was set by a directive.

MP Chunk Size Field

Below the MP scheduling description is the MP Chunk size editable text field, a field that allows you to set the C$CHUNK size for the scheduling scheme you select.

When you change an entry in the field, the upper right corner of the field turns down, indicating the change (Figure 6-10). To toggle back to the original value, left-click the turned-down corner (changed-entry indicator). The corner unfolds, 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 remembers the original value, which is always displayed after you click on the changed-entry indicator.

Figure 6-10. MP Chunk Size Field Changed

MP Chunk Size Field Changed

Be aware of the following when you use the MP Chunk size field:

  • Your entry should be syntactically correct, although it is not checked.

  • Like any other editable text field, the background color changes when you cannot make edits. This can happen if you are looking at a read-only file, if you invoked cvpav with the -ro True option, if the loop comes from an included file, or in some other cases.

Obstacles to Parallelization Information Block

Obstacles to parallelization are listed when the compiler discovers aspects of a loop's structure that make it impossible to parallelize. They appear in the loop information display below the parallelization controls.

Figure 6-11, illustrates a message describing an obstacle. The message has a highlight button directly to its left to indicate the troublesome line(s) in the Source View window, and opens the window if necessary. If appropriate, the referenced variable or function call is highlighted in a contrasting color.

Figure 6-11. Obstacles to Parallelization Block

Obstacles to Parallelization Block

Assertions and Directives Information Blocks

The loop information display lists any assertions and directives for the selected loop along with highlight buttons. When you left-click the highlight button to the left of an assertion or directive, the Source View window shows the selected loop with the assertion or directive highlighted in the code.

Recall that assertions and directives are special Fortran source comments that tell the compiler how to transform Fortran code for multiprocessing. Directives enable, disable, or modify features of the compiler when it processes the source. Assertions provide the compiler with additional information about the source code that can sometimes improve optimization.

Some assertions or directives appear with an information block option button that allows you to Keep or Delete it. (If you compile o32, you can also  -> Reverse it.) Figure 6-12 shows an assertion block and its option button.

Figure 6-12. Assertion Information Block and Options (n32 and n64 Compilation)

Assertion Information Block and Options (n32
and n64 Compilation)

Assertions and directives that govern loop parallelization or scheduling do not have associated option buttons; those functions are controlled by the loop parallelization status option button and the MP scheduling option button. (See “Loop Parallelization Controls in the Loop Information Display”.)

Compiler Messages

The Loop information display also shows any messages generated by the compiler to describe aspects of the loops created by transforming original source loops. As an example, the loop information display in Figure 6-8, shows there are 11 messages present although only one is shown. Some messages have associated buttons that highlight sections of the selected loop in the Source View window.

Views Menu Options

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: This menu contains a single Close command that closes the corresponding view.

  • Help menu: This menu provides access to the online help system. (See “Help Menu”, for an explanation of the commands in this menu.)

Parallelization Control View

The Parallelization Control View shows parallelization controls (directives and their clauses), where applicable, and all the variables referenced in the selected loop, OpenMP construct, or subroutine. It can be opened by either of two ways.

  • Selecting the Views  -> Parallelization Control View option. Figure 6-13, shows the Parallelization Control View when it is launched from the Views menu with the Default loop parallelization status option button; this is the display for loops without directives.

  • Selecting C$OMP PARALLEL DO... or C$OMP DO... in the loop parallelization status option button (Figure 6-14, and Figure 6-15). This approach provides controls for clauses you can append to these directives.

Features that appear no matter which method is used to open the Parallelization Control View are discussed under “Common Features of the Parallelization Control View”. Features that appear only when the view is opened from the loop parallelization status option button with C$OMP PARALLEL DO... or C$OMP DO... selected are discussed in the following:

Common Features of the Parallelization Control View

Independently of how you open the Parallelization Control View, these elements appear in the window (Figure 6-13):

  • Selected loop: Contains the Olid of the loop, and the information about the loop from the Loop-ID and Variable columns of the loop list.

  • Directive information section: If a directive is applicable to the loop, this section lists directive, clauses, and parameter values. (See “C$OMP PARALLEL DO and C$OMP DO Directive Information”.)

  • Variables Referenced: The listing has two icons for each variable. They allow you to highlight the variable in the Source View and to determine the variable's read/write status; see “Icon Legend... Option”, for an explanation of these icons.

    For discussion of added option buttons that appear if the view is opened from the loop parallelization status option button when C$OMP PARALLEL DO... or C$OMP DO... is selected, see “Variable List Option Buttons”.

  • Add Variable : Located at the bottom of the window frame, this button allows you to add new variables to a loop.

  • List to add: Located at the bottom of the window frame, this editable 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.

C$OMP PARALLEL DO and C$OMP DO Directive Information

Option buttons and editable text fields in addition to those described in “Common Features of the Parallelization Control View”, are available if you open the Parallelization Control View from the loop parallelization status option button with either C$OMP PARALLEL DO... or C$OMP DO... selected. (See Figure 6-14, and Figure 6-15.)

There are two additional option buttons available:

  • MP scheduling option button: This button allows you to alter a loop's scheduling scheme by changing the C$MP_SCHEDTYPE clause. See “MP Scheduling Option Button: Clauses for One Loop”, for further information. This is the same button shown in Figure 6-9.

  • Synchronization construct option button ( C$OMP DO... only): This button allows you to set the NOWAIT clause at the end of the C$OMP END DO directive to avoid the implied BARRIER.

    Figure 6-14. Parallelization Control View With C$OMP PARALLEL DO Directive

    Parallelization Control View With C$OMP PARALLEL DO
Directive

    Figure 6-15. Parallelization Control View With C$OMP DO Directive

    Parallelization Control View With C$OMP DO
Directive

The following is a list of additional editable text fields that allow you to specify clauses for the C$OMP PARALLEL DO or C$OMP DO directives.

  • Condition for parallelization: Allows you to enter a Fortran conditional statement, for example, NSIZE .GT. 83. (C$OMP PARALLEL DO... only.)

    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 Chunk size: Allows you to set the C$CHUNK size for the scheduling scheme you select. For further information, see “MP Chunk Size Field”.

  • Private: Declares the variables in a list to be PRIVATE to each thread in a team.

  • Shared: Makes variables that appear in a list shared among all the threads in a team. All threads within a team access the same storage area for SHARED data. (C$OMP PARALLEL DO... only.)

  • Default: Allows you to specify a PRIVATE, SHARED, or NONE scope attribute for all variables in the lexical extent of any parallel region. Variables in THREADPRIVATE common blocks are not affected by this clause. (C$OMP PARALLEL DO... only.)

  • Firstprivate: Provides a superset of the functionality provided by the PRIVATE clause.

  • Lastprivate: Provides a superset of the functionality provided by the PRIVATE clause.

  • Copyin: Applies only to common blocks that are declared as THREADPRIVATE. ( C$OMP PARALLEL DO... only.)

    A COPYIN clause on a parallel region specifies that the data in the master thread of the team be copied to the thread private copies of the common block at the beginning of the parallel region.

  • Reduction: Performs a reduction on the variables that appear in a list with an operator ( +, *, -, .AND., .OR., .EQV., or .NEQV.), or an intrinsic (MAX, MIN, IAND, IOR, or IEOR).

  • Affinity: Allows you to specify the parameters for the affinity scheduling clause. The two types of affinity scheduling are described below. For more details and syntax, see the MIPSpro Fortran 77 Programmer's Guide.

    • Data affinity scheduling, which assigns loop iterations to processors according to data distribution.

    • Thread affinity scheduling, which assigns loop iterations to designated processors.

  • Nest: Allows you to specify parameters in this clause for concurrent execution of nested loops. You can use the NEST clause to parallelize nested loops only when there is no code between either the opening DO statements or the closing ENDDO statements. For more details and syntax, see the MIPSpro Fortran 77 Programmer's Guide.

  • Onto: Allows you to specify parameters for this clause to determine explicitly how processors are assigned to array variables or loop iteration variables. For more details and syntax, see the MIPSpro Fortran 77 Programmer's Guide

MP Scheduling Option Button: Clauses for One Loop

The Parallelization Control View contains an MP scheduling option button if it is opened from the loop parallelization status option button with either C$OMP PARALLEL DO... or C$OMP DO... selected.

The options that appear have the same names as those for the MP scheduling option button in the loop information display, shown in Figure 6-9. However, the option button in the Parallelization Control View affects the C$MP_SCHEDTYPE and C$CHUNK clauses in the C$OMP PARALLEL DO directive, and so affects only the currently selected loop. Recall that the MP scheduling option button in the loop information display affects the placement of the C$MP_SCHEDTYPE and C$CHUNK directives and thus all subsequent loops.

Except for this difference in scope, the effects of both option buttons are the same; for a description, see “MP Scheduling Option Button: Directives for All Loops”.

Variable List Option Buttons

If the Parallelization Control View is opened from the loop parallelization status option button when either C$OMP PARALLEL DO... or C$OMP DO... is selected, each variable listed in the lower portion of the view appears with an option button. The menu allows you to append a clause to the directive, enabling you to control how the processors manage the variable. It is an addition to the highlight and read/write icons discussed in “Common Features of the Parallelization Control View”.


Note: The highlight button may not indicate in the Source View all the occurrences relevant to a variable subject to a OpenMP directive; you may need to select the entire parallel region in which the variable occurs.

If the view is opened from the loop parallelization status option button when C$OMP PARALLEL DO... is selected, the following are the variable list option button choices (Figure 6-14):

  • Default: uses the control established by the compiler.

  • Shared: one copy of the variable is used by all threads of the MP process.

  • Local: each processor has its own copy of the variable.

  • Last-local: similar to Local, except the value of the variable after the loop is as the logically last iteration would have left it.

  • Reduction : a sum, product, minimum, or maximum computation of the variable can be done partially in each thread and then combined afterwards.

If the view is opened from the loop parallelization status option button when C$OMP DO... is selected, the following are the variable list option button choices (Figure 6-15):

  • Region-default: uses the control established by the compiler for the parallel region.

  • Local: Each processor has its own copy of the variable.

  • First-local: similar to Local, except the value of the variable after the loop is as the logically first iteration would have left it.

  • Last-local: similar to Local, except the value of the variable after the loop is as the logically last iteration would have left it.

Variable List Storage Labeling

In parentheses after each variable name in the list of variables is a word indicating the storage class of the variable. There are three possibilities:

  • Automatic: The variable is local to the subroutine, and is allocated on the stack.

  • Common: The variable is in a common block.

  • Reference: The variable is a formal argument, or dummy variable, local to the subroutine.

Transformed Loops View

The Transformed Loops View contains information about how a loop selected from the loop list is rewritten by the compiler into one or more transformed loops.

To open this view, choose Views -> Transformed Loops View (see Figure 6-16).

Figure 6-16. Transformed Loops View

Transformed Loops View

Loop identifying information appears on the first line below the window menu, and below that is an indication of how many transformed loops were created.

Each transformed loop is displayed in its own section of the Transformed Loops View in an information block.

  • The first line in each block for contains:

    • A parallelization status icon

    • A highlighting button (highlights the loop in the Transformed Source window and in the original loop in the Source View)

    • The Olid number of the transformed loop

  • The next line describes the transformed loop, providing information such as the following:

    • Whether it is a primary loop or secondary loop (whether it is directly transformed from the selected original loop or transformed from a different original loop, but incorporates some code from the selected original loop)

    • Parallelization state

    • Whether it is an ordinary loop or interchanged loop

    • Its nesting level

  • The last line in the loop's information block displays the location of the loop in the transformed source.

Any messages generated by the compiler are below the loop information blocks. To the left of the message lines are highlight buttons. Left-clicking them highlights in the Transformed View the part of the original source that relates to the message. Often it is the first line of the original loop that is highlighted, since the message refers to the entire loop.

PFA Analysis Parameters View

If you compile with o32, you can use the PFA Analysis Parameters View, which contains a list of PFA execution parameters accompanied by fields into which you can enter new values. If you compile with n32 or n64, these parameters have no effect and this view is not useful.

To open this view, choose Views -> PFA Analysis Parameters View in the main window. (See Figure 6-16.)

When you update a source file, any PFA parameters you alter are changed for that file (Figure 6-17). When you change a parameter, the upper right corner of the field window turns down, as discussed in “MP Chunk Size Field”.

Figure 6-17. PFA Analysis Parameters View

PFA Analysis Parameters View

Subroutines and Files View

The Subroutines and Files View contains a list from the file(s) in the current session of the Parallel Analyzer View (Figure 6-18). Below each filename in the list is an indented list of the Fortran subroutines it contains. Each item in the list is accompanied by icons to indicate file or subroutine status:

  • A green check mark appears to the left of the file or subroutine name if the file has been scanned correctly or the subroutine has no errors.

  • A red plus sign is above the green check mark shows if any changes have been made to loops in the file using the Parallel Analyzer View.

  • A red international not symbol replaces the check mark if an error occurred because a file could not be scanned or a subroutine had errors.

    Figure 6-18. Subroutines and Files View

    Subroutines and Files View

The Search field in the Parallel Analyzer View uses the subroutine and file names listed in the Subroutines and Files View as a menu for search targets; see “Search Loop List Field”.

You can select items in the list for two purposes:

  • To save changes to a selected file: click the filename and use the Update  -> Update Selected File option at the top of the Parallel Analyzer View main window. (See “Update Menu”.)

  • To select a file or subroutine for loop list filtering, discussed in “Filtering Option Button”, double-click on it. The selected name appears in the filtering text field; if the item is appropriate for the selected filtering option, the loop list is rescanned.

At the bottom of the window is a Search editable text field, which you can use to search the list of files and subroutines.

Loop Display Control Button Views

These views are summoned by clicking on the Source and Transformed Source loop display control buttons.

Source View and Parallel Analyzer View - Transformed Source

The Source View window and the Transformed Source window together present views of the source code before and after compiler optimization ( Figure 6-19). The two windows use the WorkShop Source View interface.

Both the Source View 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 to the left of the code chooses and highlights the corresponding loop.

In the Transformed Source window, an indicator bar (a 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 are annotated with performance data.

Figure 6-19. Original and Transformed Source Windows

Original and Transformed Source Windows


Note: The File and Display menus shown in the Source View and Transformed Source windows are standard Source View menus, and are described in the ProDev WorkShop: Debugger User's Guide.