Shape of arrays compiled with PGI accelerator in debugger

I’m compiling with 15.3 for OpenACC. Am I correct that doing so will confuse the debugger (pgdbg / Allinea DDT) when it comes to array shapes?

For example:

pgdbg> list
#88: & ngm, ntlm
#89: use parameter_vars, only : ksw_runmode, ksw_runmode_nl, ksw_runmode_tl, ksw_runmode_ad
#90: implicit none
#92: allocate( mom_x_v(nx_mn:nx_mx, ny_mn:ny_mx, nz_mn:nz_mx, 3))
#93:==>> allocate( mom_y_v(nx_mn:nx_mx, ny_mn:ny_mx, nz_mn:nz_mx, 3))
#94: allocate( mom_z_v(nx_mn:nx_mx, ny_mn:ny_mx, nz_mn:nz_mx, 3))
#96: allocate( dens_ptb_v(nx_mn:nx_mx, ny_mn:ny_mx, nz_mn:nz_mx, 3))
#97: allocate( rmpt_ptb_v(nx_mn:nx_mx, ny_mn:ny_mx, nz_mn:nz_mx, 3))

pgdbg> p nx_mn
pgdbg> p nx_mx
pgdbg> p ny_mn
pgdbg> p ny_mx
pgdbg> p nz_mn
pgdbg> p nz_mx
pgdbg> p mom_x_v

(-1:0,-1,0,1) : 0 0

(-1:0,0,0,1) : 0 0

(-1:0,-1,0,0) : 0 0

(-1:0,0,0,0) : 0 0

Doing the same with the CPU-only version (also compiled with pgf90) will show the correct shape for “mom_x_v(nx_mn:nx_mx, ny_mn:ny_mx, nz_mn:nz_mx, 3)”. I’ve started noticing this behaviour in otherwise correctly running programs, but now I’m trying to hunt down a bug with DDT, which won’t show useful content for the arrays when it can’t recognise an array’s shape. Is this known behaviour or am I something wrong?

My compiler command:

pgf90 -acc -g -Kieee -O0 -DGPU -I /home/michel/asuca/hybrid/Nusdas13/src -I //home/michel/lib/netcdf3/include -Mcuda=5.5,cc3x -ta=nvidia,cc3x,keepgpu,keepbin,time -Minline=levels:5,reshape Mipa=inline,reshape -Minfo=accel,inline,ipa -Mneginfo -Minform=inform -byteswapio -Mmpi=mpich -DGPU -c {SOURCE} -o {OBJECT-FILE}


I need a bit more context here, are those arrays used in accelerator region ?
If yes, do you want to be able to inspect their value in the host code or device code ? One work-around if you intent is to inspect their values on host, is to add -ta=tesla:nodebug.

Hope this helps

The arrays will be used in data / accelerator regions at a later point, yes. At the point I’m showing I’d just like to inspect the data on the host. My question was specifically about the data shape however - for example if I’d try to access with “p my_data(i,j,:)” it wouldn’t work. What does “nodebug” do? I couldn’t find any documentation in the manpages. Is it related to

Table 28 Supported PGI_TERM Values
This enables/disables just-in-time debugging. The default is nodebug

from the user guide?

-ta=tesla:nodebug would prevent the compiler to generate debuginfo for GPU code. There are some limitations in array shape debug capabilities for GPU code. Since it same binary we would generate debug info for both host and device my guess is that device debug info from device might have been picked by debugger instead of those for host with respect to array shape. If you can provide me with the object file generated I may be able to confirm that.