Skip to content

Commit

Permalink
Switched from allreduce to Allreduce in spectral helper (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen authored Oct 25, 2024
1 parent cefdf0e commit 2f84eda
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pySDC/helpers/spectral_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,10 @@ def _transform_dct(self, u, axes, padding=None, **kwargs):
if padding is not None:
shape = list(v.shape)
if self.comm:
shape[0] = self.comm.allreduce(v.shape[0])
send_buf = np.array(v.shape[0])
recv_buf = np.array(v.shape[0])
self.comm.Allreduce(send_buf, recv_buf)
shape[0] = int(recv_buf)
fft = self.get_fft(axes, 'forward', shape=shape)
else:
fft = self.get_fft(axes, 'forward', **kwargs)
Expand Down Expand Up @@ -1643,7 +1646,10 @@ def _transform_idct(self, u, axes, padding=None, **kwargs):
if padding[axis] != 1:
shape = list(v.shape)
if self.comm:
shape[0] = self.comm.allreduce(v.shape[0])
send_buf = np.array(v.shape[0])
recv_buf = np.array(v.shape[0])
self.comm.Allreduce(send_buf, recv_buf)
shape[0] = int(recv_buf)
ifft = self.get_fft(axes, 'backward', shape=shape)
else:
ifft = self.get_fft(axes, 'backward', padding=padding, **kwargs)
Expand Down

0 comments on commit 2f84eda

Please sign in to comment.