for key, comm in self._p2p_comm_cache.items():
comm.destroy()
min_rank, max_rank = self._parse_p2p_group_key(key)
if self.rank == min_rank:
self._destroy_store(key)
self._p2p_comm_cache[key] = None
for key in list(self._p2p_comm_cache.keys()):
del self._p2p_comm_cache[key]
self._p2p_comm_cache = None
After Change
// Destroy the communicators and streams.
for comm_key, comms in self._dev_comm_map.items():
for c in comms:
c.destroy()
self._dev_comm_map[comm_key] = None
if self.rank == 0:
for comm_key in self._dev_comm_map: