From b228ffdcd7e576213e253ab137605f4f83428b1f Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:50:42 +0200 Subject: [PATCH] Small cleanup in mesh datatype --- pySDC/implementations/datatype_classes/mesh.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pySDC/implementations/datatype_classes/mesh.py b/pySDC/implementations/datatype_classes/mesh.py index 8ad26465c0..1504ff8cfd 100644 --- a/pySDC/implementations/datatype_classes/mesh.py +++ b/pySDC/implementations/datatype_classes/mesh.py @@ -70,12 +70,11 @@ def __abs__(self): float: absolute maximum of all mesh values """ # take absolute values of the mesh values - local_absval = float(np.amax(np.ndarray.__abs__(self))) + local_absval = float(np.max(np.ndarray.__abs__(self))) if self.comm is not None: - if self.comm.Get_size() > 1: - global_absval = 0.0 - global_absval = max(self.comm.allreduce(sendobj=local_absval, op=MPI.MAX), global_absval) + if self.comm.size > 1: + global_absval = self.comm.allreduce(sendobj=local_absval, op=MPI.MAX) else: global_absval = local_absval else: