How can I debug parfor loop to find out where an error comes from?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 30 de Ag. de 2012
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.
Respuestas (0)
Ver también
Categorías
Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!