August 22, 2022 at 11:06 amjev1Subscriber
I have a problem using the lumapi to control Interconnect. When I load a .spi file that has an error in a model definition, Interconnect crashes and closes down but it never raises an error in the API, so the rest of my code just freezes. The handle in the API still thinks the solver is alive and well. I prevented the execution from getting frozen by running interconnect in a thread, but then when I go back to try and check if the handle is available, the API doesn't seem to know anything about it being dead.
I expected calling lumapi.verifyConnection(handle) would detect the lost connection, but it doesn't raise any exceptions. Is there a way to correctly determine if my connection is alive (lumerical hasn't crashed).
Here is a minimal example of what I mention
from lumapi import LumApiError
solver = lumapi.open('interconnect')
def thread_eval(folder, file_name):
lumapi.evalScript(solver, "cd ('" + folder + "');\n")
lumapi.evalScript(solver, "feval('" + file_name + "');\n")
if __name__ == '__main__':
tmp_folder = 'C:\\Users\\jev1\\test\\lumapi_closing\\'
p = threading.Thread(target=thread_eval, name="Load and Run Circuit", args=(tmp_folder, 'TOP'))
print('Interconnect is not responding, the next line should raise an error if the solver is closed.')
print("... But it didn't!")
Of course, better than that is, how to prevent Interconnect from crashing when faulty .spi netlist gets loaded.
August 23, 2022 at 1:22 pmGreg BaethgeAnsys Employee
Thanks for posting your question. As you noted, these are 2 separate issues. Regarding the API issue, I did a quick test, closing the solver then running verifyConnection, it detected the solver was closed so I'm wondering, when this happens, could you check if there's still an interconnect process running?
Regarding the netlist import, does it crash also if you manually import the netlist in INTERCONNECT? Or is it only via the API?
Finally, could you let us know what version of INTERCONNECT you are using?
- You must be logged in to reply to this topic.
Simulation World 2022
Earth Rescue – An Ansys Online Series
- “Import optical generation” or “delta generation rate”?
- Error on Lumerical device
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Using a license file on a new license server
- Ansys Insight: Convergence issues in CHARGE
- Ansys Insight: About override mesh in FDTD: its use and settings
- Ansys Insight: Diverging Simulations
- Lumerical support has moved to the Ansys Learning Forum (ALF)
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- focusing efficiency