use .to_dict()

This commit is contained in:
Empyreus
2026-06-18 00:01:41 +00:00
parent e48c6da34b
commit 24187fcded
2 changed files with 4 additions and 4 deletions

View File

@@ -984,10 +984,10 @@ class SwitchChannel:
self.src_rank = rank
if src_chunk.rank not in self.rank_group.ranks:
raise RuntimeError(
f"Destination chunk rank {src_chunk.rank} is not part of the rank group {self.rank_group.ranks}."
f"Source chunk rank {src_chunk.rank} is not part of the rank group {self.rank_group.ranks}."
)
if src_chunk.size != size:
raise RuntimeError(f"Destination chunk size {src_chunk.size} does not match the required size {size}.")
raise RuntimeError(f"Source chunk size {src_chunk.size} does not match the required size {size}.")
for rank in self.rank_group.ranks:
if self.buffer_type == BufferType.scratch:

View File

@@ -926,7 +926,7 @@ class GroupStore(BaseOperation):
def to_dict(self):
result = {"name": self.name.value}
result["src_buff"] = [{"type": self.src_chunk.buffer.value, "index": self.src_chunk.index, "size": self.size}]
result["src_buff"] = [self.src_chunk.to_dict()]
result["dst_buff"] = [
{"switch_channel_id": self.channel_ids[0], "index": self.buffer_offset, "size": self.size}
]
@@ -958,7 +958,7 @@ class GroupStorePacket(BaseOperation):
def to_dict(self):
result = {"name": self.name.value}
result["src_buff"] = [{"type": self.src_chunk.buffer.value, "index": self.src_chunk.index, "size": self.size}]
result["src_buff"] = [self.src_chunk.to_dict()]
result["dst_buff"] = [
{"switch_channel_id": self.channel_ids[0], "index": self.buffer_offset, "size": self.size}
]