Effacer les filtres
Effacer les filtres

Multistart run ID with UseParallel

2 vues (au cours des 30 derniers jours)
Alexander Andreychenko
Alexander Andreychenko le 4 Avr 2016
Commenté : Walter Roberson le 13 Avr 2016
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 commentaires
sam0037
sam0037 le 12 Avr 2016
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 le 13 Avr 2016
You might as well use tempname() for creating unique file names.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Global or Multiple Starting Point Search dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by