OpenMP, VTune, idle threads

515 Views Asked by At

I use VTune to check concurrency of my code. Here is the screen-shot of the output. You can see, that there is some initial period with 1 thread, then ~0.3 sec of intensive multi-thread work (brown spikes) and then almost 3 seconds of idle (no brown "CPU", just green "Running").

Any idea what can cause threads to be in green-idle state? My code should return after doing all intensive computation, there is no cause to wait 3 additional seconds...

1

There are 1 best solutions below

0
On

How much does your program take to execute without the profiler? Is it faster? Looking at the VTune's timeline view I get an impression that the main thread may be exiting main() function using pthread_exit() and so the OpenMP worker threads continue to live preventing the program from finishing until some timeout expires and the worker threads do decide to shut themselves down. See here a discussion on pthread_exit.