Skip to content

Commit f2b1254

Browse files
authored
Merge pull request #1287 from deeptools/overcommitted_cpus
Overcommitted cpus
2 parents 5790f38 + 8fc7c79 commit f2b1254

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* initiate deprecation of tight_layout in plotheatmap, in favor of constrained_layout. Minor changes in paddings, etc can occur (but for the better).
66
* documentation changes to improve ESS tab, table constraints have been lifted & sphinx_rtd_theme to v2.0.0
77
* upload artifact in gh test runner pinned to 3
8+
* Try to get the number of processors from sched_getaffinity, to avoid using to many in job submissions for example. #1199
9+
* Fix typo in estimateScaleFactor that fixes broken argparsing. #1286
810

911
3.5.4
1012
* error handling and cases for bwAverage with >2 samples

deeptools/estimateScaleFactor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def main(args=None):
9898
between to samples
9999
100100
"""
101-
args = parseArguments().parse_args(args)
101+
args = parseArguments(args)
102102
if len(args.bamfiles) > 2:
103103
print("SES method to estimate scale factors only works for two samples")
104104
exit(0)

deeptools/parserCommon.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
import os
33
from importlib.metadata import version
4+
import multiprocessing
45

56

67
def check_float_0_1(value):
@@ -341,8 +342,12 @@ def getParentArgParse(args=None, binSize=True, blackList=True):
341342

342343

343344
def numberOfProcessors(string):
344-
import multiprocessing
345-
availProc = multiprocessing.cpu_count()
345+
try:
346+
# won't work on macOS or windows
347+
# limit threads to what is available (e.g. grid submissions, issue #1199)
348+
availProc = len(os.sched_getaffinity(0))
349+
except AttributeError:
350+
availProc = multiprocessing.cpu_count()
346351

347352
if string == "max/2": # default case
348353
# by default half of the available processors are used

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy