0

I am using parfor of matlab parallel toolbox to see if that boosts my code's speed. However, I don't see any difference in speed. I tried with very simple to complex loop body. But I don't see any difference.

The simplest I tried was

parfor i=:1000000
   [i]
end

The more time consuming one

parfor i=1:1000000
   pcg(A,b); %solve system of linear equations with huge A matrix(definitely time consuming)
end

But I don't see any speedups. What should I do? Where might it go wrong?

user34790
  • 2,020
  • 7
  • 30
  • 37
  • 1
    How many cores do you have? Have you established a pool of workers? Are you certain that the `pcg` function isn't already optimized to work on multiple cores? – Dan Mar 17 '14 at 11:40
  • @Dan. I am not sure if a single call to pcg is optimized to use multiple cores at once. I have four cores. – user34790 Mar 17 '14 at 13:12
  • 1
    As previous commenter has mentioned, you have to use the command matlabpool to specify how many processes you would like to create – freude Mar 17 '14 at 13:15

0 Answers0