2004-01-29 05:43:58 +03:00
|
|
|
/*
|
2007-02-21 19:18:43 +03:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-24 20:38:08 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2007-01-30 09:34:38 +03:00
|
|
|
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-29 05:43:58 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-29 05:43:58 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2007-04-01 20:16:54 +04:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif /* HAVE_UNIST_H */
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2007-02-21 19:18:43 +03:00
|
|
|
#include "opal/util/output.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/constants.h"
|
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "ompi/mca/pml/base/base.h"
|
2007-07-11 03:45:23 +04:00
|
|
|
#include "ompi/mca/pml/base/pml_base_request.h"
|
2004-01-29 05:43:58 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The following file was created by configure. It contains extern
|
|
|
|
* statements and the definition of an array of pointers to each
|
2004-08-02 04:24:22 +04:00
|
|
|
* component's public mca_base_component_t struct.
|
2004-01-29 05:43:58 +03:00
|
|
|
*/
|
|
|
|
|
2005-07-04 22:24:58 +04:00
|
|
|
#include "ompi/mca/pml/base/static-components.h"
|
2004-01-29 05:43:58 +03:00
|
|
|
|
2005-01-13 18:30:49 +03:00
|
|
|
int mca_pml_base_progress(void)
|
2004-08-28 05:15:19 +04:00
|
|
|
{
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2006-07-15 01:33:26 +04:00
|
|
|
#define xstringify(pml) #pml
|
|
|
|
#define stringify(pml) xstringify(pml)
|
2004-01-29 05:43:58 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Global variables
|
|
|
|
*/
|
2006-08-24 20:38:08 +04:00
|
|
|
int mca_pml_base_output = 0;
|
|
|
|
mca_pml_base_module_t mca_pml = {
|
2004-10-12 19:50:01 +04:00
|
|
|
NULL, /* pml_add_procs */
|
|
|
|
NULL, /* pml_del_procs */
|
2007-01-30 09:34:38 +03:00
|
|
|
NULL, /* pml_enable */
|
2004-10-12 19:50:01 +04:00
|
|
|
mca_pml_base_progress, /* pml_progress */
|
|
|
|
NULL, /* pml_add_comm */
|
|
|
|
NULL, /* pml_del_comm */
|
|
|
|
NULL, /* pml_irecv_init */
|
|
|
|
NULL, /* pml_irecv */
|
|
|
|
NULL, /* pml_recv */
|
|
|
|
NULL, /* pml_isend_init */
|
|
|
|
NULL, /* pml_isend */
|
|
|
|
NULL, /* pml_send */
|
|
|
|
NULL, /* pml_iprobe */
|
|
|
|
NULL, /* pml_probe */
|
2007-01-30 09:34:38 +03:00
|
|
|
NULL, /* pml_start */
|
|
|
|
NULL, /* pml_dump */
|
2007-03-17 02:11:45 +03:00
|
|
|
NULL, /* pml_ft_event */
|
2007-01-30 09:34:38 +03:00
|
|
|
0, /* pml_max_contextid */
|
|
|
|
0 /* pml_max_tag */
|
2004-08-28 05:15:19 +04:00
|
|
|
};
|
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_t mca_pml_base_components_available;
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_pml_base_component_t mca_pml_base_selected_component;
|
2007-02-03 05:01:18 +03:00
|
|
|
ompi_pointer_array_t mca_pml_base_pml;
|
2004-01-29 05:43:58 +03:00
|
|
|
|
|
|
|
/**
|
2004-08-02 04:24:22 +04:00
|
|
|
* Function for finding and opening either all MCA components, or the one
|
2004-01-29 05:43:58 +03:00
|
|
|
* that was specifically requested via a MCA parameter.
|
|
|
|
*/
|
|
|
|
int mca_pml_base_open(void)
|
|
|
|
{
|
2007-02-21 19:18:43 +03:00
|
|
|
int value;
|
2007-04-24 21:08:48 +04:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
char* wrapper_pml = NULL;
|
|
|
|
#endif
|
2007-02-21 19:18:43 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Register some MCA parameters
|
|
|
|
*/
|
2007-03-17 02:11:45 +03:00
|
|
|
/* Debugging/Verbose output */
|
2007-08-18 07:05:45 +04:00
|
|
|
mca_base_param_reg_int_name("pml",
|
|
|
|
"base_verbose",
|
2007-03-17 02:11:45 +03:00
|
|
|
"Verbosity level of the PML framework",
|
|
|
|
false, false,
|
|
|
|
0, &value);
|
2007-02-21 19:18:43 +03:00
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
mca_pml_base_output = opal_output_open(NULL);
|
|
|
|
opal_output_set_verbosity(mca_pml_base_output, value);
|
2006-11-10 07:53:00 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* Open up all available components */
|
2004-01-29 05:43:58 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
if (OMPI_SUCCESS !=
|
2007-03-17 02:11:45 +03:00
|
|
|
mca_base_components_open("pml", mca_pml_base_output, mca_pml_base_static_components,
|
2005-07-12 09:40:56 +04:00
|
|
|
&mca_pml_base_components_available,
|
|
|
|
!MCA_pml_DIRECT_CALL)) {
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2004-01-31 01:56:36 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* Set a sentinel in case we don't select any components (e.g.,
|
|
|
|
ompi_info) */
|
2004-01-31 01:56:36 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
mca_pml_base_selected_component.pmlm_finalize = NULL;
|
2005-06-20 20:40:12 +04:00
|
|
|
|
2006-11-10 07:53:00 +03:00
|
|
|
/**
|
|
|
|
* Right now our selection of BTLs is completely broken. If we have
|
2007-02-03 05:01:18 +03:00
|
|
|
* multiple PMLs that use BTLs than we will open all BTLs several times, leading to
|
2006-11-10 07:53:00 +03:00
|
|
|
* undefined behaviors. The simplest solution, at least until we
|
2007-02-03 05:01:18 +03:00
|
|
|
* figure out the correct way to do it, is to force a default PML that
|
|
|
|
* uses BTLs and any other PMLs that do not in the mca_pml_base_pml array.
|
2006-11-10 07:53:00 +03:00
|
|
|
*/
|
2007-02-03 05:01:18 +03:00
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_base_pml, ompi_pointer_array_t);
|
|
|
|
|
2006-11-10 07:53:00 +03:00
|
|
|
#if MCA_pml_DIRECT_CALL
|
2007-02-03 05:01:18 +03:00
|
|
|
ompi_pointer_array_add(&mca_pml_base_pml,
|
|
|
|
stringify(MCA_pml_DIRECT_CALL_COMPONENT));
|
2006-11-10 07:53:00 +03:00
|
|
|
#else
|
2007-10-18 17:48:56 +04:00
|
|
|
{
|
|
|
|
char* default_pml = NULL;
|
|
|
|
|
|
|
|
mca_base_param_reg_string_name("pml", NULL,
|
|
|
|
"Specify a specific PML to use",
|
|
|
|
false, false, "", &default_pml);
|
|
|
|
|
|
|
|
if(0 == strlen(default_pml)){
|
|
|
|
ompi_pointer_array_add(&mca_pml_base_pml, strdup("ob1"));
|
|
|
|
ompi_pointer_array_add(&mca_pml_base_pml, strdup("cm"));
|
|
|
|
} else {
|
|
|
|
ompi_pointer_array_add(&mca_pml_base_pml, strdup(default_pml));
|
|
|
|
}
|
2007-02-03 05:01:18 +03:00
|
|
|
}
|
2007-04-24 21:08:48 +04:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
2007-03-17 02:11:45 +03:00
|
|
|
/*
|
|
|
|
* Which PML Wrapper component to use, if any
|
|
|
|
* - NULL or "" = No wrapper
|
|
|
|
* - ow. select that specific wrapper component
|
|
|
|
*/
|
|
|
|
mca_base_param_reg_string_name("pml", "wrapper",
|
|
|
|
"Use a Wrapper component around the selected PML component",
|
|
|
|
false, false,
|
|
|
|
NULL, &wrapper_pml);
|
|
|
|
if( NULL != wrapper_pml ) {
|
|
|
|
ompi_pointer_array_add(&mca_pml_base_pml, strdup(wrapper_pml));
|
|
|
|
}
|
2007-04-24 21:08:48 +04:00
|
|
|
#endif
|
|
|
|
|
2006-11-10 07:53:00 +03:00
|
|
|
#endif
|
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
/**
|
|
|
|
* Construct the send and receive request queues. There are 2 reasons to do it
|
|
|
|
* here. First, as they are globals it's better to construct them in one common
|
|
|
|
* place. Second, in order to be able to allow the external debuggers to show
|
|
|
|
* their content, they should get constructed as soon as possible once the MPI
|
|
|
|
* process is started.
|
|
|
|
*/
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_base_send_requests, ompi_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_pml_base_recv_requests, ompi_free_list_t);
|
|
|
|
|
2006-02-23 08:24:58 +03:00
|
|
|
return OMPI_SUCCESS;
|
2007-02-03 05:01:18 +03:00
|
|
|
|
2004-01-29 05:43:58 +03:00
|
|
|
}
|