Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Joshua Ladd
*An enhancement to permit some form of delimiter escaping would probably
still be nice, but is low priority.*
[Josh] Not a problem, Dave. We will do this.


On Wed, Jul 16, 2014 at 4:32 PM, Dave Goodell (dgoodell)  wrote:

> On Jul 16, 2014, at 3:08 PM, Joshua Ladd  wrote:
>
> > Ralph warned me that no matter what decision we made, someone would
> probably violently object. So, with that in mind, let me put my diplomat
> hat on...
>
> FWIW, I don't think my objections here have been "violent".
>
> > Dave, I'm sorry you view this as a "crapification" of your mpirun user
> interface. Your lament is duly noted and we are happy to work with you to
> come to (yet another) happy compromise. It's unfortunate that the issue
> wasn't raised during the dev meeting when these decisions were made (you
> were sitting right next to me while I discussed this out loud with Jeff and
> Ralph.) At the time, it seemed all interested parties had expressed their
> concern and voiced their opinion on the matter, and the implementation you
> see in the trunk today, including the decision to deprecate the "-x"
> option, was the generally agreed upon consensus.
>
> I think I misunderstood that the "-x" option was going away altogether, so
> sorry for the after-the-fact complaints.  Probably poor listening on my
> part, but I don't think that changes my opinion on the UI impact.
>
> I'm aware that I'm in the minority here.  I don't think that I care enough
> to continue arguing over this, so let's just let it be as-is.  An
> enhancement to permit some form of delimiter escaping would probably still
> be nice, but is low priority.
>
> -Dave
>
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/07/15185.php
>


Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Dave Goodell (dgoodell)
On Jul 16, 2014, at 3:08 PM, Joshua Ladd  wrote:

> Ralph warned me that no matter what decision we made, someone would probably 
> violently object. So, with that in mind, let me put my diplomat hat on...

FWIW, I don't think my objections here have been "violent".

> Dave, I'm sorry you view this as a "crapification" of your mpirun user 
> interface. Your lament is duly noted and we are happy to work with you to 
> come to (yet another) happy compromise. It's unfortunate that the issue 
> wasn't raised during the dev meeting when these decisions were made (you were 
> sitting right next to me while I discussed this out loud with Jeff and 
> Ralph.) At the time, it seemed all interested parties had expressed their 
> concern and voiced their opinion on the matter, and the implementation you 
> see in the trunk today, including the decision to deprecate the "-x" option, 
> was the generally agreed upon consensus. 

I think I misunderstood that the "-x" option was going away altogether, so 
sorry for the after-the-fact complaints.  Probably poor listening on my part, 
but I don't think that changes my opinion on the UI impact.

I'm aware that I'm in the minority here.  I don't think that I care enough to 
continue arguing over this, so let's just let it be as-is.  An enhancement to 
permit some form of delimiter escaping would probably still be nice, but is low 
priority.

-Dave



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Joshua Ladd
Ralph warned me that no matter what decision we made, someone would
probably violently object. So, with that in mind, let me put my diplomat
hat on...

Dave, I'm sorry you view this as a "crapification" of your mpirun user
interface. Your lament is duly noted and we are happy to work with you to
come to (yet another) happy compromise. It's unfortunate that the issue
wasn't raised during the dev meeting when these decisions were made (you
were sitting right next to me while I discussed this out loud with Jeff and
Ralph.) At the time, it seemed all interested parties had expressed their
concern and voiced their opinion on the matter, and the implementation you
see in the trunk today, including the decision to deprecate the "-x"
option, was the generally agreed upon consensus.

Josh


On Wed, Jul 16, 2014 at 2:43 PM, Ralph Castain  wrote:

>
> On Jul 16, 2014, at 11:34 AM, Dave Goodell (dgoodell) 
> wrote:
>
> > On Jul 16, 2014, at 12:15 PM, Mike Dubman 
> wrote:
> >
> >> we have a strong use-case for list of env variables passed as mca
> params.(it was presented and discussed in the past).
> >
> > I'm not disputing your use case for "mca_base_env_list".  I'm only
> lamenting the crapification of our mpirun user interface.  We had an
> earlier change along these lines based on similar reasoning: the
> easy-to-use-and-remember "--pernode N" was replaced with "--map-by
> ppr:N:node", which I cannot ever seem to remember.
>
> Same reason, I'm afraid - no way to do the mapping
>
> >
> >> we can rename opal_base_envlist as "-mca x var=val" for consistency.
> >> also, "-x" param now is just an alias for "-mca opal_base_envlist
> var=val" - so, we can keep it (w/o deprecation warning) as it re-uses same
> infra.
> >
> > Mike, will you make this change?
> >
> > Thanks,
> > -Dave
> > ___
> > devel mailing list
> > de...@open-mpi.org
> > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> > Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/07/15181.php
>
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/07/15182.php
>


Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Ralph Castain

