openMP: threadprivate not effected and function variables no

Problem 1: The threadprivate common block variable which is copiedin in two threads, is not private in the threads but is shared between the threads.(The memory address seen in the debugger(pgdbg) is same in both the threads).

Problem 2: Variables passed in subroutine calls inside a parallel region are not getting passed. There is no memory address and value shown in the pgdbg debugger.

The compiler is pgf90 in Linux platform.

Problem 1 is a known issue in the current pgdbg. It turns out that the compiler is not producing dwarf information for threadprivate variables as well. This will be fixed in a future release.

Problem 2 we may need a little more information on. What type of variables are being passed within the parallel region? Can you include a little code snippet?

Thanks for your reply, We have found a workaround for Problem1. Following is the explaination for Problem2:

The parallelisation is done for a DO loop inside which various call for subroutines are made. If for eg. I pass around 50 variables as arguments for this routine, some of the arguments are not passed to the called routine. Generally as I notice, only 2 contiguous variables are not getting passed. Other variables gets passed properly.

C$OMP PARALLEL
C$OMP& PRIVATE( A, B, C)
C$OMP& SHARED(X, Y, Z)
C$OMP DO

CALL FUNCTION1( A, X, B , Z, Y)

CALL FUNCTION2( Z, Y)

CALL FUNCTION3( A, Z, Y)

C$OMP END DO
C$OMP END PARALLEL


For eg. as in the above case of call to function1(), variables X and B are not passed for example. With the same ‘exe’, some times B and Z are not passed ". The variables that are not passed may be scalar/vector; etc.
I mean “not passed” as : The debugger stops at this point where it encounters this variable first used for calculation.

For example, inside function1

IF ( X(1) .EQ. 0 )

the computation stops here. There is no memory address shown for this variable in the debugger memory dialog box.

I tried some examples, but couldn’t yet recreate your problem. Do you only see it when you pass 50 or so arguments to function1? Does it have to be a combination of private and shared variables passed?

Thanks for replying.

Yes, I get the problem in one particular routine which pass around 50 variables. This has a combination of private and shared variables.

Silly question, but are you using f77? Or f90 fixed form? I noticed when I was trying to come up with a testcase, my arguments were wrapping around the lines.

Here is a test. Compile the caller and callee with ipa, and see if ipa thinks the argument lists match up. Here is what you might see if they don’t:

2, IPA: subprogram foo inlined, size 7
subprogram sub1 not inlined – wrong number of arguments (level 1, boo:67)

Use the flags -Mipa=fast,inline -Minfo=all.