turn off hyperthreading when i'am using Matlab
21 views (last 30 days)
Show older comments
Hi,
I would like to turn off the hyper threading when i'm using Matlab in on a computer with the following configuration:
MATLAB: R2010b,
OS: Mac pro,
CPU: Intel Xeon (2 processors),
RAM: 8 GB,
ATI Radeon HD 5870
Any help please, thank you in advance
0 Comments
Answers (2)
Sarah Wait Zaranek
on 6 Mar 2011
Depending on your release, you can either turn it off in the preferences - or for newer releases there is a start up option for turning it off. It is -singleCompThread.
If you are using an older version (and want to toggle while running), you can use the maxNumCompThreads command (available in R2007b through R2010a). Loren has a nice blog post about this, see link below.
1 Comment
Sarah Wait Zaranek
on 6 Mar 2011
Just noticed you are in 10b. The startup option is the way to go for you.
Walter Roberson
on 6 Mar 2011
Edited: Jan
on 18 Jan 2013
Sarah's answer is good if you want to turn off all threading. If you want to turn off only hyperthreading, here is some information from 2009; I don't know if it has become a regular preference in the meantime.
2 Comments
Sarah Wait Zaranek
on 6 Mar 2011
Good Point.
MATLAB looks to the OS to see how many cores the machine has - and uses that to set the number of computational threads. For machines with hyperthreading, the OS doesn't distinguish between real core and "virtual" ones. So, this means if you want hyperthreading off you have two options
1) Turn of all multithreading in MATLAB
2) Turn off hyperthreading on the OS level - then MATLAB will remain multithreaded but use the real cores to set the number of computational threads.
Mohammad Sayyafzadeh
on 12 Nov 2015
I have a similar issue. The computer has 4 16-core CPUs. 64 physical CPUs, no hyper-threads. But MatLab recognises half of them as hyperthreads and therefore, it uses only 32 cores. Anyone knows why is that and how I can resolve this issue? feature('numCores') MATLAB detected: 32 physical cores. MATLAB detected: 64 logical cores. MATLAB was assigned: 64 logical cores by the OS. MATLAB is using: 32 logical cores. MATLAB is not using all logical cores because hyper-threading is enabled.
ans =
32
See Also
Categories
Find more on Java Package Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!