On Jul 16, 2014, at 11:34 AM, Dave Goodell (dgoodell)  
wrote:

> On Jul 16, 2014, at 12:15 PM, Mike Dubman  wrote:
> 
>> we have a strong use-case for list of env variables passed as mca params.(it 
>> was presented and discussed in the past).
> 
> I'm not disputing your use case for "mca_base_env_list".  I'm only lamenting 
> the crapification of our mpirun user interface.  We had an earlier change 
> along these lines based on similar reasoning: the easy-to-use-and-remember 
> "--pernode N" was replaced with "--map-by ppr:N:node", which I cannot ever 
> seem to remember.

Same reason, I'm afraid - no way to do the mapping

> 
>> we can rename opal_base_envlist as "-mca x var=val" for consistency.
>> also, "-x" param now is just an alias for "-mca opal_base_envlist var=val" - 
>> so, we can keep it (w/o deprecation warning) as it re-uses same infra.
> 
> Mike, will you make this change?
> 
> Thanks,
> -Dave
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/devel/2014/07/15181.php



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Dave Goodell (dgoodell)
On Jul 16, 2014, at 12:15 PM, Mike Dubman  wrote:

> we have a strong use-case for list of env variables passed as mca params.(it 
> was presented and discussed in the past).

I'm not disputing your use case for "mca_base_env_list".  I'm only lamenting 
the crapification of our mpirun user interface.  We had an earlier change along 
these lines based on similar reasoning: the easy-to-use-and-remember "--pernode 
N" was replaced with "--map-by ppr:N:node", which I cannot ever seem to 
remember.

> we can rename opal_base_envlist as "-mca x var=val" for consistency.
> also, "-x" param now is just an alias for "-mca opal_base_envlist var=val" - 
> so, we can keep it (w/o deprecation warning) as it re-uses same infra.

Mike, will you make this change?

Thanks,
-Dave

Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Dave Goodell (dgoodell)
On Jul 16, 2014, at 12:27 PM, Joshua Ladd  wrote:

> Dave,
> 
> Your example will error out. If someone tries to set envars with both 
> mechanism, the job fails. The decision to do so was also made at the Dev 
> meeting and is so that we don't have to do this kind of checking. 

Hmm, indeed it does.  I had mis-installed my OMPI build when I first tested 
this.  I also didn't expect that setting "-mca mca_base_env_list foo=quux" on 
the command line also would cause the environment to be updated for the code I 
previously quoted.

Apologies for the false bug alarm.

-Dave



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Joshua Ladd
Dave,

Your example will error out. If someone tries to set envars with both
mechanism, the job fails. The decision to do so was also made at the Dev
meeting and is so that we don't have to do this kind of checking.

Josh


On Wed, Jul 16, 2014 at 12:22 PM, Dave Goodell (dgoodell) <
dgood...@cisco.com> wrote:

