From 2a18ebd9e138ed4cdff78fe888f4ba54923dc3d3 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 23 Mar 2006 16:53:11 +0000 Subject: [PATCH] Fix the app_context problem. NOTE: JEFF SHOULD CHECK THIS! I found that orterun was not tracking the index number of the app_contexts it was creating. Hence, the app_context->idx field was always sitting at zero. This index is used by the mapper to decide which app_context to use for each process - thus, with the value of each index being zero, the mapper only used the first app_context that was created. All others were ignored. Not sure when this might have gotten changed. Could be it was a problem that always existed, but didn't get exposed until something else was changed. Anyway, it seems to work now - could stand further testing. This commit was SVN r9389. --- orte/tools/orterun/orterun.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/orte/tools/orterun/orterun.c b/orte/tools/orterun/orterun.c index 144a7624a1..f556078ac3 100644 --- a/orte/tools/orterun/orterun.c +++ b/orte/tools/orterun/orterun.c @@ -35,7 +35,7 @@ #ifdef HAVE_SYS_WAIT_H #include #endif /* HAVE_SYS_WAIT_H */ -#ifdef HAVE_LIBGEN_H +#ifdef HAVE_LIBGEN_H #include #endif @@ -233,7 +233,7 @@ opal_cmd_line_init_t cmd_line_init[] = { { NULL, NULL, NULL, '\0', NULL, "prefix", 1, NULL, OPAL_CMD_LINE_TYPE_STRING, "Prefix where Open MPI is installed on remote nodes" }, - + /* End of list */ { NULL, NULL, NULL, '\0', NULL, NULL, 0, NULL, OPAL_CMD_LINE_TYPE_NULL, NULL } @@ -842,6 +842,9 @@ static int parse_locals(int argc, char* argv[]) app = OBJ_NEW(orte_app_context_t); rc = create_app(temp_argc, temp_argv, &app, &made_app, &env); + /** keep track of the number of apps - point this app_context to that index */ + app->idx = app_num; + app_num++; if (ORTE_SUCCESS != rc) { /* Assume that the error message has already been printed; no need to cleanup -- we can just @@ -869,6 +872,8 @@ static int parse_locals(int argc, char* argv[]) if (opal_argv_count(temp_argv) > 1) { app = OBJ_NEW(orte_app_context_t); rc = create_app(temp_argc, temp_argv, &app, &made_app, &env); + app->idx = app_num; + app_num++; if (ORTE_SUCCESS != rc) { /* Assume that the error message has already been printed; no need to cleanup -- we can just exit */