From 1599cca5e4b8ed7ea5fdf1f9951af6170d2d4611 Mon Sep 17 00:00:00 2001 From: Kirill Suvorov Date: Fri, 13 Sep 2024 13:01:33 +0200 Subject: [PATCH] FIX-#425: Fix type of shared MPI.buffer (#426) Signed-off-by: Kirill Suvorov --- unidist/core/backends/mpi/core/shared_object_store.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unidist/core/backends/mpi/core/shared_object_store.py b/unidist/core/backends/mpi/core/shared_object_store.py index 2b34057e..4aff7c4e 100644 --- a/unidist/core/backends/mpi/core/shared_object_store.py +++ b/unidist/core/backends/mpi/core/shared_object_store.py @@ -445,13 +445,17 @@ def _read_from_shared_buffer(self, data_id, shared_info): first_index = self.service_shared_buffer[service_index + self.FIRST_DATA_INDEX] s_data_last_index = first_index + s_data_len - s_data = self.shared_buffer[first_index:s_data_last_index].toreadonly() + s_data = ( + self.shared_buffer[first_index:s_data_last_index].cast("b").toreadonly() + ) prev_last_index = s_data_last_index raw_buffers = [] for raw_buffer_len in buffer_lens: raw_last_index = prev_last_index + raw_buffer_len raw_buffers.append( - self.shared_buffer[prev_last_index:raw_last_index].toreadonly() + self.shared_buffer[prev_last_index:raw_last_index] + .cast("b") + .toreadonly() ) prev_last_index = raw_last_index