2004-01-19 08:41:06 +03:00
//
2007-03-17 02:11:45 +03:00
// Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
2005-11-05 22:57:48 +03:00
// University Research and Technology
// Corporation. All rights reserved.
2006-08-24 20:38:08 +04:00
// Copyright (c) 2004-2006 The University of Tennessee and The University
2005-11-05 22:57:48 +03:00
// of Tennessee Research Foundation. All rights
// reserved.
2007-03-20 13:08:58 +03:00
// Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
2004-11-28 23:09:25 +03:00
// University of Stuttgart. All rights reserved.
2005-03-24 15:43:37 +03:00
// Copyright (c) 2004-2005 The Regents of the University of California.
// All rights reserved.
2008-05-14 00:56:20 +04:00
// Copryight (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
2004-11-22 04:38:40 +03:00
// $COPYRIGHT$
//
// Additional copyrights may follow
//
2004-01-19 08:41:06 +03:00
// $HEADER$
//
2004-01-19 20:43:50 +03:00
2007-04-21 04:51:31 +04:00
# include "ompi_config.h"
2004-01-19 08:41:06 +03:00
# include <iostream>
# include <string>
# include <utility>
2004-01-30 01:10:58 +03:00
# include <list>
2004-01-19 08:41:06 +03:00
# include <stdio.h>
# include <ctype.h>
2007-04-20 18:26:20 +04:00
# ifdef HAVE_UNISTD_H
2004-01-19 08:41:06 +03:00
# include <unistd.h>
2004-10-26 19:47:15 +04:00
# endif
2007-04-20 18:26:20 +04:00
# ifdef HAVE_NETDB_H
2004-01-19 08:41:06 +03:00
# include <netdb.h>
2004-10-26 19:47:15 +04:00
# endif
2007-04-20 18:26:20 +04:00
# ifdef HAVE_SYS_PARAM_H
2004-01-19 08:41:06 +03:00
# include <sys/param.h>
2004-10-26 19:47:15 +04:00
# endif
2004-03-25 22:19:16 +03:00
# include <errno.h>
2004-01-19 08:41:06 +03:00
2007-04-21 04:15:05 +04:00
# include "opal/mca/installdirs/installdirs.h"
2005-07-03 20:06:07 +04:00
# include "opal/class/opal_object.h"
2006-07-27 05:51:18 +04:00
# include "opal/runtime/opal.h"
2006-02-12 04:33:29 +03:00
# include "orte/runtime/runtime.h"
2008-06-09 18:53:58 +04:00
# include "orte/util/show_help.h"
2005-07-04 04:13:44 +04:00
# include "opal/util/cmd_line.h"
# include "opal/util/argv.h"
2006-02-12 04:33:29 +03:00
# include "ompi/communicator/communicator.h"
# include "opal/mca/base/base.h"
2007-04-21 04:51:31 +04:00
# include "ompi/tools/ompi_info/ompi_info.h"
2005-07-04 02:45:48 +04:00
# include "opal/threads/mutex.h"
2004-01-19 20:43:50 +03:00
2004-01-19 08:41:06 +03:00
using namespace std ;
2004-06-07 19:33:53 +04:00
using namespace ompi_info ;
2004-01-19 08:41:06 +03:00
2004-01-19 20:43:50 +03:00
//
// Public variables
//
2004-01-19 08:41:06 +03:00
2004-06-07 19:33:53 +04:00
bool ompi_info : : pretty = true ;
2005-07-04 04:13:44 +04:00
opal_cmd_line_t * ompi_info : : cmd_line = NULL ;
2004-01-19 08:41:06 +03:00
2004-06-07 19:33:53 +04:00
const string ompi_info : : type_all = " all " ;
const string ompi_info : : type_ompi = " ompi " ;
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
const string ompi_info : : type_orte = " orte " ;
const string ompi_info : : type_opal = " opal " ;
2004-06-07 19:33:53 +04:00
const string ompi_info : : type_base = " base " ;
ompi_info : : type_vector_t ompi_info : : mca_types ;
2004-01-19 08:41:06 +03:00
2004-09-05 20:05:37 +04:00
2004-01-19 20:43:50 +03:00
int main ( int argc , char * argv [ ] )
2004-01-19 08:41:06 +03:00
{
2004-02-06 07:20:13 +03:00
int ret = 0 ;
2005-06-17 05:06:36 +04:00
bool want_help = false ;
bool cmd_error = false ;
2004-01-19 08:41:06 +03:00
bool acted = false ;
bool want_all = false ;
2005-08-08 20:42:28 +04:00
char * * app_env = NULL , * * global_env = NULL ;
While waiting for fortran compiles...
Fixes for orterun in handling different MCA params for different
processes (reviewed by Brian):
- By design, if you run the following:
mpirun --mca foo aaa --mca foo bbb a.out
a.out will get a single MCA param for foo with value "aaa,bbb".
- However, if you specify multiple apps with different values for the
same MCA param, you should expect to get the different values for
each app. For example:
mpirun --mca foo aaa a.out : --mca foo bbb b.out
Should yield a.out with a "foo" param with value "aaa" and b.out
with a "foo" param with a value "bbb".
- This did not work -- both a.out and b.out would get a "foo" with
"aaa,bbb".
- This commit fixes this behavior -- now a.out will get aaa and b.out
will get bbb.
- Additionally, if you mix --mca and and app file, you can have
"global" params and per-line-in-the-appfile params. For example:
mpirun --mca foo zzzz --app appfile
where "appfile" contains:
-np 1 --mca bar aaa a.out
-np 1 --mca bar bbb b.out
In this case, a.out will get foo=zzzz and bar=aaa, and b.out will
get foo=zzzz and bar=bbb.
Spiffy.
Ok, fortran build is done... back to Fortran... sigh...
This commit was SVN r5710.
2005-05-13 18:36:36 +04:00
int i , len ;
2004-01-19 08:41:06 +03:00
// Initialize the argv parsing handle
2008-05-16 18:18:56 +04:00
if ( OMPI_SUCCESS ! = opal_init_util ( ) ) {
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
orte_show_help ( " help-ompi_info.txt " , " lib-call-fail " , true ,
2006-07-27 05:51:18 +04:00
" opal_init_util " , __FILE__ , __LINE__ , NULL ) ;
exit ( ret ) ;
}
2005-07-04 04:13:44 +04:00
cmd_line = OBJ_NEW ( opal_cmd_line_t ) ;
2004-01-19 08:41:06 +03:00
if ( NULL = = cmd_line ) {
ret = errno ;
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
orte_show_help ( " help-ompi_info.txt " , " lib-call-fail " , true ,
2005-07-04 04:13:44 +04:00
" opal_cmd_line_create " , __FILE__ , __LINE__ , NULL ) ;
2008-07-10 15:56:41 +04:00
opal_finalize_util ( ) ;
2004-01-19 08:41:06 +03:00
exit ( ret ) ;
}
2005-03-14 23:57:21 +03:00
2007-03-20 13:08:58 +03:00
opal_cmd_line_make_opt3 ( cmd_line , ' v ' , NULL , " version " , 2 ,
2007-07-02 10:12:02 +04:00
" Show version of Open MPI or a component. The first parameter can be the keywords \" ompi \" or \" all \" , a framework name (indicating all components in a framework), or a framework:component string (indicating a specific component). The second parameter can be one of: full, major, minor, release, greek, svn. " ) ;
2007-03-20 13:08:58 +03:00
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " param " , 2 ,
2007-07-02 10:12:02 +04:00
" Show MCA parameters. The first parameter is the framework (or the keyword \" all \" ); the second parameter is the specific component name (or the keyword \" all \" ). " ) ;
2007-03-20 13:08:58 +03:00
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " internal " , 0 ,
" Show internal MCA parameters (not meant to be modified by users) " ) ;
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " path " , 1 ,
2007-12-03 18:35:37 +03:00
" Show paths that Open MPI was configured with. Accepts the following parameters: prefix, bindir, libdir, incdir, mandir, pkglibdir, sysconfdir " ) ;
2007-03-20 13:08:58 +03:00
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " arch " , 0 ,
" Show architecture Open MPI was compiled on " ) ;
opal_cmd_line_make_opt3 ( cmd_line , ' c ' , NULL , " config " , 0 ,
" Show configuration options " ) ;
opal_cmd_line_make_opt3 ( cmd_line , ' h ' , NULL , " help " , 0 ,
" Show this help message " ) ;
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " pretty " , 0 ,
2007-07-02 10:12:02 +04:00
" When used in conjunction with other parameters, the output is displayed in 'prettyprint' format (default) " ) ;
2007-03-20 13:08:58 +03:00
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " parsable " , 0 ,
2007-07-02 10:12:02 +04:00
" When used in conjunction with other parameters, the output is displayed in a machine-parsable format " ) ;
2007-03-20 13:08:58 +03:00
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " parseable " , 0 ,
" Synonym for --parsable " ) ;
opal_cmd_line_make_opt3 ( cmd_line , ' \0 ' , NULL , " hostname " , 0 ,
" Show the hostname that Open MPI was configured "
" and built on " ) ;
opal_cmd_line_make_opt3 ( cmd_line , ' a ' , NULL , " all " , 0 ,
" Show all configuration options and MCA parameters " ) ;
2004-01-19 08:41:06 +03:00
2004-02-06 07:20:13 +03:00
// Call some useless functions in order to guarantee to link in some
// global variables. Only check the return value so that the
// compiler doesn't optimize out the useless function.
2004-06-07 19:33:53 +04:00
if ( OMPI_SUCCESS ! = ompi_comm_link_function ( ) ) {
2004-02-06 07:20:13 +03:00
// Stop .. or I'll say stop again!
+ + ret ;
} else {
- - ret ;
}
2005-03-22 03:31:17 +03:00
// set our threading level
2005-07-04 02:45:48 +04:00
opal_set_using_threads ( false ) ;
2005-03-22 03:31:17 +03:00
2004-01-19 20:43:50 +03:00
// Get MCA parameters, if any */
2004-01-19 08:41:06 +03:00
2006-08-24 20:38:08 +04:00
if ( OMPI_SUCCESS ! = mca_base_open ( ) ) {
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
orte_show_help ( " help-ompi_info.txt " , " lib-call-fail " , true , " mca_base_open " , __FILE__ , __LINE__ ) ;
2008-07-10 15:56:41 +04:00
OBJ_RELEASE ( cmd_line ) ;
opal_finalize_util ( ) ;
2006-08-24 20:38:08 +04:00
exit ( 1 ) ;
}
2004-01-19 20:43:50 +03:00
mca_base_cmd_line_setup ( cmd_line ) ;
2004-01-19 08:41:06 +03:00
// Do the parsing
2005-07-04 04:13:44 +04:00
if ( OMPI_SUCCESS ! = opal_cmd_line_parse ( cmd_line , false , argc , argv ) ) {
2005-06-17 05:06:36 +04:00
cmd_error = true ;
}
2007-03-20 13:08:58 +03:00
if ( ! cmd_error & &
( opal_cmd_line_is_taken ( cmd_line , " help " ) | |
opal_cmd_line_is_taken ( cmd_line , " h " ) ) ) {
2005-06-17 05:06:36 +04:00
want_help = true ;
}
if ( cmd_error | | want_help ) {
2005-07-04 04:13:44 +04:00
char * usage = opal_cmd_line_get_usage_msg ( cmd_line ) ;
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
orte_show_help ( " help-ompi_info.txt " , " usage " , true , usage ) ;
2005-06-17 05:06:36 +04:00
free ( usage ) ;
2008-07-10 15:56:41 +04:00
mca_base_close ( ) ;
OBJ_RELEASE ( cmd_line ) ;
opal_finalize_util ( ) ;
2005-06-17 05:06:36 +04:00
exit ( cmd_error ? 1 : 0 ) ;
2004-01-19 08:41:06 +03:00
}
2004-01-19 20:43:50 +03:00
2005-08-08 20:42:28 +04:00
mca_base_cmd_line_process_args ( cmd_line , & app_env , & global_env ) ;
While waiting for fortran compiles...
Fixes for orterun in handling different MCA params for different
processes (reviewed by Brian):
- By design, if you run the following:
mpirun --mca foo aaa --mca foo bbb a.out
a.out will get a single MCA param for foo with value "aaa,bbb".
- However, if you specify multiple apps with different values for the
same MCA param, you should expect to get the different values for
each app. For example:
mpirun --mca foo aaa a.out : --mca foo bbb b.out
Should yield a.out with a "foo" param with value "aaa" and b.out
with a "foo" param with a value "bbb".
- This did not work -- both a.out and b.out would get a "foo" with
"aaa,bbb".
- This commit fixes this behavior -- now a.out will get aaa and b.out
will get bbb.
- Additionally, if you mix --mca and and app file, you can have
"global" params and per-line-in-the-appfile params. For example:
mpirun --mca foo zzzz --app appfile
where "appfile" contains:
-np 1 --mca bar aaa a.out
-np 1 --mca bar bbb b.out
In this case, a.out will get foo=zzzz and bar=aaa, and b.out will
get foo=zzzz and bar=bbb.
Spiffy.
Ok, fortran build is done... back to Fortran... sigh...
This commit was SVN r5710.
2005-05-13 18:36:36 +04:00
// putenv() all the stuff that we got back from env (in case the
// user specified some --mca params on the command line). This
// creates a memory leak, but that's unfortunately how putenv()
// works. :-(
2005-08-08 20:42:28 +04:00
len = opal_argv_count ( app_env ) ;
While waiting for fortran compiles...
Fixes for orterun in handling different MCA params for different
processes (reviewed by Brian):
- By design, if you run the following:
mpirun --mca foo aaa --mca foo bbb a.out
a.out will get a single MCA param for foo with value "aaa,bbb".
- However, if you specify multiple apps with different values for the
same MCA param, you should expect to get the different values for
each app. For example:
mpirun --mca foo aaa a.out : --mca foo bbb b.out
Should yield a.out with a "foo" param with value "aaa" and b.out
with a "foo" param with a value "bbb".
- This did not work -- both a.out and b.out would get a "foo" with
"aaa,bbb".
- This commit fixes this behavior -- now a.out will get aaa and b.out
will get bbb.
- Additionally, if you mix --mca and and app file, you can have
"global" params and per-line-in-the-appfile params. For example:
mpirun --mca foo zzzz --app appfile
where "appfile" contains:
-np 1 --mca bar aaa a.out
-np 1 --mca bar bbb b.out
In this case, a.out will get foo=zzzz and bar=aaa, and b.out will
get foo=zzzz and bar=bbb.
Spiffy.
Ok, fortran build is done... back to Fortran... sigh...
This commit was SVN r5710.
2005-05-13 18:36:36 +04:00
for ( i = 0 ; i < len ; + + i ) {
2005-08-08 20:42:28 +04:00
putenv ( app_env [ i ] ) ;
}
len = opal_argv_count ( global_env ) ;
for ( i = 0 ; i < len ; + + i ) {
putenv ( global_env [ i ] ) ;
While waiting for fortran compiles...
Fixes for orterun in handling different MCA params for different
processes (reviewed by Brian):
- By design, if you run the following:
mpirun --mca foo aaa --mca foo bbb a.out
a.out will get a single MCA param for foo with value "aaa,bbb".
- However, if you specify multiple apps with different values for the
same MCA param, you should expect to get the different values for
each app. For example:
mpirun --mca foo aaa a.out : --mca foo bbb b.out
Should yield a.out with a "foo" param with value "aaa" and b.out
with a "foo" param with a value "bbb".
- This did not work -- both a.out and b.out would get a "foo" with
"aaa,bbb".
- This commit fixes this behavior -- now a.out will get aaa and b.out
will get bbb.
- Additionally, if you mix --mca and and app file, you can have
"global" params and per-line-in-the-appfile params. For example:
mpirun --mca foo zzzz --app appfile
where "appfile" contains:
-np 1 --mca bar aaa a.out
-np 1 --mca bar bbb b.out
In this case, a.out will get foo=zzzz and bar=aaa, and b.out will
get foo=zzzz and bar=bbb.
Spiffy.
Ok, fortran build is done... back to Fortran... sigh...
This commit was SVN r5710.
2005-05-13 18:36:36 +04:00
}
2004-01-19 20:43:50 +03:00
2005-08-02 02:38:17 +04:00
ompi_info : : mca_types . push_back ( " mca " ) ;
2004-10-15 14:52:08 +04:00
ompi_info : : mca_types . push_back ( " mpi " ) ;
2005-08-02 02:38:17 +04:00
ompi_info : : mca_types . push_back ( " orte " ) ;
2006-01-11 07:36:39 +03:00
ompi_info : : mca_types . push_back ( " opal " ) ;
2004-01-30 01:32:45 +03:00
2008-05-14 00:56:20 +04:00
ompi_info : : mca_types . push_back ( " filter " ) ;
2006-07-27 07:48:12 +04:00
ompi_info : : mca_types . push_back ( " backtrace " ) ;
2008-02-12 11:46:27 +03:00
ompi_info : : mca_types . push_back ( " memchecker " ) ;
2005-08-13 20:07:37 +04:00
ompi_info : : mca_types . push_back ( " memory " ) ;
ompi_info : : mca_types . push_back ( " paffinity " ) ;
2008-01-23 12:20:34 +03:00
ompi_info : : mca_types . push_back ( " carto " ) ;
2005-08-26 14:56:39 +04:00
ompi_info : : mca_types . push_back ( " maffinity " ) ;
2005-08-21 23:14:49 +04:00
ompi_info : : mca_types . push_back ( " timer " ) ;
2007-04-21 04:15:05 +04:00
ompi_info : : mca_types . push_back ( " installdirs " ) ;
2007-03-17 02:11:45 +03:00
# if OPAL_ENABLE_FT == 1
ompi_info : : mca_types . push_back ( " crs " ) ;
# endif
2008-02-28 04:57:57 +03:00
ompi_info : : mca_types . push_back ( " dpm " ) ;
ompi_info : : mca_types . push_back ( " pubsub " ) ;
2004-07-11 08:35:31 +04:00
ompi_info : : mca_types . push_back ( " allocator " ) ;
2004-06-07 19:33:53 +04:00
ompi_info : : mca_types . push_back ( " coll " ) ;
ompi_info : : mca_types . push_back ( " io " ) ;
2004-07-11 08:35:31 +04:00
ompi_info : : mca_types . push_back ( " mpool " ) ;
2004-06-07 19:33:53 +04:00
ompi_info : : mca_types . push_back ( " pml " ) ;
2006-02-11 03:14:44 +03:00
ompi_info : : mca_types . push_back ( " bml " ) ;
ompi_info : : mca_types . push_back ( " rcache " ) ;
2005-07-14 22:05:30 +04:00
ompi_info : : mca_types . push_back ( " btl " ) ;
2006-07-04 05:20:20 +04:00
ompi_info : : mca_types . push_back ( " mtl " ) ;
2004-06-07 19:33:53 +04:00
ompi_info : : mca_types . push_back ( " topo " ) ;
2006-01-28 18:38:37 +03:00
ompi_info : : mca_types . push_back ( " osc " ) ;
Two major things in this commit:
* New "op" MPI layer framework
* Addition of the MPI_REDUCE_LOCAL proposed function (for MPI-2.2)
= Op framework =
Add new "op" framework in the ompi layer. This framework replaces the
hard-coded MPI_Op back-end functions for (MPI_Op, MPI_Datatype) tuples
for pre-defined MPI_Ops, allowing components and modules to provide
the back-end functions. The intent is that components can be written
to take advantage of hardware acceleration (GPU, FPGA, specialized CPU
instructions, etc.). Similar to other frameworks, components are
intended to be able to discover at run-time if they can be used, and
if so, elect themselves to be selected (or disqualify themselves from
selection if they cannot run). If specialized hardware is not
available, there is a default set of functions that will automatically
be used.
This framework is ''not'' used for user-defined MPI_Ops.
The new op framework is similar to the existing coll framework, in
that the final set of function pointers that are used on any given
intrinsic MPI_Op can be a mixed bag of function pointers, potentially
coming from multiple different op modules. This allows for hardware
that only supports some of the operations, not all of them (e.g., a
GPU that only supports single-precision operations).
All the hard-coded back-end MPI_Op functions for (MPI_Op,
MPI_Datatype) tuples still exist, but unlike coll, they're in the
framework base (vs. being in a separate "basic" component) and are
automatically used if no component is found at runtime that provides a
module with the necessary function pointers.
There is an "example" op component that will hopefully be useful to
those writing meaningful op components. It is currently
.ompi_ignore'd so that it doesn't impinge on other developers (it's
somewhat chatty in terms of opal_output() so that you can tell when
its functions have been invoked). See the README file in the example
op component directory. Developers of new op components are
encouraged to look at the following wiki pages:
https://svn.open-mpi.org/trac/ompi/wiki/devel/Autogen
https://svn.open-mpi.org/trac/ompi/wiki/devel/CreateComponent
https://svn.open-mpi.org/trac/ompi/wiki/devel/CreateFramework
= MPI_REDUCE_LOCAL =
Part of the MPI-2.2 proposal listed here:
https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/24
is to add a new function named MPI_REDUCE_LOCAL. It is very easy to
implement, so I added it (also because it makes testing the op
framework pretty easy -- you can do it in serial rather than via
parallel reductions). There's even a man page!
This commit was SVN r20280.
2009-01-15 02:44:31 +03:00
ompi_info : : mca_types . push_back ( " op " ) ;
2006-07-04 05:20:20 +04:00
ompi_info : : mca_types . push_back ( " common " ) ;
2007-03-17 02:11:45 +03:00
# if OPAL_ENABLE_FT == 1
ompi_info : : mca_types . push_back ( " crcp " ) ;
# endif
2004-01-19 08:41:06 +03:00
2008-06-18 07:15:56 +04:00
# if !ORTE_DISABLE_FULL_SUPPORT
2005-03-14 23:57:21 +03:00
ompi_info : : mca_types . push_back ( " iof " ) ;
ompi_info : : mca_types . push_back ( " oob " ) ;
2006-11-29 19:24:49 +03:00
ompi_info : : mca_types . push_back ( " odls " ) ;
2005-03-14 23:57:21 +03:00
ompi_info : : mca_types . push_back ( " ras " ) ;
ompi_info : : mca_types . push_back ( " rmaps " ) ;
ompi_info : : mca_types . push_back ( " rml " ) ;
2007-07-23 22:31:02 +04:00
ompi_info : : mca_types . push_back ( " routed " ) ;
2008-02-28 04:57:57 +03:00
ompi_info : : mca_types . push_back ( " plm " ) ;
2007-03-17 02:11:45 +03:00
# if OPAL_ENABLE_FT == 1
ompi_info : : mca_types . push_back ( " snapc " ) ;
# endif
ompi_info : : mca_types . push_back ( " filem " ) ;
2008-06-18 07:15:56 +04:00
# endif
/* these are always included */
ompi_info : : mca_types . push_back ( " errmgr " ) ;
ompi_info : : mca_types . push_back ( " ess " ) ;
ompi_info : : mca_types . push_back ( " grpcomm " ) ;
2004-01-19 08:41:06 +03:00
// Execute the desired action(s)
2005-07-04 04:13:44 +04:00
if ( opal_cmd_line_is_taken ( cmd_line , " pretty " ) ) {
2004-06-07 19:33:53 +04:00
ompi_info : : pretty = true ;
2006-04-04 12:53:32 +04:00
} else if ( opal_cmd_line_is_taken ( cmd_line , " parsable " ) | | opal_cmd_line_is_taken ( cmd_line , " parseable " ) ) {
2004-06-07 19:33:53 +04:00
ompi_info : : pretty = false ;
2004-01-19 20:43:50 +03:00
}
2004-01-19 08:41:06 +03:00
2005-07-04 04:13:44 +04:00
want_all = opal_cmd_line_is_taken ( cmd_line , " all " ) ;
if ( want_all | | opal_cmd_line_is_taken ( cmd_line , " version " ) ) {
2004-01-19 08:41:06 +03:00
do_version ( want_all , cmd_line ) ;
acted = true ;
}
2005-07-04 04:13:44 +04:00
if ( want_all | | opal_cmd_line_is_taken ( cmd_line , " path " ) ) {
2004-01-19 08:41:06 +03:00
do_path ( want_all , cmd_line ) ;
acted = true ;
}
2005-07-04 04:13:44 +04:00
if ( want_all | | opal_cmd_line_is_taken ( cmd_line , " arch " ) ) {
2007-07-02 10:12:02 +04:00
do_arch ( ) ;
acted = true ;
}
if ( want_all | | opal_cmd_line_is_taken ( cmd_line , " hostname " ) ) {
do_hostname ( ) ;
2004-01-19 08:41:06 +03:00
acted = true ;
}
2005-07-04 04:13:44 +04:00
if ( want_all | | opal_cmd_line_is_taken ( cmd_line , " config " ) ) {
2004-01-19 08:41:06 +03:00
do_config ( true ) ;
acted = true ;
}
2005-07-04 04:13:44 +04:00
if ( want_all | | opal_cmd_line_is_taken ( cmd_line , " param " ) ) {
do_params ( want_all , opal_cmd_line_is_taken ( cmd_line , " internal " ) ) ;
2004-01-19 08:41:06 +03:00
acted = true ;
}
2004-01-19 20:43:50 +03:00
// If no command line args are specified, show default set
2004-01-19 08:41:06 +03:00
if ( ! acted ) {
2004-06-07 19:33:53 +04:00
ompi_info : : show_ompi_version ( ver_full ) ;
2007-04-21 04:15:05 +04:00
ompi_info : : show_path ( path_prefix , opal_install_dirs . prefix ) ;
2007-07-02 10:12:02 +04:00
ompi_info : : do_arch ( ) ;
ompi_info : : do_hostname ( ) ;
2004-06-07 19:33:53 +04:00
ompi_info : : do_config ( false ) ;
2004-07-14 00:25:12 +04:00
ompi_info : : open_components ( ) ;
2005-02-14 19:58:42 +03:00
for ( ompi_info : : type_vector_t : : size_type i = 0 ;
i < mca_types . size ( ) ; + + i ) {
if ( " mpi " ! = mca_types [ i ] ) {
ompi_info : : show_component_version ( mca_types [ i ] , component_all ,
ver_full , type_all ) ;
}
}
2004-01-19 08:41:06 +03:00
}
// All done
2004-01-19 20:43:50 +03:00
2005-08-08 20:42:28 +04:00
if ( NULL ! = app_env ) {
opal_argv_free ( app_env ) ;
}
if ( NULL ! = global_env ) {
opal_argv_free ( global_env ) ;
While waiting for fortran compiles...
Fixes for orterun in handling different MCA params for different
processes (reviewed by Brian):
- By design, if you run the following:
mpirun --mca foo aaa --mca foo bbb a.out
a.out will get a single MCA param for foo with value "aaa,bbb".
- However, if you specify multiple apps with different values for the
same MCA param, you should expect to get the different values for
each app. For example:
mpirun --mca foo aaa a.out : --mca foo bbb b.out
Should yield a.out with a "foo" param with value "aaa" and b.out
with a "foo" param with a value "bbb".
- This did not work -- both a.out and b.out would get a "foo" with
"aaa,bbb".
- This commit fixes this behavior -- now a.out will get aaa and b.out
will get bbb.
- Additionally, if you mix --mca and and app file, you can have
"global" params and per-line-in-the-appfile params. For example:
mpirun --mca foo zzzz --app appfile
where "appfile" contains:
-np 1 --mca bar aaa a.out
-np 1 --mca bar bbb b.out
In this case, a.out will get foo=zzzz and bar=aaa, and b.out will
get foo=zzzz and bar=bbb.
Spiffy.
Ok, fortran build is done... back to Fortran... sigh...
This commit was SVN r5710.
2005-05-13 18:36:36 +04:00
}
2004-07-14 00:25:12 +04:00
ompi_info : : close_components ( ) ;
2004-08-26 11:56:45 +04:00
OBJ_RELEASE ( cmd_line ) ;
2005-04-20 17:16:32 +04:00
mca_base_close ( ) ;
2006-07-27 05:51:18 +04:00
opal_finalize_util ( ) ;
2004-01-19 08:41:06 +03:00
return 0 ;
}