filtfilt licence error ONLY within parfor

1 Ansicht (letzte 30 Tage)
Gordon Smith
Gordon Smith am 12 Aug. 2022
Bearbeitet: Gordon Smith am 12 Aug. 2022
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
-----------------------------------------------------------------------------------------------------

Akzeptierte Antwort

Gordon Smith
Gordon Smith am 12 Aug. 2022
Bearbeitet: Gordon Smith am 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.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 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 Kommentare
Gordon Smith
Gordon Smith am 12 Aug. 2022
Bearbeitet: Gordon Smith am 12 Aug. 2022
Thanks for the suggestion. Unfortunately it doesn't work in my hands. Either checking out explicitly prior to parfor or calling the function prior to the parfor still results in an error.
It seems matlab cannot properly access toolbox licences within parfor loops? I've submitted a bug report, will add if I hear anything back. Other suggestions are still welcome.
>> license('checkout','Signal_Toolbox')
ans =
1
>> parfor i=1:1;
license('checkout','Signal_Toolbox')
end
License checkout failed.
License Manager Error -5
Cannot find a license for Signal_Toolbox.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/R2021b/5
Diagnostic Information:
Feature: Signal_Toolbox
License path: /home/naxos2-raid1/gbsmith/.matlab/R2021b_licenses:/opt/local/matlab2021b/licenses/license.dat:/opt/local/matlab2021b/licenses/network.lic
Licensing error: -5,0.
ans =
0
Walter Roberson
Walter Roberson am 12 Aug. 2022
https://www.mathworks.com/matlabcentral/answers/374821-why-do-i-receive-a-license-manager-error-5-when-running-parfor#answer_297977

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by