OpenMP Private and Shared Variables

TotalView allows you to view both OpenMP private and shared variables.

OpenMP private variables are maintained in the outlined routine, and are stored by the compiler like local variables. See Displaying Local Variables and Registers. However, OpenMP shared variables are maintained in the master thread's original routine stack frame.

TotalView allows you to display shared variables through a Process Window focused on the OpenMP master thread or through one of the OpenMP worker threads.

Here is how you display an OpenMP shared variable:

  1. Select the outlined routine in the Stack Trace Pane; or select the original routine stack frame in the OpenMP master thread.
     
  2. Dive on the variable name, or select the View > Lookup Variable command. When prompted, enter the variable name.

    TotalView will open a Variable Window displaying the value of the OpenMP shared variable, as shown in the following figure.

    OpenMP Shared Variable

Shared variables are stored on the OpenMP master thread's stack. When displaying shared variables in OpenMP worker threads, TotalView uses the stack context of the OpenMP master thread to find the shared variable. TotalView uses the OpenMP master thread's context in the resulting Variable Window to display the shared variable.

You can also view OpenMP shared variables in the Stack Frame Pane by selecting the original routine stack frame in the OpenMP master thread, or by selecting the stack parent token line in the Stack Trace Pane of OpenMP worker threads, as shown in the following figure.

 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0