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

Small meshes fail in parallel #594

Open
connorjward opened this issue Dec 16, 2024 · 0 comments
Open

Small meshes fail in parallel #594

connorjward opened this issue Dec 16, 2024 · 0 comments
Labels
bug Pull requests or issues to relating to something not working parallel Relates to parallel capability

Comments

@connorjward
Copy link
Contributor

connorjward commented Dec 16, 2024

Running the code

from firedrake import *
from gusto import Domain


m = PeriodicIntervalMesh(3, 10)  # increasing 3 to 5 here makes the error go away
mesh = ExtrudedMesh(m, layers=3, layer_height=10/3)
domain = Domain(mesh, 0.1, 'CG', 1)

with mpiexec -n 2 python myfile.py throws

Traceback (most recent call last):
  File "/home/connor/Code/firedrake-dev3/src/gusto/mydemo.py", line 7, in <module>
    domain = Domain(mesh, 0.1, 'CG', 1)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/connor/Code/firedrake-dev3/src/gusto/gusto/core/domain.py", line 152, in __init__
    self.set_height_above_surface()
  File "/home/connor/Code/firedrake-dev3/src/gusto/gusto/core/domain.py", line 179, in set_height_
above_surface
    columnwise_height, index_data = self.coords.get_column_data(CG1_height, self)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/connor/Code/firedrake-dev3/src/gusto/gusto/core/coordinates.py", line 193, in get_co
lumn_data
    data_range = np.max(coords_X) - np.min(coords_X)
                 ^^^^^^^^^^^^^^^^
  File "/home/connor/Code/firedrake-dev3/lib/python3.12/site-packages/numpy/_core/fromnumeric.py",
 line 3199, in max
    return _wrapreduction(a, np.maximum, 'max', axis, None, out,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/connor/Code/firedrake-dev3/lib/python3.12/site-packages/numpy/_core/fromnumeric.py",
 line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: zero-size array to reduction operation maximum which has no identity

which is because an array getting passed to np.max has zero size. I expect this is because one rank has no cells kept on it.

@tommbendall tommbendall added bug Pull requests or issues to relating to something not working parallel Relates to parallel capability labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Pull requests or issues to relating to something not working parallel Relates to parallel capability
Projects
None yet
Development

No branches or pull requests

2 participants