2004-08-14 05:56:05 +04:00
/*
2005-11-05 22:57:48 +03:00
* Copyright ( c ) 2004 - 2005 The Trustees of Indiana University and Indiana
* 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 .
2004-11-28 23:09:25 +03:00
* Copyright ( c ) 2004 - 2005 High Performance Computing Center Stuttgart ,
* 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-07-10 05:44:51 +04:00
* Copyright ( c ) 2006 - 2008 Cisco Systems , Inc . All rights reserved .
2007-02-09 23:17:37 +03:00
* Copyright ( c ) 2007 Los Alamos National Security , LLC . All rights
* reserved .
2004-11-22 04:38:40 +03:00
* $ COPYRIGHT $
*
* Additional copyrights may follow
*
2004-08-14 05:56:05 +04:00
* $ HEADER $
*/
# include "ompi_config.h"
2006-08-24 20:38:08 +04:00
# if HAVE_TIME_H
2005-11-19 01:51:11 +03:00
# include <time.h>
2006-08-24 20:38:08 +04:00
# endif /* HAVE_TIME_H */
2005-11-19 01:51:11 +03:00
2006-02-12 04:33:29 +03:00
# include "ompi/constants.h"
2005-11-19 01:51:11 +03:00
# include "ompi/runtime/mpiruntime.h"
# include "ompi/runtime/params.h"
# include "ompi/datatype/datatype.h"
2008-06-09 18:53:58 +04:00
# include "orte/util/show_help.h"
2005-08-02 02:38:17 +04:00
# include "opal/mca/base/mca_base_param.h"
2008-08-02 04:43:27 +04:00
# include "opal/util/argv.h"
2004-08-14 05:56:05 +04:00
/*
* Global variables
*
* As a deviation from the norm , ompi_mpi_param_check is also
* extern ' ed in src / mpi / interface / c / bindings . h because it is already
* included in all MPI function imlementation files
*
* The values below are the default values .
*/
bool ompi_mpi_param_check = true ;
bool ompi_debug_show_handle_leaks = false ;
2007-08-02 01:33:25 +04:00
int ompi_debug_show_mpi_alloc_mem_leaks = 0 ;
2004-08-14 05:56:05 +04:00
bool ompi_debug_no_free_handles = false ;
2005-07-09 01:01:37 +04:00
bool ompi_mpi_show_mca_params = false ;
char * ompi_mpi_show_mca_params_file = NULL ;
2008-07-11 01:12:45 +04:00
bool ompi_mpi_paffinity_alone = false ;
2006-03-31 08:21:09 +04:00
bool ompi_mpi_abort_print_stack = false ;
2006-03-31 04:31:15 +04:00
int ompi_mpi_abort_delay = 0 ;
2006-05-11 23:46:21 +04:00
bool ompi_mpi_keep_peer_hostnames = true ;
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
bool ompi_mpi_keep_fqdn_hostnames = false ;
2007-01-21 17:02:06 +03:00
bool ompi_mpi_leave_pinned = false ;
bool ompi_mpi_leave_pinned_pipeline = false ;
2007-08-04 04:41:26 +04:00
bool ompi_have_sparse_group_storage = OPAL_INT_TO_BOOL ( OMPI_GROUP_SPARSE ) ;
bool ompi_use_sparse_group_storage = OPAL_INT_TO_BOOL ( OMPI_GROUP_SPARSE ) ;
2006-05-11 23:46:21 +04:00
2008-08-01 00:00:45 +04:00
static bool show_default_mca_params = false ;
static bool show_file_mca_params = false ;
static bool show_enviro_mca_params = false ;
static bool show_override_mca_params = false ;
2004-08-14 05:56:05 +04:00
int ompi_mpi_register_params ( void )
{
2008-07-11 19:39:59 +04:00
int value ;
2008-08-01 00:00:45 +04:00
char * param ;
2004-08-14 17:07:30 +04:00
/* Whether we want MPI API function parameter checking or not */
2005-08-02 02:38:17 +04:00
mca_base_param_reg_int_name ( " mpi " , " param_check " ,
" Whether you want MPI API parameters checked at run-time or not. Possible values are 0 (no checking) and 1 (perform checking at run-time) " ,
false , false , MPI_PARAM_CHECK , & value ) ;
2006-08-28 22:59:16 +04:00
ompi_mpi_param_check = OPAL_INT_TO_BOOL ( value ) ;
2004-08-14 17:07:30 +04:00
if ( ompi_mpi_param_check ) {
value = 0 ;
if ( MPI_PARAM_CHECK ) {
value = 1 ;
}
if ( 0 = = value ) {
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-mpi-runtime.txt " ,
2005-08-02 02:38:17 +04:00
" mpi-param-check-enabled-but-compiled-out " ,
true ) ;
2004-08-14 17:07:30 +04:00
ompi_mpi_param_check = false ;
}
}
2004-08-14 05:56:05 +04:00
2005-03-30 05:40:26 +04:00
/*
2005-07-04 01:57:43 +04:00
* opal_progress : decide whether to yield and the event library
2005-03-30 05:40:26 +04:00
* tick rate
*/
2005-08-02 02:38:17 +04:00
/* JMS: Need ORTE data here -- set this to 0 when
exactly / under - subscribed , or 1 when oversubscribed */
mca_base_param_reg_int_name ( " mpi " , " yield_when_idle " ,
" Yield the processor when waiting for MPI communication (for MPI processes, will default to 1 when oversubscribing nodes) " ,
2007-02-01 22:31:44 +03:00
false , false , - 1 , NULL ) ;
2005-08-02 02:38:17 +04:00
mca_base_param_reg_int_name ( " mpi " , " event_tick_rate " ,
2005-08-18 09:34:22 +04:00
" How often to progress TCP communications (0 = never, otherwise specified in microseconds) " ,
2005-08-02 02:38:17 +04:00
false , false , - 1 , NULL ) ;
2005-03-30 05:40:26 +04:00
2004-08-14 05:56:05 +04:00
/* Whether or not to show MPI handle leaks */
2005-08-02 02:38:17 +04:00
mca_base_param_reg_int_name ( " mpi " , " show_handle_leaks " ,
" Whether MPI_FINALIZE shows all MPI handles that were not freed or not " ,
false , false ,
( int ) ompi_debug_show_handle_leaks , & value ) ;
2006-08-28 22:59:16 +04:00
ompi_debug_show_handle_leaks = OPAL_INT_TO_BOOL ( value ) ;
2004-08-14 05:56:05 +04:00
2004-08-14 17:07:30 +04:00
/* Whether or not to free MPI handles. Useless without run-time
param checking , so implicitly set that to true if we don ' t want
to free the handles . */
2004-08-14 05:56:05 +04:00
2005-08-02 02:38:17 +04:00
mca_base_param_reg_int_name ( " mpi " , " no_free_handles " ,
" Whether to actually free MPI objects when their handles are freed " ,
false , false ,
( int ) ompi_debug_no_free_handles , & value ) ;
2006-08-28 22:59:16 +04:00
ompi_debug_no_free_handles = OPAL_INT_TO_BOOL ( value ) ;
2004-08-14 17:07:30 +04:00
if ( ompi_debug_no_free_handles ) {
ompi_mpi_param_check = true ;
value = 0 ;
if ( MPI_PARAM_CHECK ) {
value = 1 ;
}
if ( 0 = = value ) {
2008-06-09 18:53:58 +04:00
opal_output ( 0 , " WARNING: MCA parameter mpi_no_free_handles set to true, but MPI " ) ;
opal_output ( 0 , " WARNING: parameter checking has been compiled out of Open MPI. " ) ;
opal_output ( 0 , " WARNING: mpi_no_free_handles is therefore only partially effective! " ) ;
2004-08-14 17:07:30 +04:00
}
}
2005-07-09 01:01:37 +04:00
2007-08-02 01:33:25 +04:00
/* Whether or not to show MPI_ALLOC_MEM leaks */
mca_base_param_reg_int_name ( " mpi " , " show_mpi_alloc_mem_leaks " ,
" If >0, MPI_FINALIZE will show up to this many instances of memory allocated by MPI_ALLOC_MEM that was not freed by MPI_FREE_MEM " ,
false , false ,
ompi_debug_show_mpi_alloc_mem_leaks ,
& ompi_debug_show_mpi_alloc_mem_leaks ) ;
2005-07-09 01:01:37 +04:00
/* Whether or not to print all MCA parameters in MPI_INIT */
2008-08-01 00:00:45 +04:00
mca_base_param_reg_string_name ( " mpi " , " show_mca_params " ,
" Whether to show all MCA parameter values during MPI_INIT or not (good for reproducability of MPI jobs "
2008-08-02 04:43:27 +04:00
" for debug purposes). Accepted values are all, default, file, api, and enviro - or a comma "
" delimited combination of them " ,
2008-08-01 00:00:45 +04:00
false , false , NULL , & param ) ;
if ( NULL ! = param ) {
2008-08-02 04:43:27 +04:00
char * * args ;
int i ;
2008-08-01 00:00:45 +04:00
ompi_mpi_show_mca_params = true ;
2008-08-02 04:43:27 +04:00
args = opal_argv_split ( param , ' , ' ) ;
if ( NULL = = args ) {
opal_output ( 0 , " WARNING: could not parse mpi_show_mca_params request - defaulting to show \" all \" " ) ;
2008-08-01 00:00:45 +04:00
show_default_mca_params = true ;
show_file_mca_params = true ;
show_enviro_mca_params = true ;
show_override_mca_params = true ;
2008-08-02 04:43:27 +04:00
} else {
for ( i = 0 ; NULL ! = args [ i ] ; i + + ) {
if ( 0 = = strcasecmp ( args [ i ] , " all " ) | | 0 = = strcmp ( args [ i ] , " 1 " ) ) {
show_default_mca_params = true ;
show_file_mca_params = true ;
show_enviro_mca_params = true ;
show_override_mca_params = true ;
} else if ( 0 = = strcasecmp ( args [ i ] , " default " ) ) {
show_default_mca_params = true ;
} else if ( 0 = = strcasecmp ( args [ i ] , " file " ) ) {
show_file_mca_params = true ;
} else if ( 0 = = strcasecmp ( args [ i ] , " enviro " ) | |
0 = = strcasecmp ( args [ i ] , " env " ) ) {
show_enviro_mca_params = true ;
} else if ( 0 = = strcasecmp ( args [ i ] , " api " ) ) {
show_override_mca_params = true ;
}
}
opal_argv_free ( args ) ;
2008-08-01 00:00:45 +04:00
}
}
2005-07-09 01:01:37 +04:00
/* File to use when dumping the parameters */
2005-08-02 02:38:17 +04:00
mca_base_param_reg_string_name ( " mpi " , " show_mca_params_file " ,
" If mpi_show_mca_params is true, setting this string to a valid filename tells Open MPI to dump all the MCA parameter values into a file suitable for reading via the mca_param_files parameter (good for reproducability of MPI jobs) " ,
false , false ,
" " , & ompi_mpi_show_mca_params_file ) ;
2004-08-14 05:56:05 +04:00
2005-08-16 20:17:52 +04:00
/* User-level process pinning controls */
2006-05-11 23:46:21 +04:00
/* Do we want to save hostnames for debugging messages? This can
eat quite a bit of memory . . . */
mca_base_param_reg_int_name ( " mpi " , " keep_peer_hostnames " ,
" If nonzero, save the string hostnames of all MPI peer processes (mostly for error / debugging output messages). This can add quite a bit of memory usage to each MPI process. " ,
false , false , 1 , & value ) ;
2006-08-28 22:59:16 +04:00
ompi_mpi_keep_peer_hostnames = OPAL_INT_TO_BOOL ( value ) ;
2006-05-11 23:46:21 +04:00
2006-03-31 04:31:15 +04:00
/* MPI_ABORT controls */
mca_base_param_reg_int_name ( " mpi " , " abort_delay " ,
" If nonzero, print out an identifying message when MPI_ABORT is invoked (hostname, PID of the process that called MPI_ABORT) and delay for that many seconds before exiting (a negative delay value means to never abort). This allows attaching of a debugger before quitting the job. " ,
false , false ,
ompi_mpi_abort_delay ,
& ompi_mpi_abort_delay ) ;
mca_base_param_reg_int_name ( " mpi " , " abort_print_stack " ,
" If nonzero, print out a stack trace when MPI_ABORT is invoked " ,
false ,
/* If we do not have stack trace
capability , make this a read - only
MCA param */
# if OMPI_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) && defined(HAVE_BACKTRACE)
false ,
# else
true ,
# endif
( int ) ompi_mpi_abort_print_stack ,
& value ) ;
# if OMPI_WANT_PRETTY_PRINT_STACKTRACE && ! defined(__WINDOWS__) && defined(HAVE_BACKTRACE)
/* Only take the value if we have stack trace capability */
2006-08-28 22:59:16 +04:00
ompi_mpi_abort_print_stack = OPAL_INT_TO_BOOL ( value ) ;
2006-03-31 04:31:15 +04:00
# else
/* If we do not have stack trace capability, ensure that this is
hard - coded to false */
ompi_mpi_abort_print_stack = false ;
# endif
2006-08-04 18:41:31 +04:00
mca_base_param_reg_int_name ( " mpi " , " preconnect_all " ,
2007-05-01 08:49:36 +04:00
" Whether to force MPI processes to create OOB "
" and MPI connections with *all* peers during "
" MPI_INIT (vs. making connections lazily -- "
" upon the first MPI traffic between each "
" process peer pair) " ,
false , false , 0 , NULL ) ;
mca_base_param_reg_int_name ( " mpi " , " preconnect_mpi " ,
" Whether to force MPI processes to fully "
" wire-up the MPI connections between MPI "
" processes. " ,
false , false , 0 , NULL ) ;
2007-01-21 17:02:06 +03:00
2007-02-09 23:17:37 +03:00
mca_base_param_reg_int_name ( " mpi " , " preconnect_oob " ,
2007-05-01 08:49:36 +04:00
" Whether to force MPI processes to fully "
" wire-up the OOB system between MPI processes. " ,
false , false , 0 , NULL ) ;
2007-02-09 23:17:37 +03:00
2007-05-24 01:35:44 +04:00
mca_base_param_reg_int_name ( " mpi " , " preconnect_oob_simultaneous " ,
" Number of simultaneous outstanding "
" OOB connections to allow during preconnect. " ,
false , false , 4 , NULL ) ;
2007-01-21 17:02:06 +03:00
/* Leave pinned parameter */
mca_base_param_reg_int_name ( " mpi " , " leave_pinned " ,
" Whether to use the \" leave pinned \" protocol or not. Enabling this setting can help bandwidth performance when repeatedly sending and receiving large messages with the same buffers over RDMA-based networks. " ,
false , false ,
( int ) ompi_mpi_leave_pinned , & value ) ;
ompi_mpi_leave_pinned = OPAL_INT_TO_BOOL ( value ) ;
mca_base_param_reg_int_name ( " mpi " , " leave_pinned_pipeline " ,
" Whether to use the \" leave pinned pipeline \" protocol or not. " ,
false , false ,
( int ) ompi_mpi_leave_pinned_pipeline , & value ) ;
ompi_mpi_leave_pinned_pipeline = OPAL_INT_TO_BOOL ( value ) ;
2006-08-04 18:41:31 +04:00
2007-01-21 17:02:06 +03:00
if ( ompi_mpi_leave_pinned & & ompi_mpi_leave_pinned_pipeline ) {
ompi_mpi_leave_pinned_pipeline = 0 ;
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-mpi-runtime.txt " ,
2007-01-21 17:02:06 +03:00
" mpi-params:leave-pinned-and-pipeline-selected " ,
true ) ;
}
2008-07-11 01:12:45 +04:00
mca_base_param_reg_int_name ( " mpi " , " paffinity_alone " ,
" If nonzero, assume that this job is the only (set of) process(es) running on each node and bind processes to processors, starting with processor ID 0 " ,
false , false ,
( int ) ompi_mpi_paffinity_alone , & value ) ;
ompi_mpi_paffinity_alone = OPAL_INT_TO_BOOL ( value ) ;
2008-07-10 05:44:51 +04:00
2007-08-04 04:41:26 +04:00
/* Sparse group storage support */
mca_base_param_reg_int_name ( " mpi " , " have_sparse_group_storage " ,
" Whether this Open MPI installation supports storing of data in MPI groups in \" sparse \" formats (good for extremely large process count MPI jobs that create many communicators/groups) " ,
false , true , ( int ) OMPI_GROUP_SPARSE , NULL ) ;
mca_base_param_reg_int_name ( " mpi " , " use_sparse_group_storage " ,
" Whether to use \" sparse \" storage formats for MPI groups (only relevant if mpi_have_sparse_group_storage is 1) " ,
false , false , OMPI_GROUP_SPARSE , & value ) ;
ompi_use_sparse_group_storage = OPAL_INT_TO_BOOL ( value ) ;
if ( ompi_use_sparse_group_storage ) {
value = 0 ;
if ( OMPI_GROUP_SPARSE ) {
value = 1 ;
}
if ( 0 = = value ) {
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-mpi-runtime.txt " ,
2007-08-04 04:41:26 +04:00
" sparse groups enabled but compiled out " ,
true ) ;
ompi_use_sparse_group_storage = false ;
}
}
2005-11-19 01:51:11 +03:00
/* The ddt engine has a few parameters */
return ompi_ddt_register_params ( ) ;
2005-02-21 21:56:30 +03:00
}
2005-03-14 23:57:21 +03:00
2005-07-09 01:01:37 +04:00
int ompi_show_all_mca_params ( int32_t rank , int requested , char * nodename ) {
2008-08-01 00:00:45 +04:00
opal_list_t * info ;
opal_list_item_t * i ;
mca_base_param_info_t * item ;
char * value_string ;
int value_int ;
FILE * fp = NULL ;
time_t timestamp ;
mca_base_param_source_t source ;
char * src_file ;
char * src_string ;
if ( rank ! = 0 ) {
return OMPI_SUCCESS ;
}
timestamp = time ( NULL ) ;
/* Open the file if one is specified */
if ( 0 ! = strlen ( ompi_mpi_show_mca_params_file ) ) {
if ( NULL = = ( fp = fopen ( ompi_mpi_show_mca_params_file , " w " ) ) ) {
opal_output ( 0 , " Unable to open file <%s> to write MCA parameters " , ompi_mpi_show_mca_params_file ) ;
return OMPI_ERR_FILE_OPEN_FAILURE ;
}
fprintf ( fp , " # \n " ) ;
fprintf ( fp , " # This file was automatically generated on %s " , ctime ( & timestamp ) ) ;
fprintf ( fp , " # by MPI_COMM_WORLD rank %d (out of a total of %d) on %s \n " , rank , requested , nodename ) ;
fprintf ( fp , " # \n " ) ;
}
mca_base_param_dump ( & info , false ) ;
for ( i = opal_list_get_first ( info ) ;
i ! = opal_list_get_last ( info ) ;
i = opal_list_get_next ( i ) ) {
item = ( mca_base_param_info_t * ) i ;
2008-08-02 04:43:27 +04:00
/* If this is an internal param, don't print it */
if ( item - > mbpp_internal ) {
continue ;
}
2008-08-01 00:00:45 +04:00
/* get the source - where the param was last set */
if ( OPAL_SUCCESS ! =
mca_base_param_lookup_source ( item - > mbpp_index , & source , & src_file ) ) {
continue ;
}
/* is this a default value and we are not displaying
* defaults , ignore this one
*/
if ( MCA_BASE_PARAM_SOURCE_DEFAULT = = source & & ! show_default_mca_params ) {
continue ;
}
/* is this a file value and we are not displaying files,
* ignore it
*/
if ( MCA_BASE_PARAM_SOURCE_FILE = = source & & ! show_file_mca_params ) {
continue ;
}
/* is this an enviro value and we are not displaying enviros,
* ignore it
*/
if ( MCA_BASE_PARAM_SOURCE_ENV = = source & & ! show_enviro_mca_params ) {
continue ;
}
/* is this an API value and we are not displaying APIs,
* ignore it
*/
if ( MCA_BASE_PARAM_SOURCE_OVERRIDE = = source & & ! show_override_mca_params ) {
continue ;
}
/* Get the parameter name, and convert it to a printable string */
if ( MCA_BASE_PARAM_TYPE_STRING = = item - > mbpp_type ) {
mca_base_param_lookup_string ( item - > mbpp_index , & value_string ) ;
if ( NULL = = value_string ) {
value_string = strdup ( " " ) ;
}
} else {
mca_base_param_lookup_int ( item - > mbpp_index , & value_int ) ;
asprintf ( & value_string , " %d " , value_int ) ;
}
switch ( source ) {
case MCA_BASE_PARAM_SOURCE_DEFAULT :
src_string = " default value " ;
break ;
case MCA_BASE_PARAM_SOURCE_ENV :
src_string = " environment " ;
break ;
case MCA_BASE_PARAM_SOURCE_FILE :
src_string = " file " ;
break ;
case MCA_BASE_PARAM_SOURCE_OVERRIDE :
src_string = " API override " ;
break ;
default :
src_string = NULL ;
break ;
}
/* Print the parameter */
if ( 0 ! = strlen ( ompi_mpi_show_mca_params_file ) ) {
if ( NULL = = src_file ) {
fprintf ( fp , " %s=%s (%s) \n " , item - > mbpp_full_name , value_string ,
( NULL ! = src_string ? src_string : " unknown " ) ) ;
} else {
fprintf ( fp , " %s=%s (%s:%s) \n " , item - > mbpp_full_name , value_string ,
( NULL ! = src_string ? src_string : " unknown " ) , src_file ) ;
}
} else {
if ( NULL = = src_file ) {
opal_output ( 0 , " %s=%s (%s) \n " , item - > mbpp_full_name , value_string ,
( NULL ! = src_string ? src_string : " unknown " ) ) ;
} else {
opal_output ( 0 , " %s=%s (%s:%s) \n " , item - > mbpp_full_name , value_string ,
( NULL ! = src_string ? src_string : " unknown " ) , src_file ) ;
}
}
free ( value_string ) ;
}
/* Close file, cleanup allocated memory*/
if ( 0 ! = strlen ( ompi_mpi_show_mca_params_file ) ) {
fclose ( fp ) ;
}
mca_base_param_dump_release ( info ) ;
return OMPI_SUCCESS ;
2005-07-09 01:01:37 +04:00
}