Checking if MATLAB is multithreaded

The documentation states that MATLAB can be run in single-threaded mode as follows:

matlab -singleCompThread 

My question is: is there a reliable way to check from MATLAB if it works in this mode or in multithreading mode by default?

We have access to a remote cluster, where, depending on the job sending queue and the availability of computing resources, MATLAB can start in singleCompThread mode, and it would be great if we could find out from MATLAB.

+6
source share
2 answers

You can currently use maxNumCompThreads , although it warns that it will be removed in a future version. In singleCompThread mode, it will return 1. (At least on Windows, where I tested it.)

+7
source

In 2011a (what I'm launching) the following works:

 maxNumCompThreads 

However, the documentation indicates that it is outdated and will be removed from future versions.

+2
source

Source: https://habr.com/ru/post/900789/


All Articles