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

4 views (last 30 days)
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.

Accepted Answer

OCDER
OCDER on 27 Jul 2018
Edited: OCDER on 27 Jul 2018
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.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!