There is an endless loop in the function "getCompleteIntervals".

7 visualizaciones (últimos 30 días)
Cole
Cole el 18 de Mayo de 2017
Comentada: John Henry Campbell el 24 de Jul. de 2023
Hi, there.
When the parfor loop finished, the program dropped into an endless loop in the function "getCompleteIntervals".
This function is in the file "remoteparfor.m".
Is there any solution? Thanks.
The screen capture is as follows. The variable r is empty.
  6 comentarios
Hongbiao Chen
Hongbiao Chen el 29 de En. de 2018
Editada: Hongbiao Chen el 2 de Feb. de 2018
I have encountered the similar problem. My program (using parfor) works fine in my labtop (Win8) but would be stuck in the workstation (MATLAB2016b, Windows Server 2012, Dell T630, 2 CPU and 32 cores Xeon®). In the code block above, 'r' is always empty while 'obj.CaughError' is empty too. Update: Fixed. The key resaon in my problem is the size of data. After dividing the data into smaller pieces, the problem sloved (my output result may >2G).
Victor Gonçalves
Victor Gonçalves el 21 de Feb. de 2018
Editada: Victor Gonçalves el 21 de Feb. de 2018
I have the same problem using the optimization toolbox GA function with parallel processing enabled on 2016b. After running a generation, the parfor becomes stuck in this loop. My setup is a Intel Xeon 4 cores, Win10, 16GB RAM.

Iniciar sesión para comentar.

Respuestas (2)

Paul Hoffrichter
Paul Hoffrichter el 22 de Jun. de 2020
Editada: Paul Hoffrichter el 22 de Jun. de 2020
I had a similar problem in MATLAB 2020a. I saw two single pre-allocated arrays defined before the parfor-loop. I made them double. That allowed what appeared to be an infinite loop in remoteparfor to complete in the normal expected timely manner.
  3 comentarios
Paul Hoffrichter
Paul Hoffrichter el 31 de Mayo de 2021
Editada: Paul Hoffrichter el 31 de Mayo de 2021
Every problem is different, of course. In my case, I had learned that it is known that parfor calculations can produce slightly different results from a for-loop due to truncation/roundoff errors creeping in a different manner even for Matlab built-in functions.In my case I narrowed the problem down to a threshold check that was true in for-loop, but false in a parfor-loop. By changing the single precision to double precision, the threshold check remained true in both for- and parfor-loops.
John Henry Campbell
John Henry Campbell el 24 de Jul. de 2023
Hi! I am using the ga function in matlab in tandom with Abaqus. The ga function will run for about a day or two but then the workers will run into the issues describe above by the original post. Are these pre-allocated arrays specific to a parfor loops or were these array that needed to be chaned to double specific to the code you were running? Also, do you think you could post the code that you had to end up changing if it is related to the parfor loop specifically?

Iniciar sesión para comentar.


DeepSea
DeepSea el 15 de Ag. de 2021
I've been stucked in this problem for couples of weeks, and fixed it by removing "continue" in an if-judgement and a for-loop.
for CondA
...
if CondB
continue; % Avoid using "continue"
end
...
end

Categorías

Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!