Startting parallel pool from App Designer

2 次查看(过去 30 天)
Hy guys,
I created an interactive figure using uifigure and now I'm moving it to App Designer. Everything works fine without error.
The first version of the code which uses uifigure, calls an external function, i.e. defined in a separate file, which runs a parfor loop. If the parallel pool is not already opened, it will start a new one and I see the corresponding messages in the command window.
When I run the App from AppDesigner, instead, no message about the parallel pool is shown in the command window.
How I can know if the loop Is running in parallel? Can an external function called within AppDesigner start a parallel pool?

回答(1 个)

Raymond Norris
Raymond Norris 2022-3-29
Hi @Giuseppe Gallo, I'm assuming the corresponding message in the command window is that the parallel pool is starting up with X workers, correct? That's a bit different than how to tell if the loop is running parallel.
Graphically, you can tell if a pool is running by looking at the lower lefthand icon
Another way is to log onto the machine running the workers and look at the processes -- are there a collection of MATLABs running? If you're running the App locally, it's easy enough to bring up either the Windows Task Manager or Linux top utility.
Regarding if the loop is running in parallel, one option is to create a DataQueue to send updates back to the App on how far along the parfor loop has finished (the waitbar example they give is a poor mans' way) -- you could update plots, write to a file, etc.
An external function can start a pool (and in some cases will). Keep in mind, you can only have one parallel pool running at a time.

类别

Help CenterFile Exchange 中查找有关 Downloads 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by