Skip to content

Commit

Permalink
enh: reserve one CPU for writer thread and control logic
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed May 31, 2024
1 parent c97dcc4 commit cf15ed3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
0.20.4
- enh: reserve one CPU for writer thread and control logic
- enh: disentangle logging and debugging keyword arguments
0.20.3
- enh: improve strategy for stalling for slow writer
Expand Down
4 changes: 4 additions & 0 deletions src/dcnum/logic/ctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,13 @@ def task_segment_extract(self):
# Split segmentation and feature extraction workers evenly.
num_extractors = self.job["num_procs"] // 2
num_segmenters = self.job["num_procs"] - num_extractors
# leave one CPU for the writer and the remaining Threads
num_segmenters -= 1
else: # GPU segmenter
num_slots = 3
num_extractors = self.job["num_procs"]
# leave one CPU for the writer and the remaining Threads
num_extractors -= 1
num_segmenters = 1
num_extractors = max(1, num_extractors)
num_segmenters = max(1, num_segmenters)
Expand Down

0 comments on commit cf15ed3

Please sign in to comment.