optimplot optimization monitoring if the optimfunction has a parfor loop inside doesn't redraw the figure.

2 ビュー (過去 30 日間)
Hello, everyone.
I have a very heavy optimization process, with each step requiring several hours of running.
To increase the speed at least a little bit, I use the follwoing:
  • I set 'Use Parallel' 'always' as an optimoption to compute gradients in parallel.
  • I use a parfor over a dataset inside every objective function computation.
My dataset is typically about 20 points, and the amount of variables is 10. In total, my cluster has 36 cores ( 18 dual-core Celeron machines).
I ask Matlab to plot the objective function value, as well as the variables themselves.
The problem is, however, that the main monitoring figure is only redrawn when the control returns to the main Matlab instance, which only happens between the optimization steps, and not for a long time. Moreover, if I move the monitoring figure, or resize it, the plots disappear, and ever the menubar takes a few minutes to ger drawn. The figure menu is also completely unresponsive.
I would like to use drawnow or snapnow, but I don't know where to plug them is, since the objective function's 'drawnow' is executed at the nodes, not the main machine.
I use Matlab Distributed Computing Toolbox and Matlab Parallel Computing Toolbox 2013a.
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 7 月 22 日
How are you currently asking matlab to do the plotting?
Lockywolf
Lockywolf 2019 年 7 月 22 日
options = optimoptions( @fmincon, ...
'Algorithm', 'interior-point', ...
'Diagnostics', 'on',...
'Display', 'iter-detailed',...
'TolX', 1.0e-4,...
'TolFun', 1.0e-4,...
'OutputFcn', { @(x, optimValues, state, varargin) myOutputFunction( x, optimValues, state, varargin) },... % doesn't do any plotting
'PlotFcns', {...
@optimplotfval, ...
@optimplotstepsize, ...
@optimplotfirstorderopt, ...
@optimplotx,...
@(x, optimValues, state, varargin) my_otimplotxi( 'ParamName', 1, x, optimValues, state, varargin)},...
'MaxIter', 30,...
'MaxFunEvals', 9999999999999, %
'UseParallel', 'always' );

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

製品


リリース

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by