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

Seg Fault in CombinerGenerator #29843

Open
miaoyinb opened this issue Feb 9, 2025 · 1 comment
Open

Seg Fault in CombinerGenerator #29843

miaoyinb opened this issue Feb 9, 2025 · 1 comment
Labels
P: minor A defect that does not affect the accuracy of results. T: defect An anomaly, which is anything that deviates from expectations.

Comments

@miaoyinb
Copy link
Contributor

miaoyinb commented Feb 9, 2025

Bug Description

Using CombinerGenerator in distrubuted_mesh mode with very small mesh leads to seg fault.

Steps to Reproduce

[Mesh]
  [gmg_0]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 1
    subdomain_ids = 1
  []
  [gmg_1]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 4
    subdomain_ids = 4
  []
  [cmbn]
      type = CombinerGenerator
      inputs = 'gmg_0 gmg_1'
      positions = '0 2 0
                   2 0 0'
  []
[]

Running this in distributed_mesh mode (mpirun -n 2 moose_test-opt -i single_scalar_alt.i --mesh-only --distributed-mesh) leads to a seg fault. It seems to be related to that the mesh is too small. So far this issue seems to only happen when one input mesh has only one element and the other mesh is bigger.

Impact

Prevent such use of distributed_mesh mode.

[Optional] Diagnostics

No response

@miaoyinb miaoyinb added P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations. labels Feb 9, 2025
@GiudGiud GiudGiud added P: minor A defect that does not affect the accuracy of results. and removed P: normal A defect affecting operation with a low possibility of significantly affects. labels Feb 9, 2025
@miaoyinb
Copy link
Contributor Author

@GiudGiud I think the issue may originate from the libMesh::UnstructuredMesh::copy_nodes_and_elements().

However, if we sort the input meshes so that we start from the mesh with most elements first, the issue seems to be averted. If you think this is a okay solution for now, I can do a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: minor A defect that does not affect the accuracy of results. T: defect An anomaly, which is anything that deviates from expectations.
Projects
None yet
Development

No branches or pull requests

2 participants