How to handle Matlab license error when using parallel pooling

135 views Asked by At

I am trying to run a 3rd party toolbox (Measures of Effect Size (MES) Toolbox) that is dependent on Statistics_Toolbox license. In a 'classical' for loop, the computation is done without any errors but whenever I run the computations in a parallel for loop, I get the following error:

Error using ncpci
tinv requires a Statistics_Toolbox license.

I have confirmed the existence of Statistics_Toolbox license both with ver command and license('test', 'Statistics_Toolbox') command. Is this an expected behaviour for the parallel pooling in Matlab?

Here is my system info:

MATLAB Version: 9.12.0.1884302 (R2022a)
Ubuntu 22.04

2

There are 2 answers

1
Edric On BEST ANSWER

This is not expected behaviour. When you use parpool, the workers should have available any licences that you have in your desktop MATLAB session. This is detailed here for MATLAB Parallel Server - the same applies to local workers using only Parallel Computing Toolbox. I suggest you contact MathWorks Support to resolve this.

0
DrJay On

MATLAB can do this when using PCT and its features, e.g. parallel for loops.

Make sure the Statistics Toolbox license is available to each worker. Explicitly set up licensing for parallel workers before running the parallel code. e.g.:

Matlab

    % Explicitly set up licensing for parallel workers
parpool('local', numWorkers);  % numWorkers is the number of parallel workers you want

% Now, run your parallel code
parfor i = 1:numIterations
    % Your parallel computation here
end

% Close the parallel pool when you're done
delete(gcp);

Check Toolbox Compatibility. If not fully compatable, it can lead to this unexpected behaviour.

Check for updates, patches, or hotfixes available for MATLAB R2022a that address this issue.

If all else fails, contact MathWorks Support for assistance.