2006-03-21 03:12:55 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* 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.
|
2006-05-25 19:47:59 +04:00
|
|
|
* Copyright (c) 2006 Sandia National Laboratories. All rights
|
|
|
|
* reserved.
|
2006-09-22 23:28:09 +04:00
|
|
|
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
|
2006-03-21 03:12:55 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "btl_udapl.h"
|
2005-12-19 19:37:05 +03:00
|
|
|
#include "btl_udapl_frag.h"
|
2006-12-17 15:26:41 +03:00
|
|
|
#include "ompi/mca/mpool/rdma/mpool_rdma.h"
|
2005-12-19 19:37:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
static void mca_btl_udapl_frag_common_constructor(mca_btl_udapl_frag_t* frag)
|
2006-03-23 19:21:08 +03:00
|
|
|
{
|
2007-03-05 17:17:50 +03:00
|
|
|
mca_btl_udapl_reg_t* reg =
|
|
|
|
(mca_btl_udapl_reg_t*)frag->base.super.registration;
|
2006-03-23 19:21:08 +03:00
|
|
|
|
2006-04-20 02:20:22 +04:00
|
|
|
#if OMPI_ENABLE_DEBUG
|
2005-12-19 19:37:05 +03:00
|
|
|
frag->base.des_src = NULL;
|
|
|
|
frag->base.des_src_cnt = 0;
|
|
|
|
frag->base.des_dst = NULL;
|
|
|
|
frag->base.des_dst_cnt = 0;
|
2006-03-31 20:25:19 +04:00
|
|
|
frag->base.des_flags = 0;
|
2006-04-20 02:20:22 +04:00
|
|
|
#endif
|
2006-03-31 20:25:19 +04:00
|
|
|
|
2007-01-03 00:44:12 +03:00
|
|
|
frag->registration = reg;
|
2007-03-05 17:17:50 +03:00
|
|
|
frag->segment.seg_addr.pval = (unsigned char*)frag->base.super.ptr;
|
2006-09-22 23:28:09 +04:00
|
|
|
frag->ftr = NULL;
|
2006-03-23 19:21:08 +03:00
|
|
|
|
|
|
|
/* Don't understand why yet, but there are cases where reg is NULL -
|
|
|
|
that is, this memory has not been registered. So be careful not
|
|
|
|
to dereference a NULL pointer. */
|
|
|
|
if(NULL != reg) {
|
|
|
|
/* Save the LMR context so we can set up LMR subset triplets later */
|
2006-03-31 20:25:19 +04:00
|
|
|
frag->triplet.lmr_context = reg->lmr_triplet.lmr_context;
|
2006-03-23 19:21:08 +03:00
|
|
|
}
|
2005-12-19 19:37:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_udapl_frag_eager_constructor(mca_btl_udapl_frag_t* frag)
|
|
|
|
{
|
2006-05-25 19:47:59 +04:00
|
|
|
frag->segment.seg_len = mca_btl_udapl_module.super.btl_eager_limit;
|
2006-04-07 19:26:05 +04:00
|
|
|
frag->size = mca_btl_udapl_component.udapl_eager_frag_size;
|
2005-12-19 19:37:05 +03:00
|
|
|
mca_btl_udapl_frag_common_constructor(frag);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_udapl_frag_max_constructor(mca_btl_udapl_frag_t* frag)
|
|
|
|
{
|
2006-05-25 19:47:59 +04:00
|
|
|
frag->segment.seg_len = mca_btl_udapl_module.super.btl_max_send_size;
|
2006-01-12 07:05:02 +03:00
|
|
|
frag->size = mca_btl_udapl_component.udapl_max_frag_size;
|
2005-12-19 19:37:05 +03:00
|
|
|
mca_btl_udapl_frag_common_constructor(frag);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_udapl_frag_user_constructor(mca_btl_udapl_frag_t* frag)
|
|
|
|
{
|
2006-03-31 20:25:19 +04:00
|
|
|
mca_btl_udapl_frag_common_constructor(frag);
|
|
|
|
frag->segment.seg_len = 0;
|
2007-01-05 01:07:37 +03:00
|
|
|
frag->segment.seg_addr.pval = NULL;
|
2006-09-22 23:28:09 +04:00
|
|
|
frag->ftr = NULL;
|
2007-01-09 13:29:20 +03:00
|
|
|
frag->size = 0;
|
|
|
|
frag->registration = NULL;
|
2005-12-19 19:37:05 +03:00
|
|
|
}
|
|
|
|
|
2007-01-11 18:22:08 +03:00
|
|
|
static void mca_btl_udapl_frag_eager_rdma_constructor(mca_btl_udapl_frag_t* frag)
|
|
|
|
{
|
|
|
|
mca_btl_udapl_frag_eager_constructor(frag);
|
|
|
|
frag->segment.seg_len = mca_btl_udapl_module.super.btl_eager_limit;
|
|
|
|
frag->size = mca_btl_udapl_component.udapl_eager_frag_size;
|
|
|
|
frag->rdma_ftr = (mca_btl_udapl_rdma_footer_t *)
|
|
|
|
((char *)(frag->segment.seg_addr.pval) +
|
|
|
|
frag->size -
|
|
|
|
sizeof(mca_btl_udapl_rdma_footer_t));
|
|
|
|
frag->rdma_ftr->active=0;
|
|
|
|
}
|
|
|
|
|
2006-04-07 19:26:05 +04:00
|
|
|
static void mca_btl_udapl_frag_common_destructor(mca_btl_udapl_frag_t* frag)
|
|
|
|
{
|
|
|
|
#if OMPI_ENABLE_DEBUG
|
2006-09-22 23:28:09 +04:00
|
|
|
frag->ftr = NULL;
|
2006-04-07 19:26:05 +04:00
|
|
|
frag->size = 0;
|
|
|
|
frag->registration = NULL;
|
|
|
|
frag->segment.seg_len = 0;
|
2007-01-05 01:07:37 +03:00
|
|
|
frag->segment.seg_addr.pval = NULL;
|
2006-04-07 19:26:05 +04:00
|
|
|
|
|
|
|
frag->base.des_src = NULL;
|
|
|
|
frag->base.des_src_cnt = 0;
|
|
|
|
frag->base.des_dst = NULL;
|
|
|
|
frag->base.des_dst_cnt = 0;
|
|
|
|
frag->base.des_flags = 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2005-12-19 19:37:05 +03:00
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_udapl_frag_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_udapl_frag_eager_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
mca_btl_udapl_frag_eager_constructor,
|
2006-04-07 19:26:05 +04:00
|
|
|
mca_btl_udapl_frag_common_destructor);
|
2005-12-19 19:37:05 +03:00
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_udapl_frag_max_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
mca_btl_udapl_frag_max_constructor,
|
2006-04-07 19:26:05 +04:00
|
|
|
mca_btl_udapl_frag_common_destructor);
|
2005-12-19 19:37:05 +03:00
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_udapl_frag_user_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
mca_btl_udapl_frag_user_constructor,
|
|
|
|
NULL);
|
|
|
|
|
2007-01-11 18:22:08 +03:00
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_udapl_frag_eager_rdma_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
mca_btl_udapl_frag_eager_rdma_constructor,
|
|
|
|
mca_btl_udapl_frag_common_destructor);
|