spmd inner matrix dimensions' problem

2 views (last 30 days)
Lian
Lian on 11 Jun 2015
Commented: Aarti Ghatkesar on 16 Jun 2015
I have a main function calls an inner function which works OK in series manner, i.e. without spmd. However after converting to spmd, an error of 'inner matrix dimensions must agree' happens immediately at the second line of the inner function. I tried with 1 labor, as if the code still runs in series manner, the error also occurs.
So what does it mean by inner matrix? I have some other codes with spmd, which all work fine.
Any one can point me a direction? Many thanks in advance.
  2 Comments
Lian
Lian on 11 Jun 2015
Problem just found. It is due to the global variables. So looks like spmd does not accept global variables. The error message is very misleading.
Just to benefit anyone who has the same problem.
Aarti Ghatkesar
Aarti Ghatkesar on 16 Jun 2015
Hi Lian,
The error you are getting is a very generic one. Could you post your code here in order to see what is causing this error? Also, you are right about global variables not being allowed while using spmd.
What do you mean by inner function? Is it a nested function? If so, there are limitations while using nested functions with spmd. Check out the limitations of spmd at the link: Limitations of spmd

Sign in to comment.

Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!