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?
>>x=rand(5,1000);
y=zeros(5,1000);
[b,a] = butter(1, 1/30, 'low');
for i=1:5
y(i,:)=filtfilt(b,a,x(i,:));
end
fprintf('\nfor loop works\n')
% Works!
parfor i=1:5
y(i,:)=filtfilt(b,a,x(i,:));
end
for loop works
Error using untitled7 (line 9)
filtfilt requires a Signal_Toolbox license.
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.11.0.1837725 (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.
  2 Comments
Walter Roberson
Walter Roberson on 12 Aug 2022
https://www.mathworks.com/matlabcentral/answers/374821-why-do-i-receive-a-license-manager-error-5-when-running-parfor#answer_297977

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by