Skip to content

Commit

Permalink
set default nproc to the number of logical CPUs the current process c…
Browse files Browse the repository at this point in the history
…an use (#191)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Nov 15, 2023
1 parent 7bf3f2d commit 1954d5d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mddatasetbuilder/datasetbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import tempfile
import time
from collections import Counter, defaultdict
from multiprocessing import cpu_count

import numpy as np
from ase.data import atomic_numbers
Expand Down Expand Up @@ -125,7 +124,7 @@ def __init__(
self.clusteratom = clusteratom if clusteratom else atomname
self.atombondtype = []
self.stepinterval = stepinterval
self.nproc = nproc if nproc else cpu_count()
self.nproc = nproc if nproc else len(os.sched_getaffinity(0))
self.cutoff = cutoff
self.n_clusters = n_clusters
self.n_each = n_each
Expand Down

0 comments on commit 1954d5d

Please sign in to comment.