Skip to content

Commit 6638ba3

Browse files
Change maximum number of threads so no memory issues
1 parent 56ff1e1 commit 6638ba3

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to
66
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
# [2.2.26] - 2023-11-15
9+
10+
- Fix memory usage, limit threads
11+
812
# [2.2.25] - 2023-11-15
913

1014
- Fixed multiprocessing

deeplc/deeplc.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,12 @@ def __init__(
249249
self.n_jobs = n_jobs
250250

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

257259
self.use_library = use_library
258260
self.write_library = write_library

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="deeplc",
9-
version="2.2.25",
9+
version="2.2.26",
1010
license="apache-2.0",
1111
description="DeepLC: Retention time prediction for (modified) peptides using Deep Learning.",
1212
long_description=LONG_DESCRIPTION,

0 commit comments

Comments
 (0)