Skip to content

Commit

Permalink
Hotfix for grid generation use of mpi operators
Browse files Browse the repository at this point in the history
  • Loading branch information
fmalatino committed Jan 16, 2025
1 parent 1c7c30c commit 1fa8d79
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ndsl/grid/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np

from ndsl.comm.comm_abc import ReductionOperator
from ndsl.comm.communicator import Communicator
from ndsl.constants import (
N_HALO_DEFAULT,
Expand Down Expand Up @@ -3428,7 +3429,11 @@ def _reduce_global_area_minmaxes(self):
max_area = self._np.max(self.area.data[3:-4, 3:-4])[()]
min_area_c = self._np.min(self.area_c.data[3:-4, 3:-4])[()]
max_area_c = self._np.max(self.area_c.data[3:-4, 3:-4])[()]
self._da_min = float(self._comm.comm.allreduce(min_area, min))
self._da_max = float(self._comm.comm.allreduce(max_area, max))
self._da_min_c = float(self._comm.comm.allreduce(min_area_c, min))
self._da_max_c = float(self._comm.comm.allreduce(max_area_c, max))
self._da_min = float(self._comm.comm.allreduce(min_area, ReductionOperator.MIN))
self._da_max = float(self._comm.comm.allreduce(max_area, ReductionOperator.MAX))
self._da_min_c = float(
self._comm.comm.allreduce(min_area_c, ReductionOperator.MIN)
)
self._da_max_c = float(
self._comm.comm.allreduce(max_area_c, ReductionOperator.MAX)
)

0 comments on commit 1fa8d79

Please sign in to comment.