2009-02-12 00:48:11 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
2005-05-24 02:06:50 +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.
|
2009-02-12 00:48:11 +03:00
|
|
|
* Copyright (c) 2004-2009 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.
|
2009-02-13 06:45:11 +03:00
|
|
|
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
2005-05-24 02:06:50 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/sys/cache.h"
|
2005-07-04 03:09:55 +04:00
|
|
|
#include "opal/event/event.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
#include "mpi.h"
|
2007-01-21 17:02:06 +03:00
|
|
|
#include "ompi/runtime/params.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
#include "ompi/mca/pml/base/pml_base_bsend.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
#include "pml_ob1.h"
|
|
|
|
#include "pml_ob1_hdr.h"
|
|
|
|
#include "pml_ob1_sendreq.h"
|
|
|
|
#include "pml_ob1_recvreq.h"
|
2005-06-10 00:16:33 +04:00
|
|
|
#include "pml_ob1_rdmafrag.h"
|
2005-06-07 18:12:47 +04:00
|
|
|
#include "pml_ob1_recvfrag.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/mca/bml/base/base.h"
|
2006-08-24 20:38:08 +04:00
|
|
|
#include "pml_ob1_component.h"
|
2007-03-22 04:00:34 +03:00
|
|
|
#include "ompi/mca/allocator/base/base.h"
|
2005-05-24 02:06:50 +04:00
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_CLASS_INSTANCE( mca_pml_ob1_pckt_pending_t,
|
|
|
|
ompi_free_list_item_t,
|
|
|
|
NULL,
|
|
|
|
NULL );
|
|
|
|
|
|
|
|
static int mca_pml_ob1_component_open(void);
|
|
|
|
static int mca_pml_ob1_component_close(void);
|
|
|
|
static mca_pml_base_module_t*
|
|
|
|
mca_pml_ob1_component_init( int* priority, bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads );
|
|
|
|
static int mca_pml_ob1_component_fini(void);
|
2006-07-20 18:44:35 +04:00
|
|
|
|
2008-07-29 02:40:57 +04:00
|
|
|
mca_pml_base_component_2_0_0_t mca_pml_ob1_component = {
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
/* First, the mca_base_component_t struct containing meta
|
|
|
|
information about the component itself */
|
|
|
|
|
|
|
|
{
|
2008-07-29 02:40:57 +04:00
|
|
|
MCA_PML_BASE_VERSION_2_0_0,
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
"ob1", /* 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-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1_component_open, /* component open */
|
|
|
|
mca_pml_ob1_component_close /* component close */
|
|
|
|
},
|
|
|
|
{
|
2007-03-17 02:11:45 +03:00
|
|
|
/* The component is checkpoint ready */
|
|
|
|
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
2005-05-24 02:06:50 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
mca_pml_ob1_component_init, /* component init */
|
|
|
|
mca_pml_ob1_component_fini /* component finalize */
|
2007-03-22 04:00:34 +03:00
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
};
|
|
|
|
|
2007-03-22 04:00:34 +03:00
|
|
|
void *mca_pml_ob1_seg_alloc( struct mca_mpool_base_module_t* mpool,
|
|
|
|
size_t* size,
|
|
|
|
mca_mpool_base_registration_t** registration);
|
|
|
|
|
|
|
|
void mca_pml_ob1_seg_free( struct mca_mpool_base_module_t* mpool,
|
|
|
|
void* segment );
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
static inline int mca_pml_ob1_param_register_int(
|
|
|
|
const char* param_name,
|
|
|
|
int default_value)
|
|
|
|
{
|
|
|
|
int id = mca_base_param_register_int("pml","ob1",param_name,NULL,default_value);
|
|
|
|
int param_value = default_value;
|
|
|
|
mca_base_param_lookup_int(id,¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
static int mca_pml_ob1_component_open(void)
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_allocator_base_component_t* allocator_component;
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1.free_list_num =
|
2005-09-21 23:10:56 +04:00
|
|
|
mca_pml_ob1_param_register_int("free_list_num", 4);
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1.free_list_max =
|
|
|
|
mca_pml_ob1_param_register_int("free_list_max", -1);
|
|
|
|
mca_pml_ob1.free_list_inc =
|
2005-09-21 23:10:56 +04:00
|
|
|
mca_pml_ob1_param_register_int("free_list_inc", 64);
|
2005-05-24 02:06:50 +04:00
|
|
|
mca_pml_ob1.priority =
|
2007-02-04 03:55:25 +03:00
|
|
|
mca_pml_ob1_param_register_int("priority", 20);
|
2005-06-02 01:09:43 +04:00
|
|
|
mca_pml_ob1.send_pipeline_depth =
|
2005-06-02 21:42:53 +04:00
|
|
|
mca_pml_ob1_param_register_int("send_pipeline_depth", 3);
|
2005-06-02 01:09:43 +04:00
|
|
|
mca_pml_ob1.recv_pipeline_depth =
|
2005-07-15 01:28:17 +04:00
|
|
|
mca_pml_ob1_param_register_int("recv_pipeline_depth", 4);
|
2007-06-03 12:31:58 +04:00
|
|
|
mca_pml_ob1.rdma_put_retries_limit =
|
|
|
|
mca_pml_ob1_param_register_int("rdma_put_retries_limit", 5);
|
2007-07-01 15:31:26 +04:00
|
|
|
mca_pml_ob1.max_rdma_per_request =
|
|
|
|
mca_pml_ob1_param_register_int("max_rdma_per_request", 4);
|
2007-07-01 15:34:23 +04:00
|
|
|
mca_pml_ob1.max_send_per_range =
|
|
|
|
mca_pml_ob1_param_register_int("max_send_per_range", 4);
|
2007-06-03 12:31:58 +04:00
|
|
|
|
2007-03-22 04:00:34 +03:00
|
|
|
mca_pml_ob1.unexpected_limit =
|
|
|
|
mca_pml_ob1_param_register_int("unexpected_limit", 128);
|
|
|
|
|
|
|
|
mca_base_param_reg_string(&mca_pml_ob1_component.pmlm_version,
|
|
|
|
"allocator",
|
|
|
|
"Name of allocator component for unexpected messages",
|
|
|
|
false, false,
|
|
|
|
"bucket",
|
|
|
|
&mca_pml_ob1.allocator_name);
|
|
|
|
|
|
|
|
allocator_component = mca_allocator_component_lookup( mca_pml_ob1.allocator_name );
|
|
|
|
if(NULL == allocator_component) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "mca_pml_ob1_component_open: can't find allocator: %s\n", mca_pml_ob1.allocator_name);
|
2007-03-22 04:00:34 +03:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2009-02-12 00:48:11 +03:00
|
|
|
|
2007-03-22 04:00:34 +03:00
|
|
|
mca_pml_ob1.allocator = allocator_component->allocator_init(true,
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_ob1_seg_alloc,
|
|
|
|
mca_pml_ob1_seg_free, NULL);
|
2007-03-22 04:00:34 +03:00
|
|
|
if(NULL == mca_pml_ob1.allocator) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "mca_pml_ob1_component_open: unable to initialize allocator\n");
|
2007-03-22 04:00:34 +03:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-08-12 06:41:14 +04:00
|
|
|
mca_pml_ob1.enabled = false;
|
|
|
|
return mca_bml_base_open();
|
2005-05-24 02:06:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
static int mca_pml_ob1_component_close(void)
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
|
|
|
int rc;
|
2005-07-12 09:40:56 +04:00
|
|
|
|
2009-02-13 06:45:11 +03:00
|
|
|
if (OMPI_SUCCESS != (rc = mca_bml_base_close())) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
if (NULL != mca_pml_ob1.allocator_name) {
|
|
|
|
free(mca_pml_ob1.allocator_name);
|
|
|
|
}
|
2005-05-24 02:06:50 +04:00
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
static mca_pml_base_module_t*
|
|
|
|
mca_pml_ob1_component_init( int* priority,
|
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads )
|
2005-05-24 02:06:50 +04:00
|
|
|
{
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output_verbose( 10, 0,
|
2007-02-03 05:01:18 +03:00
|
|
|
"in ob1, my priority is %d\n", mca_pml_ob1.priority);
|
|
|
|
|
|
|
|
if((*priority) > mca_pml_ob1.priority) {
|
|
|
|
*priority = mca_pml_ob1.priority;
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-05-24 02:06:50 +04:00
|
|
|
*priority = mca_pml_ob1.priority;
|
|
|
|
|
2006-03-29 20:19:17 +04:00
|
|
|
if(OMPI_SUCCESS != mca_bml_base_init( enable_progress_threads,
|
2006-07-04 05:20:20 +04:00
|
|
|
enable_mpi_threads)) {
|
2006-02-13 19:28:25 +03:00
|
|
|
return NULL;
|
2006-03-29 20:19:17 +04:00
|
|
|
}
|
2007-07-11 02:16:38 +04:00
|
|
|
|
2008-07-25 02:51:26 +04:00
|
|
|
/* Set this here (vs in component_open()) because
|
|
|
|
ompi_mpi_leave_pinned* may have been set after MCA params were
|
|
|
|
read (e.g., by the openib btl) */
|
2008-09-17 02:06:14 +04:00
|
|
|
mca_pml_ob1.leave_pinned = (1 == ompi_mpi_leave_pinned);
|
2008-07-25 02:51:26 +04:00
|
|
|
mca_pml_ob1.leave_pinned_pipeline = (int) ompi_mpi_leave_pinned_pipeline;
|
|
|
|
|
2005-05-24 02:06:50 +04:00
|
|
|
return &mca_pml_ob1.super;
|
|
|
|
}
|
|
|
|
|
2007-07-11 03:45:23 +04:00
|
|
|
int mca_pml_ob1_component_fini(void)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
/* Shutdown BML */
|
|
|
|
if(OMPI_SUCCESS != (rc = mca_bml.bml_finalize()))
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
if(!mca_pml_ob1.enabled)
|
|
|
|
return OMPI_SUCCESS; /* never selected.. return success.. */
|
|
|
|
mca_pml_ob1.enabled = false; /* not anymore */
|
|
|
|
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.rdma_pending);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.pckt_pending);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.recv_pending);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.send_pending);
|
2008-09-16 03:04:18 +04:00
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.non_existing_communicator_pending);
|
2007-07-11 03:45:23 +04:00
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.buffers);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.pending_pckts);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.recv_frags);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.rdma_frags);
|
|
|
|
OBJ_DESTRUCT(&mca_pml_ob1.lock);
|
|
|
|
|
|
|
|
if(OMPI_SUCCESS != (rc = mca_pml_ob1.allocator->alc_finalize(mca_pml_ob1.allocator))) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
if (mca_pml_base_send_requests.fl_num_allocated !=
|
|
|
|
mca_pml_base_send_requests.super.opal_list_length) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "ob1 send requests: %d allocated %d returned\n",
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_base_send_requests.fl_num_allocated,
|
|
|
|
mca_pml_base_send_requests.super.opal_list_length);
|
|
|
|
}
|
|
|
|
if (mca_pml_base_recv_requests.fl_num_allocated !=
|
|
|
|
mca_pml_base_recv_requests.super.opal_list_length) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "ob1 recv requests: %d allocated %d returned\n",
|
2007-07-11 03:45:23 +04:00
|
|
|
mca_pml_base_recv_requests.fl_num_allocated,
|
|
|
|
mca_pml_base_recv_requests.super.opal_list_length);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2007-03-22 04:00:34 +03:00
|
|
|
void *mca_pml_ob1_seg_alloc( struct mca_mpool_base_module_t* mpool,
|
|
|
|
size_t* size,
|
|
|
|
mca_mpool_base_registration_t** registration) {
|
|
|
|
return malloc(*size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void mca_pml_ob1_seg_free( struct mca_mpool_base_module_t* mpool,
|
|
|
|
void* segment ) {
|
|
|
|
free(segment);
|
|
|
|
}
|