Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyedb/generic/process.py solve_siwave fails in linux due to popen #297

Closed
2 tasks done
vishak-venkatraman opened this issue Mar 28, 2024 · 0 comments · Fixed by #305
Closed
2 tasks done

pyedb/generic/process.py solve_siwave fails in linux due to popen #297

vishak-venkatraman opened this issue Mar 28, 2024 · 0 comments · Fixed by #305
Labels
bug Something isn't working

Comments

@vishak-venkatraman
Copy link

Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

Description of the bug

IO error

Steps To Reproduce

pyedb/generic/process.py

 73     def solve(self):
 74         # supporting non graphical solve only
 75         if self.nongraphical:
 76             if is_linux:
 77                 exe_path = os.path.join(self.installer_path, "siwave_ng")
 78             else:
 79                 exe_path = os.path.join(self.installer_path, "siwave_ng.exe")
 80             exec_file = os.path.splitext(self._project_path)[0] + ".exec"
 81             if os.path.exists(exec_file):
 82                 with open(exec_file, "r+") as f:
 83                     content = f.readlines()
 84                     if "SetNumCpus" not in content:
 85                         f.writelines(str.format("SetNumCpus {}", str(self.nbcores)) + "\n")
 86                         f.writelines("SaveSiw")
 87                     else:
 88                         fstarts = [i for i in range(len(content)) if content[i].startswith("SetNumCpus")]
 89                         content[fstarts[0]] = str.format("SetNumCpus {}", str(self.nbcores))
 90                         f.close()
 91                         os.remove(exec_file)
 92                         f = open(exec_file, "w")
 93                         f.writelines(content)
 94             command = [exe_path]
 95             command.append(self._project_path)
 96             command.append(exec_file)
 97             command.append("-formatOutput -useSubdir")
 98             p = subprocess.Popen(" ".join(command))
 99             p.wait()

line 98 should instead be

         if os.name == "posix":
             p = subprocess.Popen(command)
         else:
             p = subprocess.Popen(" ".join(command))

This is because in linux environment you get IO error like this

PyEDB INFO: EDB file save time: 0.89ms
PyEDB INFO: StdOut is enabled
PyEDB INFO: Logger is initialized in EDB.
PyEDB INFO: legacy v0.4.0
PyEDB INFO: Python version 3.8.6 (default, Sep 25 2020, 11:54:06) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
PyEDB INFO: Database file.aedb Opened in 2024.1
PyEDB INFO: Cell cell Opened
PyEDB INFO: Builder was initialized.
PyEDB INFO: EDB initialized.
PyEDB ERROR: IO ERROR on solve_siwave
PyEDB ERROR: 2
PyEDB ERROR:   File "file.py", line 73, in <module>
PyEDB ERROR:     out = edbapp.solve_siwave()
PyEDB ERROR:   File "python3.8/site-packages/pyedb/dotnet/edb.py", line 2990, in solve_siwave
PyEDB ERROR: Check Online documentation on: https://edb.docs.pyansys.com/version/stable/search.html?q=solve_siwave
 

Please fix wherever this issue is ASAP. I am unable to get work done as I keep having to fix edb code every time I do an upgrade.

Which Operating System are you using?

Linux

Which Python version are you using?

3.8

Installed packages

NA

@vishak-venkatraman vishak-venkatraman added the bug Something isn't working label Mar 28, 2024
@svandenb-dev svandenb-dev linked a pull request Apr 2, 2024 that will close this issue
@SMoraisAnsys SMoraisAnsys pinned this issue Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant