- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am debugging a code in an OpenMP parallel region, and I am experiencing a problem with an incorrect value of variable added to Watch. My (simplified) code is:
!$omp parallel if ( omp_body_forces ) num_threads ( threads ) default ( shared )
!$omp& private ( k )
!$omp do schedule(auto)
do k=k2,k1,-1
...
!$omp end do
!$omp end parallelomp_body_forces is logical*1, value is .true., thread is integer*4, value is 1, k is integer*4, k1 and k2 ar local variables initialized outside the parallel region.
An incorrect value is shown for k added to Watch. If I comment out the parallelization, k in Watch has a correct value.
I can see k listed twice in Locals, once with an incorrect value, once with the expected value.
Is this an expected behavior of the debugger and Watch for variables inside an OpenMP parallel region, with number of threads set to 1?
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page