2013-07-26 21:44:10 +04:00
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
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 .
2009-02-13 06:40:53 +03:00
* Copyright ( c ) 2006 - 2009 Cisco Systems , Inc . All rights reserved .
2013-02-28 21:31:47 +04:00
* Copyright ( c ) 2007 - 2013 Los Alamos National Security , LLC . All rights
2007-02-09 23:17:37 +03:00
* reserved .
2013-01-30 00:24:04 +04:00
* Copyright ( c ) 2013 NVIDIA Corporation . All rights reserved .
As per the email discussion, revise the sparse handling of hostnames so that we avoid potential infinite loops while allowing large-scale users to improve their startup time:
* add a new MCA param orte_hostname_cutoff to specify the number of nodes at which we stop including hostnames. This defaults to INT_MAX => always include hostnames. If a value is given, then we will include hostnames for any allocation smaller than the given limit.
* remove ompi_proc_get_hostname. Replace all occurrences with a direct link to ompi_proc_t's proc_hostname, protected by appropriate "if NULL"
* modify the OMPI-ORTE integration component so that any call to modex_recv automatically loads the ompi_proc_t->proc_hostname field as well as returning the requested info. Thus, any process whose modex info you retrieve will automatically receive the hostname. Note that on-demand retrieval is still enabled - i.e., if we are running under direct launch with PMI, the hostname will be fetched upon first call to modex_recv, and then the ompi_proc_t->proc_hostname field will be loaded
* removed a stale MCA param "mpi_keep_peer_hostnames" that was no longer used anywhere in the code base
* added an envar lookup in ess/pmi for the number of nodes in the allocation. Sadly, PMI itself doesn't provide that info, so we have to get it a different way. Currently, we support PBS-based systems and SLURM - for any other, rank0 will emit a warning and we assume max number of daemons so we will always retain hostnames
This commit was SVN r29052.
2013-08-20 22:59:36 +04:00
* Copyright ( c ) 2013 Intel , Inc . 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"
2009-03-13 05:10:32 +03:00
# ifdef HAVE_STRING_H
# include <string.h>
# endif
2009-07-16 22:27:33 +04:00
# ifdef 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"
2009-07-13 08:59:13 +04:00
# include "ompi/datatype/ompi_datatype.h"
2005-11-19 01:51:11 +03:00
# include "ompi/runtime/mpiruntime.h"
# include "ompi/runtime/params.h"
2013-01-28 03:25:10 +04:00
# include "ompi/mca/rte/rte.h"
2008-08-02 04:43:27 +04:00
# include "opal/util/argv.h"
2009-02-14 05:26:12 +03:00
# include "opal/util/output.h"
2013-02-13 01:10:11 +04:00
# include "opal/util/show_help.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 ;
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 ;
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 ;
2008-09-17 02:06:14 +04:00
int ompi_mpi_leave_pinned = - 1 ;
2007-01-21 17:02:06 +03:00
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 ) ;
2013-11-01 16:19:40 +04:00
bool ompi_mpi_built_with_cuda_support = OPAL_INT_TO_BOOL ( OPAL_CUDA_SUPPORT ) ;
2013-07-23 21:58:21 +04:00
bool ompi_mpi_cuda_support ;
2006-05-11 23:46:21 +04:00
2013-08-22 07:40:26 +04:00
uint32_t ompi_hostname_cutoff = UINT32_MAX ;
2013-03-28 01:09:41 +04:00
bool ompi_mpi_yield_when_idle = true ;
int ompi_mpi_event_tick_rate = - 1 ;
char * ompi_mpi_show_mca_params_string = NULL ;
bool ompi_mpi_have_sparse_group_storage = ! ! ( OMPI_GROUP_SPARSE ) ;
bool ompi_mpi_preconnect_mpi = false ;
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 ;
2004-08-14 17:07:30 +04:00
2013-07-26 21:44:10 +04:00
/* Whether we want MPI API function parameter checking or not. Disable this by default if
parameter checking is compiled out . */
2005-08-02 02:38:17 +04:00
2013-07-26 21:44:10 +04:00
ompi_mpi_param_check = ! ! ( MPI_PARAM_CHECK ) ;
2013-03-28 01:09:41 +04:00
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " 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) " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_param_check ) ;
if ( ompi_mpi_param_check & & ! MPI_PARAM_CHECK ) {
opal_show_help ( " help-mpi-runtime.txt " ,
" mpi-param-check-enabled-but-compiled-out " ,
true ) ;
ompi_mpi_param_check = false ;
2004-08-14 17:07:30 +04:00
}
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 */
2013-03-28 01:09:41 +04:00
ompi_mpi_yield_when_idle = true ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " yield_when_idle " ,
" Yield the processor when waiting for MPI communication (for MPI processes, will default to 1 when oversubscribing nodes) " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_yield_when_idle ) ;
ompi_mpi_event_tick_rate = - 1 ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " event_tick_rate " ,
" How often to progress TCP communications (0 = never, otherwise specified in microseconds) " ,
MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_event_tick_rate ) ;
2005-03-30 05:40:26 +04:00
2004-08-14 05:56:05 +04:00
/* Whether or not to show MPI handle leaks */
2013-03-28 01:09:41 +04:00
ompi_debug_show_handle_leaks = false ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " show_handle_leaks " ,
" Whether MPI_FINALIZE shows all MPI handles that were not freed or not " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_debug_show_handle_leaks ) ;
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 . */
2013-03-28 01:09:41 +04:00
ompi_debug_no_free_handles = false ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " no_free_handles " ,
" Whether to actually free MPI objects when their handles are freed " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_debug_no_free_handles ) ;
2004-08-14 17:07:30 +04:00
if ( ompi_debug_no_free_handles ) {
ompi_mpi_param_check = true ;
2013-03-28 01:09:41 +04:00
if ( ! MPI_PARAM_CHECK ) {
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 */
2013-03-28 01:09:41 +04:00
ompi_debug_show_mpi_alloc_mem_leaks = 0 ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " 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 " ,
MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_debug_show_mpi_alloc_mem_leaks ) ;
2007-08-02 01:33:25 +04:00
2005-07-09 01:01:37 +04:00
/* Whether or not to print all MCA parameters in MPI_INIT */
2013-03-28 01:09:41 +04:00
ompi_mpi_show_mca_params_string = NULL ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " show_mca_params " ,
" Whether to show all MCA parameter values during MPI_INIT or not (good for reproducability of MPI jobs "
" for debug purposes). Accepted values are all, default, file, api, and enviro - or a comma "
" delimited combination of them " ,
MCA_BASE_VAR_TYPE_STRING , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_show_mca_params_string ) ;
if ( NULL ! = ompi_mpi_show_mca_params_string ) {
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 ;
2013-03-28 01:09:41 +04:00
args = opal_argv_split ( ompi_mpi_show_mca_params_string , ' , ' ) ;
2008-08-02 04:43:27 +04:00
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 ;
2009-06-19 07:43:53 +04:00
} else if ( 0 = = strncasecmp ( args [ i ] , " env " , 3 ) ) {
2008-08-02 04:43:27 +04:00
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 */
2013-03-28 01:09:41 +04:00
ompi_mpi_show_mca_params_file = " " ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " 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) " ,
MCA_BASE_VAR_TYPE_STRING , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& 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-03-31 04:31:15 +04:00
/* MPI_ABORT controls */
2013-03-28 01:09:41 +04:00
ompi_mpi_abort_delay = 0 ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " abort_delay " ,
2006-03-31 04:31:15 +04:00
" 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. " ,
2013-03-28 01:09:41 +04:00
MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_abort_delay ) ;
ompi_mpi_abort_print_stack = false ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " abort_print_stack " ,
" If nonzero, print out a stack trace when MPI_ABORT is invoked " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 ,
2006-03-31 04:31:15 +04:00
/* If we do not have stack trace
2013-03-28 01:09:41 +04:00
capability , make this a constant
MCA variable */
2013-02-28 21:31:47 +04:00
# if OPAL_WANT_PRETTY_PRINT_STACKTRACE && defined(HAVE_BACKTRACE)
2013-03-28 01:09:41 +04:00
0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
2006-03-31 04:31:15 +04:00
# else
2013-03-28 01:09:41 +04:00
MCA_BASE_VAR_FLAG_DEFAULT_ONLY ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_CONSTANT ,
2006-03-31 04:31:15 +04:00
# endif
2013-03-28 01:09:41 +04:00
& ompi_mpi_abort_print_stack ) ;
2006-03-31 04:31:15 +04:00
2013-03-28 01:09:41 +04:00
ompi_mpi_preconnect_mpi = false ;
value = mca_base_var_register ( " ompi " , " mpi " , NULL , " preconnect_mpi " ,
" Whether to force MPI processes to fully "
" wire-up the MPI connections between MPI "
" processes during "
" MPI_INIT (vs. making connections lazily -- "
" upon the first MPI traffic between each "
" process peer pair) " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 ,
MCA_BASE_VAR_FLAG_INTERNAL ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_preconnect_mpi ) ;
mca_base_var_register_synonym ( value , " ompi " , " mpi " , NULL , " preconnect_all " ,
MCA_BASE_VAR_SYN_FLAG_DEPRECATED ) ;
2007-01-21 17:02:06 +03:00
2013-03-28 01:09:41 +04:00
/* Leave pinned parameter */
ompi_mpi_leave_pinned = - 1 ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " 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 (0 = do not use \" leave pinned \" protocol, 1 = use \" leave pinned \" protocol, -1 = allow network to choose at runtime). " ,
MCA_BASE_VAR_TYPE_INT , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_leave_pinned ) ;
2007-01-21 17:02:06 +03:00
2013-03-28 01:09:41 +04:00
ompi_mpi_leave_pinned_pipeline = false ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " leave_pinned_pipeline " ,
2007-01-21 17:02:06 +03:00
" Whether to use the \" leave pinned pipeline \" protocol or not. " ,
2013-03-28 01:09:41 +04:00
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_mpi_leave_pinned_pipeline ) ;
2006-08-04 18:41:31 +04:00
2013-05-01 00:08:32 +04:00
if ( ompi_mpi_leave_pinned > 0 & & ompi_mpi_leave_pinned_pipeline ) {
2007-01-21 17:02:06 +03:00
ompi_mpi_leave_pinned_pipeline = 0 ;
2013-02-13 01:10:11 +04:00
opal_show_help ( " help-mpi-runtime.txt " ,
2012-06-27 05:28:28 +04:00
" mpi-params:leave-pinned-and-pipeline-selected " ,
true ) ;
2007-01-21 17:02:06 +03:00
}
2013-03-28 01:09:41 +04:00
ompi_warn_on_fork = true ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " warn_on_fork " ,
" If nonzero, issue a warning if program forks under conditions that could cause system errors " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_warn_on_fork ) ;
2008-08-06 18:22:03 +04:00
2007-08-04 04:41:26 +04:00
/* Sparse group storage support */
2013-03-28 01:09:41 +04:00
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " 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) " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 ,
MCA_BASE_VAR_FLAG_DEFAULT_ONLY ,
OPAL_INFO_LVL_9 ,
MCA_BASE_VAR_SCOPE_CONSTANT ,
& ompi_mpi_have_sparse_group_storage ) ;
2007-08-04 04:41:26 +04:00
2013-03-28 01:09:41 +04:00
ompi_use_sparse_group_storage = ompi_mpi_have_sparse_group_storage ;
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " use_sparse_group_storage " ,
" Whether to use \" sparse \" storage formats for MPI groups (only relevant if mpi_have_sparse_group_storage is 1) " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 ,
ompi_mpi_have_sparse_group_storage ? 0 : MCA_BASE_VAR_FLAG_DEFAULT_ONLY ,
OPAL_INFO_LVL_9 ,
ompi_mpi_have_sparse_group_storage ? MCA_BASE_VAR_SCOPE_READONLY : MCA_BASE_VAR_SCOPE_CONSTANT ,
& ompi_use_sparse_group_storage ) ;
if ( ompi_use_sparse_group_storage & & ! ompi_mpi_have_sparse_group_storage ) {
opal_show_help ( " help-mpi-runtime.txt " ,
" sparse groups enabled but compiled out " ,
true ) ;
ompi_use_sparse_group_storage = false ;
2007-08-04 04:41:26 +04:00
}
2013-07-23 21:58:21 +04:00
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " built_with_cuda_support " ,
" Whether CUDA GPU buffer support is built into library or not " ,
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 ,
MCA_BASE_VAR_FLAG_DEFAULT_ONLY ,
OPAL_INFO_LVL_4 ,
MCA_BASE_VAR_SCOPE_CONSTANT ,
& ompi_mpi_built_with_cuda_support ) ;
/* Current default is to enable CUDA support if it is built into library */
ompi_mpi_cuda_support = ompi_mpi_built_with_cuda_support ;
2013-03-28 01:09:41 +04:00
( void ) mca_base_var_register ( " ompi " , " mpi " , NULL , " cuda_support " ,
" Whether CUDA GPU buffer support is enabled or not " ,
2013-07-23 21:58:21 +04:00
MCA_BASE_VAR_TYPE_BOOL , NULL , 0 , 0 ,
OPAL_INFO_LVL_4 ,
2013-12-21 00:39:25 +04:00
MCA_BASE_VAR_SCOPE_READONLY ,
2013-03-28 01:09:41 +04:00
& ompi_mpi_cuda_support ) ;
2013-07-23 21:58:21 +04:00
if ( ompi_mpi_cuda_support & & ! ompi_mpi_built_with_cuda_support ) {
2013-03-28 01:09:41 +04:00
opal_show_help ( " help-mpi-runtime.txt " , " no cuda support " ,
true ) ;
2013-07-23 21:58:21 +04:00
ompi_rte_abort ( 1 , NULL ) ;
2013-01-30 00:24:04 +04:00
}
2013-08-22 07:40:26 +04:00
/* cutoff for retrieving hostnames */
ompi_hostname_cutoff = UINT32_MAX ;
( void ) mca_base_var_register ( " ompi " , " ompi " , NULL , " hostname_cutoff " ,
" If the number of processes in the application exceeds the provided value, "
" hostnames for remote processes will not be retrieved by applications [default: UINT32_MAX] " ,
For large scale systems, we would like to avoid doing a full modex during MPI_Init so that launch will scale a little better. At the moment, our options are somewhat limited as only a few BTLs don't immediately call modex_recv on all procs during startup. However, for those situations where someone can take advantage of it, add the ability to do a "modex on demand" retrieval of data from remote procs when we launch via mpirun.
NOTE: launch performance will be absolutely awful if you do this with BTLs that aren't configured to modex_recv on first message!
Even with "modex on demand", we still have to do a barrier in place of the modex - we simply don't move any data around, which does reduce the time impact. The barrier is required to ensure that the other proc has in fact registered all its BTL info and therefore is prepared to hand over a complete data package. Otherwise, you may not get the info you need. In addition, the shared memory BTL can fail to properly rendezvous as it expects the barrier to be in place.
This behavior will *only* take effect under the following conditions:
1. launched via mpirun
2. #procs is greater than ompi_hostname_cutoff, which defaults to UINT32_MAX
3. mca param rte_orte_direct_modex is set to 1. At the moment, we are having problems getting this param to register properly, so only the first two conditions are in effect. Still, the bottom line is you have to *want* this behavior to get it.
The planned next evolution of this will be to make the direct modex be non-blocking - this will require two fixes:
1. if the remote proc doesn't have the required info, then let it delay its response until it does. This means we need a way for the MPI layer to tell the RTE "I am done entering modex data".
2. adjust the SM rendezvous logic to loop until the required file has been created
Creating a placeholder to bring this over to 1.7.5 when ready.
cmr=v1.7.5:reviewer=hjelmn:subject=Enable direct modex at scale
This commit was SVN r30259.
2014-01-11 21:36:06 +04:00
MCA_BASE_VAR_TYPE_UNSIGNED_INT , NULL , 0 , 0 ,
2013-08-22 07:40:26 +04:00
OPAL_INFO_LVL_9 , MCA_BASE_VAR_SCOPE_READONLY ,
& ompi_hostname_cutoff ) ;
2009-07-13 08:59:13 +04:00
return OMPI_SUCCESS ;
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 ) {
2013-03-28 01:09:41 +04:00
const mca_base_var_t * var ;
int var_count , i , ret ;
2008-08-01 00:00:45 +04:00
FILE * fp = NULL ;
time_t timestamp ;
2013-03-28 01:09:41 +04:00
char * * var_dump ;
2008-08-01 00:00:45 +04:00
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 " ) ;
}
2008-08-02 04:43:27 +04:00
2013-03-28 01:09:41 +04:00
var_count = mca_base_var_get_count ( ) ;
for ( i = 0 ; i < var_count ; + + i ) {
ret = mca_base_var_get ( i , & var ) ;
if ( OPAL_SUCCESS ! = ret ) {
2008-08-02 04:43:27 +04:00
continue ;
}
2013-03-28 01:09:41 +04:00
/* If this is an internal param, don't print it */
if ( MCA_BASE_VAR_FLAG_INTERNAL & var - > mbv_flags ) {
2008-08-01 00:00:45 +04:00
continue ;
}
/* is this a default value and we are not displaying
* defaults , ignore this one
*/
2013-03-28 01:09:41 +04:00
if ( MCA_BASE_VAR_SOURCE_DEFAULT = = var - > mbv_source & & ! show_default_mca_params ) {
2008-08-01 00:00:45 +04:00
continue ;
}
/* is this a file value and we are not displaying files,
* ignore it
*/
2013-03-28 01:09:41 +04:00
if ( ( MCA_BASE_VAR_SOURCE_FILE = = var - > mbv_source | |
2013-12-02 23:41:59 +04:00
MCA_BASE_VAR_SOURCE_OVERRIDE = = var - > mbv_source ) & &
! show_file_mca_params ) {
2008-08-01 00:00:45 +04:00
continue ;
}
/* is this an enviro value and we are not displaying enviros,
* ignore it
*/
2013-03-28 01:09:41 +04:00
if ( MCA_BASE_VAR_SOURCE_ENV = = var - > mbv_source & & ! show_enviro_mca_params ) {
2008-08-01 00:00:45 +04:00
continue ;
}
/* is this an API value and we are not displaying APIs,
* ignore it
*/
2013-03-28 01:09:41 +04:00
if ( MCA_BASE_VAR_SOURCE_OVERRIDE = = var - > mbv_source & & ! show_override_mca_params ) {
2008-08-01 00:00:45 +04:00
continue ;
}
2013-03-28 01:09:41 +04:00
ret = mca_base_var_dump ( i , & var_dump , MCA_BASE_VAR_DUMP_SIMPLE ) ;
if ( OPAL_SUCCESS ! = ret ) {
continue ;
2008-08-01 00:00:45 +04:00
}
2013-03-28 01:09:41 +04:00
2008-08-01 00:00:45 +04:00
/* Print the parameter */
if ( 0 ! = strlen ( ompi_mpi_show_mca_params_file ) ) {
2013-03-28 01:09:41 +04:00
fprintf ( fp , " %s \n " , var_dump [ 0 ] ) ;
2008-08-01 00:00:45 +04:00
} else {
2013-03-28 01:09:41 +04:00
opal_output ( 0 , " %s \n " , var_dump [ 0 ] ) ;
2008-08-01 00:00:45 +04:00
}
2013-03-28 01:09:41 +04:00
free ( var_dump [ 0 ] ) ;
free ( var_dump ) ;
2008-08-01 00:00:45 +04:00
}
/* Close file, cleanup allocated memory*/
if ( 0 ! = strlen ( ompi_mpi_show_mca_params_file ) ) {
fclose ( fp ) ;
}
return OMPI_SUCCESS ;
2005-07-09 01:01:37 +04:00
}