Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Debugging threadprivate variables

jimdempseyatthecove
Honored Contributor III
1,131 Views

Using MS VS 2019 (haven't tried 2022 community yet)

Debugging threadprivate variables is problematic. I suspect it uses the address of the main thread regardless of the thread context. The memory address does not change when you use loc(module::var) in a memory window, issued with thread focus set to different threads.

 

Related:

I tried a work around to use associate(local_var => threadprivate_var)

When I attempt to view the contents of the variable, the debugger shows:

    Childeren could not be evaluated

 

For now, I can work around by declaring the threadprivate variable with target, then set a pointer to this within the procedure. This (both issues) is cumbersome to say the least.

 

Jim Dempsey

 

0 Kudos
7 Replies
Barbara_P_Intel
Employee
1,072 Views

When you get a chance, can you upload a reproducer?

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,059 Views

MS VS 2022 (17.7.5) hangs in Locals window (note "busy"). IDE hangs, had to kill it with TaskManager.

NOTE, compile with OpenMP enabled.

jimdempseyatthecove_0-1698193554267.png

Will get MS VS 2019 after I reboot. (system behaving funny).

Jim

 

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,048 Views

After reboot, S VS 2019 wouldn't launch. Hung at splash screen.

Rebooted again, performing Repair on MS VS 2019.

That was on my Xeon E5-2620v2 system.

Running MS VS 2019 on my Intel NUC

jimdempseyatthecove_0-1698198152197.png

I don't crash (and don't bugger MS VS), but cannot access threadprivate variables.

program Console29
    use mod_foo
    implicit none
    integer :: i
    do i=1,size(aType%array)
        aType%array(i) = i
    end do
end program Console29
module mod_foo
    type sometype
        real :: array(10)
    end type sometype
    type(sometype) :: aType
    !$omp threadprivate(aType)
    end module mod_foo
    

Note, compile as separate source files.

 

Jim Dempsey

0 Kudos
Barbara_P_Intel
Employee
1,017 Views

@jimdempseyatthecove, VS 2022 v17.7.x has issues with the Fortran compiler. Devorah posted a patch in this thread. Maybe that will help.

 

0 Kudos
JohnNichols
Valued Contributor III
1,016 Views

JohnNichols_0-1698262715195.png

 

Jim,  there is a bullet, bite it and update to VS 2022 Preview.  

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,008 Views

@JohnNichols 

I did. 2022 hangs... and somehow trashed 2019 in the process.

Must be an infinite loop.

 

Not only did I have the kill MS VS 2022 (17.7.5) with Task Manager, I also had to kill MS Remote Debugger (I only debugged locally).

After I killed those processes, the system acted funny. I rebooted, then MS VS 2019 wouldn't load past the splash screen. Killed that, rebooted, did a Repair on 2019. Now it is back up and running.

 

Stranger than fiction comes to mind.

 

Jim

0 Kudos
JohnNichols
Valued Contributor III
1,000 Views

Buy a decent computer.  

I laughed till I cried.  

Biting the bullet is usually without chloroform,  it is generally not pleasant.  Then again neither is driving an oyster knife into your wrist on your 21st birthday and your Dr Father saying - be a man and put a band aid on it.  

0 Kudos
Reply