From eb132f923b51c1591f517a622a6fc35cf088b444 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 11 Sep 2013 19:21:22 +0000 Subject: [PATCH] Check for bozo error of negative np for an app as this will cause ORTE to spin forever. cmr:v1.7.3:reviewer=jsquyres:subject=Check for negative np cmr:v1.6.6:reviewer=jsquyres:subject=Check for negative np This commit was SVN r29157. --- orte/tools/orterun/help-orterun.txt | 9 +++++++++ orte/tools/orterun/orterun.c | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/orte/tools/orterun/help-orterun.txt b/orte/tools/orterun/help-orterun.txt index a8f09455f6..24070c596d 100644 --- a/orte/tools/orterun/help-orterun.txt +++ b/orte/tools/orterun/help-orterun.txt @@ -630,3 +630,12 @@ More than one combiner was specified. The combiner takes the output from the final reducer in each chain to produce a single, combined result. Thus, there can only be one combiner for a job. Please review your command line and try again. +# +[orterun:negative-nprocs] +%s has detected that one or more applications was given a negative +number of processes to run: + + Application: %s + Num procs: %d + +Please correct this value and try again. diff --git a/orte/tools/orterun/orterun.c b/orte/tools/orterun/orterun.c index e42634c551..beae15cf27 100644 --- a/orte/tools/orterun/orterun.c +++ b/orte/tools/orterun/orterun.c @@ -14,6 +14,7 @@ * Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2013 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -1845,10 +1846,15 @@ static int create_app(int argc, char* argv[], } } - /* Get the numprocs */ + /* check for bozo error */ + if (0 > orterun_globals.num_procs) { + orte_show_help("help-orterun.txt", "orterun:negative-nprocs", + true, orte_basename, app->argv[0], + orterun_globals.num_procs, NULL); + return ORTE_ERR_FATAL; + } app->num_procs = (orte_std_cntr_t)orterun_globals.num_procs; - total_num_apps++; /* Capture any preload flags */