Analyzers
Support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
4680 Discussions

Program running with 2 threads although OMP_NUM_THREADS=1

schorscherl
Beginner
242 Views
Hi all,

when I run my OpenMP program using the cli version
of VTune 3.0b, it runs with one thread when I set OMP_NUM_THREADS=1,
as expected (this is for callgraph profiling). When I do the same
under GUI (vtlec) control, it insists on running with 2 threads. I
have tried setting OMP_NUM_THREADS=1 on the command line before
starting vtlec, as well as setting it in the 'Advanced' project
options (user-defined environment), but this does not help. OMP_NUM_THREADS
seems to get ignored when the GUI is running.

Any ideas?

Georg.

PS: This is on a dual Xeon, SuSE 8.1, Kernel 2.4.24.
0 Kudos
2 Replies
TimP
Black Belt
242 Views
Sometimes, it has been necessary to run a script, in which the environment variables are set before starting the application.

OpenMP programs built with Intel compilers have 2 monitor threads, in addition to those counted under OMP_NUM_THREADS. Intel libguide and linux libpthread each are responsible for one. They normally accumulate well under a second together. I'm not certain from your description whether those are involved.
schorscherl
Beginner
242 Views
Hi,

I can see the two helper threads, but there is one additional thread
which collects a lot of CPU time, and it is definitely a compute
thread. Besides, the program uses omp_get_num_threads() to determine
the number of threads it is running on, and this number is reported
as 2.

The script trick works, ok.

Btw, I have checked that the problem does not appear when doing
IP sampling. Strange.

Thanks,
Georg.
Reply