I have nested for loops.After I convert the outer for loop to parfor (I get no compilation errors), the program doesn't even go to the first step in the parfor loop until after 2.5 hours or so. Can someone please tell me why?
I tried various configurations where the number of broadcast variables were small and contained no large arrays but still the same problem. The program structure is as follows:
Variable initializations (around 10)
Matrix initializations (all to zeros, some of size 15*15, some 225*225) % Even if these matrices are initialized as local matrices inside the parfor loop it makes no difference.
del(m)=some_value_depending on m
H=[some 15*15 matrix with some elements depending on m and some
others on v, but none of them depend on both simultaneously]
M=[225*225 matrix computed from some operations on H]
some one line operation on M giving 2 matrices W and S
B=Inverse(W)*S -- size is 15*1;
Few lines of code operating on A(m)
As you can see, there are no functions, but there are several large matrices within the loops. Will writing each loop as a function make it faster? If so, can someone please explain why?
Also, can someone tell how to use profile command for parallel computations if at all?
I am stuck for the past few weeks-please help.