Multistart run ID with UseParallel

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Global 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