-
-
May 30, 2022 at 8:12 am
edward.vansieleghem
SubscriberHello,
I recently ran into a problem that was previously encountered by some other users, and for which I could not yet find a great answer:
https://forum.ansys.com/discussion/28380/issue-starting-lumerical-fdtd-via-python-api/p1
At some point, I was not able to start FDTD with the Python API outside of lumarical (i.e. running ‘python3’ from console). However, I was still able to start an FDTD instance from the Python API when running python from within an existing FDTD GUI (i.e. running python from within an existing FDTD instance by using the ‘Run script’).
A prototype script that would run from within Lumerical, but not from ouside of Lumerical:
import lumapi
fdtd = lumapi.FDTD(hide=False)
print('I am in!')
fdtd.close The problem appeared out of nowhere (no license, version, or configuration changes in either Lumerical or Python & LumApi propertly configured in PYTHONPATH). I believe it may have been triggered when—at some point—I failed to properly close a lumapi.FDTD instance before terminating the python interpreter (i.e. I did not call fdtd.close() before the interpreter closed/crached).
After some digging in the ‘~/.ansys/ansyscl.xxxx.log’ file, I found out that the Ansys Licensing Interconnect was not started anymore when calling lumapi.FDTD() from the Python API outside of an existing FDTD instance. Therefore, the lumapi.FDTD() command would run indefinitely—presumably, while the python API was waiting for a response from the never-started license interconnect.
After some more digging I found out that I was able to resolve/bypass the problem by setting the ‘ANSYSCL_SESSION_ID’ environmental variable manually in the terminal before starting FDTD from the Python API outside of Lumerical. That way, the Ansys Licensing Interconnect was able to start up properly again.
This variable seems to be set automatically to something like ‘__dev_pts_4_ ’ when opening FDTD in the regular way (i.e. not from the Python API).
Although I’m happy this hack fixes the problem, I’m sure this is not the intended behavior of the software.
Could you please advise?
Best regards Edward
-
July 19, 2022 at 9:14 pm
Lito Yap
Ansys Employee@vansieleghem, Try to set your environment variable as shown in the KB. >https://optics.ansys.com/hc/en-us/articles/5771091294739
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Transmission results greater than one
- Ansys Insight: Diverging Simulations
- Ansys Insight: About override mesh in FDTD: its use and settings
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- Ansys Insight: Convergence issues in CHARGE
-
3850
-
2629
-
1853
-
1248
-
600
© 2023 Copyright ANSYS, Inc. All rights reserved.