Matlab parallel for loop or Matlab open pool -


I am trying to do some computations and I would like to use it in parforl or by opening matlabpool .. current implementation Too slow:

  result = zero (25,16000); For I = 1: Length (vector 1)% length is for Jammu = 1: Length (vector 2)% Length 16000 temp1 = vector1 (i); Temp2 = Vector 2 (J); Load image% 1 from T1 = load (matfiles1 (temp1) .name)% matfile1t2 = load (matfiles2 (temp2) .name) matfile2 result (i, j) = t1. * T2 end end  load the image% 2  

Its okay but I really want to know that there is no way to speed up something ... thanks a long time ago!

using a on loop and opening matlabpool Come together. Provides your MATLAB session with dedicated workers who open Metallibol with which it can run your on loop body. So, you can change your code in something like this:

  matlabpool local 4% or so many core is for you parfor i = ... ... end   

Before running your code in parallel, I would definitely recommend to ensure that you understand that time is spent on running your code. (I wonder if there is no effect in the external loop in t1 in load - the profiler should be shown that load calls your Compared with the rest of the algorithm, it takes less time.)

Comments