From 670c0e07ec13243f4aa69f3d6dd5f937d110658e Mon Sep 17 00:00:00 2001 From: David Emms Date: Tue, 29 Jun 2021 10:29:26 +0100 Subject: [PATCH] Check requested number of threads is positive, resolves #567 --- scripts_of/__main__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts_of/__main__.py b/scripts_of/__main__.py index bea8af63..b5dbbee8 100755 --- a/scripts_of/__main__.py +++ b/scripts_of/__main__.py @@ -1200,6 +1200,14 @@ def ProcessArgs(prog_caller, args): if options.nProcessAlg is None: options.nProcessAlg = min(16, max(1, int(options.nBlast/8))) + if options.nBlast < 1: + print("ERROR: Number of '-t' threads cannot be fewer than 1, got %d" % options.nBlast) + util.Fail() + + if options.nProcessAlg < 1: + print("ERROR: Number of '-a' threads cannot be fewer than 1, got %d" % options.nProcessAlg) + util.Fail() + # check argument combinations if not (options.qStartFromFasta or options.qStartFromBlast or options.qStartFromGroups or options.qStartFromTrees): print("ERROR: Please specify the input directory for OrthoFinder using one of the options: '-f', '-b', '-fg' or '-ft'.")