From 02a59384b1e22f97dab3f467edd2ce75370a2e40 Mon Sep 17 00:00:00 2001 From: Yossi Farjoun Date: Fri, 19 Jul 2024 11:21:32 -0400 Subject: [PATCH 1/2] fix parallelism for osx --- src/sniffles/sniffles | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sniffles/sniffles b/src/sniffles/sniffles index fcde5ce..9a1fa90 100755 --- a/src/sniffles/sniffles +++ b/src/sniffles/sniffles @@ -10,6 +10,7 @@ # import logging import logging.config +import multiprocessing from typing import Optional from sniffles.utils.resmon import ResourceMonitor @@ -70,6 +71,8 @@ def Sniffles2_Main(processes: list[parallel.SnifflesWorker]): input_ext = [f.split(".")[-1].lower() for f in config.input] + # needed for running on osx + multiprocessing.set_start_method("fork") if len(set(input_ext)) > 1: util.fatal_error_main(f"Please specify either: A single .bam/.cram file - OR - one or more .snf files - OR - a single .tsv file containing a list of .snf files and optional sample ids as input. (supplied were: {list(set(input_ext))})") From b89b496d9ea0d53a1a9dd5a2309b34fdd7f9f277 Mon Sep 17 00:00:00 2001 From: Yossi Farjoun Date: Fri, 19 Jul 2024 23:27:32 -0400 Subject: [PATCH 2/2] only change default for "darwin" --- src/sniffles/sniffles | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sniffles/sniffles b/src/sniffles/sniffles index 9a1fa90..9a8d7d0 100755 --- a/src/sniffles/sniffles +++ b/src/sniffles/sniffles @@ -72,7 +72,9 @@ def Sniffles2_Main(processes: list[parallel.SnifflesWorker]): input_ext = [f.split(".")[-1].lower() for f in config.input] # needed for running on osx - multiprocessing.set_start_method("fork") + if sys.platform == "darwin": + multiprocessing.set_start_method("fork") + if len(set(input_ext)) > 1: util.fatal_error_main(f"Please specify either: A single .bam/.cram file - OR - one or more .snf files - OR - a single .tsv file containing a list of .snf files and optional sample ids as input. (supplied were: {list(set(input_ext))})")