niober123 / ompt-intel-openmp

Automatically exported from code.google.com/p/ompt-intel-openmp
0 stars 0 forks source link

Assertion failure with nested regions and ompt_wait_barrier_end #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Try the attached example with an OMPT tool attached and register to 
ompt_event_wait_barrier_end.

The runtime will fail with either an assertion failure or a segmentation fault.
The problem arises because a thread is reused in the second parallel region and 
its state gets overwritten. So what happens (as far as I understood that from 
debugging) is, that the task in the first parallel region goes into the 
implicit barrier setting the threads state to wait_barrier. Then it starts to 
execute the task created earlier, there it creates a team that consists (if 
nesting=false) of only itself. Now the state from the thread is set to working 
and it completes the parallel region. Afterward the thread fires a parallel_end 
for the nested region and sets its state to overhead. When it now continues in 
the outside barrier, its state will still be "overhead" and not wait_barrier as 
asserted. Also some structs will be destroyed/zeroed causing the SegFault.
With nested=true I have seen similar behavior as threads gets still reused (at 
least the master) and I have seen a state of zero (work_serial) which is not 
even possible if the thread goes through the thread_create functions. 

Original issue reported on code.google.com by Alexande...@mailbox.tu-dresden.de on 25 Aug 2014 at 10:24

Attachments: