Description: adjust multiprocessed pipeline to the machine's available cores
 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.
Author: Étienne Mollier <emollier@debian.org>
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
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- python-ruffus.orig/ruffus/test/test_with_logger.py
+++ python-ruffus/ruffus/test/test_with_logger.py
@@ -189,7 +189,7 @@
             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 @@
         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__':
