Skip to content

Commit 7b3cecd

Browse files
committed
Use host_array to make buffers to receive into
1 parent 4f1f493 commit 7b3cecd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

distributed/comm/ucx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,17 @@ async def read(self, deserializers=("cuda", "dask", "pickle", "error")):
222222
try:
223223
# Recv meta data
224224
nframes_fmt = "Q"
225-
nframes = bytearray(struct.calcsize(nframes_fmt))
225+
nframes = host_array(struct.calcsize(nframes_fmt))
226226
await self.ep.recv(nframes)
227227
(nframes,) = struct.unpack(nframes_fmt, nframes)
228228

229229
cuda_frames_fmt = nframes * "?"
230-
cuda_frames = bytearray(struct.calcsize(cuda_frames_fmt))
230+
cuda_frames = host_array(struct.calcsize(cuda_frames_fmt))
231231
await self.ep.recv(cuda_frames)
232232
cuda_frames = struct.unpack(cuda_frames_fmt, cuda_frames)
233233

234234
sizes_fmt = nframes * "Q"
235-
sizes = bytearray(struct.calcsize(sizes_fmt))
235+
sizes = host_array(struct.calcsize(sizes_fmt))
236236
await self.ep.recv(sizes)
237237
sizes = struct.unpack(sizes_fmt, sizes)
238238
except (ucp.exceptions.UCXBaseException, CancelledError):

0 commit comments

Comments
 (0)