Skip to content

Commit aec988b

Browse files
committedJan 20, 2022
Fix bug related numpy views
1 parent b759ec2 commit aec988b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎source-code/mpi4py/halo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def halos_to_str(left, upper, right, lower):
6565
print(f'rank {rank}, left = {left}, up = {up}, right = {right}, down = {down}')
6666
# note that the column data is stored non-contiguously, and has to be copied
6767
# before sending it
68-
send_buffer = np.array(matrix[:, 0])
68+
send_buffer = np.array(matrix[:, 0]).copy()
6969
cart_comm.Sendrecv(send_buffer, left, recvbuf=right_halo, source=right)
70-
send_buffer = np.array(matrix[:, -1])
70+
send_buffer = np.array(matrix[:, -1]).copy()
7171
cart_comm.Sendrecv(send_buffer, right, recvbuf=left_halo, source=left)
7272
# row data is contiguous and can be used as a sendbuffer without copying
7373
cart_comm.Sendrecv(matrix[0, :], up, recvbuf=lower_halo, source=down)

0 commit comments

Comments
 (0)