2005-06-15 23:10:26 +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.
|
2005-06-15 23:10:26 +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.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
2005-12-11 01:04:28 +03:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2005-06-15 23:10:26 +04:00
|
|
|
#include <unistd.h>
|
2005-12-11 01:04:28 +03:00
|
|
|
#endif /* HAVE_UNISTD_H */
|
|
|
|
#ifdef HAVE_STRING_H
|
2005-06-15 23:10:26 +04:00
|
|
|
#include <string.h>
|
2005-12-11 01:04:28 +03:00
|
|
|
#endif /* HAVE_STRING_H */
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2005-06-15 23:10:26 +04:00
|
|
|
#include <sys/types.h>
|
2005-12-11 01:04:28 +03:00
|
|
|
#endif /* HAVE_SYS_TYPES_H */
|
2005-06-15 23:10:26 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/constants.h"
|
|
|
|
#include "opal/sys/cache.h"
|
2005-07-04 03:09:55 +04:00
|
|
|
#include "opal/event/event.h"
|
2005-07-04 05:36:20 +04:00
|
|
|
#include "opal/util/if.h"
|
2005-07-04 04:13:44 +04:00
|
|
|
#include "opal/util/argv.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/util/sys_info.h"
|
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
2005-06-30 09:50:55 +04:00
|
|
|
#include "btl_self.h"
|
|
|
|
#include "btl_self_frag.h"
|
2005-06-15 23:10:26 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Shared Memory (SELF) component instance.
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_self_component_t mca_btl_self_component = {
|
2005-06-15 23:10:26 +04:00
|
|
|
{ /* super is being filled in */
|
|
|
|
/* First, the mca_base_component_t struct containing meta information
|
|
|
|
about the component itself */
|
|
|
|
{
|
|
|
|
/* Indicate that we are a pml v1.0.0 component (which also implies a
|
|
|
|
specific MCA version) */
|
2006-08-18 02:02:01 +04:00
|
|
|
MCA_BTL_BASE_VERSION_1_0_1,
|
2005-06-15 23:10:26 +04:00
|
|
|
"self", /* MCA component name */
|
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
|
|
|
OMPI_MAJOR_VERSION, /* MCA component major version */
|
|
|
|
OMPI_MINOR_VERSION, /* MCA component minor version */
|
|
|
|
OMPI_RELEASE_VERSION, /* MCA component release version */
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_self_component_open, /* component open */
|
|
|
|
mca_btl_self_component_close /* component close */
|
2005-06-15 23:10:26 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
|
|
{
|
|
|
|
/* Whether the component is checkpointable or not */
|
|
|
|
false
|
|
|
|
},
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_self_component_init,
|
2005-06-15 23:10:26 +04:00
|
|
|
NULL,
|
|
|
|
} /* end super */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called by MCA framework to open the component, registers
|
|
|
|
* component parameters.
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_self_component_open(void)
|
2005-06-15 23:10:26 +04:00
|
|
|
{
|
2006-08-19 01:36:07 +04:00
|
|
|
int tmp;
|
|
|
|
|
2005-06-15 23:10:26 +04:00
|
|
|
/* register SELF component parameters */
|
2006-06-20 18:09:58 +04:00
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "free_list_num",
|
|
|
|
"Number of fragments by default", false, false,
|
|
|
|
0, &mca_btl_self_component.free_list_num );
|
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "free_list_max",
|
|
|
|
"Maximum number of fragments", false, false,
|
|
|
|
-1, &mca_btl_self_component.free_list_max );
|
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "free_list_inc",
|
|
|
|
"Increment by this number of fragments", false, false,
|
|
|
|
32, &mca_btl_self_component.free_list_inc );
|
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "eager_limit",
|
|
|
|
"Eager size fragmeng (before the rendez-vous ptotocol)", false, false,
|
2006-08-19 01:36:07 +04:00
|
|
|
128 * 1024, &tmp);
|
|
|
|
mca_btl_self.btl_eager_limit = tmp;
|
2006-06-20 18:09:58 +04:00
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "min_send_size",
|
|
|
|
"Minimum fragment size after the rendez-vous", false, false,
|
2006-08-19 01:36:07 +04:00
|
|
|
256 * 1024, &tmp);
|
|
|
|
mca_btl_self.btl_min_send_size = tmp;
|
2006-06-20 18:09:58 +04:00
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "max_send_size",
|
|
|
|
"Maximum fragment size after the rendez-vous", false, false,
|
2006-08-19 01:36:07 +04:00
|
|
|
256 * 1024, &tmp);
|
|
|
|
mca_btl_self.btl_max_send_size = tmp;
|
2006-06-20 18:09:58 +04:00
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "min_rdma_size",
|
|
|
|
"Maximum fragment size for the RDMA transfer", false, false,
|
2006-08-19 01:36:07 +04:00
|
|
|
INT_MAX, &tmp);
|
|
|
|
mca_btl_self.btl_min_rdma_size = tmp;
|
2006-06-20 18:09:58 +04:00
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "max_rdma_size",
|
|
|
|
"Maximum fragment size for the RDMA transfer", false, false,
|
2006-08-19 01:36:07 +04:00
|
|
|
INT_MAX, &tmp);
|
|
|
|
mca_btl_self.btl_max_rdma_size = tmp;
|
2006-06-20 18:09:58 +04:00
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "exclusivity",
|
|
|
|
"Device exclusivity", false, false,
|
|
|
|
MCA_BTL_EXCLUSIVITY_HIGH, (int*)&mca_btl_self.btl_exclusivity );
|
|
|
|
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_self_component, "flags",
|
|
|
|
"Active behavior flags", false, false,
|
2006-06-27 02:29:29 +04:00
|
|
|
MCA_BTL_FLAGS_PUT | MCA_BTL_FLAGS_SEND_INPLACE,
|
2006-06-20 18:09:58 +04:00
|
|
|
(int*)&mca_btl_self.btl_flags );
|
2005-06-15 23:10:26 +04:00
|
|
|
|
|
|
|
/* initialize objects */
|
2005-07-04 02:45:48 +04:00
|
|
|
OBJ_CONSTRUCT(&mca_btl_self_component.self_lock, opal_mutex_t);
|
2005-06-30 09:50:55 +04:00
|
|
|
OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_eager, ompi_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_send, ompi_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_self_component.self_frags_rdma, ompi_free_list_t);
|
2005-06-15 23:10:26 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* component cleanup - sanity checking of queue lengths
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_self_component_close(void)
|
2005-06-15 23:10:26 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
OBJ_DESTRUCT(&mca_btl_self_component.self_lock);
|
|
|
|
OBJ_DESTRUCT(&mca_btl_self_component.self_frags_eager);
|
|
|
|
OBJ_DESTRUCT(&mca_btl_self_component.self_frags_send);
|
|
|
|
OBJ_DESTRUCT(&mca_btl_self_component.self_frags_rdma);
|
2005-06-15 23:10:26 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SELF component initialization
|
|
|
|
*/
|
2006-10-27 03:05:41 +04:00
|
|
|
mca_btl_base_module_t** mca_btl_self_component_init( int *num_btls,
|
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads )
|
2005-06-15 23:10:26 +04:00
|
|
|
{
|
2005-07-19 00:55:42 +04:00
|
|
|
mca_btl_base_module_t **btls = NULL;
|
|
|
|
*num_btls = 0;
|
2005-06-15 23:10:26 +04:00
|
|
|
|
|
|
|
/* allocate the Shared Memory PTL */
|
2005-07-19 00:55:42 +04:00
|
|
|
*num_btls = 1;
|
2006-08-24 20:38:08 +04:00
|
|
|
btls = (mca_btl_base_module_t**)malloc((*num_btls)*sizeof(mca_btl_base_module_t*));
|
2005-07-19 00:55:42 +04:00
|
|
|
if (NULL == btls) {
|
2005-06-15 23:10:26 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize free lists */
|
2006-10-27 03:05:41 +04:00
|
|
|
ompi_free_list_init( &mca_btl_self_component.self_frags_eager,
|
|
|
|
sizeof(mca_btl_self_frag_eager_t) + mca_btl_self.btl_eager_limit,
|
|
|
|
OBJ_CLASS(mca_btl_self_frag_eager_t),
|
|
|
|
mca_btl_self_component.free_list_num,
|
|
|
|
mca_btl_self_component.free_list_max,
|
|
|
|
mca_btl_self_component.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
ompi_free_list_init( &mca_btl_self_component.self_frags_send,
|
|
|
|
sizeof(mca_btl_self_frag_send_t) + mca_btl_self.btl_max_send_size,
|
|
|
|
OBJ_CLASS(mca_btl_self_frag_send_t),
|
|
|
|
mca_btl_self_component.free_list_num,
|
|
|
|
mca_btl_self_component.free_list_max,
|
|
|
|
mca_btl_self_component.free_list_inc,
|
|
|
|
NULL );
|
|
|
|
ompi_free_list_init( &mca_btl_self_component.self_frags_rdma,
|
|
|
|
sizeof(mca_btl_self_frag_rdma_t),
|
|
|
|
OBJ_CLASS(mca_btl_self_frag_rdma_t),
|
|
|
|
mca_btl_self_component.free_list_num,
|
|
|
|
mca_btl_self_component.free_list_max,
|
|
|
|
mca_btl_self_component.free_list_inc,
|
|
|
|
NULL );
|
2005-06-15 23:10:26 +04:00
|
|
|
|
2005-07-19 00:55:42 +04:00
|
|
|
/* get pointer to the btls */
|
|
|
|
btls[0] = (mca_btl_base_module_t *)(&mca_btl_self);
|
|
|
|
return btls;
|
2005-06-15 23:10:26 +04:00
|
|
|
}
|
|
|
|
|