Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] [OMPI svn] svn:open-mpi r31302 - in trunk: opal/mca/base orte/tools/orterun
From: Mike Dubman (miked_at_[hidden])
Date: 2014-04-01 21:32:12


mca param file treats any key=val as mca parameter only.
In order to add parser support for something that is not mca param, will
require change file syntax and it will look bad, i.e.:

mca btl = sm,self,openib
env DISPLAY = console:0

I think the current implementation is less intrusive and re-uses existing
infra in the most elegant way.
The param file syntax change is too big effort to justify this feature
(IMHO) which can be provided with existing infra w/o breaking anything.

On Wed, Apr 2, 2014 at 3:04 AM, Ralph Castain <rhc_at_[hidden]> wrote:

> Understood - my point, however, was that we can easily add that capability
> to the mca params file.. This would seem far preferable to creating a
> completely new, parallel way of setting envars.
>
> Why not do it that way?
>
>
>
> On Tue, Apr 1, 2014 at 4:34 PM, Mike Dubman <miked_at_[hidden]>wrote:
>
>> The "-x var=val" cannot be placed into mca params file.
>>
>>
>> On Wed, Apr 2, 2014 at 2:34 AM, Mike Dubman <miked_at_[hidden]>wrote:
>>
>>> yes, it is expected that the "string" value should be quoted. will
>>> clarify it in the help message and man page. Thanks for spotting.
>>>
>>> The underlying libraries used from OMPI
>>> (mxm,psm,hcoll,glibc,pmi2,slurm,...) all have shell environment variables
>>> to control their behave.
>>>
>>> It is unreasonable to expose mca parameter for every library tunable
>>> used from ompi, but for most frequently used ones.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Apr 2, 2014 at 2:23 AM, Ralph Castain <rhc_at_[hidden]> wrote:
>>>
>>>> If you are expecting the user to put quotes around the string, then you
>>>> better tell them that in the help message. Otherwise, they would do what I
>>>> did - simply list the envars with a space in-between, and everything fails.
>>>>
>>>> Also, you need to update mpirun.1in to reflect this new option or else
>>>> nobody will know about it :-)
>>>>
>>>> However, looking at your example leaves me totally puzzled. Why are
>>>> these not just MCA params to begin with, in which case we don't need
>>>> another duplicate mechanism for setting them?
>>>>
>>>> We should only be setting envars that have nothing to do with OMPI, not
>>>> setting OMPI-related envars - anything OMPI related is supposed to be an
>>>> MCA param.
>>>>
>>>>
>>>>
>>>> On Tue, Apr 1, 2014 at 4:16 PM, Mike Dubman <miked_at_[hidden]>wrote:
>>>>
>>>>> not sure what you mean, could you please provide example?
>>>>>
>>>>> comma is used often as part of the value, here is a example:
>>>>>
>>>>> -mca base_env_list "HCOLL_BCOL=basesmuma,mlnx_p2p HCOLL_SBGP=basesmuma
>>>>> ,p2p HCOLL_ML_USE_KNOMIAL_ALLREDUCE=1"
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Apr 2, 2014 at 2:12 AM, Ralph Castain <rhc_at_[hidden]>wrote:
>>>>>
>>>>>> This change just looks wrong - you can't split the variables on a
>>>>>> "space" as there is no way to know how many variables there might be, and
>>>>>> thus how to parse the rest of the cmd line. At best, you need a
>>>>>> comma-delimited list.
>>>>>>
>>>>>> Please fix this!
>>>>>> Ralph
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Apr 1, 2014 at 2:14 PM, <svn-commit-mailer_at_[hidden]>wrote:
>>>>>>
>>>>>>> Author: miked (Mike Dubman)
>>>>>>> Date: 2014-04-01 17:14:31 EDT (Tue, 01 Apr 2014)
>>>>>>> New Revision: 31302
>>>>>>> URL: https://svn.open-mpi.org/trac/ompi/changeset/31302
>>>>>>>
>>>>>>> Log:
>>>>>>> opal: add mca param to control ranks env variables
>>>>>>>
>>>>>>> add -mca base_env_list "var1=val1 var2=val2 ..." mca parameter that
>>>>>>> can be used in mca param files
>>>>>>> or with -am app.conf mpirun commandline to set rank env variables
>>>>>>> with mca mechanism
>>>>>>>
>>>>>>> fixed by Elena, reviewed by Miked
>>>>>>>
>>>>>>> cmr=v1.8.1:reviewer=ompi-rm1.8
>>>>>>>
>>>>>>> Text files modified:
>>>>>>> trunk/opal/mca/base/help-mca-var.txt | 5 +++++
>>>>>>> trunk/opal/mca/base/mca_base_var.c | 36
>>>>>>> ++++++++++++++++++++++++++++++++++++
>>>>>>> trunk/opal/mca/base/mca_base_var.h | 2 ++
>>>>>>> trunk/orte/tools/orterun/orterun.c | 2 ++
>>>>>>> 4 files changed, 45 insertions(+), 0 deletions(-)
>>>>>>>
>>>>>>> Modified: trunk/opal/mca/base/help-mca-var.txt
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> --- trunk/opal/mca/base/help-mca-var.txt Tue Apr 1 16:57:12
>>>>>>> 2014 (r31301)
>>>>>>> +++ trunk/opal/mca/base/help-mca-var.txt 2014-04-01 17:14:31
>>>>>>> EDT (Tue, 01 Apr 2014) (r31302)
>>>>>>> @@ -121,3 +121,8 @@
>>>>>>>
>>>>>>> Value: %s
>>>>>>> Source: %s
>>>>>>> +#
>>>>>>> +[incorrect-env-list-param]
>>>>>>> +The format of mca_base_env_list parameter is incorrect. It should be
>>>>>>> +VAR1=VAL1 VAR2=VAL2 VAR3=VAL3 ...
>>>>>>> + Value: %s
>>>>>>>
>>>>>>> Modified: trunk/opal/mca/base/mca_base_var.c
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> --- trunk/opal/mca/base/mca_base_var.c Tue Apr 1 16:57:12 2014
>>>>>>> (r31301)
>>>>>>> +++ trunk/opal/mca/base/mca_base_var.c 2014-04-01 17:14:31 EDT
>>>>>>> (Tue, 01 Apr 2014) (r31302)
>>>>>>> @@ -61,6 +61,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;
>>>>>>> @@ -259,6 +260,41 @@
>>>>>>> return OPAL_SUCCESS;
>>>>>>> }
>>>>>>>
>>>>>>> +int mca_base_var_process_env_list(char ***context_env)
>>>>>>> +{
>>>>>>> + 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,
>>>>>>> &mca_base_env_list);
>>>>>>> + if ((0 > ret) || (NULL == mca_base_env_list)) {
>>>>>>> + return ret;
>>>>>>> + }
>>>>>>> + tokens = opal_argv_split(mca_base_env_list, ' ');
>>>>>>> + if (NULL != tokens) {
>>>>>>> + for (i = 0; NULL != tokens[i]; i++) {
>>>>>>> + if (NULL == (ptr = strchr(tokens[i], '='))) {
>>>>>>> + opal_show_help("help-mca-var.txt",
>>>>>>> "incorrect-env-list-param",
>>>>>>> + true, mca_base_env_list);
>>>>>>> + opal_argv_free(tokens);
>>>>>>> + return OPAL_ERROR;
>>>>>>> + } else {
>>>>>>> + param = strdup(tokens[i]);
>>>>>>> + value = strchr(param, '=');
>>>>>>> + *value = '\0';
>>>>>>> + value++;
>>>>>>> + opal_setenv(param, value, false, context_env);
>>>>>>> + free(param);
>>>>>>> + }
>>>>>>> + }
>>>>>>> + opal_argv_free(tokens);
>>>>>>> + }
>>>>>>> + return OPAL_SUCCESS;
>>>>>>> +}
>>>>>>> +
>>>>>>> static int mca_base_var_cache_files(bool rel_path_search)
>>>>>>> {
>>>>>>> char *tmp;
>>>>>>>
>>>>>>> Modified: trunk/opal/mca/base/mca_base_var.h
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> --- trunk/opal/mca/base/mca_base_var.h Tue Apr 1 16:57:12 2014
>>>>>>> (r31301)
>>>>>>> +++ trunk/opal/mca/base/mca_base_var.h 2014-04-01 17:14:31 EDT
>>>>>>> (Tue, 01 Apr 2014) (r31302)
>>>>>>> @@ -716,6 +716,8 @@
>>>>>>> */
>>>>>>> OPAL_DECLSPEC int mca_base_var_dump(int vari, char ***out,
>>>>>>> mca_base_var_dump_type_t output_type);
>>>>>>>
>>>>>>> +OPAL_DECLSPEC int mca_base_var_process_env_list(char
>>>>>>> ***context_env);
>>>>>>> +
>>>>>>> END_C_DECLS
>>>>>>>
>>>>>>> #endif /* OPAL_MCA_BASE_VAR_H */
>>>>>>>
>>>>>>> Modified: trunk/orte/tools/orterun/orterun.c
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> --- trunk/orte/tools/orterun/orterun.c Tue Apr 1 16:57:12 2014
>>>>>>> (r31301)
>>>>>>> +++ trunk/orte/tools/orterun/orterun.c 2014-04-01 17:14:31 EDT
>>>>>>> (Tue, 01 Apr 2014) (r31302)
>>>>>>> @@ -1628,6 +1628,8 @@
>>>>>>> goto cleanup;
>>>>>>> }
>>>>>>> mca_base_cmd_line_process_args(&cmd_line, app_env,
>>>>>>> &global_mca_env);
>>>>>>> + mca_base_var_process_env_list(app_env);
>>>>>>> +
>>>>>>>
>>>>>>> /* Is there an appfile in here? */
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> svn mailing list
>>>>>>> svn_at_[hidden]
>>>>>>> http://www.open-mpi.org/mailman/listinfo.cgi/svn
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> devel mailing list
>>>>>> devel_at_[hidden]
>>>>>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
>>>>>> Link to this post:
>>>>>> http://www.open-mpi.org/community/lists/devel/2014/04/14441.php
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> devel mailing list
>>>>> devel_at_[hidden]
>>>>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
>>>>> Link to this post:
>>>>> http://www.open-mpi.org/community/lists/devel/2014/04/14442.php
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> devel mailing list
>>>> devel_at_[hidden]
>>>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
>>>> Link to this post:
>>>> http://www.open-mpi.org/community/lists/devel/2014/04/14444.php
>>>>
>>>
>>>
>>
>> _______________________________________________
>> devel mailing list
>> devel_at_[hidden]
>> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
>> Link to this post:
>> http://www.open-mpi.org/community/lists/devel/2014/04/14447.php
>>
>
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/04/14448.php
>