フィルターのクリア

Multistart run ID with UseParallel

2 ビュー (過去 30 日間)
Alexander Andreychenko
Alexander Andreychenko 2016 年 4 月 4 日
コメント済み: Walter Roberson 2016 年 4 月 13 日
Hello! I have a pretty long execution of MultiStart. I am using it to run fmincon on my goal function. Since my goal function is not really 'stable' I have it it inside try/catch block and also trying to put the execution into log file (using log4m). The problem is that the log file becomes a mess because of parallel execution of MultiStart (I am using it with 'UseParallel').
Currently I can only see the ID of the task (from getCurrentTask). But the taskID and ProcessId (from getCurrentWorker) both do not change while execution. So, if I have parallel pool of 4 workers, the runs of MultiStart spread over workers and then executed (I assume).
What I want to do is to see the ID of MultiStart task. For instance, I have 10 initial points. Then I would like to create 10 log files for each of local runs. Is it possible somehow to get the ID of MultiStart task?
I see one possible solution in having the persistent variable in my goal function body but I would like not to mess with persistent variables in parallel execution. It seems like overkilling.
Any help is appreciated!
Thank you, Alex
  2 件のコメント
sam0037
sam0037 2016 年 4 月 12 日
Hi,
My understanding is that you would like to have different log files for each start point in the MultiStart algorithm. One of the ways to achieve this would be to generate random numbers inside the goal function and use them to create different log file names and finally use the same to create new log files.
Walter Roberson
Walter Roberson 2016 年 4 月 13 日
You might as well use tempname() for creating unique file names.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGlobal or Multiple Starting Point Search についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by