Optimizer and SPMD: Error using optimizer/subsref (line 358) #946
-
I would like to solve many SDP problems in parallel (using MOSEK). However, parallelization in MATLAB seems to rely on serialization of objects, which does not work in YALMIP. I gathered from remarks in previous posts in the YAMIP forum that it would be a good idea to generate an optimizer object beforehand (which seems to be a low level description of the problem that can be serialized?) and then use this in an SPMD block. As a result, my code is roughly of the following structure as the simple example below:
However, while the code above works fine and circumvents the problems with serialization, I get the following error for my (unfortunately slightly more complicated) example:
If I remove the SPMD block and solve the problems serially (manually assigning labindices), the problems solve fine. Unfortunately, I did not manage to produce a minimal example like the one above, which replicates the error. Is this a bug in the optimizer or I am using YALMIP in a wrong way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I guess you have more than 1 parameter in your non-revealed failing example P([a b c]) is equivalent to [P(a) P(b) P(c)] which means your trial example will work for scalar parameter but likely will fail if you have more than 1 parameter but still send 1 x N argument parfor appears to work in 2020 and later or something like that (and should definitely work with optimizer) |
Beta Was this translation helpful? Give feedback.
I guess you have more than 1 parameter in your non-revealed failing example
P([a b c]) is equivalent to [P(a) P(b) P(c)] which means your trial example will work for scalar parameter but likely will fail if you have more than 1 parameter but still send 1 x N argument
parfor appears to work in 2020 and later or something like that (and should definitely work with optimizer)