dbx can print all shared, private, and thread-private variables. If you try to print a thread private variable outside of a parallel region, the master thread’s copy is printed. The whatis command prints data sharing attributes for shared and private variables within a parallel construction. It prints data sharing attributes for thread-private variables regardless of whether they are within a parallel construction. For example:
(dbx) whatis p_a # OpenMP first and last private variable int p_a;
The print –s command prints the value of an expression expression for each thread in the current OpenMP parallel region if the expression contains private or thread private variables. For example:
(dbx) print -s p_a thread t@3: p_a = 3 thread t@4: p_a = 3
If the expression does not contain any private or thread private variables, only one value is printed.