Skip to content

Commit

Permalink
Change maximum number of threads so no memory issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbinBouwmeester committed Nov 20, 2023
1 parent 56ff1e1 commit 6638ba3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [2.2.26] - 2023-11-15

- Fix memory usage, limit threads

# [2.2.25] - 2023-11-15

- Fixed multiprocessing
Expand Down
6 changes: 4 additions & 2 deletions deeplc/deeplc.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ def __init__(
self.n_jobs = n_jobs

max_threads = multiprocessing.cpu_count()
# Hard limit the number of threads if not provided as
# most times it will run into a memory issue otherwise
if not self.n_jobs:
self.n_jobs = max_threads
self.n_jobs = int(max_threads / 5.0) + 1
elif self.n_jobs > max_threads:
self.n_jobs = max_threads
self.n_jobs = int(max_threads / 5.0) + 1

self.use_library = use_library
self.write_library = write_library
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="deeplc",
version="2.2.25",
version="2.2.26",
license="apache-2.0",
description="DeepLC: Retention time prediction for (modified) peptides using Deep Learning.",
long_description=LONG_DESCRIPTION,
Expand Down

0 comments on commit 6638ba3

Please sign in to comment.