From e4f8ad303e51455cb9ed15b0a7e919ed376502f1 Mon Sep 17 00:00:00 2001 From: Tim Prins Date: Mon, 25 Sep 2006 19:41:54 +0000 Subject: [PATCH] Fix for #397 on 64 bit platforms sizeof(size_t) != sizeof(orte_std_cntr_t), and we were incorrectly assuming this when dealing with num procs. It worked on little endian platforms, but not big endian. So change num_procs to type int, and cast where needed. This commit was SVN r11796. --- orte/tools/orterun/orterun.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/orte/tools/orterun/orterun.c b/orte/tools/orterun/orterun.c index 931b20a9d1..8d67525359 100644 --- a/orte/tools/orterun/orterun.c +++ b/orte/tools/orterun/orterun.c @@ -111,7 +111,7 @@ struct globals_t { bool no_oversubscribe; bool debugger; bool no_local_schedule; - orte_std_cntr_t num_procs; + int num_procs; int exit_status; char *hostfile; char *env_val; @@ -153,10 +153,10 @@ opal_cmd_line_init_t cmd_line_init[] = { /* Number of processes; -c, -n, --n, -np, and --np are all synonyms */ { NULL, NULL, NULL, 'c', "np", "np", 1, - &orterun_globals.num_procs, OPAL_CMD_LINE_TYPE_SIZE_T, + &orterun_globals.num_procs, OPAL_CMD_LINE_TYPE_INT, "Number of processes to run" }, { NULL, NULL, NULL, '\0', "n", "n", 1, - &orterun_globals.num_procs, OPAL_CMD_LINE_TYPE_SIZE_T, + &orterun_globals.num_procs, OPAL_CMD_LINE_TYPE_INT, "Number of processes to run" }, /* Set a hostfile */ @@ -1414,7 +1414,7 @@ static int create_app(int argc, char* argv[], orte_app_context_t **app_ptr, /* Get the numprocs */ - app->num_procs = orterun_globals.num_procs; + app->num_procs = (orte_std_cntr_t)orterun_globals.num_procs; /* If the user didn't specify the number of processes to run, then we default to launching an app process using every slot. We can't do