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

Fix using Meshwell in Ray #17

Open
nikosavola opened this issue Jul 27, 2023 · 1 comment
Open

Fix using Meshwell in Ray #17

nikosavola opened this issue Jul 27, 2023 · 1 comment

Comments

@nikosavola
Copy link
Contributor

Meshwell meshing fails for me when running in Ray

    component.to_gmsh(
  File "/usr/local/home/nikosavola/dev/gdsfactory/gdsfactory/component.py", line 2548, in to_gmsh
    return xyz_mesh(padded_component, layer_stack, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/google/home/nikosavola/dev/gdsfactory/gdsfactory/simulation/gmsh/xyz_mesh.py", line 145, in xyz_mesh
    mesh_out = model.mesh(
               ^^^^^^^^^^^
  File "/usr/local/home/nikosavola/dev/meshwell/meshwell/model.py", line 289, in mesh
    gmsh.finalize()
  File "/usr/local/home/nikosavola/venv/gdsfactory/lib/python3.11/site-packages/gmsh.py", line 316, in finalize
    signal.signal(signal.SIGINT, oldsig)
  File "/usr/lib/python3.11/signal.py", line 56, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: signal only works in main thread of the main interpreter

The issue is documented in https://gitlab.onelab.info/gmsh/gmsh/-/issues/2399 and the solution is to use new initialization with gmsh.intialize(interruptible=False). This argument however is not in a release version of gmsh.

@nikosavola
Copy link
Contributor Author

The local fix is easy enough that maybe this should be fixed after a new version of gmsh is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant