2005-08-31 05:43:48 +04: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-04-20 03:42:06 +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 .
2005-08-31 05:43:48 +04:00
* Copyright ( c ) 2004 - 2005 High Performance Computing Center Stuttgart ,
* University of Stuttgart . All rights reserved .
* Copyright ( c ) 2004 - 2005 The Regents of the University of California .
* All rights reserved .
2008-05-07 06:31:24 +04:00
* Copyright ( c ) 2008 Sun Microsystems , Inc . All rights reserved .
2005-08-31 05:43:48 +04:00
* $ COPYRIGHT $
*
* Additional copyrights may follow
*
* $ HEADER $
*
* These symbols are in a file by themselves to provide nice linker
* semantics . Since linkers generally pull in symbols by object
* files , keeping these symbols as the only symbols in this file
* prevents utility programs such as " ompi_info " from having to import
* entire components just to query their version and parameters .
*/
# include "ompi_config.h"
# include "coll_tuned.h"
# include "mpi.h"
2006-02-12 04:33:29 +03:00
# include "ompi/mca/coll/coll.h"
2005-08-31 05:43:48 +04:00
# include "coll_tuned.h"
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
# include "orte/util/output.h"
# include "orte/util/output.h"
2005-11-10 04:19:27 +03:00
2005-08-31 05:43:48 +04:00
/*
* Public string showing the coll ompi_tuned component version number
*/
2005-12-22 16:49:33 +03:00
const char * ompi_coll_tuned_component_version_string =
2007-08-19 07:37:49 +04:00
" Open MPI tuned collective MCA component version " OMPI_VERSION ;
2005-08-31 05:43:48 +04:00
/*
* Global variable
*/
2005-12-22 16:49:33 +03:00
int ompi_coll_tuned_stream = - 1 ;
int ompi_coll_tuned_priority = 30 ;
2007-02-20 07:25:00 +03:00
int ompi_coll_tuned_preallocate_memory_comm_size_limit = ( 32 * 1024 ) ;
2005-12-22 16:49:33 +03:00
int ompi_coll_tuned_use_dynamic_rules = 0 ;
char * ompi_coll_tuned_dynamic_rules_filename = ( char * ) NULL ;
int ompi_coll_tuned_init_tree_fanout = 4 ;
int ompi_coll_tuned_init_chain_fanout = 4 ;
2007-02-20 07:25:00 +03:00
int ompi_coll_tuned_init_max_requests = 128 ;
2005-10-25 01:33:48 +04:00
/* forced alogrithm variables */
2006-04-20 03:42:06 +04:00
/* indices for the MCA parameters */
coll_tuned_force_algorithm_mca_param_indices_t ompi_coll_tuned_forced_params [ COLLCOUNT ] ;
/* max algorithm values */
int ompi_coll_tuned_forced_max_algorithms [ COLLCOUNT ] ;
2005-10-25 07:55:58 +04:00
2005-08-31 05:43:48 +04:00
/*
* Local function
*/
static int tuned_open ( void ) ;
2006-02-01 23:50:14 +03:00
static int tuned_close ( void ) ;
2005-08-31 05:43:48 +04:00
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
2006-02-01 23:50:14 +03:00
mca_coll_tuned_component_t mca_coll_tuned_component = {
2005-08-31 05:43:48 +04:00
2006-02-01 23:50:14 +03:00
/* First, fill in the super (mca_coll_base_component_1_0_0_t) */
2005-08-31 05:43:48 +04:00
2006-02-01 23:50:14 +03:00
{
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
/* First, the mca_component_t struct containing meta information
about the component itself */
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
{
/* Indicate that we are a coll v1.0.0 component (which also implies a
specific MCA version ) */
2005-08-31 05:43:48 +04:00
2007-08-19 07:37:49 +04:00
MCA_COLL_BASE_VERSION_1_1_0 ,
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
/* Component name and version */
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
" tuned " ,
OMPI_MAJOR_VERSION ,
OMPI_MINOR_VERSION ,
OMPI_RELEASE_VERSION ,
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
/* Component open and close functions */
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
tuned_open ,
tuned_close
} ,
2005-08-31 05:43:48 +04:00
2006-10-18 06:00:46 +04:00
/* Next the MCA v1.0.0 component meta data */
{
2007-03-17 02:11:45 +03:00
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
2006-10-18 06:00:46 +04:00
} ,
2006-02-01 23:50:14 +03:00
2006-10-18 06:00:46 +04:00
/* Initialization / querying functions */
2006-02-01 23:50:14 +03:00
2006-10-18 06:00:46 +04:00
ompi_coll_tuned_init_query ,
ompi_coll_tuned_comm_query ,
} ,
2006-02-01 23:50:14 +03:00
/* priority of the module */
0 ,
2006-10-18 06:00:46 +04:00
/* Tuned component specific information */
/* Note some of this WAS in the module */
2006-02-01 23:50:14 +03:00
NULL /* ompi_coll_alg_rule_t ptr */
2005-08-31 05:43:48 +04:00
} ;
static int tuned_open ( void )
{
2006-11-10 22:54:09 +03:00
# if OMPI_ENABLE_DEBUG
{
int param ;
2005-08-31 05:43:48 +04:00
2006-11-10 22:54:09 +03:00
param = mca_base_param_find ( " coll " , NULL , " base_verbose " ) ;
if ( param > = 0 ) {
int verbose ;
mca_base_param_lookup_int ( param , & verbose ) ;
if ( verbose > 0 ) {
2008-06-03 18:24:01 +04:00
ompi_coll_tuned_stream = orte_output_open ( NULL ) ;
2006-11-10 22:54:09 +03:00
}
}
}
# endif /* OMPI_ENABLE_DEBUG */
/* Use a low priority, but allow other components to be lower */
2006-02-01 23:50:14 +03:00
mca_base_param_reg_int ( & mca_coll_tuned_component . super . collm_version ,
2005-10-11 22:51:03 +04:00
" priority " ,
" Priority of the tuned coll component " ,
2005-12-22 16:49:33 +03:00
false , false , ompi_coll_tuned_priority ,
& ompi_coll_tuned_priority ) ;
2005-10-11 22:51:03 +04:00
/* parameter for pre-allocated memory requests etc */
2006-02-01 23:50:14 +03:00
mca_base_param_reg_int ( & mca_coll_tuned_component . super . collm_version ,
2005-10-11 22:51:03 +04:00
" pre_allocate_memory_comm_size_limit " ,
" Size of communicator were we stop pre-allocating memory for the fixed internal buffer used for message requests etc that is hung off the communicator data segment. I.e. if you have a 100'000 nodes you might not want to pre-allocate 200'000 request handle slots per communicator instance! " ,
2005-12-22 16:49:33 +03:00
false , false , ompi_coll_tuned_preallocate_memory_comm_size_limit ,
& ompi_coll_tuned_preallocate_memory_comm_size_limit ) ;
2005-09-13 08:28:18 +04:00
2005-09-01 03:38:09 +04:00
/* some initial guesses at topology parameters */
2006-02-01 23:50:14 +03:00
mca_base_param_reg_int ( & mca_coll_tuned_component . super . collm_version ,
2005-10-11 22:51:03 +04:00
" init_tree_fanout " ,
" Inital fanout used in the tree topologies for each communicator. This is only an initial guess, if a tuned collective needs a different fanout for an operation, it build it dynamically. This parameter is only for the first guess and might save a little time " ,
2005-12-22 16:49:33 +03:00
false , false , ompi_coll_tuned_init_tree_fanout ,
& ompi_coll_tuned_init_tree_fanout ) ;
2005-10-11 22:51:03 +04:00
2006-02-01 23:50:14 +03:00
mca_base_param_reg_int ( & mca_coll_tuned_component . super . collm_version ,
2005-10-11 22:51:03 +04:00
" init_chain_fanout " ,
" Inital fanout used in the chain (fanout followed by pipeline) topologies for each communicator. This is only an initial guess, if a tuned collective needs a different fanout for an operation, it build it dynamically. This parameter is only for the first guess and might save a little time " ,
2005-12-22 16:49:33 +03:00
false , false , ompi_coll_tuned_init_chain_fanout ,
& ompi_coll_tuned_init_chain_fanout ) ;
2005-10-11 22:51:03 +04:00
2006-04-20 03:42:06 +04:00
/* now check that the user hasn't overrode any of the decision functions if dynamic rules are enabled */
/* the user can redo this before every comm dup/create if they like */
2005-10-25 07:55:58 +04:00
/* this is useful for benchmarking and user knows best tuning */
2006-04-20 03:42:06 +04:00
/* as this is the component we only lookup the indicies of the mca params */
/* the actual values are looked up during comm create via module init */
2005-10-25 07:55:58 +04:00
/* intra functions first */
2006-11-10 22:54:09 +03:00
/* if dynamic rules allowed then look up dynamic rules config filename, else we leave it an empty filename (NULL) */
/* by default DISABLE dynamic rules and instead use fixed [if based] rules */
mca_base_param_reg_int ( & mca_coll_tuned_component . super . collm_version ,
" use_dynamic_rules " ,
" Switch used to decide if we use static (compiled/if statements) or dynamic (built at runtime) decision function rules " ,
false , false , ompi_coll_tuned_use_dynamic_rules ,
& ompi_coll_tuned_use_dynamic_rules ) ;
2006-04-20 03:42:06 +04:00
if ( ompi_coll_tuned_use_dynamic_rules ) {
2006-11-10 22:54:09 +03:00
mca_base_param_reg_string ( & mca_coll_tuned_component . super . collm_version ,
" dynamic_rules_filename " ,
" Filename of configuration file that contains the dynamic (@runtime) decision function rules " ,
false , false , ompi_coll_tuned_dynamic_rules_filename ,
& ompi_coll_tuned_dynamic_rules_filename ) ;
2006-04-20 03:42:06 +04:00
ompi_coll_tuned_allreduce_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ ALLREDUCE ] ) ;
ompi_coll_tuned_alltoall_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ ALLTOALL ] ) ;
2006-12-21 21:40:02 +03:00
ompi_coll_tuned_allgather_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ ALLGATHER ] ) ;
2007-07-04 03:33:12 +04:00
ompi_coll_tuned_allgatherv_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ ALLGATHERV ] ) ;
2008-05-07 06:31:24 +04:00
ompi_coll_tuned_alltoallv_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ ALLTOALLV ] ) ;
2006-04-20 03:42:06 +04:00
ompi_coll_tuned_barrier_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ BARRIER ] ) ;
ompi_coll_tuned_bcast_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ BCAST ] ) ;
ompi_coll_tuned_reduce_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ REDUCE ] ) ;
2007-03-05 23:40:39 +03:00
ompi_coll_tuned_reduce_scatter_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ REDUCESCATTER ] ) ;
2007-02-28 04:11:01 +03:00
ompi_coll_tuned_gather_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ GATHER ] ) ;
2007-03-03 02:19:02 +03:00
ompi_coll_tuned_scatter_intra_check_forced_init ( & ompi_coll_tuned_forced_params [ SCATTER ] ) ;
2006-04-20 03:42:06 +04:00
}
2005-10-25 07:55:58 +04:00
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_OUTPUT ( ( ompi_coll_tuned_stream , " coll:tuned:component_open: done! " ) ) ;
2005-08-31 05:43:48 +04:00
return OMPI_SUCCESS ;
}
2006-02-01 23:50:14 +03:00
/* here we should clean up state stored on the component */
/* i.e. alg table and dynamic changable rules if allocated etc */
static int tuned_close ( void )
{
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_OUTPUT ( ( ompi_coll_tuned_stream , " coll:tuned:component_close: called " ) ) ;
2006-02-01 23:50:14 +03:00
/* dealloc alg table if allocated */
/* dealloc dynamic changable rules if allocated */
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_OUTPUT ( ( ompi_coll_tuned_stream , " coll:tuned:component_close: done! " ) ) ;
2006-02-01 23:50:14 +03:00
return OMPI_SUCCESS ;
}
2007-08-19 07:37:49 +04:00
static void
mca_coll_tuned_module_construct ( mca_coll_tuned_module_t * module )
{
module - > tuned_data = NULL ;
}
static void
mca_coll_tuned_module_destruct ( mca_coll_tuned_module_t * module )
{
mca_coll_tuned_comm_t * data ;
/* Free the space in the data mpool and the data hanging off the
communicator */
data = module - > tuned_data ;
if ( NULL ! = data ) {
# if OMPI_ENABLE_DEBUG
/* Reset the reqs to NULL/0 -- they'll be freed as part of freeing
the generel c_coll_selected_data */
data - > mcct_reqs = NULL ;
data - > mcct_num_reqs = 0 ;
# endif
/* free any cached information that has been allocated */
if ( data - > cached_ntree ) { /* destroy general tree if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_ntree ) ;
}
if ( data - > cached_bintree ) { /* destroy bintree if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_bintree ) ;
}
if ( data - > cached_bmtree ) { /* destroy bmtree if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_bmtree ) ;
}
if ( data - > cached_in_order_bmtree ) { /* destroy bmtree if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_in_order_bmtree ) ;
}
if ( data - > cached_chain ) { /* destroy general chain if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_chain ) ;
}
if ( data - > cached_pipeline ) { /* destroy pipeline if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_pipeline ) ;
}
if ( data - > cached_in_order_bintree ) { /* destroy in order bintree if defined */
ompi_coll_tuned_topo_destroy_tree ( & data - > cached_in_order_bintree ) ;
}
#if 0 /* FIXME: */
/* if any algorithm rules are cached on the communicator, only free them if its MCW */
/* as this is the only place they are allocated by reading the decision configure file */
if ( ( ompi_coll_tuned_use_dynamic_rules ) & & ( & ompi_mpi_comm_world = = comm ) ) {
if ( comm - > data - > all_base_rules ) {
ompi_coll_tuned_free_all_rules ( comm - > data - > all_base_rules , COLLCOUNT ) ;
}
}
# endif
free ( data ) ;
}
}
OBJ_CLASS_INSTANCE ( mca_coll_tuned_module_t ,
mca_coll_base_module_1_1_0_t ,
mca_coll_tuned_module_construct ,
mca_coll_tuned_module_destruct ) ;