Skip to content

Commit

Permalink
using env.NUM_WORKERS for pool size
Browse files Browse the repository at this point in the history
Signed-off-by: Chun Cai <[email protected]>
  • Loading branch information
caic99 authored Dec 25, 2024
1 parent 1dcc5d5 commit feb5902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/pt/utils/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def construct_dataset(system):
global_rank = dist.get_rank() if dist.is_initialized() else 0
if global_rank == 0:
log.info(f"Constructing DataLoaders from {len(systems)} systems")
with Pool(os.cpu_count()) as pool:
with Pool(env.NUM_WORKERS) as pool:
self.systems = pool.map(construct_dataset, systems)
else:
self.systems = [None] * len(systems) # type: ignore
Expand Down

0 comments on commit feb5902

Please sign in to comment.