TAGGED: fdtd, lumapi, Lumerical-FDTD, python
-
-
May 15, 2023 at 5:20 am
Zhaoyu Zhang
SubscriberHi,
When I use FDTD lumapi to run some optimization algorithms in python, the error "QProcess: Destroyed while process ("fdtd-solutions.exe") is still running" would sporadically pop up and terminate my program altogether.
I'm not sure where this error is steming from or what it's specifically related to. Any ideas how to avoid/fix this?
Thanks.
-
May 16, 2023 at 10:07 am
Zhaoyu Zhang
Subscriber-
May 16, 2023 at 9:03 pm
Lito
Ansys Employee@Zhaoyu Zhang,
Try to run this sample API script (i.e. save as 'lumtest.py');
import lumapi
fdtd = lumapi.FDTD()
fdtd.addfdtd()
fdtd.addring()
fdtd.addmesh()
fdtd.save("lumtestpy.fsp")from the "CAD > Script file editor" window. With Python Integration showing "Active". (see image)
If it works and runs to completion, it will save the file, "lumtestpy.fsp" on your current working directory (cwd).
-
-
May 17, 2023 at 4:13 am
Zhaoyu Zhang
SubscriberHi Lito, yes your sample code worked and saved the test file. How is this related to the QProcess error?
-
May 17, 2023 at 4:05 pm
Lito
Ansys Employee@Zhaoyu Zhang,
That was to test if our API is working.
Based on your screenshot your are not running from the CAD > Script file editor window. Try running your ‘lumapi script’ from the CAD as you did with our sample script and see this works. And vice-versa, run our sample lumapi script on the third party application (shown on your screenshot), to verify if it works outside the CAD.
This should verify if the issue is with the API or Lumerical CAD or something else on your settings for the other application or system settings.
Looking forward to your feedback. Thank you.
-
May 18, 2023 at 5:34 am
Zhaoyu Zhang
SubscriberHi Lito, appreciete the detailed explanations.
I've tested lumapi in both the CAD and my own python code IDE, and both times it worked just fine. Actually, the QProcess error only occurs sporadically (meaning it occurs randomly and inconsistently).
I have a question: which part of lumerical FDTD uses the QProcess module?
Best.
-
-
-
May 18, 2023 at 4:04 pm
Lito
Ansys Employee@Zhaoyu Zhang,
Does the error happen when you run the script in the CAD or only when you run from the other application? QT is used by “lumapi”. Which version of Ansys Optics/FDTD are you using.
-
May 19, 2023 at 2:43 am
Zhaoyu Zhang
SubscriberHi Lito,
The error only occurs when I run in my python IDE. My version of FDTD is 2021 R1.4.
I did some deeper searches on the internet and found that the QProcess error could be connected to the GUI or multi-processes computing. But i'm not sure how that would translate to my problem.
Actually, I can think of a possible reason why this error occurs. I'm using a windows software called "clickoff" that detects pop-up windows and automatically clicks buttons on the pop-up window to close it (https://whatsoftware.com/auto-click-annoying-confirmation-buttons-clickoff/). "clickoff" is used by me to automatically detect and close the "select frequency" window when I run the field and power monitor (DFT monitor) in FDTD, where it would click the "ok" button to close the window (see image below). Do you think the error could have been caused by using the "clickoff" tool?
-
May 19, 2023 at 3:10 pm
Lito
Ansys EmployeeQT is used by the API which requires and calls the CAD when run.
>>>Python API overview – Ansys Optics
We do not know how other application affect our software since we do not use thirdparty utilities. But based on your information on what this software does, it might affect our application. You can disable this software before running the API script as this is not require by our tools.
Or you can hide the CAD/GUI on your lumapi script.
>>>Session management – Python API – Ansys Optics
-
-
-
- The topic ‘QProcess: Destroyed while process (“fdtd-solutions.exe”) is still running.’ is closed to new replies.
-
3492
-
1057
-
1051
-
965
-
942
© 2025 Copyright ANSYS, Inc. All rights reserved.