Startting parallel pool from App Designer
20 ビュー (過去 30 日間)
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 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.