2005-05-24 02:06:50 +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.
|
2007-07-12 02:21:04 +04:00
|
|
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-05-24 02:06:50 +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.
|
2007-10-15 17:10:20 +04:00
|
|
|
* Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved.
|
2005-05-24 02:06:50 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2007-01-11 08:45:13 +03:00
|
|
|
#include "opal/util/output.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "ompi/mca/btl/btl.h"
|
|
|
|
#include "ompi/mca/btl/base/base.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
/*
|
2005-06-30 06:08:24 +04:00
|
|
|
* mca_btl_base_descriptor_t
|
2005-05-24 02:06:50 +04:00
|
|
|
*/
|
|
|
|
|
2005-06-30 06:08:24 +04:00
|
|
|
static void mca_btl_base_descriptor_constructor(mca_btl_base_descriptor_t* des)
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
|
|
|
des->des_src = NULL;
|
|
|
|
des->des_src_cnt = 0;
|
|
|
|
des->des_dst = NULL;
|
|
|
|
des->des_dst_cnt = 0;
|
|
|
|
des->des_cbfunc = NULL;
|
|
|
|
des->des_cbdata = NULL;
|
|
|
|
des->des_flags = 0;
|
|
|
|
}
|
|
|
|
|
2005-06-30 06:08:24 +04:00
|
|
|
static void mca_btl_base_descriptor_destructor(mca_btl_base_descriptor_t* des)
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
2005-06-30 06:08:24 +04:00
|
|
|
mca_btl_base_descriptor_t,
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t,
|
2005-06-30 06:08:24 +04:00
|
|
|
mca_btl_base_descriptor_constructor,
|
|
|
|
mca_btl_base_descriptor_destructor);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The following file was created by configure. It contains extern
|
|
|
|
* statements and the definition of an array of pointers to each
|
|
|
|
* component's public mca_base_component_t struct.
|
|
|
|
*/
|
|
|
|
|
2005-07-04 22:24:58 +04:00
|
|
|
#include "ompi/mca/btl/base/static-components.h"
|
2005-08-09 21:49:39 +04:00
|
|
|
#include "btl_base_error.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Global variables
|
|
|
|
*/
|
2005-06-30 06:08:24 +04:00
|
|
|
int mca_btl_base_output = -1;
|
|
|
|
char* mca_btl_base_include = NULL;
|
|
|
|
char* mca_btl_base_exclude = NULL;
|
2006-09-27 17:24:42 +04:00
|
|
|
int mca_btl_base_warn_component_unused = 1;
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_t mca_btl_base_components_opened;
|
|
|
|
opal_list_t mca_btl_base_modules_initialized;
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2007-07-12 02:21:04 +04:00
|
|
|
int already_opened = 0;
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function for finding and opening either all MCA components, or the one
|
|
|
|
* that was specifically requested via a MCA parameter.
|
|
|
|
*/
|
2005-06-30 06:08:24 +04:00
|
|
|
int mca_btl_base_open(void)
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
2007-07-12 02:21:04 +04:00
|
|
|
if( ++already_opened > 1 ) return OMPI_SUCCESS;
|
2005-07-28 20:31:29 +04:00
|
|
|
|
2007-10-15 17:10:20 +04:00
|
|
|
/* Verbose output */
|
|
|
|
mca_base_param_reg_int_name("btl",
|
|
|
|
"base_verbose",
|
|
|
|
"Verbosity level of the BTL framework",
|
|
|
|
false, false,
|
|
|
|
0,
|
|
|
|
&mca_btl_base_verbose);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2007-10-15 17:10:20 +04:00
|
|
|
mca_btl_base_output = opal_output_open(NULL);
|
|
|
|
opal_output_set_verbosity(mca_btl_base_output, mca_btl_base_verbose);
|
2007-01-11 00:24:35 +03:00
|
|
|
|
2005-08-09 21:49:39 +04:00
|
|
|
/* Open up all available components */
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
if (OMPI_SUCCESS !=
|
2007-10-15 17:10:20 +04:00
|
|
|
mca_base_components_open("btl", mca_btl_base_output, mca_btl_base_static_components,
|
2005-06-30 06:08:24 +04:00
|
|
|
&mca_btl_base_components_opened, true)) {
|
2005-05-24 02:06:50 +04:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-06-30 06:08:24 +04:00
|
|
|
/* Initialize the list so that in mca_btl_base_close(), we can
|
2005-05-24 02:06:50 +04:00
|
|
|
iterate over it (even if it's empty, as in the case of
|
|
|
|
ompi_info) */
|
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT(&mca_btl_base_modules_initialized, opal_list_t);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
/* register parameters */
|
|
|
|
mca_base_param_lookup_string(
|
2005-06-30 06:08:24 +04:00
|
|
|
mca_base_param_register_string("btl","base","include",NULL,NULL), &mca_btl_base_include);
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_base_param_lookup_string(
|
2005-06-30 06:08:24 +04:00
|
|
|
mca_base_param_register_string("btl","base","exclude",NULL,NULL), &mca_btl_base_exclude);
|
2006-09-27 17:24:42 +04:00
|
|
|
mca_base_param_reg_int_name("btl", "base_warn_component_unused",
|
|
|
|
"This parameter is used to turn on warning messages when certain NICs are not used",
|
|
|
|
false, false, 1, &mca_btl_base_warn_component_unused);
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
/* All done */
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|