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

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 件のコメント

Tianqi Guo
Tianqi Guo 2017 年 10 月 4 日
Hi Cole,
I have the same problem and whenever it happens if I press Pause and then Continue, the loop stops and the code moves on.
Let me know if you have resolved this issue.
Best, Tianqi.
Ryan
Ryan 2017 年 11 月 7 日
編集済み: Ryan 2017 年 11 月 7 日
I have a similar problem. My program executes fine for a while, then the CPU utilization goes to zero. When I hit Ctrl-C, I find that I appear to be stuck in this loop. Essentially parfor just hangs.
Daniel Terry
Daniel Terry 2017 年 11 月 7 日
I've experienced the same issue consistently for years and never found a solution. Oddly it seems specific to our dual-socket systems. What type of system are you using?
Details are described in my earlier question (see below), which includes code for reproducing the problem. It is reproducible even with a very simple loop.
Ryan
Ryan 2017 年 11 月 18 日
Daniel. Thanks for the post. You are correct, my program runs just fine on my computer that has a single CPU and 6 cores (6 workers), but hangs on my workstation that has quad processors, with each processor having 6 cores (24 workers in total). I assume this issue does not occur in a virtual environment/ cloud as I assume someone would have noticed by now.
Hongbiao Chen
Hongbiao Chen 2018 年 1 月 29 日
編集済み: Hongbiao Chen 2018 年 2 月 2 日
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 2018 年 2 月 21 日
編集済み: Victor Gonçalves 2018 年 2 月 21 日
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.

サインインしてコメントする。

回答 (2 件)

Paul Hoffrichter
Paul Hoffrichter 2020 年 6 月 22 日
編集済み: Paul Hoffrichter 2020 年 6 月 22 日

1 投票

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 件のコメント

Jinsu Kim
Jinsu Kim 2021 年 5 月 31 日
Actually I have same problem. Could you expalin in more details how to fix the code?
Thank you.
Paul Hoffrichter
Paul Hoffrichter 2021 年 5 月 31 日
編集済み: Paul Hoffrichter 2021 年 5 月 31 日
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 2023 年 7 月 24 日
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?

サインインしてコメントする。

DeepSea
DeepSea 2021 年 8 月 15 日

0 投票

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

カテゴリ

ヘルプ センター および File Exchange循环及条件语句 についてさらに検索

質問済み:

2017 年 5 月 18 日

Community Treasure Hunt

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

Start Hunting!