OpenMP THREADPRIVATE Common Blocks

The Compaq Tru64 UNIX OpenMP and SGI IRIX compilers implement OpenMP THREADPRIVATE common blocks by using the thread local storage system facility. This facility stores a variable declared in OpenMP THREADPRIVATE common blocks at different memory locations for each thread in an OpenMP process. This allows the variable to have different values in each thread.

Here's how you can view a variable in an OpenMP THREADPRIVATE common block, or the OpenMP THREADPRIVATE common block itself:

  1. In the Threads Pane of the Process Window, select the thread containing the private copy of the variable or common block you would like to view.
     
  2. In the Stack Trace Pane of the Process Window, select the stack frame that will allow you to access OpenMP THREADPRIVATE common block variable. You can select either the outlined routine or the original routine for an OpenMP master thread. You must, however, select the outlined routine for an OpenMP worker thread.
     
  3. From the Process Window, dive on the variable name or common block name. Or, select the View > Lookup Variable command. When prompted, enter the name of the variable or common block. You may need to append an underscore (_) after the common block name.

    TotalView opens a Variable Window displaying the value of the variable or common block for the selected thread.

    See Displaying Variable Windows for more information on displaying variables.
     

  4. To view OpenMP THREADPRIVATE common blocks or variables across all threads, you can use the Variable Window's View > Laminate Threads command. See Displaying a Variable in All Processes or Threads.

The following figure shows Variable Windows displaying an OpenMP THREADPRIVATE common blocks. Because the Variable Window has the same thread context as the Process Window from which it was created, the title bar patterns for the same thread match. In the laminated views, the values of the common block across all threads are displayed.

OpenMP THREADPRIVATE Common Block Variables

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