From bfe89ab121fe6f50527ecd71337593b0dc57b30d Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 15 Nov 2023 17:16:28 -0500 Subject: [PATCH 1/2] set default nproc to the number of logical CPUs the current process can use --- mddatasetbuilder/datasetbuilder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mddatasetbuilder/datasetbuilder.py b/mddatasetbuilder/datasetbuilder.py index 65d7c57..5b504f8 100644 --- a/mddatasetbuilder/datasetbuilder.py +++ b/mddatasetbuilder/datasetbuilder.py @@ -125,7 +125,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 From bee1e222c794cc96db3edbeac30c9ef5d2a85349 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:16:49 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mddatasetbuilder/datasetbuilder.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mddatasetbuilder/datasetbuilder.py b/mddatasetbuilder/datasetbuilder.py index 5b504f8..5b6d320 100644 --- a/mddatasetbuilder/datasetbuilder.py +++ b/mddatasetbuilder/datasetbuilder.py @@ -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