Hi,

It seems that OMPI_MCA environment variables with spaces (for rsh?) are incorrectly escaped.

This happens with version 1.8 and 1.8.1. I did not try Version 1.7!

To reproduce:

0) ./configure && make && make install # no special configure flags required
1) Create a host file, with a couple of hostnames in it.
2) export OMPI_MCA_mpi_show_handle_leaks="1 --foo"
3) mpirun -hostfile /path/to/hostfile -n 1 /code/to/mpi.exe

Expected:

--------------------------------------------------------------------------
An invalid value was supplied for an enum variable.

  Variable     : mpi_show_handle_leaks
  Value        : 1 --foo
  Valid values : 0: f|false|disabled, 1: t|true|enabled
--------------------------------------------------------------------------
...

Actual:

orted: Error: unknown option "--foo"
Type 'orted --help' for usage.
Usage: orted [OPTION]...
   -am <arg0>            Aggregate MCA parameter set file list
...


A potential patch that fixes the problem (but then I don't know why ";" would be considered a special character in the first place).

--- ./orte/mca/plm/rsh/plm_rsh_module.c.orig 2014-07-18 17:25:38.477318000 +0100 +++ ./orte/mca/plm/rsh/plm_rsh_module.c 2014-07-18 17:25:06.936780000 +0100
@@ -618,7 +618,7 @@
                     /* if the value has a special character in it,
                      * then protect it with quotes
                      */
-                    if (NULL != strchr(value, ';')) {
+                    if (NULL != strchr(value, ' ')) {
                         char *p2;
                         asprintf(&p2, "\"%s\"", value);
                         opal_argv_append(&argc, &argv, p2);

Regards,
Dirk

Reply via email to