Matlab can use multithreading and parallel computing to speed up computations [1], which may have an impact on performance in shared workspaces.


  • Matlab is resource-greedy by default when computing built-in functions with implicit multithreading, of which there are many

  • multithreading resources in Matlab can be managed with the -singleCompThread startup option or the maxNumCompThreads function to limit the number of computational threads available

  • additionally, parallel computing resources in Matlab can be managed using the parpool function to limit the number of parallel 'workers' used by both built-in functions with implicit parallelisation and custom functions that use defined parallel programming constructs


A number of functions are implicitly multithreaded by default [2] in Matlab releases since 2008a [1].

This has been identified as a potential issue since Matlab will use all available processors for implicitly multithreaded functions [3].

The Matlab function maxNumCompThreads [4] can be used to both set and query the current maximum number of computational threads, though this function is being deprecated.

On beastiexx, maxNumCompThreads returned 32 when recently checked.

As a workaround, Matlab can be started with the command line option -singleCompThread [5], which is suggested by various research computing guides [3] [6] [7], found via a quick online search of the topic.

Resource management on beastiexx may be improved by:

  1. calling Matlab with the -singleCompThread startup option, or

  2. reducing the computational threads available to Matlab using the maxNumCompThreads function, ideally as part of startup.m, until it is removed in a future version.

Parallel Computation

Matlab can perform parallel computations [8] using built-in functions with implicit parallelisation [9] or using defined programming constructs [10].

Resources allocated for parallel computing can be defined using the parpool function [11].

Sharing of resources may be fascilitated through use of the Distributed Computing Server [12], though usability may be worth review prior to implementation [13].


  1. Run MATLAB on multicore and multiprocessor machines

  2. Which MATLAB functions benefit from multithreaded computation?

  3. MATLAB overutilizing CPUS

  4. Matlab: Control maximum number of computational threads

  1. Commonly Used Startup Options: singleCompThread

  2. How to run MATLAB jobs on the TIGRESS clusters

  3. High Throughput Computing: How To Run Matlab

  4. Parallel Computing Toolbox

  5. Built-in Parallel Computing Support in MathWorks Products

  6. Matlab Programming Parallel Application

  7. Matlab: Create parallel pool on cluster

  8. Matlab: Distributed Computing Server

  9. A review of Matlab Distributed Computing Server