You can synchronize the processes and then perform the variable update on your desired rank process.
Then you will need to distribute the aggregated value to the other ranks.
import torch
import torch.distributed as dist

RANK = 0 #  your target rank
...
dist.barrier() # synchronize (wait for the slowest process)
if dist.get_rank() == RANK:
    self.x = aggregate()