Skip to content

Commit 2f84eda

Browse files
Switched from allreduce to Allreduce in spectral helper (#498)
1 parent cefdf0e commit 2f84eda

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pySDC/helpers/spectral_helper.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,10 @@ def _transform_dct(self, u, axes, padding=None, **kwargs):
14711471
if padding is not None:
14721472
shape = list(v.shape)
14731473
if self.comm:
1474-
shape[0] = self.comm.allreduce(v.shape[0])
1474+
send_buf = np.array(v.shape[0])
1475+
recv_buf = np.array(v.shape[0])
1476+
self.comm.Allreduce(send_buf, recv_buf)
1477+
shape[0] = int(recv_buf)
14751478
fft = self.get_fft(axes, 'forward', shape=shape)
14761479
else:
14771480
fft = self.get_fft(axes, 'forward', **kwargs)
@@ -1643,7 +1646,10 @@ def _transform_idct(self, u, axes, padding=None, **kwargs):
16431646
if padding[axis] != 1:
16441647
shape = list(v.shape)
16451648
if self.comm:
1646-
shape[0] = self.comm.allreduce(v.shape[0])
1649+
send_buf = np.array(v.shape[0])
1650+
recv_buf = np.array(v.shape[0])
1651+
self.comm.Allreduce(send_buf, recv_buf)
1652+
shape[0] = int(recv_buf)
16471653
ifft = self.get_fft(axes, 'backward', shape=shape)
16481654
else:
16491655
ifft = self.get_fft(axes, 'backward', padding=padding, **kwargs)

0 commit comments

Comments
 (0)