def _set_env_vars(self):
        """
        Sets environment variables for world size, rank, local rank, master addr, and master port.
        """
        os.environ['WORLD_SIZE'] = str(self.world_size)
        os.environ['RANK'] = str(self.rank)
        os.environ["LOCAL_RANK"] = str(self.local_rank)
        os.environ['MASTER_ADDR'] = self.master_address
        os.environ['MASTER_PORT'] = self.master_port

        Sets environment variables for world size, rank, local rank, master addr, and master port.
        
trainer/utils/mpi_adapter.py