Skip to content

Commit a3e9023

Browse files
committed
Fix deadlock
1 parent 606853e commit a3e9023

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmarks/bench_ping_pong_latency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def ping_pong(
4545
token_second_done = i + 2
4646
if curr_rank == first_rank:
4747
iris.store(data + offsets, i, curr_rank, peer_rank, heap_bases, mask=data_mask)
48-
iris.store(flag + offsets, token_first_done, curr_rank, peer_rank, heap_bases, mask=flag_mask)
48+
iris.atomic_xchg(flag + offsets, token_first_done, curr_rank, peer_rank, heap_bases, mask=flag_mask)
4949
while tl.load(flag, cache_modifier=".cv", volatile=True) != token_second_done:
5050
pass
5151
else:
5252
while tl.load(flag, cache_modifier=".cv", volatile=True) != token_first_done:
5353
pass
5454
iris.store(data + offsets, i, curr_rank, peer_rank, heap_bases, mask=data_mask)
55-
iris.store(flag + offsets, token_second_done, curr_rank, peer_rank, heap_bases, mask=flag_mask)
55+
iris.atomic_xchg(flag + offsets, token_second_done, curr_rank, peer_rank, heap_bases, mask=flag_mask)
5656

5757
stop = read_realtime()
5858
tl.store(mm_end_timestamp_ptr + peer_rank * BLOCK_SIZE + offsets, stop, time_stmp_mask)

0 commit comments

Comments
 (0)