> On Jul 15, 2014, at 2:03 PM, Mike Dubman  wrote:
>
> > these are two separate issues:
> >
> > 1. -x var=val (or -mca opal_base_envlist var=val) will work in the same
> way
> > opal_base_envlist does the same as "-x" and can be used in the very same
> fashion as -x
> >
> > 2. When list of vars is passed with help of opal_base_envlist, the
> escaping is possible but escaped char should differ from delimiter char.
>
> That would be my preference (use something like "\" as the escape char).
>  Though we could always go with a scheme where a doubled delimiter means
> "literal delimiter", sort of like "$$" in a Makefile.
>
> > I think -x should stay as shotrt-form alias for -mca opal_base_envlist
> var=val and -mca opal_base_envlist var.
> > on dev meeting it was decided to deprecate it as some point.
>
> Can we revisit this decision?  Mike and I both seem to be in favor of
> retaining "-x", at least for non-conflicting uses.  Would someone who is
> against retaining "-x" please speak up in favor of that position?
>
> Also, Mike, I just looked again at the code and I don't think it is
> robustly checking for conflict cases.  It's possible to do this and you
> won't get an error with the current code, right?
>
> 8<
> $ mpirun -mca mca_base_env_list foo=bar -x foo=baz ...
> 8<
>
> See this code, which only looks at the environment when looking for
> "mca_base_env_list":
>
> > Modified: trunk/orte/tools/orterun/orterun.c
> >
> ==
> > --- trunk/orte/tools/orterun/orterun.cTue Jul  8 20:10:04 2014
>  (r32162)
> > +++ trunk/orte/tools/orterun/orterun.c2014-07-08 20:38:25 EDT
> (Tue, 08 Jul 2014)  (r32163)
> > @@ -1722,6 +1722,13 @@
> >
> >  /* Did the user request to export any environment variables on the
> cmd line? */
> >  if (opal_cmd_line_is_taken(_line, "x")) {
> > +char* env_set_flag = getenv("OMPI_MCA_mca_base_env_list");
> > +if (NULL != env_set_flag) {
> > +orte_show_help("help-orterun.txt",
> "orterun:conflict-env-set", false);
> > +return ORTE_ERR_FATAL;
> > +} else {
> > +orte_show_help("help-orterun.txt",
> "orterun:deprecated-env-set", false);
> > +}
> >  j = opal_cmd_line_get_ninsts(_line, "x");
> >  for (i = 0; i < j; ++i) {
> >  param = opal_cmd_line_get_param(_line, "x", i, 0);
>
>
> -Dave
>
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/07/15173.php
>


Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Mike Dubman
we have a strong use-case for list of env variables passed as mca params.(it
was presented and discussed in the past).

we can rename opal_base_envlist as "-mca x var=val" for consistency.
also, "-x" param now is just an alias for "-mca opal_base_envlist var=val"
- so, we can keep it (w/o deprecation warning) as it re-uses same infra.



On Wed, Jul 16, 2014 at 8:10 PM, Ralph Castain  wrote:

> Don't look at me - I didn't care to begin with as I never use -x and won't
> be using this param! :-)
>
> My point was only that having both is clunky and leads to potential
> conflict. No good solution, so 
>
>
> On Jul 16, 2014, at 9:57 AM, Dave Goodell (dgoodell) 
> wrote:
>
> > On Jul 16, 2014, at 11:31 AM, Ralph Castain  wrote:
> >
> >> Nobody was "against" retaining it. The issue is that "-x" isn't an MCA
> parameter, nor does it get translated to one under the covers. So the
> problem was one of how to insert it into the typical MCA param precedence
> chain.
> >
> > I understand the combination of the two features is clunky and could
> lead to odd corner cases, but the "-x" argument is a feature I actually use
> on a fairly regular basis, but I am unlikely to use mca_base_env_list
> unless given no other choice.  It's just a worse, clunkier interface unless
> one really needs to set that MCA parameter via environment variable.
> >
> > So can we just strike the deprecation warning that is currently issued
> when "-x" is passed in the absence of "mca_base_env_list"?
> >
> > -Dave
> >
> > ___
> > devel mailing list
> > de...@open-mpi.org
> > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> > Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/07/15176.php
>
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/07/15177.php
>


Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Ralph Castain
Don't look at me - I didn't care to begin with as I never use -x and won't be 
using this param! :-)

My point was only that having both is clunky and leads to potential conflict. 
No good solution, so 


On Jul 16, 2014, at 9:57 AM, Dave Goodell (dgoodell)  wrote:

> On Jul 16, 2014, at 11:31 AM, Ralph Castain  wrote:
> 
>> Nobody was "against" retaining it. The issue is that "-x" isn't an MCA 
>> parameter, nor does it get translated to one under the covers. So the 
>> problem was one of how to insert it into the typical MCA param precedence 
>> chain.
> 
> I understand the combination of the two features is clunky and could lead to 
> odd corner cases, but the "-x" argument is a feature I actually use on a 
> fairly regular basis, but I am unlikely to use mca_base_env_list unless given 
> no other choice.  It's just a worse, clunkier interface unless one really 
> needs to set that MCA parameter via environment variable.
> 
> So can we just strike the deprecation warning that is currently issued when 
> "-x" is passed in the absence of "mca_base_env_list"?
> 
> -Dave
> 
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/devel/2014/07/15176.php



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Dave Goodell (dgoodell)
On Jul 16, 2014, at 11:31 AM, Ralph Castain  wrote:

> Nobody was "against" retaining it. The issue is that "-x" isn't an MCA 
> parameter, nor does it get translated to one under the covers. So the problem 
> was one of how to insert it into the typical MCA param precedence chain.

I understand the combination of the two features is clunky and could lead to 
odd corner cases, but the "-x" argument is a feature I actually use on a fairly 
regular basis, but I am unlikely to use mca_base_env_list unless given no other 
choice.  It's just a worse, clunkier interface unless one really needs to set 
that MCA parameter via environment variable.

So can we just strike the deprecation warning that is currently issued when 
"-x" is passed in the absence of "mca_base_env_list"?

-Dave



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Ralph Castain
Nobody was "against" retaining it. The issue is that "-x" isn't an MCA 
parameter, nor does it get translated to one under the covers. So the problem 
was one of how to insert it into the typical MCA param precedence chain.

If we don't try to do that, but instead simply error out if both -x and the MCA 
param are present, then that resolves the problem. However, and this is a big 
"but", remember that there is no way to "unset" an MCA param. So if someone 
puts the mca_base_env_list param into the default MCA param file, then there is 
no way a user can put -x on the cmd line because the conflict will be detected 
- and they can't turn "off" the MCA param to resolve it.

The inconsistent behavior may prove highly annoying in the user community, but 
I don't know how widely used this feature will be.


On Jul 16, 2014, at 9:22 AM, Dave Goodell (dgoodell)  wrote:

> On Jul 15, 2014, at 2:03 PM, Mike Dubman  wrote:
> 
>> these are two separate issues:
>> 
>> 1. -x var=val (or -mca opal_base_envlist var=val) will work in the same way
>> opal_base_envlist does the same as "-x" and can be used in the very same 
>> fashion as -x
>> 
>> 2. When list of vars is passed with help of opal_base_envlist, the escaping 
>> is possible but escaped char should differ from delimiter char.
> 
> That would be my preference (use something like "\" as the escape char).  
> Though we could always go with a scheme where a doubled delimiter means 
> "literal delimiter", sort of like "$$" in a Makefile.
> 
>> I think -x should stay as shotrt-form alias for -mca opal_base_envlist 
>> var=val and -mca opal_base_envlist var.
>> on dev meeting it was decided to deprecate it as some point.
> 
> Can we revisit this decision?  Mike and I both seem to be in favor of 
> retaining "-x", at least for non-conflicting uses.  Would someone who is 
> against retaining "-x" please speak up in favor of that position?
> 
> Also, Mike, I just looked again at the code and I don't think it is robustly 
> checking for conflict cases.  It's possible to do this and you won't get an 
> error with the current code, right?
> 
> 8<
> $ mpirun -mca mca_base_env_list foo=bar -x foo=baz ...
> 8<
> 
> See this code, which only looks at the environment when looking for 
> "mca_base_env_list":
> 
>> Modified: trunk/orte/tools/orterun/orterun.c
>> ==
>> --- trunk/orte/tools/orterun/orterun.c   Tue Jul  8 20:10:04 2014
>> (r32162)
>> +++ trunk/orte/tools/orterun/orterun.c   2014-07-08 20:38:25 EDT (Tue, 
>> 08 Jul 2014)  (r32163)
>> @@ -1722,6 +1722,13 @@
>> 
>> /* Did the user request to export any environment variables on the cmd 
>> line? */
>> if (opal_cmd_line_is_taken(_line, "x")) {
>> +char* env_set_flag = getenv("OMPI_MCA_mca_base_env_list");
>> +if (NULL != env_set_flag) {
>> +orte_show_help("help-orterun.txt", "orterun:conflict-env-set", 
>> false);
>> +return ORTE_ERR_FATAL;
>> +} else {
>> +orte_show_help("help-orterun.txt", 
>> "orterun:deprecated-env-set", false);
>> +}
>> j = opal_cmd_line_get_ninsts(_line, "x");
>> for (i = 0; i < j; ++i) {
>> param = opal_cmd_line_get_param(_line, "x", i, 0);
> 
> 
> -Dave
> 
> ___
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/devel/2014/07/15173.php



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-16 Thread Dave Goodell (dgoodell)
On Jul 15, 2014, at 2:03 PM, Mike Dubman  wrote:

> these are two separate issues:
> 
> 1. -x var=val (or -mca opal_base_envlist var=val) will work in the same way
> opal_base_envlist does the same as "-x" and can be used in the very same 
> fashion as -x
> 
> 2. When list of vars is passed with help of opal_base_envlist, the escaping 
> is possible but escaped char should differ from delimiter char.

That would be my preference (use something like "\" as the escape char).  
Though we could always go with a scheme where a doubled delimiter means 
"literal delimiter", sort of like "$$" in a Makefile.

> I think -x should stay as shotrt-form alias for -mca opal_base_envlist 
> var=val and -mca opal_base_envlist var.
> on dev meeting it was decided to deprecate it as some point.

Can we revisit this decision?  Mike and I both seem to be in favor of retaining 
"-x", at least for non-conflicting uses.  Would someone who is against 
retaining "-x" please speak up in favor of that position?

Also, Mike, I just looked again at the code and I don't think it is robustly 
checking for conflict cases.  It's possible to do this and you won't get an 
error with the current code, right?

8<
$ mpirun -mca mca_base_env_list foo=bar -x foo=baz ...
8<

See this code, which only looks at the environment when looking for 
"mca_base_env_list":

> Modified: trunk/orte/tools/orterun/orterun.c
> ==
> --- trunk/orte/tools/orterun/orterun.cTue Jul  8 20:10:04 2014
> (r32162)
> +++ trunk/orte/tools/orterun/orterun.c2014-07-08 20:38:25 EDT (Tue, 
> 08 Jul 2014)  (r32163)
> @@ -1722,6 +1722,13 @@
>  
>  /* Did the user request to export any environment variables on the cmd 
> line? */
>  if (opal_cmd_line_is_taken(_line, "x")) {
> +char* env_set_flag = getenv("OMPI_MCA_mca_base_env_list");
> +if (NULL != env_set_flag) {
> +orte_show_help("help-orterun.txt", "orterun:conflict-env-set", 
> false);
> +return ORTE_ERR_FATAL;
> +} else {
> +orte_show_help("help-orterun.txt", "orterun:deprecated-env-set", 
> false);
> +}
>  j = opal_cmd_line_get_ninsts(_line, "x");
>  for (i = 0; i < j; ++i) {
>  param = opal_cmd_line_get_param(_line, "x", i, 0);


-Dave



Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-15 Thread Mike Dubman
these are two separate issues:

1. -x var=val (or -mca opal_base_envlist var=val) will work in the same way
opal_base_envlist does the same as "-x" and can be used in the very same
fashion as -x

2. When list of vars is passed with help of opal_base_envlist, the escaping
is possible but escaped char should differ from delimiter char.

I think -x should stay as shotrt-form alias for -mca opal_base_envlist
var=val and -mca opal_base_envlist var.
on dev meeting it was decided to deprecate it as some point.




On Tue, Jul 15, 2014 at 8:14 PM, Dave Goodell (dgoodell)  wrote:

> This commit (and the subsequent amendments to the feature) doesn't appear
> to support escaping the separator.  A later commit allows you to change the
> separator character, which helps, but AFAICS you still can't actually
> escape the separator itself.  That seems like a real deficiency to me...
>
> Furthermore, I really like the "-x" argument and I'm sad to see that it's
> being deprecated in favor of a much clunkier syntax.  Is there a good
> reason we can't keep the "-x" syntax and only complain when there is a
> conflict with the mca_base_env_list variable?
>
> -Dave
>
> On Jul 8, 2014, at 7:38 PM, svn-commit-mai...@open-mpi.org wrote:
>
> > Author: jladd (Joshua Ladd)
> > Date: 2014-07-08 20:38:25 EDT (Tue, 08 Jul 2014)
> > New Revision: 32163
> > URL: https://svn.open-mpi.org/trac/ompi/changeset/32163
> >
> > Log:
> > Opal: add a new MCA parameter that allows the user to specify a list of
> environment variables. This parameter will become the standard mechanism by
> which environment variables are set for OMPI applications replacing the -x
> option.
> >
> > mpirun ... -x env_foo1=val1 -x env_foo2 -x env_foo3=val3  should now be
> expressed as
> >
> > mpirun ... -mca mca_base_env_list env_foo1=val1+env_foo2+env_foo3=val3.
> >
> > The motivation for doing this is so that a list of environment variables
> may be set via standard MCA mechanisms such as mca parameter files, amca
> lists, etc.
> >
> > This feature was developed by Elena Shipunova and was reviewed by Josh
> Ladd.
> >
> > Text files modified:
> >   trunk/opal/mca/base/help-mca-var.txt  |11 
> >   trunk/opal/mca/base/mca_base_var.c|52
> 
> >   trunk/orte/tools/orterun/help-orterun.txt |13 +
> >   trunk/orte/tools/orterun/orterun.c| 7 +
> >   4 files changed, 82 insertions(+), 1 deletions(-)
> >
> > Modified: trunk/opal/mca/base/help-mca-var.txt
> >
> ==
> > --- trunk/opal/mca/base/help-mca-var.txt  Tue Jul  8 20:10:04 2014
>  (r32162)
> > +++ trunk/opal/mca/base/help-mca-var.txt  2014-07-08 20:38:25 EDT
> (Tue, 08 Jul 2014)  (r32163)
> > @@ -121,3 +121,14 @@
> >
> >   Value:  %s
> >   Source: %s
> > +#
> > +[incorrect-env-list-param]
> > +WARNING: The format of MCA parameter "mca_base_env_list" is a plus-sign
> (+) delimited
> > +list of VAR=VAL and/or VAR instances, e.g.: -mca mca_base_env_list
> VAR1=VAL1+VAR2+VAR3=VAL3;...
> > +If a variable, VAR, is listed but not explicitly assigned a value in
> the command line, VAR will
> > +be assigned the value set in the executing environment.
> > +
> > +The following environment variable was listed unassigned in
> "mca_base_env_list", but was
> > +not found in your environment:
> > +  Variable: %s
> > +  MCA variable value:   %s
> >
> > Modified: trunk/opal/mca/base/mca_base_var.c
> >
> ==
> > --- trunk/opal/mca/base/mca_base_var.cTue Jul  8 20:10:04 2014
>  (r32162)
> > +++ trunk/opal/mca/base/mca_base_var.c2014-07-08 20:38:25 EDT
> (Tue, 08 Jul 2014)  (r32163)
> > @@ -62,6 +62,7 @@
> > static char *mca_base_var_override_file = NULL;
> > static char *mca_base_var_file_prefix = NULL;
> > static char *mca_base_param_file_path = NULL;
> > +static char *mca_base_env_list = NULL;
> > static bool mca_base_var_suppress_override_warning = false;
> > static opal_list_t mca_base_var_file_values;
> > static opal_list_t mca_base_var_override_values;
> > @@ -123,6 +124,7 @@
> > static int var_set_initial (mca_base_var_t *var);
> > static int var_get (int vari, mca_base_var_t **var_out, bool original);
> > static int var_value_string (mca_base_var_t *var, char **value_string);
> > +static int mca_base_var_process_env_list(void);
> >
> > /*
> >  * classes
> > @@ -255,11 +257,61 @@
> > mca_base_var_initialized = true;
> >
> > mca_base_var_cache_files(false);
> > +
> > +/* set nesessary env variables for external usage */
> > +mca_base_var_process_env_list();
> > }
> >
> > return OPAL_SUCCESS;
> > }
> >
> > +static int mca_base_var_process_env_list(void)
> > +{
> > +int i, ret;
> > +char** tokens;
> > +char* ptr;
> > +char* param, *value;
> > +ret = 

Re: [OMPI devel] [OMPI svn] svn:open-mpi r32163 - in trunk: opal/mca/base orte/tools/orterun

2014-07-15 Thread Dave Goodell (dgoodell)
This commit (and the subsequent amendments to the feature) doesn't appear to 
support escaping the separator.  A later commit allows you to change the 
separator character, which helps, but AFAICS you still can't actually escape 
the separator itself.  That seems like a real deficiency to me...

Furthermore, I really like the "-x" argument and I'm sad to see that it's being 
deprecated in favor of a much clunkier syntax.  Is there a good reason we can't 
keep the "-x" syntax and only complain when there is a conflict with the 
mca_base_env_list variable?

-Dave

On Jul 8, 2014, at 7:38 PM, svn-commit-mai...@open-mpi.org wrote:

> Author: jladd (Joshua Ladd)
> Date: 2014-07-08 20:38:25 EDT (Tue, 08 Jul 2014)
> New Revision: 32163
> URL: https://svn.open-mpi.org/trac/ompi/changeset/32163
> 
> Log:
> Opal: add a new MCA parameter that allows the user to specify a list of 
> environment variables. This parameter will become the standard mechanism by 
> which environment variables are set for OMPI applications replacing the -x 
> option.   
> 
> mpirun ... -x env_foo1=val1 -x env_foo2 -x env_foo3=val3  should now be 
> expressed as
> 
> mpirun ... -mca mca_base_env_list env_foo1=val1+env_foo2+env_foo3=val3. 
> 
> The motivation for doing this is so that a list of environment variables may 
> be set via standard MCA mechanisms such as mca parameter files, amca lists, 
> etc. 
> 
> This feature was developed by Elena Shipunova and was reviewed by Josh Ladd.
> 
> Text files modified: 
>   trunk/opal/mca/base/help-mca-var.txt  |11   
>   
>   trunk/opal/mca/base/mca_base_var.c|52 
> 
>   trunk/orte/tools/orterun/help-orterun.txt |13 + 
>   
>   trunk/orte/tools/orterun/orterun.c| 7 + 
>   
>   4 files changed, 82 insertions(+), 1 deletions(-)
> 
> Modified: trunk/opal/mca/base/help-mca-var.txt
> ==
> --- trunk/opal/mca/base/help-mca-var.txt  Tue Jul  8 20:10:04 2014
> (r32162)
> +++ trunk/opal/mca/base/help-mca-var.txt  2014-07-08 20:38:25 EDT (Tue, 
> 08 Jul 2014)  (r32163)
> @@ -121,3 +121,14 @@
> 
>   Value:  %s
>   Source: %s
> +#
> +[incorrect-env-list-param]
> +WARNING: The format of MCA parameter "mca_base_env_list" is a plus-sign (+) 
> delimited
> +list of VAR=VAL and/or VAR instances, e.g.: -mca mca_base_env_list 
> VAR1=VAL1+VAR2+VAR3=VAL3;... 
> +If a variable, VAR, is listed but not explicitly assigned a value in the 
> command line, VAR will 
> +be assigned the value set in the executing environment.
> +
> +The following environment variable was listed unassigned in 
> "mca_base_env_list", but was
> +not found in your environment:
> +  Variable: %s
> +  MCA variable value:   %s
> 
> Modified: trunk/opal/mca/base/mca_base_var.c
> ==
> --- trunk/opal/mca/base/mca_base_var.cTue Jul  8 20:10:04 2014
> (r32162)
> +++ trunk/opal/mca/base/mca_base_var.c2014-07-08 20:38:25 EDT (Tue, 
> 08 Jul 2014)  (r32163)
> @@ -62,6 +62,7 @@
> static char *mca_base_var_override_file = NULL;
> static char *mca_base_var_file_prefix = NULL;
> static char *mca_base_param_file_path = NULL;
> +static char *mca_base_env_list = NULL;
> static bool mca_base_var_suppress_override_warning = false;
> static opal_list_t mca_base_var_file_values;
> static opal_list_t mca_base_var_override_values;
> @@ -123,6 +124,7 @@
> static int var_set_initial (mca_base_var_t *var);
> static int var_get (int vari, mca_base_var_t **var_out, bool original);
> static int var_value_string (mca_base_var_t *var, char **value_string);
> +static int mca_base_var_process_env_list(void);
> 
> /*
>  * classes
> @@ -255,11 +257,61 @@
> mca_base_var_initialized = true; 
> 
> mca_base_var_cache_files(false);
> +
> +/* set nesessary env variables for external usage */
> +mca_base_var_process_env_list();
> }
> 
> return OPAL_SUCCESS;
> }
> 
> +static int mca_base_var_process_env_list(void)
> +{
> +int i, ret;
> +char** tokens;
> +char* ptr;
> +char* param, *value;
> +ret = mca_base_var_register ("opal", "mca", "base", "env_list",
> + "Set SHELL env variables",
> + MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, 
> OPAL_INFO_LVL_3,
> + MCA_BASE_VAR_SCOPE_READONLY, 
> _base_env_list);
> +if ((0 > ret) || (NULL == mca_base_env_list)) {
> +return OPAL_SUCCESS;
> +}
> +tokens = opal_argv_split(mca_base_env_list, '+');
> +if (NULL != tokens) {
> +for (i = 0; NULL != tokens[i]; i++) {
> +if (NULL == (ptr = strchr(tokens[i], '='))) {
> +value = getenv(tokens[i]);
> +