
we send our local addr_t OOB. Remote side then matches endpoints and calls dat_ep_connect(). Everything should be the same as before from here, except that client/server roles are reversed. - Properly set our buffer size when posting receives. When the frag used to transfer address information is recycled by the free list, the wrong buffer size was being used, which caused buffer overflow errors. - Finally put the uDAPL error handling stuff in the mpool component. - Remove a few more OPAL_OUTPUTs. This commit was SVN r9569.
113 строки
3.4 KiB
C
113 строки
3.4 KiB
C
/*
|
|
* 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.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "btl_udapl.h"
|
|
#include "btl_udapl_frag.h"
|
|
#include "ompi/mca/mpool/udapl/mpool_udapl.h"
|
|
|
|
|
|
static void mca_btl_udapl_frag_common_constructor(mca_btl_udapl_frag_t* frag)
|
|
{
|
|
mca_mpool_udapl_registration_t* reg = frag->base.super.user_data;
|
|
|
|
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;
|
|
|
|
frag->registration = (mca_mpool_base_registration_t*)reg;
|
|
frag->hdr = (mca_btl_base_header_t*)(frag + 1);
|
|
frag->segment.seg_addr.pval = (unsigned char*)(frag->hdr + 1);
|
|
|
|
/* 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 */
|
|
frag->triplet.lmr_context = reg->lmr_triplet.lmr_context;
|
|
}
|
|
}
|
|
|
|
static void mca_btl_udapl_frag_eager_constructor(mca_btl_udapl_frag_t* frag)
|
|
{
|
|
frag->segment.seg_len = mca_btl_udapl_module.super.btl_eager_limit -
|
|
sizeof(mca_btl_base_header_t);
|
|
frag->size = mca_btl_udapl_component.udapl_eager_frag_size;
|
|
mca_btl_udapl_frag_common_constructor(frag);
|
|
}
|
|
|
|
static void mca_btl_udapl_frag_max_constructor(mca_btl_udapl_frag_t* frag)
|
|
{
|
|
frag->segment.seg_len = mca_btl_udapl_module.super.btl_max_send_size -
|
|
sizeof(mca_btl_base_header_t);
|
|
frag->size = mca_btl_udapl_component.udapl_max_frag_size;
|
|
mca_btl_udapl_frag_common_constructor(frag);
|
|
}
|
|
|
|
static void mca_btl_udapl_frag_user_constructor(mca_btl_udapl_frag_t* frag)
|
|
{
|
|
mca_btl_udapl_frag_common_constructor(frag);
|
|
frag->segment.seg_len = 0;
|
|
frag->hdr = NULL;
|
|
frag->size = 0;
|
|
}
|
|
|
|
static void mca_btl_udapl_frag_common_destructor(mca_btl_udapl_frag_t* frag)
|
|
{
|
|
#if OMPI_ENABLE_DEBUG
|
|
frag->hdr = NULL;
|
|
frag->size = 0;
|
|
frag->registration = NULL;
|
|
frag->segment.seg_len = 0;
|
|
frag->segment.seg_addr.pval = NULL;
|
|
|
|
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
|
|
}
|
|
|
|
|
|
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,
|
|
mca_btl_udapl_frag_common_destructor);
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
mca_btl_udapl_frag_max_t,
|
|
mca_btl_base_descriptor_t,
|
|
mca_btl_udapl_frag_max_constructor,
|
|
mca_btl_udapl_frag_common_destructor);
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
mca_btl_udapl_frag_user_t,
|
|
mca_btl_base_descriptor_t,
|
|
mca_btl_udapl_frag_user_constructor,
|
|
NULL);
|
|
|