필터 지우기
필터 지우기

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 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