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

4 次查看(过去 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