Parralel run optimization with different x0

80 views
Skip to first unread message

Michiel Jansen

unread,
Mar 6, 2015, 3:37:27 AM3/6/15
to yal...@googlegroups.com
Hi all,

I wanted to parallel compute optimizations with different starting points to increase the chance of reaching a global minimum (non-convex problem).

I am therefore using a parfor loop:

parfor i=1:5
assign(Pr,gas.node(:,9)*ones(1,horizon));                                 % assign initial values
assign(Si,gas.node(:,10)*ones(1,horizon).*rand);
assign(shedg,zeros(nnode,horizon));                                       % assign initial values

exitflag = optimize(Constraints,Objective,options)                     % run optimization

end

However it looks like the assign function cannot be used with the workers:

Error using Gaspar (line 120)
An UndefinedFunction error was thrown on the workers for 'assign'.  This might be because the file containing 'assign' is not
accessible on the workers.  Use addAttachedFiles(pool, files) to specify the required files to be attached.  See the
documentation for 'parallel.Pool/addAttachedFiles' for more details.

Caused by:
    Undefined function 'assign' for input arguments of type 'double'.


Is there a way to solve this?

Thanks in advance!

Kind regards,
Michiel

Johan Löfberg

unread,
Mar 6, 2015, 3:51:18 AM3/6/15
to yal...@googlegroups.com
parfor does not work with YALMIP. No way around it.
Reply all
Reply to author
Forward
0 new messages