Skip to content

Commit

Permalink
Merge pull request #1287 from deeptools/overcommitted_cpus
Browse files Browse the repository at this point in the history
Overcommitted cpus
  • Loading branch information
WardDeb authored Jan 17, 2024
2 parents 5790f38 + 8fc7c79 commit f2b1254
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* initiate deprecation of tight_layout in plotheatmap, in favor of constrained_layout. Minor changes in paddings, etc can occur (but for the better).
* documentation changes to improve ESS tab, table constraints have been lifted & sphinx_rtd_theme to v2.0.0
* upload artifact in gh test runner pinned to 3
* Try to get the number of processors from sched_getaffinity, to avoid using to many in job submissions for example. #1199
* Fix typo in estimateScaleFactor that fixes broken argparsing. #1286

3.5.4
* error handling and cases for bwAverage with >2 samples
Expand Down
2 changes: 1 addition & 1 deletion deeptools/estimateScaleFactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def main(args=None):
between to samples
"""
args = parseArguments().parse_args(args)
args = parseArguments(args)
if len(args.bamfiles) > 2:
print("SES method to estimate scale factors only works for two samples")
exit(0)
Expand Down
9 changes: 7 additions & 2 deletions deeptools/parserCommon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import os
from importlib.metadata import version
import multiprocessing


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


def numberOfProcessors(string):
import multiprocessing
availProc = multiprocessing.cpu_count()
try:
# won't work on macOS or windows
# limit threads to what is available (e.g. grid submissions, issue #1199)
availProc = len(os.sched_getaffinity(0))
except AttributeError:
availProc = multiprocessing.cpu_count()

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

0 comments on commit f2b1254

Please sign in to comment.