MATLAB: How can I use the parallel computing for lsquarefit function.

parallel computing

I run a image processing program and it has a data of matrix with size of (254*318*31). Each element represents a pixel and it takes approximately 0.5-1 second for one pixel so it takes around 3 days to get my results any faster method. I tried with the parallel computing but when I start the parallel computing it runs only for 30 mins and stops automatically. How do i make it run throughout the program.

Best Answer

Hi Sasidharan,
Could you provide a bit more context, at a high level, how you're running your code. That is
  • on your machine or a cluster
  • if on a cluster, using MJS or a scheduler (e.g. PBS)
  • how are you starting the parallel pool, explicitly (i.e. calling parpool) or automatically (e.g. by calling parfor)
  • is the code a combination of a lot of serial code (i.e. outside of a parfor) and parallel code or just parallel code (i.e. the bulk of the time is running in a parfor/spmd block)?
For starters, be aware that, by default, a parellel pool will be deleted after 30 minutes of inactivity. I could imagine that you've run your parallel code, but your (serial) code still runs in access of 30 minutes after the last parfor/spmd call so that MATLAB automatically shuts down your parallel pool, but continues to run your code.
If you want to disable/extend the time out, go to the MATLAB Preferences > Parallel Computing Toolbox. At the bottom is a checkbox to disable automatic timeout as well as an edit box to change the default if you do want it.
Thanks,
Raymond
Related Question