- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an OpenMP code that is compiled with ifort version 14.0.3.166 on a quad-core Macbook Pro running OS X 10.9.3. All the work is done in a simple parallel DO region, and I have not requested any sort of dynamic thread management; the number of threads is fixed with OMP_NUM_THREADS=4. The program works fine, and the "top" utility shows 4 running threads when the program is executing. However, the cpu usage shows only 50%. Is this an artifact of top's sampling algorithm, or are only two cores actually executing all the threads? Is this an o/s limitation or is there some environment or kernel configuration issue that I am missing? Any suggestions appreciated. Thanks!
--Eric
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the work in the parallel DO region equal amongst threads?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have HyperThreading active, 4 threads on 4 cores are expected to show 50% usage even if you may be getting the full performance of the platform. I don't know whether any Macbook has HT; you can look up your CPU model on ark.intel.com
If you don't set an affinity option, chances are some cores will be running 2 threads. For example, your compiler library should support OMP_PROC_BIND = spread which would be one of the options for spreading 4 threads across 4 cores, which would usually improve performance
On a single quiad-core CPU, if you don't set affinity, disabling HT may improve performance, besides enabling you to see "100%" usage with 4 threads.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page