Error thrown in a parlor loop
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to speed up some computations using the parallel toolbox - particularly replacing a far loop with a parfor loop. I have made each iteration of the loop independent and debugged it using a normal for instead of parlor. There are 8 captured signal buffers. I want to find the time of arrival of a given signal in each buffer. The loop is 8 long - one for each buffer.
I first using a correlation procedure find the coarse TOA in a buffer and then using a different algorithm find the fine TOA and fill in the fields of a structure with the data. The results is an 8 dimensional structure array (already memory allocated). I have verbose debugging print out in the loop. When I run it with for - is is fine. When I run it with parfor it will do 3 and blow up one time and 6 and blow up the next time. The error is thrown during parfor gives me no clue to where the true error was. I put a try/catch around the contents of the loop but that did work either.
The specific error is "Subscripted assignment between dissimilar structures.
"Error in calc_SRS_pseudo_ranges_Ver_P (line 96) parfor n=1:num_int;"
Line 96 is the start of the parfor statement so this tells me nothing. Two questions - why will it work for some number properly and they blow up and any idea on how I better hone in on the actual line of code that is causing this?
Any help or suggestions will be appreciated.
Thank You Truman Prevatt
0 Commenti
Risposta accettata
Edric Ellis
il 10 Lug 2014
Have you tried debugging the loop when running it as a PARFOR? You can force the PARFOR to run locally in your desktop MATLAB instance by changing
parfor idx = 1:N
to
parfor (idx = 1:N, 0)
I suspect that the problem is that some structure that you're building inside the loop changes form somehow as the loop progresses.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements 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!