File: reasonable-multiprocessing.patch

package info (click to toggle)
python-ruffus 2.8.4-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,492 kB
  • sloc: python: 17,613; makefile: 213; sh: 18
file content (38 lines) | stat: -rw-r--r-- 1,632 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: =?utf-8?q?=C3=89tienne_Mollier?= <emollier@debian.org>
Date: Sun, 8 Mar 2026 11:17:36 +0100
Subject: adjust multiprocessed pipeline to the machine's available cores

Bug: https://github.com/cgat-developers/ruffus/issues/104
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841073
Last-Update: 2021-12-06

The purpose of the patch is to reduce the memory consumption on machines with
little resources, while keeping the tests of high cores count to more buffy
equipment.
Last-Update: 2021-12-06
---
 ruffus/test/test_with_logger.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ruffus/test/test_with_logger.py b/ruffus/test/test_with_logger.py
index 085b4cf..10a07e4 100755
--- a/ruffus/test/test_with_logger.py
+++ b/ruffus/test/test_with_logger.py
@@ -189,7 +189,7 @@ class Test_ruffus(unittest.TestCase):
             pass
 
     def test_simpler(self):
-        pipeline_run(multiprocess=500, verbose=0, pipeline="main")
+        pipeline_run(multiprocess=len(os.sched_getaffinity(0)), verbose=0, pipeline="main")
 
     def test_newstyle_simpler(self):
         test_pipeline = Pipeline("test")
@@ -202,7 +202,7 @@ class Test_ruffus(unittest.TestCase):
         test_pipeline.merge(task4, task3, final_file_name,
                             extras=[logger_proxy, logging_mutex])
         #test_pipeline.merge(task4, task3, final_file_name, extras = {"logger_proxy": logger_proxy, "logging_mutex": logging_mutex})
-        test_pipeline.run(multiprocess=500, verbose=0)
+        test_pipeline.run(multiprocess=len(os.sched_getaffinity(0)), verbose=0)
 
 
 if __name__ == '__main__':