How can I debug parfor loop to find out where an error comes from?

2 ビュー (過去 30 日間)
Pegah Hosseini
Pegah Hosseini 2012 年 8 月 28 日
Hi. I am trying to run a specific code 15 times, each time for a new set of data so my iterations are not sequential. I use SPM toolbox and am trying to speed up the calculations using matlabpool and parfor. In each iteration, a temporary structure variable (DCM) is initialised then sent to a function to return the output to the same variable (DCM). At the end of each parfor iteration, the estimated DCM is saved on the disk as DCM_i and it is worth mentioning that the analysis time for different datasets is different. When I ran the code for 15 datasets, it loaded 8 datasets randomly and I could see (according to the script I have written) when one of the sets was finished in a lab, another one would be loaded. So, after 7 of datasets were analysed and their DCM's were saved on the disk, suddenly I got a similar error to the following:
Error in converting struct to double => It is not possible to change struct to double
Now I have no idea where this error happens. All my datasets are exactly the same and the same code has been applied on all of them using for loop. As my parfor loop is working now and it has given me the results of some of the datasets, I don't get it why I would receive such a basic error. I feel I should have received the same error for all datasets if there was a coding mistake.
Best, Pegah
  5 件のコメント
Walter Roberson
Walter Roberson 2012 年 8 月 30 日
When the pool is not open, "for" is used instead of "parfor". Except that the iterations might not be done in the same order as if "parfor" had not been specified.
Pegah Hosseini
Pegah Hosseini 2012 年 8 月 30 日
So is it possible that the way I define the parameters in the above code is not suitable for parfor?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by