Potential bug in the multi-core processing by utilizing "parallel computing" toolbox

조회 수: 3 (최근 30일)
I am trying to speed up my simple data-extraction Matlab (R2011b) script that includes a simple loop structure. I managed to get it working with the loop structure that allows the 'multi-core' processing:
Loop starts
  • create a 'data' filename
  • open the 'data' file
  • open the 'output' file
  • extract the line with the selected phrase until the end of the 'data' file
  • close the 'data' file
  • close the 'output' file
Loop ends
However, the output files of the duo- and quad-cores processing resulted in random omissions of the extracted lines compared to those in the output file of the single-core processing.
No# Core/Total Lines Extracted/% Line Omission
1 Core/72000/0
2 Cores/71899/0.14
4 Cores/71222/1.08
Considering the facts that (1) the 1-core processing produced the anticipated results and (2) the Matlab script is simple and short, I believe that this is the software bug in the Matlab 'parallel computing toolbox'. I am wondering whether anyone else observed the similar issues or whether it has already been acknowledged as a software bug and has already been fixed with some sort of patch.
Thank you in advance.

채택된 답변

OCDER
OCDER 2018년 7월 27일
편집: OCDER 2018년 7월 27일
That's called "Race Condition". Not a Matlab-specific bug, but a bug caused by improper multithreaded codes. Read more about this here:
If you show us the actual code, we may be able to pinpoint the issue.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by