1
1
openmpi/src/mca/base/mca_base_parse_paramfile_lex.l

55 строки
1.1 KiB
Plaintext
Исходник Обычный вид История

- New capability for MCA parameters to be read from files. Order of resolution is now (effectively): - read from MPI keyval (if associated) - read from command line - read from environment - read from file More capabilities will be added shortly for developers to programatically set MCA parameter values - Create [empty but commented] system-wide MCA param file that gets installed at $sysconf/openmpi-mca-params.conf (i.e., $prefix/etc/openmpi-mca-params.conf) - The following files are opened and read (in order): 1. $sysconf/openmpi-mca-params.conf 2. $HOME/.openmpi/mca-params.conf Specifically, the values in 2) will override the values in 1) (so users can override system-wide defaults. - Update MCA string params to allow for "~/" in the middle to be expanded to the user's home directory. - Added to default value of MCA parameter component_path to be: $pkglibdir:$HOME/.openmpi/components $pkglibdir is typically $prefix/lib/openmpi. So now both of these directories will be searched for components at run time (in all Open MPI executables, including ompi_info). Note that this is an MCA parameter, so it, too, can be changed at run-time. - Updated all docs to match this behavior -- some is \internal, so it doesn't show unless you tell doxygen to generate internal docs (which is not the default) - update ompi_info to handle new behavior; ompi_info --param now shows the *current* default value (i.e., it will look in the environment and/or files to find out what the default values are -- so if you change a value in $HOME/.openmpi/mca-params.conf, it should be reflected in "ompi_info --param all all") - updated bunches of doxygen docs to match - this diff is slightly artifically large -- some of the changes are converstions to 4 space tabs (I re-indented my own code that previously used 2 space tabs) This commit was SVN r2408.
2004-08-31 13:49:56 +04:00
%{ /* -*- C -*- */
#include <stdio.h>
#include "mca/base/mca_base_parse_paramfile_lex.h"
/*
* local functions
*/
static int mca_base_yyerror(void);
static int mca_base_yywrap(void);
/*
* global variables
*/
int mca_base_yynewlines = 1;
bool mca_base_parse_done = false;
char *mca_base_string = NULL;
%}
WHITE [\f\t\v ]
CHAR [A-Za-z0-9_\-\.]
%x VALUE
%%
{WHITE}*\n { mca_base_yynewlines++; return MCA_BASE_PARSE_NEWLINE; }
#.*\n { mca_base_yynewlines++; return MCA_BASE_PARSE_NEWLINE; }
{WHITE}*"="{WHITE}* { BEGIN(VALUE); return MCA_BASE_PARSE_EQUAL; }
{WHITE}+ ; /* whitespace */
{CHAR}+ { return MCA_BASE_PARSE_SINGLE_WORD; }
<VALUE>{WHITE}*\n { BEGIN(INITIAL); }
<VALUE>[^\n]*[^\t \n]/[\t ]*\n { return MCA_BASE_PARSE_VALUE; }
. { return MCA_BASE_PARSE_ERROR; }
%%
static int mca_base_yyerror(void)
{
printf("%d: Invalid input (%s)\n", mca_base_yynewlines, mca_base_yytext);
return MCA_BASE_PARSE_ERROR;
}
static int mca_base_yywrap(void)
{
mca_base_parse_done = true;
return 1;
}