Can I create the dict2 next to rpc.init_rpc as
if rank == 1:
        rpc.init_rpc("worker0", rank=rank, world_size=world_size)
        fn("worker1")
    else:
        # initial dict2 here.
        rpc.init_rpc("worker1", rank=rank, world_size=world_size)

My target is that each rank will hold their dictionary, and this dictionary is always available in the program. In your code, If I repeat the run() function, The dict1 is initial again.
For example, rank 0 call run function on rank 1. Your codes is good. But I wanna run it several time, and after calling function on rank 1. The rank 1 changes something in the dictionary. Then, in the next iteration, rank0 wanna get the value from updated dictionary on rank1.
Thanks,