Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
caic99 committed Dec 19, 2024
1 parent 5ad15d1 commit 96c9f03
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions deepmd/pt/utils/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ def construct_dataset(system):
if global_rank == 0:
with Pool(os.cpu_count()) as pool:
self.systems = pool.map(construct_dataset, systems)
if dist.is_initialized():
dist.broadcast_object_list(self.systems)
else:
self.systems = [None] * len(systems) # type: ignore
if dist.is_initialized():
dist.broadcast_object_list(self.systems)
assert self.systems[-1] is not None
self.sampler_list: list[DistributedSampler] = []
Expand Down

0 comments on commit 96c9f03

Please sign in to comment.