Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking if MATLAB is running in multithread mode

Tags:

matlab

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.

like image 286
Amelio Vazquez-Reina Avatar asked Nov 04 '11 16:11

Amelio Vazquez-Reina


2 Answers

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.)

like image 75
Andrew Janke Avatar answered Oct 10 '22 00:10

Andrew Janke


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.

like image 45
John Avatar answered Oct 10 '22 02:10

John