Normally, it's most productive simply to treat HyperThreading as a level of multi-threading allowing a core to support more threads, similar to, but (in most cases) not as effectively, as more cores. I think this agrees with your comment. For Intel OpenMP, if you set KMP_AFFINITY=verbose, along with any of the usual options, you will see that the logical threads on each core are treated as interchangeable. This is because they share cache to a greater extent even than pairs of cores on the same CPU do. This also implies that one of the conditions for HyperThreading to show an advantage is that the threads share data in cache, or at least don't have a combined footprint exceeding cache size. During your searches, you should have seen the comments about how the hyperthreads on Xeon compete for several important resources, such as FPU. Then, in highly optimized code such as MKL, more effective use of FPU is achieved by making only 1 thread active per core.
I agree with the fact that sometimes it's best to make only 1 thread per core. Therefore I would like to know how to detect if hyperthreading is enabled. If I can't do it with omp, maybe I can use a call to another library. @TimP, do you know how I can achieve that?
The documentation for several Intel software products, including MKL, OpenMP (KMP_AFFINITY), and MPI, deals with this, perhaps not in a fully satisfactory way. All of them rely on ability to do it under OpenMP (using functionality not specified in OpenMP standard), and on updated capabilities for each significant platform change. Under linux (when the kernel is sufficiently up to date for the platform), you have facilities showing information about hyperthreading, as displayed e.g. in /proc/cpuinfo and by irqbalance -debug