@@ -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