Publish & Snapnow issue in parallel jobs

2 次查看(过去 30 天)
Hi
Context: In order to generate measurement reports (pdf) from my models, I use the publish function. I also use the snapnow function to force the correct positioning of the figures with the display of the measurements.
I work on Linux (Centos7) and on the r2021b version of Matlab.
Problem: when I run a single job, it works fine. But when I run several jobs in parallel on the same machine, it seems that the snapnow function mixes the figures of the different jobs.
Question: any idea on how to handle this problem? I can serialize the jobs and/or run the jobs on several machines in parallel, but it is not practical.
Thanks,
Lionel

回答(1 个)

Vidip
Vidip 2023-11-2
I understand that you are facing an issue with ‘snapnow’ function mixing figures from different parallel jobs, this could be related to the way it interacts with the underlying display and graphics system.
Using ‘parpool’ in MATLAB can be a helpful approach to manage parallel processing and potentially mitigate issues related to parallel figure rendering. Inside a ‘parfor’ loop or using other parallel constructs, perform your computations in parallel. Ensure that each parallel worker creates and renders figures independently. Use unique figure handles or separate figure names to distinguish figures.
For further information, refer to the documentation link below:

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by