フィルターのクリア

Is it possible to perform parallel computing with lsqnonlin?

12 ビュー (過去 30 日間)
Igor
Igor 2013 年 3 月 20 日
コメント済み: Daniel Haxton 2017 年 8 月 23 日
Hello,
Could anybody please tell me if parallel computations are possible with the MATLAB optimization routine "lsqnonlin"? For my applications, this nonlinear optimization function seems to be the best one out of many, but I was disappointed to find out parallel computations were not supported for "lsqnonlin" in R2012a. What about the newest release?
I understand that it might be inherently impossible to make this function work in a parallelized way, but I would like to make sure whether or not the feature is now implemented.
Thank you in advance.

採用された回答

Jill Reese
Jill Reese 2013 年 3 月 21 日
In the latest release (R2013a), lsqnonlin does not support parallel computations. The most up-to-date information on what optimization routines support parallel computations can be found by looking at the documentation for optimoptions. Optimization routines that support parallel computations will have 'UseParallel' listed as one of their options.

その他の回答 (1 件)

William Smith
William Smith 2016 年 11 月 3 日
This is now supported (since around 2016a). Pass the { 'UseParallel' , true } flag in the optimoptions.
  2 件のコメント
Igor
Igor 2016 年 11 月 3 日
Good to know that! Thank you!
Daniel Haxton
Daniel Haxton 2017 年 8 月 23 日
Hello,
I am also wondering if I can use lsqnonlin for parallel computation.
This is what I mean: I have a function that returns a vector that is distributed among workers.
function localvectorpart = parallelfunction(parameters)
it is called within a spmd block. I run my program in a spmd block.
>> spmd; myprogram; end
My vector is distributed among workers and I want to minimize the sum of squares of all the entries in the vector. I would like to pass lsqnonlin a function that returns a distributed or codistributed vector, in some fashion.
Is it true, what it seems to me, that lsqnonlin cannot do this?
[1] I can call it like this,
function myprogram
..
fitparams = lsqnonlin(@(x) gather(codistributed.build(parallelfunction(x),mycodist)), guessparams, ...)
end
[2] but I would prefer to call
function myprogram
..
fitparams = lsqnonlin(@(x) codistributed.build(parallelfunction(x),mycodist), guessparams, ...)
end
[3] or simply
function myprogram
..
fitparams = lsqnonlin(parallelfunction, guessparams, ...)
end
Are [2] or [3] possible? [2] appears impossible because lsqnonlin does not accept functions that return codistributed vectors. [3] does not work regardless of the value of "UseParallel." Is there an option that would enable [3]? Is [1] actually equivalent, just as good? I suppose that gather() in [1] is indeed actually gathering the vectors, performing an allgather, and incurring extra communication. That is why I am asking.

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

カテゴリ

Help Center および File ExchangeLinear Least Squares についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by