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

4 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

OCDER
OCDER il 27 Lug 2018
Modificato: OCDER il 27 Lug 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.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by