The documentation states that MATLAB can be launched in single-thread mode as follows:
matlab -singleCompThread
My question is: Is there a way to reliably check from within MATLAB if it's running in this mode or in the default multi-thread mode?
We have access to a remote cluster where depending on the queue the jobs are sent and the availability of computing resources, MATLAB may start in singleCompThread
mode, and it would be great if we could tell this from within MATLAB.
For now, you can use maxNumCompThreads
, though it warns it will be removed in a future release. In singleCompThread mode, it will return 1. (At least on Windows, where I tested it.)
On 2011a (what I'm running) the following works:
maxNumCompThreads
However, the documentation indicates that it's deprecated, and will be removed from future versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With