parfor is suddenly not supported by thread-based workers anymore.

I am using a parfor-loop for a parafac and since a week or so, Matlab gives an error that it cannot work with the parfor anymore. I have not changed the code in any way, so I do not know why this error occurs now. Was there an update or change in parafac?
These are the lines that I am using:
parfor i=1:10
[FactorsNaNFixed{i,1},itNaN{i,1},errNaN{i,1}]=parafac(NaNArray,Comp,Options,const,OldLoadC,FixModeC);
end
and here is the error that is generated:
Error using parafac
Use of function load is not supported on a thread-based worker.
All inputs (NaNArray,Comp,Options,const,OldLoadC,FixModeC) are pre-allocated,so I do not know why this happens, also given that it worked perfectly fine before. Parallel pool on Threads is running normally with 12 workers.
All the best,
Chris

4 comentarios

parafac is not a Mathworks product; it looks like it is not even in the File Exchange. Is it possibly from the third-party PLS Toolbox ? https://www.mathworks.com/products/connections/product_detail/pls-toolbox.html
Chris Pruefert
Chris Pruefert el 31 de Jul. de 2023
Editada: Chris Pruefert el 31 de Jul. de 2023
It is part of the "The N-Way Toolbox" in the File Exchange indeed, but it hasn't been updated in a while, so nothing should have changed from the "parafac"-side. I guess I need to rephrase my question now. Did anything in Matlab change so that parfor is evaluated differently? This would be in the framework of "function load"
All the best,
Chris
What MATLAB version were you using? Also, if you could provide the files to reproduce the issue at our end then it would be beneficial.
Hello, sorry for jumping it. In a different context, I have the same problem in 2023a and 2023b if I am correct, and the same error message with the function "predict" in the SI toolbox.
I have been using threads since the feature was available with this function and there was no problem in the previous version.
There are other posts related to other functions (https://uk.mathworks.com/matlabcentral/answers/2028350-use-of-function-save-is-not-supported-on-a-thread-based-worker) which may or may not be related to this.
If you could patch it would be great please, thank you very much, because it is much faster to parallelize with treads that with processes in some cases,
Thank you again.
Kind regards

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Productos

Versión

R2023a

Etiquetas

Preguntada:

el 29 de Jul. de 2023

Comentada:

el 19 de Nov. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by