OpenMP thread number
Hello,
I add OpenMP directives in my code, do "setenv OMP_NUM_THREADS 4", then run the code. When the code is running, I use "top" utility to look at this running job. One column "THR" in the "top" screen shows "6" for this job. I only set to use at most 4 threads, why are there "6" threads? I then tested different thread numbers, when I set thread number to 1,2,3,4, respectively, the running process actually uses 3,4,5,6 threads respectively. So, even if I want it to run serially by set 1 thread, it still create 3 threads.
If I compile the real serial code which has no OpenMP directives at all, the code would run as a real serial code, "top" indicates only 1 thread is created.
This kind of behavior is not expected, anything wrong with SUN compiler or parallel run time system? I am using Studio8 compiler on 4-processor SUN fire V880 system.
Anybody has similar experience?
Thanks for any input or comments.
Jeff

