filtfilt licence error ONLY within parfor

10 views (last 30 days)
I am trying to run filtfilt within a parfor loop, but get a license error ("filtfilt requires a Signal_Toolbox license.") ONLY when running within parfor. Using filtfilt without parfor works fine.
Any ideas?
[b,a] = butter(1, 1/30, 'low');
for i=1:5
fprintf('\nfor loop works\n')
% Works!
parfor i=1:5
for loop works
Error using untitled7 (line 9)
filtfilt requires a Signal_Toolbox license.
>> ver
MATLAB Version: (R2021b) Update 2
MATLAB License Number:
Operating System: Linux 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Accepted Answer

Gordon Smith
Gordon Smith on 12 Aug 2022
Edited: Gordon Smith on 12 Aug 2022
Heard from Mathworks support.
Licence checkout must occur before the FIRST initiation of a parpool.
"If you start MATLAB and immediately check out the toolbox license you need BEFORE the first time you try to open a 'parpool', then the workers will inherit the license. If you have initiated a 'parpool' at any point (even if you subsequently delete it) before checking out the license, then the parpool workers will not properly inherit the license until you restart MATLAB. In the event issues still persist and you are using MacOS, please increase the ulimit for file handles" ...
See Walter's comment above for more info on increasing ulimit on MacOS.

More Answers (1)

Walter Roberson
Walter Roberson on 12 Aug 2022
I recently saw a Mathworks Support post on this topic, but possibly a different toolbox. The post said that it is a bug, and the workaround was to ensure that the license was checked out before the parfor. That could be by using license() to ask to check out the toolbox, or by doing an operation involving the toolbox before the loop so that it would be automatically checked out.
Walter Roberson
Walter Roberson on 12 Aug 2022

Sign in to comment.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by