¿Puedo saber qué 'worker' realiza cada ejecución del lazo parfor?

1 visualizzazione (ultimi 30 giorni)
Cuando se realiza un lazo parfor, quiero saber si se puede conocer qué 'worker' realiza cada iteración

Risposte (1)

Shivani
Shivani il 14 Mag 2024
Please note that I will be answering the question in English as my knowledge of Spanish is limited.
To offer a more accurate solution, it would be helpful to have additional context regarding the specific reasons for wanting to identify which worker is executing each iteration. As far as I understand, MATLAB does not provide a direct way to determine the exact worker executing a given task within a ‘parfor loop.
It's important to note that the implementation of parfor automatically distributes the loop's iterations among the workers. You can utilize the parforOptions function to effectively control the distribution of the load to the worker nodes.
Please refer to the MATLAB documentation link for more details on how to use this function to control the partitioning of iterations among the workers: https://www.mathworks.com/help/releases/R2019b/parallel-computing/parforoptions.html?s_tid=doc_ta
Hope this resolves your query!
  1 Commento
Policarpo Abascal
Policarpo Abascal il 14 Mag 2024
Thank you for the provided response. They have replied that with the 'getCurrentTask' command, I can achieve the goal of my question. Thank you anyway.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!