1
1

Fix a number of issues with the ompi_ptr_t:

* Make sure that the pval always writes to the correct portion of the
    lval.  This only matters on 32 bit big endian machines.
  * On 32 bit machines when assigning to pval, the other 4 bytes of lval
    weren't being written, which could lead to bogus data

We use macros so that there aren't casts all over the code and the pval
assignment can occur to the correct 4 bytes.  Refs trac:587

This commit was SVN r12974.

The following Trac tickets were found above:
  Ticket 587 --> https://svn.open-mpi.org/trac/ompi/ticket/587
Этот коммит содержится в:
Brian Barrett 2007-01-03 19:47:48 +00:00
родитель 4df8750d74
Коммит 27cea44a9c
59 изменённых файлов: 501 добавлений и 379 удалений

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -83,7 +85,7 @@ static void mca_bml_base_completion(
{
mca_bml_base_context_t* ctx = (mca_bml_base_context_t*) des->des_cbdata;
/* restore original state */
((unsigned char*)des->des_src[0].seg_addr.pval)[ctx->index] ^= ~0;
((unsigned char*)OMPI_PTR_GET_PVAL(des->des_src[0].seg_addr))[ctx->index] ^= ~0;
des->des_cbdata = ctx->cbdata;
des->des_cbfunc = ctx->cbfunc;
free(ctx);
@ -121,7 +123,7 @@ int mca_bml_base_send(
ctx->index = (size_t) ((des->des_src[0].seg_len * rand() * 1.0) / (RAND_MAX + 1.0));
ctx->cbfunc = des->des_cbfunc;
ctx->cbdata = des->des_cbdata;
((unsigned char*)des->des_src[0].seg_addr.pval)[ctx->index] ^= ~0;
((unsigned char*)OMPI_PTR_GET_PVAL(des->des_src[0].seg_addr))[ctx->index] ^= ~0;
des->des_cbdata = ctx;
des->des_cbfunc = mca_bml_base_completion;
}

Просмотреть файл

@ -10,6 +10,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Myricom, Inc. All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -308,7 +310,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
}
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, iov.iov_base);
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
@ -344,7 +346,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
iov.iov_base = (unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data);
if(rc < 0) {
MCA_BTL_GM_FRAG_RETURN(btl, frag);
@ -409,7 +411,8 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_dst(
frag->type = MCA_BTL_GM_PUT;
frag->segment.seg_len = *size;
frag->segment.seg_addr.pval = convertor->pBaseBuf + lb + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr,
convertor->pBaseBuf + lb + convertor->bConverted);
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
@ -418,7 +421,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_dst(
frag->base.des_flags = 0;
if(NULL == registration) {
rc = mpool->mpool_register( mpool,
frag->segment.seg_addr.pval,
OMPI_PTR_GET_PVAL(frag->segment.seg_addr),
frag->segment.seg_len,
0,
&registration );
@ -720,12 +723,8 @@ static int mca_btl_gm_put_nl(
/* post the put descriptor */
gm_put(gm_btl->port,
des->des_src->seg_addr.pval,
#if GM_SIZEOF_VOID_P == 4
des->des_dst->seg_addr.ival,
#else
des->des_dst->seg_addr.lval,
#endif
OMPI_PTR_GET_PVAL(des->des_src->seg_addr),
OMPI_PTR_GET_LVAL(des->des_dst->seg_addr),
des->des_src->seg_len,
GM_LOW_PRIORITY,
endpoint->endpoint_addr.node_id,
@ -766,12 +765,8 @@ int mca_btl_gm_put(
/* post the put descriptor */
gm_put(gm_btl->port,
des->des_src->seg_addr.pval,
#if GM_SIZEOF_VOID_P == 4
des->des_dst->seg_addr.ival,
#else
des->des_dst->seg_addr.lval,
#endif
OMPI_PTR_GET_PVAL(des->des_src->seg_addr),
OMPI_PTR_GET_LVAL(des->des_dst->seg_addr),
des->des_src->seg_len,
GM_LOW_PRIORITY,
endpoint->endpoint_addr.node_id,
@ -876,12 +871,8 @@ static int mca_btl_gm_get_nl(
/* post get put descriptor */
gm_get(gm_btl->port,
#if GM_SIZEOF_VOID_P == 4
des->des_dst->seg_addr.ival,
#else
des->des_dst->seg_addr.lval,
#endif
des->des_src->seg_addr.pval,
OMPI_PTR_GET_LVAL(des->des_dst->seg_addr),
OMPI_PTR_GET_PVAL(des->des_src->seg_addr),
des->des_src->seg_len,
GM_LOW_PRIORITY,
endpoint->endpoint_addr.node_id,
@ -923,12 +914,8 @@ int mca_btl_gm_get(
/* post get put descriptor */
gm_get(gm_btl->port,
#if GM_SIZEOF_VOID_P == 4
des->des_dst->seg_addr.ival,
#else
des->des_dst->seg_addr.lval,
#endif
des->des_src->seg_addr.pval,
OMPI_PTR_GET_LVAL(des->des_dst->seg_addr),
OMPI_PTR_GET_PVAL(des->des_src->seg_addr),
des->des_src->seg_len,
GM_LOW_PRIORITY,
endpoint->endpoint_addr.node_id,

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -591,7 +593,7 @@ int mca_btl_gm_component_progress()
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)(buffer - sizeof(mca_btl_gm_frag_t));
mca_btl_base_header_t* hdr = (mca_btl_base_header_t *)gm_ntohp(event->recv.message);
mca_btl_base_recv_reg_t* reg;
frag->segment.seg_addr.pval = (hdr+1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (hdr+1));
frag->segment.seg_len = gm_ntohl(event->recv.length) - sizeof(mca_btl_base_header_t);
reg = &btl->gm_reg[hdr->tag];
@ -618,7 +620,7 @@ int mca_btl_gm_component_progress()
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)(buffer - sizeof(mca_btl_gm_frag_t));
mca_btl_base_header_t* hdr = (mca_btl_base_header_t*)buffer;
mca_btl_base_recv_reg_t* reg;
frag->segment.seg_addr.pval = (hdr+1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (hdr+1));
frag->segment.seg_len = gm_ntohl(event->recv.length) - sizeof(mca_btl_base_header_t);
reg = &btl->gm_reg[hdr->tag];
if(reg->cbfunc) {
@ -684,7 +686,7 @@ static void* mca_btl_gm_progress_thread( opal_object_t* arg )
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)(buffer - sizeof(mca_btl_gm_frag_t));
mca_btl_base_header_t* hdr = (mca_btl_base_header_t *)gm_ntohp(event->recv.message);
mca_btl_base_recv_reg_t* reg;
frag->segment.seg_addr.pval = (hdr+1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (hdr+1));
frag->segment.seg_len = gm_ntohl(event->recv.length) - sizeof(mca_btl_base_header_t);
reg = &btl->gm_reg[hdr->tag];
@ -704,7 +706,7 @@ static void* mca_btl_gm_progress_thread( opal_object_t* arg )
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)(buffer - sizeof(mca_btl_gm_frag_t));
mca_btl_base_header_t* hdr = (mca_btl_base_header_t*)buffer;
mca_btl_base_recv_reg_t* reg;
frag->segment.seg_addr.pval = (hdr+1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (hdr+1));
frag->segment.seg_len = gm_ntohl(event->recv.length) - sizeof(mca_btl_base_header_t);
reg = &btl->gm_reg[hdr->tag];

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -30,7 +32,7 @@ do { \
static void mca_btl_gm_frag_eager_constructor(mca_btl_gm_frag_t* frag)
{
frag->hdr = (mca_btl_base_header_t*)(frag + 1);
frag->segment.seg_addr.pval = (unsigned char*)(frag->hdr + 1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (unsigned char*)(frag->hdr + 1));
frag->segment.seg_len = mca_btl_gm_module.super.btl_eager_limit - sizeof(mca_btl_base_header_t);
frag->size = mca_btl_gm_component.gm_eager_frag_size;
MCA_BTL_GM_FRAG_COMMON_CONSTRUCTOR(frag);
@ -39,7 +41,7 @@ static void mca_btl_gm_frag_eager_constructor(mca_btl_gm_frag_t* frag)
static void mca_btl_gm_frag_max_constructor(mca_btl_gm_frag_t* frag)
{
frag->hdr = (mca_btl_base_header_t*)(frag + 1);
frag->segment.seg_addr.pval = (unsigned char*)(frag->hdr + 1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (unsigned char*)(frag->hdr + 1));
frag->segment.seg_len = mca_btl_gm_module.super.btl_max_send_size - sizeof(mca_btl_base_header_t);
frag->size = mca_btl_gm_component.gm_max_frag_size;
MCA_BTL_GM_FRAG_COMMON_CONSTRUCTOR(frag);

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -320,7 +322,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_src(
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t)iov.iov_base;
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, iov.iov_base);
frag->segment.seg_key.key32[0] = (uint32_t)frag->sg_entry.lkey;
BTL_VERBOSE(("frag->sg_entry.lkey = %lu .addr = %llu "
@ -350,7 +352,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_src(
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*)frag->segment.seg_addr.pval + reserve;
iov.iov_base = (unsigned char*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data);
if( rc < 0 ) {
MCA_BTL_IB_FRAG_RETURN(mvapi_btl, frag);
@ -408,7 +410,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_dst(
ompi_ddt_type_lb(convertor->pDesc, &lb);
frag->segment.seg_len = *size;
frag->segment.seg_addr.pval = convertor->pBaseBuf + lb + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, convertor->pBaseBuf + lb + convertor->bConverted);
frag->base.des_flags = 0;
if(NULL == registration) {
@ -416,10 +418,10 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_dst(
* ourselves
*/
rc = btl->btl_mpool->mpool_register(btl->btl_mpool,
frag->segment.seg_addr.pval, *size, 0, &registration);
OMPI_PTR_GET_PVAL(frag->segment.seg_addr), *size, 0, &registration);
if(OMPI_SUCCESS != rc || NULL == registration) {
BTL_ERROR(("mpool_register(%p,%lu) failed: base %p lb %lu offset %lu",
frag->segment.seg_addr.pval, *size, convertor->pBaseBuf, lb, convertor->bConverted));
OMPI_PTR_GET_PVAL(frag->segment.seg_addr), *size, convertor->pBaseBuf, lb, convertor->bConverted));
MCA_BTL_IB_FRAG_RETURN(btl, frag);
return NULL;
}
@ -429,7 +431,7 @@ mca_btl_base_descriptor_t* mca_btl_mvapi_prepare_dst(
frag->sg_entry.len = *size;
frag->sg_entry.lkey = mvapi_reg->l_key;
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) frag->segment.seg_addr.pval;
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->segment.seg_key.key32[0] =mvapi_reg->r_key;
@ -495,9 +497,9 @@ int mca_btl_mvapi_put( mca_btl_base_module_t* btl,
} else {
frag->sr_desc.remote_qp = endpoint->rem_info.rem_qp_num_lp;
frag->sr_desc.remote_addr = (VAPI_virt_addr_t) (MT_virt_addr_t) frag->base.des_dst->seg_addr.pval;
frag->sr_desc.remote_addr = (VAPI_virt_addr_t) (MT_virt_addr_t) OMPI_PTR_GET_PVAL(frag->base.des_dst->seg_addr);
frag->sr_desc.r_key = frag->base.des_dst->seg_key.key32[0];
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) frag->base.des_src->seg_addr.pval;
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) OMPI_PTR_GET_PVAL(frag->base.des_src->seg_addr);
frag->sg_entry.len = frag->base.des_src->seg_len;
if(VAPI_OK != VAPI_post_sr(mvapi_btl->nic, endpoint->lcl_qp_hndl_lp, &frag->sr_desc)) {
rc = OMPI_ERROR;
@ -556,9 +558,9 @@ int mca_btl_mvapi_get( mca_btl_base_module_t* btl,
} else {
frag->sr_desc.remote_qp = endpoint->rem_info.rem_qp_num_lp;
frag->sr_desc.remote_addr = (VAPI_virt_addr_t) (MT_virt_addr_t) frag->base.des_src->seg_addr.pval;
frag->sr_desc.remote_addr = (VAPI_virt_addr_t) (MT_virt_addr_t) OMPI_PTR_GET_PVAL(frag->base.des_src->seg_addr);
frag->sr_desc.r_key = frag->base.des_src->seg_key.key32[0];
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) frag->base.des_dst->seg_addr.pval;
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) OMPI_PTR_GET_PVAL(frag->base.des_dst->seg_addr);
frag->sg_entry.len = frag->base.des_dst->seg_len;
if(VAPI_OK != VAPI_post_sr(mvapi_btl->nic, endpoint->lcl_qp_hndl_lp, &frag->sr_desc)) {

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -258,7 +260,7 @@ typedef struct mca_btl_mvapi_reg_t mca_btl_mvapi_reg_t;
OMPI_FREE_LIST_WAIT(frag_list, item, rc); \
frag = (mca_btl_mvapi_frag_t*) item; \
frag->sg_entry.len = frag->size + \
((unsigned char*) frag->segment.seg_addr.pval- \
((unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) - \
(unsigned char*) frag->hdr); \
desc_post[i] = frag->rr_desc; \
}\

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -307,7 +309,7 @@ static void mca_btl_mvapi_control(
/* dont return credits used for control messages */
mca_btl_mvapi_frag_t* frag = (mca_btl_mvapi_frag_t*)descriptor;
mca_btl_mvapi_endpoint_t* endpoint = frag->endpoint;
mca_btl_mvapi_control_header_t *ctl_hdr = frag->segment.seg_addr.pval;
mca_btl_mvapi_control_header_t *ctl_hdr = OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
mca_btl_mvapi_eager_rdma_header_t *rdma_hdr;
if(frag->size == mca_btl_mvapi_component.eager_limit) {
@ -325,12 +327,13 @@ static void mca_btl_mvapi_control(
break;
case MCA_BTL_MVAPI_CONTROL_RDMA:
rdma_hdr = (mca_btl_mvapi_eager_rdma_header_t*)ctl_hdr;
if (endpoint->eager_rdma_remote.base.pval) {
if (OMPI_PTR_GET_PVAL(endpoint->eager_rdma_remote.base)) {
BTL_ERROR(("Got RDMA connect twise!\n"));
return;
}
endpoint->eager_rdma_remote.rkey = rdma_hdr->rkey;
endpoint->eager_rdma_remote.base.pval = rdma_hdr->rdma_start.pval;
OMPI_PTR_SET_PVAL(endpoint->eager_rdma_remote.base,
OMPI_PTR_GET_PVAL(rdma_hdr->rdma_start));
endpoint->eager_rdma_remote.tokens =
mca_btl_mvapi_component.eager_rdma_num - 1;
break;
@ -679,7 +682,7 @@ int mca_btl_mvapi_handle_incoming_hp(
{
/* advance the segment address past the header and subtract from the length..*/
frag->segment.seg_len = byte_len-
((unsigned char*) frag->segment.seg_addr.pval -
((unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) -
(unsigned char*) frag->hdr);
/* call registered callback */
@ -712,7 +715,7 @@ int mca_btl_mvapi_handle_incoming_hp(
}
if (mca_btl_mvapi_component.use_eager_rdma &&
!endpoint->eager_rdma_local.base.pval &&
!OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base) &&
mvapi_btl->eager_rdma_buffers_count <
mca_btl_mvapi_component.max_eager_rdma &&
OPAL_THREAD_ADD32(&endpoint->eager_recv_count, 1) ==
@ -813,7 +816,7 @@ int mca_btl_mvapi_component_progress( void )
OPAL_THREAD_UNLOCK(&endpoint->eager_rdma_local.lock);
frag->hdr = (mca_btl_mvapi_header_t*)(((char*)frag->ftr) -
size + sizeof(mca_btl_mvapi_footer_t));
frag->segment.seg_addr.pval = ((unsigned char* )frag->hdr) +
OMPI_PTR_GET_PVAL(frag->segment.seg_addr) = ((unsigned char* )frag->hdr) +
sizeof(mca_btl_mvapi_header_t);
hret = mca_btl_mvapi_handle_incoming_hp(mvapi_btl,
@ -1039,7 +1042,7 @@ int mca_btl_mvapi_component_progress( void )
/* advance the segment address past the header and subtract from the length..*/
frag->segment.seg_len = comp.byte_len-
((unsigned char*) frag->segment.seg_addr.pval - (unsigned char*) frag->hdr);
((unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) - (unsigned char*) frag->hdr);
/* call registered callback */
mvapi_btl->ib_reg[frag->hdr->tag].cbfunc(&mvapi_btl->super,

Просмотреть файл

@ -1,5 +1,7 @@
/*
* Copyright (c) 2006 Voltaire All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -74,7 +76,7 @@ typedef struct mca_btl_mvapi_eager_rdma_remote_t mca_btl_mvapi_eager_rdma_remote
#define MCA_BTL_MVAPI_GET_LOCAL_RDMA_FRAG(E, I) \
(mca_btl_mvapi_frag_t*) \
((char*)(E)->eager_rdma_local.base.pval + \
((char*)OMPI_PTR_GET_VAL((E)->eager_rdma_local.base) + \
(I) * (E)->endpoint_btl->eager_rdma_frag_size)
#define MCA_BTL_MVAPI_RDMA_NEXT_INDEX(I) do { \

Просмотреть файл

@ -154,7 +154,7 @@ static inline int mca_btl_mvapi_endpoint_post_send(
if(do_rdma) {
mca_btl_mvapi_footer_t* ftr =
(mca_btl_mvapi_footer_t*)(((char*)frag->segment.seg_addr.pval) +
(mca_btl_mvapi_footer_t*)(((char*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr)) +
frag->segment.seg_len);
frag->sr_desc.opcode = VAPI_RDMA_WRITE;
MCA_BTL_MVAPI_RDMA_FRAG_SET_SIZE(ftr, frag->sg_entry.len);
@ -164,7 +164,7 @@ static inline int mca_btl_mvapi_endpoint_post_send(
#endif
frag->sr_desc.r_key = (VAPI_rkey_t)endpoint->eager_rdma_remote.rkey;
frag->sr_desc.remote_addr = (VAPI_virt_addr_t)
endpoint->eager_rdma_remote.base.lval +
OMPI_PTR_GET_LVAL(endpoint->eager_rdma_remote.base) +
endpoint->eager_rdma_remote.head *
mvapi_btl->eager_rdma_frag_size +
sizeof(mca_btl_mvapi_frag_t) +
@ -1073,7 +1073,7 @@ void mca_btl_mvapi_endpoint_send_credits_lp(
frag->hdr->tag = MCA_BTL_TAG_BTL;
frag->hdr->credits = endpoint->rd_credits_lp;
OPAL_THREAD_ADD32(&endpoint->rd_credits_lp, -frag->hdr->credits);
((mca_btl_mvapi_control_header_t *)frag->segment.seg_addr.pval)->type = MCA_BTL_MVAPI_CONTROL_NOOP;
((mca_btl_mvapi_control_header_t *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr))->type = MCA_BTL_MVAPI_CONTROL_NOOP;
frag->sr_desc.opcode = VAPI_SEND;
frag->sg_entry.addr = (VAPI_virt_addr_t) (MT_virt_addr_t) frag->hdr;
@ -1151,7 +1151,7 @@ void mca_btl_mvapi_endpoint_send_credits_hp(
frag->hdr->rdma_credits = endpoint->eager_rdma_local.credits;
OPAL_THREAD_ADD32(&endpoint->eager_rdma_local.credits,
-frag->hdr->rdma_credits);
((mca_btl_mvapi_control_header_t *)frag->segment.seg_addr.pval)->type = MCA_BTL_MVAPI_CONTROL_NOOP;
((mca_btl_mvapi_control_header_t *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr))->type = MCA_BTL_MVAPI_CONTROL_NOOP;
frag->sr_desc.opcode = VAPI_SEND;
@ -1203,10 +1203,10 @@ static int mca_btl_mvapi_endpoint_send_eager_rdma(
frag->base.des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
frag->hdr->tag = MCA_BTL_TAG_BTL;
rdma_hdr = (mca_btl_mvapi_eager_rdma_header_t*)frag->segment.seg_addr.pval;
rdma_hdr = (mca_btl_mvapi_eager_rdma_header_t*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
rdma_hdr->control.type = MCA_BTL_MVAPI_CONTROL_RDMA;
rdma_hdr->rkey = endpoint->eager_rdma_local.reg->r_key;
rdma_hdr->rdma_start.pval = endpoint->eager_rdma_local.base.pval;
OMPI_PTR_SET_PVAL(rdma_hdr->rdma_start, OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base));
frag->segment.seg_len = sizeof(mca_btl_mvapi_eager_rdma_header_t);
if (mca_btl_mvapi_endpoint_post_send(mvapi_btl, endpoint, frag) !=
OMPI_SUCCESS) {
@ -1225,7 +1225,7 @@ void mca_btl_mvapi_endpoint_connect_eager_rdma(
unsigned int i;
OPAL_THREAD_LOCK(&endpoint->eager_rdma_local.lock);
if (endpoint->eager_rdma_local.base.pval)
if (OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base))
goto unlock_rdma_local;
buf = mvapi_btl->super.btl_mpool->mpool_alloc(mvapi_btl->super.btl_mpool,
@ -1251,7 +1251,7 @@ void mca_btl_mvapi_endpoint_connect_eager_rdma(
mvapi_btl->eager_rdma_buffers, endpoint) < 0)
goto cleanup;
endpoint->eager_rdma_local.base.pval = buf;
OMPI_PTR_SET_PVAL(endpoint->eager_rdma_local.base, buf);
mvapi_btl->eager_rdma_buffers_count++;
if (mca_btl_mvapi_endpoint_send_eager_rdma(endpoint) == 0) {
OPAL_THREAD_UNLOCK(&mvapi_btl->eager_rdma_lock);
@ -1260,7 +1260,7 @@ void mca_btl_mvapi_endpoint_connect_eager_rdma(
}
mvapi_btl->eager_rdma_buffers_count--;
endpoint->eager_rdma_local.base.pval = NULL;
OMPI_PTR_SET_PVAL(endpoint->eager_rdma_local.base, NULL);
orte_pointer_array_set_item(mvapi_btl->eager_rdma_buffers,
endpoint->eager_rdma_index, NULL);

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -232,7 +234,7 @@ do { \
frag = (mca_btl_mvapi_frag_t*) item; \
frag->endpoint = my_endpoint; \
frag->sg_entry.len = frag->size + \
((unsigned char*) frag->segment.seg_addr.pval- \
((unsigned char*) OMPI_PTR_GET_VAL(frag->segment.seg_addr) - \
(unsigned char*) frag->hdr); \
desc_post[i] = frag->rr_desc; \
}\

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -24,7 +26,8 @@ static void mca_btl_mvapi_frag_common_constructor( mca_btl_mvapi_frag_t* frag)
mca_btl_mvapi_reg_t* mem_hndl =
(mca_btl_mvapi_reg_t*)frag->base.super.user_data;
frag->hdr = (mca_btl_mvapi_header_t*) (frag+1); /* initialize btl header to start at end of frag */
frag->segment.seg_addr.pval = ((unsigned char* )frag->hdr) + sizeof(mca_btl_mvapi_header_t);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr,
((unsigned char* )frag->hdr) + sizeof(mca_btl_mvapi_header_t));
/* init the segment address to start after the btl header */
frag->segment.seg_len = frag->size;
@ -103,7 +106,7 @@ static void mca_btl_mvapi_recv_frag_eager_constructor(mca_btl_mvapi_frag_t* frag
frag->size = mca_btl_mvapi_component.eager_limit;
frag->type = MCA_BTL_MVAPI_FRAG_EAGER;
mca_btl_mvapi_recv_frag_common_constructor(frag);
frag->ftr = (mca_btl_mvapi_footer_t*)((char*)frag->segment.seg_addr.pval
frag->ftr = (mca_btl_mvapi_footer_t*)((char*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr)
+ frag->size);
MCA_BTL_MVAPI_RDMA_MAKE_REMOTE(frag->ftr);
}

Просмотреть файл

@ -176,7 +176,7 @@ mca_btl_base_descriptor_t* mca_btl_mx_alloc( struct mca_btl_base_module_t* btl,
frag->segment[0].seg_len =
size <= mx_btl->super.btl_eager_limit ?
size : mx_btl->super.btl_eager_limit ;
frag->segment[0].seg_addr.pval = (void*)(frag+1);
OMPI_PTR_SET_PVAL(frag->segment[0].seg_addr, (void*)(frag+1));
frag->base.des_src = frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_flags = 0;
@ -252,7 +252,8 @@ mca_btl_mx_prepare_src( struct mca_btl_base_module_t* btl,
return NULL;
}
frag->base.des_src_cnt = 1;
iov.iov_base = (void*)((unsigned char*)frag->segment[0].seg_addr.pval + reserve);
iov.iov_base = (void*)((unsigned char*)OMPI_PTR_GET_PVAL(frag->segment[0].seg_addr)
+ reserve);
}
iov.iov_len = max_data;
@ -262,11 +263,11 @@ mca_btl_mx_prepare_src( struct mca_btl_base_module_t* btl,
if( 1 == frag->base.des_src_cnt ) {
frag->segment[0].seg_len = reserve + max_data;
if( 0 == reserve )
frag->segment[0].seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment[0].seg_addr, iov.iov_base);
} else {
frag->segment[0].seg_len = reserve;
frag->segment[1].seg_len = max_data;
frag->segment[1].seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment[1].seg_addr, iov.iov_base);
}
frag->base.des_src = frag->segment;
return &frag->base;
@ -305,10 +306,10 @@ mca_btl_base_descriptor_t* mca_btl_mx_prepare_dst( struct mca_btl_base_module_t*
}
frag->segment[0].seg_len = *size;
frag->segment[0].seg_addr.pval = convertor->pBaseBuf + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment[0].seg_addr, convertor->pBaseBuf + convertor->bConverted);
frag->segment[0].seg_key.key64 = (uint64_t)(intptr_t)frag;
mx_segment.segment_ptr = frag->segment[0].seg_addr.pval;
mx_segment.segment_ptr = OMPI_PTR_GET_PVAL(frag->segment[0].seg_addr);
mx_segment.segment_length = frag->segment[0].seg_len;
mx_return = mx_irecv( mx_btl->mx_endpoint, &mx_segment, 1, frag->segment[0].seg_key.key64,
BTL_MX_PUT_MASK, NULL, &(frag->mx_request) );
@ -358,7 +359,7 @@ static int mca_btl_mx_put( struct mca_btl_base_module_t* btl,
frag->tag = 0xff;
do {
mx_segment[i].segment_ptr = descriptor->des_src[i].seg_addr.pval;
mx_segment[i].segment_ptr = OMPI_PTR_GET_PVAL(descriptor->des_src[i].seg_addr);
mx_segment[i].segment_length = descriptor->des_src[i].seg_len;
} while (++i < descriptor->des_src_cnt);
@ -408,7 +409,7 @@ int mca_btl_mx_send( struct mca_btl_base_module_t* btl,
frag->tag = 0xff;
do {
mx_segment[i].segment_ptr = descriptor->des_src[i].seg_addr.pval;
mx_segment[i].segment_ptr = OMPI_PTR_GET_PVAL(descriptor->des_src[i].seg_addr);
mx_segment[i].segment_length = descriptor->des_src[i].seg_len;
total_length += descriptor->des_src[i].seg_len;
} while (++i < descriptor->des_src_cnt);

Просмотреть файл

@ -210,7 +210,7 @@ mca_btl_mx_unexpected_handler( void *context, mx_endpoint_addr_t source,
assert( tag < 16 );
reg = &(mx_btl->mx_reg[tag]);
segment.seg_addr.pval = data_if_available;
OMPI_PTR_SET_PVAL(segment.seg_addr, data_if_available);
segment.seg_len = length;
descriptor.des_dst = &segment;
descriptor.des_dst_cnt = 1;
@ -553,7 +553,7 @@ int mca_btl_mx_component_progress(void)
* Now we can register the fragment
* again with the MX BTL.
*/
mx_segment.segment_ptr = frag->base.des_dst->seg_addr.pval;
mx_segment.segment_ptr = OMPI_PTR_GET_PVAL(frag->base.des_dst->seg_addr);
mx_segment.segment_length = mca_btl_mx_module.super.btl_eager_limit;
mx_return = mx_irecv( mx_btl->mx_endpoint, &mx_segment, 1,
(uint64_t)frag->tag, BTL_MX_RECV_MASK,

Просмотреть файл

@ -69,7 +69,7 @@ extern "C" {
OMPI_FREE_LIST_WAIT( &mca_btl_mx_component.mx_send_eager_frags, item, rc); \
frag = (mca_btl_mx_frag_t*) item; \
frag->mx_frag_list = &(mca_btl_mx_component.mx_send_eager_frags); \
frag->segment[0].seg_addr.pval = (void*)(frag+1); \
OMPI_PTR_SET_PVAL(frag->segment[0].seg_addr, (void*)(frag+1)); \
}
#define MCA_BTL_MX_FRAG_ALLOC_USER(btl, frag, rc) \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -384,7 +386,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
frag->sg_entry.addr = (unsigned long)iov.iov_base;
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, iov.iov_base);
frag->segment.seg_key.key32[0] = (uint32_t)frag->sg_entry.lkey;
BTL_VERBOSE(("frag->sg_entry.lkey = %lu .addr = %llu "
@ -415,7 +417,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*)frag->segment.seg_addr.pval + reserve;
iov.iov_base = (unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data);
if(rc < 0) {
MCA_BTL_IB_FRAG_RETURN(openib_btl, frag);
@ -469,15 +471,15 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_dst(
}
ompi_ddt_type_lb(convertor->pDesc, &lb);
frag->segment.seg_addr.pval = convertor->pBaseBuf + lb +
convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr,
convertor->pBaseBuf + lb + convertor->bConverted);
if(NULL == registration){
/* we didn't get a memory registration passed in, so we have to
* register the region ourselves
*/
rc = btl->btl_mpool->mpool_register(btl->btl_mpool,
frag->segment.seg_addr.pval, *size, 0, &registration);
OMPI_PTR_GET_PVAL(frag->segment.seg_addr), *size, 0, &registration);
if(OMPI_SUCCESS != rc || NULL == registration) {
MCA_BTL_IB_FRAG_RETURN(openib_btl, frag);
return NULL;
@ -489,7 +491,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_dst(
frag->sg_entry.length = *size;
frag->sg_entry.lkey = openib_reg->mr->lkey;
frag->sg_entry.addr = (unsigned long) frag->segment.seg_addr.pval;
frag->sg_entry.addr = (unsigned long) OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->segment.seg_len = *size;
frag->segment.seg_key.key32[0] = openib_reg->mr->rkey;
@ -608,9 +610,9 @@ int mca_btl_openib_put( mca_btl_base_module_t* btl,
} else {
frag->wr_desc.sr_desc.send_flags = IBV_SEND_SIGNALED;
frag->wr_desc.sr_desc.wr.rdma.remote_addr = (unsigned long) frag->base.des_dst->seg_addr.pval;
frag->wr_desc.sr_desc.wr.rdma.remote_addr = (unsigned long) OMPI_PTR_GET_PVAL(frag->base.des_dst->seg_addr);
frag->wr_desc.sr_desc.wr.rdma.rkey = frag->base.des_dst->seg_key.key32[0];
frag->sg_entry.addr = (unsigned long) frag->base.des_src->seg_addr.pval;
frag->sg_entry.addr = (unsigned long) OMPI_PTR_GET_PVAL(frag->base.des_src->seg_addr);
frag->sg_entry.length = frag->base.des_src->seg_len;
if(ibv_post_send(endpoint->lcl_qp[BTL_OPENIB_LP_QP],
@ -670,9 +672,9 @@ int mca_btl_openib_get( mca_btl_base_module_t* btl,
} else {
frag->wr_desc.sr_desc.send_flags = IBV_SEND_SIGNALED;
frag->wr_desc.sr_desc.wr.rdma.remote_addr = (unsigned long) frag->base.des_src->seg_addr.pval;
frag->wr_desc.sr_desc.wr.rdma.remote_addr = (unsigned long) OMPI_PTR_GET_PVAL(frag->base.des_src->seg_addr);
frag->wr_desc.sr_desc.wr.rdma.rkey = frag->base.des_src->seg_key.key32[0];
frag->sg_entry.addr = (unsigned long) frag->base.des_dst->seg_addr.pval;
frag->sg_entry.addr = (unsigned long) OMPI_PTR_GET_PVAL(frag->base.des_dst->seg_addr);
frag->sg_entry.length = frag->base.des_dst->seg_len;
if(ibv_post_send(endpoint->lcl_qp[BTL_OPENIB_LP_QP],

Просмотреть файл

@ -10,6 +10,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -202,7 +204,7 @@ static void btl_openib_control(struct mca_btl_base_module_t* btl,
/* dont return credits used for control messages */
mca_btl_openib_frag_t* frag = (mca_btl_openib_frag_t*)descriptor;
mca_btl_openib_endpoint_t* endpoint = frag->endpoint;
mca_btl_openib_control_header_t *ctl_hdr = frag->segment.seg_addr.pval;
mca_btl_openib_control_header_t *ctl_hdr = OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
mca_btl_openib_eager_rdma_header_t *rdma_hdr;
mca_btl_openib_rdma_credits_header_t *credits_hdr;
@ -225,12 +227,13 @@ static void btl_openib_control(struct mca_btl_base_module_t* btl,
break;
case MCA_BTL_OPENIB_CONTROL_RDMA:
rdma_hdr = (mca_btl_openib_eager_rdma_header_t*)ctl_hdr;
if (endpoint->eager_rdma_remote.base.pval) {
if (OMPI_PTR_GET_PVAL(endpoint->eager_rdma_remote.base)) {
BTL_ERROR(("Got RDMA connect twise!"));
return;
}
endpoint->eager_rdma_remote.rkey = rdma_hdr->rkey;
endpoint->eager_rdma_remote.base.pval = rdma_hdr->rdma_start.pval;
OMPI_PTR_SET_PVAL(endpoint->eager_rdma_remote.base,
OMPI_PTR_GET_PVAL(rdma_hdr->rdma_start));
endpoint->eager_rdma_remote.tokens =
mca_btl_openib_component.eager_rdma_num - 1;
break;
@ -838,7 +841,7 @@ static int btl_openib_handle_incoming(mca_btl_openib_module_t *openib_btl,
OPAL_THREAD_UNLOCK(&endpoint->eager_rdma_local.lock);
}
if (!endpoint->eager_rdma_local.base.pval &&
if (!OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base) &&
mca_btl_openib_component.use_eager_rdma &&
BTL_OPENIB_HP_QP == prio &&
openib_btl->eager_rdma_buffers_count <
@ -1132,8 +1135,8 @@ static int btl_openib_component_progress(void)
OPAL_THREAD_UNLOCK(&endpoint->eager_rdma_local.lock);
frag->hdr = (mca_btl_openib_header_t*)(((char*)frag->ftr) -
size + sizeof(mca_btl_openib_footer_t));
frag->segment.seg_addr.pval = ((unsigned char* )frag->hdr) +
sizeof(mca_btl_openib_header_t);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, ((unsigned char* )frag->hdr) +
sizeof(mca_btl_openib_header_t));
ret = btl_openib_handle_incoming(openib_btl,
frag->endpoint, frag,

Просмотреть файл

@ -1,5 +1,7 @@
/*
* Copyright (c) 2006 Voltaire All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -73,7 +75,7 @@ typedef struct mca_btl_openib_eager_rdma_remote_t mca_btl_openib_eager_rdma_remo
#define MCA_BTL_OPENIB_GET_LOCAL_RDMA_FRAG(E, I) \
(mca_btl_openib_frag_t*) \
((char*)(E)->eager_rdma_local.base.pval + \
((char*)OMPI_PTR_GET_PVAL((E)->eager_rdma_local.base) + \
(I) * (E)->endpoint_btl->eager_rdma_frag_size)
#define MCA_BTL_OPENIB_RDMA_NEXT_INDEX(I) do { \

Просмотреть файл

@ -153,19 +153,19 @@ static inline int mca_btl_openib_endpoint_post_send(mca_btl_openib_module_t* ope
if(do_rdma) {
mca_btl_openib_footer_t* ftr =
(mca_btl_openib_footer_t*)(((char*)frag->segment.seg_addr.pval) +
(mca_btl_openib_footer_t*)(((char*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr)) +
frag->segment.seg_len);
frag->wr_desc.sr_desc.opcode = IBV_WR_RDMA_WRITE;
MCA_BTL_OPENIB_RDMA_FRAG_SET_SIZE(ftr, frag->sg_entry.length);
MCA_BTL_OPENIB_RDMA_MAKE_LOCAL(ftr);
#if OMPI_ENABLE_DEBUG
((mca_btl_openib_footer_t*)(((char*)frag->segment.seg_addr.pval) +
((mca_btl_openib_footer_t*)(((char*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr)) +
frag->segment.seg_len))->seq =
endpoint->eager_rdma_remote.seq++;
#endif
frag->wr_desc.sr_desc.wr.rdma.rkey = endpoint->eager_rdma_remote.rkey;
frag->wr_desc.sr_desc.wr.rdma.remote_addr =
(uintptr_t)endpoint->eager_rdma_remote.base.pval +
(uintptr_t)OMPI_PTR_GET_PVAL(endpoint->eager_rdma_remote.base) +
endpoint->eager_rdma_remote.head *
openib_btl->eager_rdma_frag_size +
sizeof(mca_btl_openib_frag_t) +
@ -1096,7 +1096,7 @@ void mca_btl_openib_endpoint_send_credits(mca_btl_openib_endpoint_t* endpoint,
frag = endpoint->credit_frag[prio];
credits_hdr =
(mca_btl_openib_rdma_credits_header_t*)frag->segment.seg_addr.pval;
(mca_btl_openib_rdma_credits_header_t*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->base.des_cbfunc = mca_btl_openib_endpoint_credits;
frag->base.des_cbdata = NULL;
@ -1175,10 +1175,11 @@ static int mca_btl_openib_endpoint_send_eager_rdma(
frag->base.des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
frag->hdr->tag = MCA_BTL_TAG_BTL;
rdma_hdr = (mca_btl_openib_eager_rdma_header_t*)frag->segment.seg_addr.pval;
rdma_hdr = (mca_btl_openib_eager_rdma_header_t*)OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
rdma_hdr->control.type = MCA_BTL_OPENIB_CONTROL_RDMA;
rdma_hdr->rkey = endpoint->eager_rdma_local.reg->mr->rkey;
rdma_hdr->rdma_start.pval = endpoint->eager_rdma_local.base.pval;
OMPI_PTR_SET_PVAL(rdma_hdr->rdma_start,
OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base));
frag->segment.seg_len = sizeof(mca_btl_openib_eager_rdma_header_t);
if (mca_btl_openib_endpoint_send(endpoint, frag) != OMPI_SUCCESS) {
MCA_BTL_IB_FRAG_RETURN(openib_btl, frag);
@ -1199,7 +1200,7 @@ void mca_btl_openib_endpoint_connect_eager_rdma(
/* Set local rdma pointer to 1 temporarily so other threads will not try
* to enter the function */
if(!opal_atomic_cmpset_ptr(&endpoint->eager_rdma_local.base.pval, NULL,
if(!opal_atomic_cmpset_ptr(&OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base), NULL,
(void*)1))
return;
@ -1228,7 +1229,7 @@ void mca_btl_openib_endpoint_connect_eager_rdma(
}
/* set local rdma pointer to real value */
opal_atomic_cmpset_ptr(&endpoint->eager_rdma_local.base.pval, (void*)1,
opal_atomic_cmpset_ptr(&OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base), (void*)1,
buf);
if(mca_btl_openib_endpoint_send_eager_rdma(endpoint) == 0) {
@ -1245,6 +1246,6 @@ void mca_btl_openib_endpoint_connect_eager_rdma(
buf, (mca_mpool_base_registration_t*)endpoint->eager_rdma_local.reg);
unlock_rdma_local:
/* set local rdma pointer back to zero. Will retry later */
opal_atomic_cmpset_ptr(&endpoint->eager_rdma_local.base.pval,
endpoint->eager_rdma_local.base.pval, NULL);
opal_atomic_cmpset_ptr(&OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base),
OMPI_PTR_GET_PVAL(endpoint->eager_rdma_local.base), NULL);
}

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -26,7 +28,7 @@ static void mca_btl_openib_frag_common_constructor( mca_btl_openib_frag_t* frag)
(mca_btl_openib_reg_t*)frag->base.super.user_data;
frag->hdr = (mca_btl_openib_header_t*) (frag+1); /* initialize the btl header to start at end of frag */
frag->segment.seg_addr.pval = ((unsigned char* )frag->hdr) + sizeof(mca_btl_openib_header_t);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, ((unsigned char* )frag->hdr) + sizeof(mca_btl_openib_header_t));
/* init the segment address to start after the btl header */
if(registration) {
@ -101,7 +103,7 @@ static void mca_btl_openib_recv_frag_eager_constructor(mca_btl_openib_frag_t* fr
frag->size = mca_btl_openib_component.eager_limit;
frag->type = MCA_BTL_OPENIB_FRAG_EAGER;
mca_btl_openib_recv_frag_common_constructor(frag);
frag->ftr = (mca_btl_openib_footer_t*)((char*)frag->segment.seg_addr.pval
frag->ftr = (mca_btl_openib_footer_t*)((char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr)
+ frag->size);
MCA_BTL_OPENIB_RDMA_MAKE_REMOTE(frag->ftr);
}

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -119,14 +121,14 @@ typedef struct mca_btl_openib_eager_rdma_header_t mca_btl_openib_eager_rdma_head
do { \
BTL_OPENIB_CONTROL_HEADER_HTON(h.control); \
h.rkey = htonl(h.rkey); \
h.rdma_start.lval = hton64(h.rdma_start.lval); \
OMPI_PTR_T_HTON(h.rdma_start); \
} while (0)
#define BTL_OPENIB_EAGER_RDMA_HEADER_NTOH(h) \
do { \
BTL_OPENIB_CONTROL_HEADER_NTOH(h.control); \
h.rkey = ntohl(h.rkey); \
h.rdma_start.lval = ntoh64(h.rdma_start.lval); \
OMPI_PTR_T_NTOH(h.rdma_start); \
} while (0)

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -325,7 +327,7 @@ mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base,
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segments[0].seg_addr.pval + reserve;
iov.iov_base = (unsigned char*) OMPI_PTR_GET_PVAL(frag->segments[0].seg_addr) + reserve;
ret = ompi_convertor_pack(convertor, &iov, &iov_count,
&max_data );
*size = max_data;
@ -359,7 +361,7 @@ mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base,
ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
frag->segments[0].seg_len = max_data;
frag->segments[0].seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, iov.iov_base);
frag->segments[0].seg_key.key64 =
OPAL_THREAD_ADD64(&(mca_btl_portals_module.portals_rdma_key), 1);
frag->base.des_src_cnt = 1;
@ -387,7 +389,7 @@ mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base,
}
/* setup the memory descriptor */
md.start = frag->segments[0].seg_addr.pval;
md.start = OMPI_PTR_GET_PVAL(frag->segments[0].seg_addr);
md.length = frag->segments[0].seg_len;
md.threshold = PTL_MD_THRESH_INF;
md.max_size = 0;
@ -449,7 +451,7 @@ mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base,
ompi_ddt_type_lb(convertor->pDesc, &lb);
frag->segments[0].seg_len = *size;
frag->segments[0].seg_addr.pval = convertor->pBaseBuf + lb + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, convertor->pBaseBuf + lb + convertor->bConverted);
frag->segments[0].seg_key.key64 =
OPAL_THREAD_ADD64(&(mca_btl_portals_module.portals_rdma_key), 1);
frag->base.des_src = NULL;
@ -480,7 +482,7 @@ mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base,
}
/* setup the memory descriptor. */
md.start = frag->segments[0].seg_addr.pval;
md.start = OMPI_PTR_GET_PVAL(frag->segments[0].seg_addr);
md.length = frag->segments[0].seg_len;
md.threshold = PTL_MD_THRESH_INF;
md.max_size = 0;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -434,7 +436,8 @@ mca_btl_portals_component_progress(void)
/* if we ever make this thread hot, need to do
something with the receive fragments */
frag = &mca_btl_portals_module.portals_recv_frag;
frag->segments[0].seg_addr.pval = (((char*) ev.md.start) + ev.offset);
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr,
(((char*) ev.md.start) + ev.offset));
frag->segments[0].seg_len = ev.mlength;
OPAL_OUTPUT_VERBOSE((90, mca_btl_portals_component.portals_output,

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -30,7 +32,7 @@ mca_btl_portals_frag_common_send_constructor(mca_btl_portals_frag_t* frag)
frag->base.des_src = frag->segments;
frag->base.des_src_cnt = 2;
frag->segments[0].seg_addr.pval = frag + 1;
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, frag + 1);
frag->segments[0].seg_len = frag->size;
frag->segments[0].seg_key.key64 = 0;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -58,7 +60,7 @@ mca_btl_portals_send(struct mca_btl_base_module_t* btl_base,
if (frag->md_h == PTL_INVALID_HANDLE) {
/* setup the send - always describe entire fragment */
mca_btl_portals_module.md_send.start = frag->segments[0].seg_addr.pval;
mca_btl_portals_module.md_send.start = OMPI_PTR_GET_PVAL(frag->segments[0].seg_addr);
mca_btl_portals_module.md_send.length =
0 == frag->size ? frag->segments[0].seg_len : frag->size;
mca_btl_portals_module.md_send.options =
@ -81,7 +83,7 @@ mca_btl_portals_send(struct mca_btl_base_module_t* btl_base,
"fragment info:\n"
"\tstart: 0x%x\n"
"\tlen: %d",
frag->segments[0].seg_addr.pval,
OMPI_PTR_GET_PVAL(frag->segments[0].seg_addr),
frag->segments[0].seg_len));
ret = PtlPutRegion(frag->md_h, /* memory descriptor */

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -235,7 +237,7 @@ struct mca_btl_base_descriptor_t* mca_btl_self_prepare_src(
return NULL;
}
frag->base.des_flags = 0;
frag->segment.seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1);
frag->segment.seg_len = reserve + max_data;
*size = max_data;
} else {
@ -252,7 +254,7 @@ struct mca_btl_base_descriptor_t* mca_btl_self_prepare_src(
MCA_BTL_SELF_FRAG_RETURN_RDMA(frag);
return NULL;
}
frag->segment.seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, iov.iov_base);
frag->segment.seg_len = max_data;
frag->base.des_flags = 0;
*size = max_data;
@ -286,7 +288,8 @@ struct mca_btl_base_descriptor_t* mca_btl_self_prepare_dst(
/* setup descriptor to point directly to user buffer */
ompi_ddt_type_lb( convertor->pDesc, &lb );
frag->segment.seg_addr.pval = (unsigned char*)convertor->pBaseBuf + lb + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr,
(unsigned char*)convertor->pBaseBuf + lb + convertor->bConverted);
frag->segment.seg_len = reserve + max_data;
frag->segment.seg_key.key64 = (uint64_t)(intptr_t)convertor;
frag->base.des_dst = &frag->segment;
@ -337,9 +340,9 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
mca_btl_base_segment_t* dst = des->des_dst;
size_t src_cnt = des->des_src_cnt;
size_t dst_cnt = des->des_dst_cnt;
unsigned char* src_addr = (unsigned char*)src->seg_addr.pval;
unsigned char* src_addr = (unsigned char*) OMPI_PTR_GET_PVAL(src->seg_addr);
size_t src_len = src->seg_len;
unsigned char* dst_addr = (unsigned char*)dst->seg_addr.pval;
unsigned char* dst_addr = (unsigned char*) OMPI_PTR_GET_PVAL(dst->seg_addr);
size_t dst_len = dst->seg_len;
while(src_len && dst_len) {
@ -350,7 +353,7 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
/* advance src */
if(--src_cnt != 0) {
src++;
src_addr = (unsigned char*)src->seg_addr.pval;
src_addr = (unsigned char*) OMPI_PTR_GET_PVAL(src->seg_addr);
src_len = src->seg_len;
} else {
src_len = 0;
@ -359,7 +362,7 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
/* advance dst */
if(--dst_cnt != 0) {
dst++;
dst_addr = (unsigned char*)dst->seg_addr.pval;
dst_addr = (unsigned char*) OMPI_PTR_GET_PVAL(dst->seg_addr);
dst_len = dst->seg_len;
} else {
dst_len = 0;
@ -374,7 +377,7 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
if(src_len == 0) {
if(--src_cnt != 0) {
src++;
src_addr = (unsigned char*)src->seg_addr.pval;
src_addr = (unsigned char*) OMPI_PTR_GET_PVAL(src->seg_addr);
src_len = src->seg_len;
}
} else {
@ -386,7 +389,7 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
if(dst_len == 0) {
if(--dst_cnt != 0) {
dst++;
dst_addr = (unsigned char*)src->seg_addr.pval;
dst_addr = (unsigned char*) OMPI_PTR_GET_PVAL(src->seg_addr);
dst_len = src->seg_len;
}
} else {

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -21,7 +23,7 @@
static inline void mca_btl_self_frag_constructor(mca_btl_self_frag_t* frag)
{
frag->segment.seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1);
frag->segment.seg_len = (uint32_t)frag->size;
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
@ -45,7 +47,7 @@ static void mca_btl_self_frag_send_constructor(mca_btl_self_frag_t* frag)
static void mca_btl_self_frag_rdma_constructor(mca_btl_self_frag_t* frag)
{
frag->size = 0;
frag->segment.seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1);
frag->segment.seg_len = (uint32_t)frag->size;
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -55,7 +57,7 @@ OBJ_CLASS_DECLARATION(mca_btl_self_frag_rdma_t);
{ \
OMPI_FREE_LIST_RETURN(&mca_btl_self_component.self_frags_eager, \
(ompi_free_list_item_t*)(frag)); \
frag->segment.seg_addr.pval = frag+1; \
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1); \
}
#define MCA_BTL_SELF_FRAG_ALLOC_SEND(frag, rc) \
@ -69,7 +71,7 @@ OBJ_CLASS_DECLARATION(mca_btl_self_frag_rdma_t);
{ \
OMPI_FREE_LIST_RETURN( &mca_btl_self_component.self_frags_send, \
(ompi_free_list_item_t*)(frag)); \
frag->segment.seg_addr.pval = frag+1; \
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1); \
}
#define MCA_BTL_SELF_FRAG_ALLOC_RDMA(frag, rc) \
@ -83,7 +85,7 @@ OBJ_CLASS_DECLARATION(mca_btl_self_frag_rdma_t);
{ \
OMPI_FREE_LIST_RETURN(&mca_btl_self_component.self_frags_rdma, \
(ompi_free_list_item_t*)(frag)); \
frag->segment.seg_addr.pval = frag+1; \
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1); \
}
#endif

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -475,9 +477,9 @@ int mca_btl_sm_component_progress(void)
/* completion callback */
frag->base.des_src =
( mca_btl_base_segment_t* )((ptrdiff_t)frag->base.des_dst + mca_btl_sm_component.sm_offset[peer_smp_rank]);
frag->base.des_src->seg_addr.pval = (void*)
((ptrdiff_t)frag->base.des_src->seg_addr.pval +
mca_btl_sm_component.sm_offset[peer_smp_rank]);
OMPI_PTR_SET_PVAL(frag->base.des_src->seg_addr,
(void*) ((ptrdiff_t) OMPI_PTR_GET_PVAL(frag->base.des_src->seg_addr) +
mca_btl_sm_component.sm_offset[peer_smp_rank]));
frag->base.des_dst = frag->base.des_src;
frag->base.des_cbfunc(&mca_btl_sm[1].super, frag->endpoint, &frag->base, frag->rc);
break;
@ -488,9 +490,9 @@ int mca_btl_sm_component_progress(void)
mca_btl_sm_recv_reg_t* reg = mca_btl_sm[1].sm_reg + frag->tag;
frag->base.des_dst = (mca_btl_base_segment_t*)
((ptrdiff_t)frag->base.des_src + mca_btl_sm_component.sm_offset[peer_smp_rank]);
frag->base.des_dst->seg_addr.pval = (void*)
((ptrdiff_t)frag->base.des_dst->seg_addr.pval +
mca_btl_sm_component.sm_offset[peer_smp_rank]);
OMPI_PTR_SET_PVAL(frag->base.des_dst->seg_addr,
(void*) ((ptrdiff_t) OMPI_PTR_GET_PVAL(frag->base.des_dst->seg_addr) +
mca_btl_sm_component.sm_offset[peer_smp_rank]));
frag->base.des_src = frag->base.des_dst;
reg->cbfunc(&mca_btl_sm[1].super,frag->tag,&frag->base,reg->cbdata);
frag->type = MCA_BTL_SM_FRAG_ACK;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -21,7 +23,7 @@
static inline void mca_btl_sm_frag_constructor(mca_btl_sm_frag_t* frag)
{
frag->segment.seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, frag+1);
frag->segment.seg_len = frag->size;
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;

Просмотреть файл

@ -199,7 +199,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_alloc(
return NULL;
}
frag->segments[0].seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, frag+1);
frag->base.des_src = frag->segments;
frag->base.des_src_cnt = 1;
@ -267,7 +267,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_src(
if(max_data == 0) {
frag->segments[0].seg_addr.pval = (frag + 1);
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, (frag + 1));
frag->segments[0].seg_len = reserve;
frag->base.des_src_cnt = 1;
@ -285,7 +285,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_src(
return NULL;
}
frag->segments[0].seg_addr.pval = (frag + 1);
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, (frag + 1));
frag->segments[0].seg_len = max_data + reserve;
frag->base.des_src_cnt = 1;
@ -300,9 +300,9 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_src(
return NULL;
}
frag->segments[0].seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, frag+1);
frag->segments[0].seg_len = reserve;
frag->segments[1].seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segments[1].seg_addr, iov.iov_base);
frag->segments[1].seg_len = max_data;
frag->base.des_src_cnt = 2;
}
@ -349,7 +349,8 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_dst(
ompi_ddt_type_lb(convertor->pDesc, &lb);
frag->segments->seg_len = *size;
frag->segments->seg_addr.pval = convertor->pBaseBuf + lb + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segments->seg_addr,
convertor->pBaseBuf + lb + convertor->bConverted);
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
@ -391,7 +392,7 @@ int mca_btl_tcp_send(
for(i=0; i<frag->base.des_src_cnt; i++) {
frag->hdr.size += frag->segments[i].seg_len;
frag->iov[i+1].iov_len = frag->segments[i].seg_len;
frag->iov[i+1].iov_base = (IOVBASE_TYPE*)frag->segments[i].seg_addr.pval;
frag->iov[i+1].iov_base = (IOVBASE_TYPE*) OMPI_PTR_GET_PVAL(frag->segments[i].seg_addr);
frag->iov_cnt++;
}
frag->hdr.base.tag = tag;
@ -433,7 +434,7 @@ int mca_btl_tcp_put(
for(i=0; i<frag->base.des_src_cnt; i++) {
frag->hdr.size += frag->segments[i].seg_len;
frag->iov[i+2].iov_len = frag->segments[i].seg_len;
frag->iov[i+2].iov_base = (IOVBASE_TYPE*)frag->segments[i].seg_addr.pval;
frag->iov[i+2].iov_base = (IOVBASE_TYPE*) OMPI_PTR_GET_PVAL(frag->segments[i].seg_addr);
frag->iov_cnt++;
}
frag->hdr.base.tag = MCA_BTL_TAG_BTL;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -237,7 +239,7 @@ bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t* frag, int sd)
if(frag->iov_idx == 1 && frag->hdr.size) {
frag->iov[1].iov_base = (IOVBASE_TYPE*)(frag+1);
frag->iov[1].iov_len = frag->hdr.size;
frag->segments[0].seg_addr.pval = frag+1;
OMPI_PTR_SET_PVAL(frag->segments[0].seg_addr, frag+1);
frag->segments[0].seg_len = frag->hdr.size;
frag->iov_cnt++;
goto repeat;
@ -251,7 +253,7 @@ bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t* frag, int sd)
goto repeat;
} else if (frag->iov_idx == 2) {
for(i=0; i<frag->hdr.count; i++) {
frag->iov[i+2].iov_base = (IOVBASE_TYPE*)frag->segments[i].seg_addr.pval;
frag->iov[i+2].iov_base = (IOVBASE_TYPE*) OMPI_PTR_GET_PVAL(frag->segments[i].seg_addr);
frag->iov[i+2].iov_len = frag->segments[i].seg_len;
frag->iov_cnt++;
}

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -245,7 +247,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
iov.iov_base = (unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
*size = max_data;
@ -270,7 +272,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
max_data = frag->size - reserve;
}
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
iov.iov_base = (unsigned char*) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
*size = max_data;
@ -322,7 +324,7 @@ mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
}
frag->segment.seg_len = *size;
frag->segment.seg_addr.pval = convertor->pBaseBuf + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, convertor->pBaseBuf + convertor->bConverted);
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;

Просмотреть файл

@ -12,6 +12,8 @@
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
*
* $COPYRIGHT$
*
@ -394,9 +396,9 @@ mca_btl_base_descriptor_t* mca_btl_udapl_alloc(
/* Set up the LMR triplet from the frag segment */
/* Note that this triplet defines a sub-region of a registered LMR */
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address = (DAT_VADDR)OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->ftr = (mca_btl_udapl_footer_t *)
((char *)frag->segment.seg_addr.pval + frag->segment.seg_len);
((char *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + frag->segment.seg_len);
frag->triplet.segment_length =
frag->segment.seg_len + sizeof(mca_btl_udapl_footer_t);
assert(frag->triplet.lmr_context == frag->registration->lmr_triplet.lmr_context);
@ -480,7 +482,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
&iov_count, &max_data );
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, iov.iov_base);
frag->triplet.segment_length = max_data;
frag->triplet.virtual_address = (DAT_VADDR)iov.iov_base;
@ -536,7 +538,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
((mca_mpool_udapl_registration_t*)registration)->lmr_triplet.lmr_context;
/* TODO - should our base addr be frag->ftr? */
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, iov.iov_base);
frag->triplet.segment_length = max_data;
frag->triplet.virtual_address = (DAT_VADDR)iov.iov_base;
}
@ -554,7 +556,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
}
iov.iov_len = max_data;
iov.iov_base = (char *) frag->segment.seg_addr.pval + reserve;
iov.iov_base = (char *) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor,
&iov, &iov_count, &max_data );
@ -580,7 +582,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
}
iov.iov_len = max_data;
iov.iov_base = (char *) frag->segment.seg_addr.pval + reserve;
iov.iov_base = (char *) OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + reserve;
rc = ompi_convertor_pack(convertor,
&iov, &iov_count, &max_data );
@ -596,9 +598,9 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
frag->segment.seg_len = max_data + reserve;
frag->triplet.segment_length =
max_data + reserve + sizeof(mca_btl_udapl_footer_t);
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address = (DAT_VADDR)OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->ftr = (mca_btl_udapl_footer_t *)
((char *)frag->segment.seg_addr.pval + frag->segment.seg_len);
((char *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + frag->segment.seg_len);
/* initialize base descriptor */
frag->base.des_src = &frag->segment;
@ -646,7 +648,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_dst(
ompi_ddt_type_lb(convertor->pDesc, &lb);
frag->segment.seg_len = *size;
frag->segment.seg_addr.pval = convertor->pBaseBuf + lb + convertor->bConverted;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, convertor->pBaseBuf + lb + convertor->bConverted);
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
@ -667,7 +669,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_dst(
rc = mpool->mpool_register(
mpool,
frag->segment.seg_addr.pval,
OMPI_PTR_GET_PVAL(frag->segment.seg_addr),
frag->segment.seg_len,
0,
&registration);
@ -703,7 +705,7 @@ int mca_btl_udapl_send(
frag->btl = (mca_btl_udapl_module_t*)btl;
frag->endpoint = endpoint;
frag->ftr = (mca_btl_udapl_footer_t *)
((char *)frag->segment.seg_addr.pval + frag->segment.seg_len);
((char *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + frag->segment.seg_len);
frag->ftr->tag = tag;
frag->type = MCA_BTL_UDAPL_SEND;

Просмотреть файл

@ -12,6 +12,8 @@
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
*
* $COPYRIGHT$
*
@ -413,9 +415,9 @@ static inline int mca_btl_udapl_sendrecv(mca_btl_udapl_module_t* btl,
sizeof(int32_t));
cookie.as_ptr = frag;
memcpy(frag->segment.seg_addr.pval,
memcpy(OMPI_PTR_GET_PVAL(frag->segment.seg_addr),
&btl->udapl_addr, sizeof(mca_btl_udapl_addr_t));
memcpy((char *)frag->segment.seg_addr.pval + sizeof(mca_btl_udapl_addr_t),
memcpy((char *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) + sizeof(mca_btl_udapl_addr_t),
&connection_seq, sizeof(int32_t));
connection_seq++;
@ -552,7 +554,7 @@ int mca_btl_udapl_component_progress()
assert(frag->base.des_src_cnt == 0);
assert(frag->type == MCA_BTL_UDAPL_RECV);
assert(frag->triplet.virtual_address ==
(DAT_VADDR)frag->segment.seg_addr.pval);
(DAT_VADDR)OMPI_PTR_GET_PVAL(frag->segment.seg_addr));
assert(frag->triplet.segment_length == frag->size);
assert(frag->btl == btl);
@ -560,7 +562,7 @@ int mca_btl_udapl_component_progress()
frag->segment.seg_len = dto->transfered_length -
sizeof(mca_btl_udapl_footer_t);
frag->ftr = (mca_btl_udapl_footer_t *)
((char *)frag->segment.seg_addr.pval +
((char *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) +
frag->segment.seg_len);
reg = &btl->udapl_reg[frag->ftr->tag];
OPAL_THREAD_UNLOCK(&mca_btl_udapl_component.udapl_lock);
@ -569,7 +571,7 @@ int mca_btl_udapl_component_progress()
OPAL_THREAD_LOCK(&mca_btl_udapl_component.udapl_lock);
/* Repost the frag */
frag->ftr = frag->segment.seg_addr.pval;
frag->ftr = OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->segment.seg_len =
frag->size - sizeof(mca_btl_udapl_footer_t);
frag->base.des_flags = 0;
@ -591,8 +593,8 @@ int mca_btl_udapl_component_progress()
}
case MCA_BTL_UDAPL_CONN_RECV:
mca_btl_udapl_endpoint_finish_connect(btl,
frag->segment.seg_addr.pval,
(int32_t *)((char *)frag->segment.seg_addr.pval +
OMPI_PTR_GET_PVAL(frag->segment.seg_addr),
(int32_t *)((char *)OMPI_PTR_GET_PVAL(frag->segment.seg_addr) +
sizeof(mca_btl_udapl_addr_t)),
event.event_data.connect_event_data.ep_handle);
/* No break - fall through to free */

Просмотреть файл

@ -12,6 +12,8 @@
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
*
* $COPYRIGHT$
*
@ -422,7 +424,7 @@ static int mca_btl_udapl_endpoint_finish_max(mca_btl_udapl_endpoint_t* endpoint)
cookie.as_ptr = frag;
assert(frag->triplet.virtual_address ==
(DAT_VADDR)frag->segment.seg_addr.pval);
(DAT_VADDR)OMPI_PTR_GET_PVAL(frag->segment.seg_addr));
assert(frag->triplet.segment_length ==
frag->segment.seg_len + sizeof(mca_btl_udapl_footer_t));
assert(frag->size ==
@ -498,7 +500,7 @@ static int mca_btl_udapl_endpoint_post_recv(mca_btl_udapl_endpoint_t* endpoint,
assert(size == frag->size);
/* Set up the LMR triplet from the frag segment */
/* Note that this triplet defines a sub-region of a registered LMR */
frag->triplet.virtual_address = (DAT_VADDR)frag->segment.seg_addr.pval;
frag->triplet.virtual_address = (DAT_VADDR)OMPI_PTR_GET_PVAL(frag->segment.seg_addr);
frag->triplet.segment_length = frag->size;
frag->btl = endpoint->endpoint_btl;

Просмотреть файл

@ -12,6 +12,8 @@
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -37,7 +39,7 @@ static void mca_btl_udapl_frag_common_constructor(mca_btl_udapl_frag_t* frag)
#endif
frag->registration = reg;
frag->segment.seg_addr.pval = (unsigned char*)(frag + 1);
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, (unsigned char*)(frag + 1));
frag->ftr = NULL;
/* Don't understand why yet, but there are cases where reg is NULL -
@ -67,7 +69,7 @@ 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->segment.seg_addr.pval = NULL;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, NULL);
frag->ftr = NULL;
frag->size = 0;
}
@ -79,7 +81,7 @@ static void mca_btl_udapl_frag_common_destructor(mca_btl_udapl_frag_t* frag)
frag->size = 0;
frag->registration = NULL;
frag->segment.seg_len = 0;
frag->segment.seg_addr.pval = NULL;
OMPI_PTR_SET_PVAL(frag->segment.seg_addr, NULL);
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;

Просмотреть файл

@ -45,8 +45,6 @@ mca_coll_basic_bcast_lin_intra(void *buff, int count,
int size;
int rank;
int err;
ompi_request_t **preq;
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs;
size = ompi_comm_size(comm);
rank = ompi_comm_rank(comm);
@ -61,38 +59,21 @@ mca_coll_basic_bcast_lin_intra(void *buff, int count,
/* Root sends data to all others. */
for (i = 0, preq = reqs; i < size; ++i) {
for (i = 0; i < size; ++i) {
if (i == rank) {
continue;
}
err = MCA_PML_CALL(isend_init(buff, count, datatype, i,
MCA_COLL_BASE_TAG_BCAST,
MCA_PML_BASE_SEND_STANDARD,
comm, preq++));
err = MCA_PML_CALL(send(buff, count, datatype, i,
MCA_COLL_BASE_TAG_BCAST,
MCA_PML_BASE_SEND_STANDARD,
comm));
if (MPI_SUCCESS != err) {
return err;
}
}
--i;
/* Start your engines. This will never return an error. */
MCA_PML_CALL(start(i, reqs));
/* Wait for them all. If there's an error, note that we don't
* care what the error was -- just that there *was* an error. The
* PML will finish all requests, even if one or more of them fail.
* i.e., by the end of this call, all the requests are free-able.
* So free them anyway -- even if there was an error, and return
* the error after we free everything. */
err = ompi_request_wait_all(i, reqs, MPI_STATUSES_IGNORE);
/* Free the reqs */
mca_coll_basic_free_reqs(reqs, i);
/* All done */
return err;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -191,11 +193,11 @@ ompi_mtl_portals_isend(struct mca_mtl_base_module_t* mtl,
md.user_ptr = ptl_request;
md.eq_handle = ompi_mtl_portals.ptl_eq_h;
ptr.pval = ptl_request;
OMPI_PTR_SET_PVAL(ptr, ptl_request);
ret = PtlMEAttach(ompi_mtl_portals.ptl_ni_h,
OMPI_MTL_PORTALS_READ_TABLE_ID,
endpoint->ptl_proc,
(ptl_match_bits_t) ptr.lval,
(ptl_match_bits_t) OMPI_PTR_GET_LVAL(ptr),
0,
PTL_UNLINK,
PTL_INS_AFTER,
@ -223,7 +225,7 @@ ompi_mtl_portals_isend(struct mca_mtl_base_module_t* mtl,
0,
match_bits,
0,
(ptl_hdr_data_t) ptr.lval);
(ptl_hdr_data_t) OMPI_PTR_GET_LVAL(ptr));
if (OMPI_SUCCESS != ret) {
PtlMDUnlink(md_h);
if (ptl_request->free_after) free(md.start);
@ -245,11 +247,11 @@ ompi_mtl_portals_isend(struct mca_mtl_base_module_t* mtl,
md.user_ptr = ptl_request;
md.eq_handle = ompi_mtl_portals.ptl_eq_h;
ptr.pval = ptl_request;
OMPI_PTR_SET_PVAL(ptr, ptl_request);
ret = PtlMEAttach(ompi_mtl_portals.ptl_ni_h,
OMPI_MTL_PORTALS_ACK_TABLE_ID,
endpoint->ptl_proc,
(ptl_match_bits_t) ptr.lval,
(ptl_match_bits_t) OMPI_PTR_GET_LVAL(ptr),
0,
PTL_UNLINK,
PTL_INS_AFTER,
@ -277,7 +279,7 @@ ompi_mtl_portals_isend(struct mca_mtl_base_module_t* mtl,
0,
match_bits,
0,
(ptl_hdr_data_t) ptr.lval);
(ptl_hdr_data_t) OMPI_PTR_GET_LVAL(ptr));
if (OMPI_SUCCESS != ret) {
PtlMDUnlink(md_h);
if (ptl_request->free_after) free(md.start);

Просмотреть файл

@ -7,6 +7,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -603,7 +605,7 @@ ompi_osc_pt2pt_component_fragment_cb(struct ompi_osc_pt2pt_buffer_t *pt2pt_buffe
#endif
/* get original sendreq pointer */
sendreq = (ompi_osc_pt2pt_sendreq_t*) header->hdr_origin_sendreq.pval;
sendreq = (ompi_osc_pt2pt_sendreq_t*) OMPI_PTR_GET_PVAL(header->hdr_origin_sendreq);
module = sendreq->req_module;
/* receive data */

Просмотреть файл

@ -7,6 +7,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -189,7 +191,8 @@ ompi_osc_pt2pt_sendreq_send(ompi_osc_pt2pt_module_t *module,
header->hdr_base.hdr_flags = 0;
header->hdr_windx = sendreq->req_module->p2p_comm->c_contextid;
header->hdr_origin = sendreq->req_module->p2p_comm->c_my_rank;
header->hdr_origin_sendreq.pval = (void*) sendreq;
OMPI_PTR_SET_PVAL(header->hdr_origin_sendreq,
(void*) sendreq);
header->hdr_origin_tag = 0;
header->hdr_target_disp = sendreq->req_target_disp;
header->hdr_target_count = sendreq->req_target_count;

Просмотреть файл

@ -7,7 +7,9 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
@ -446,14 +448,14 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
sizeof(ompi_osc_rdma_base_header_t));
/* handle message */
switch (((ompi_osc_rdma_base_header_t*) descriptor->des_dst[0].seg_addr.pval)->hdr_type) {
switch (((ompi_osc_rdma_base_header_t*) OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr))->hdr_type) {
case OMPI_OSC_RDMA_HDR_PUT:
{
ompi_osc_rdma_send_header_t *header;
/* get our header and payload */
header = (ompi_osc_rdma_send_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
payload = (void*) (header + 1);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -486,7 +488,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
/* get our header and payload */
header = (ompi_osc_rdma_send_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
payload = (void*) (header + 1);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -523,7 +525,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
/* get our header and payload */
header = (ompi_osc_rdma_send_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
payload = (void*) (header + 1);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -574,7 +576,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
/* get our header and payload */
header = (ompi_osc_rdma_reply_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
payload = (void*) (header + 1);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -584,7 +586,8 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
#endif
/* get original sendreq pointer */
sendreq = (ompi_osc_rdma_sendreq_t*) header->hdr_origin_sendreq.pval;
sendreq = (ompi_osc_rdma_sendreq_t*)
OMPI_PTR_GET_PVAL(header->hdr_origin_sendreq);
module = sendreq->req_module;
/* receive data */
@ -595,7 +598,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
{
ompi_osc_rdma_control_header_t *header =
(ompi_osc_rdma_control_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (header->hdr_base.hdr_flags & OMPI_OSC_RDMA_HDR_FLAG_NBO) {
@ -614,7 +617,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
{
ompi_osc_rdma_control_header_t *header =
(ompi_osc_rdma_control_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (header->hdr_base.hdr_flags & OMPI_OSC_RDMA_HDR_FLAG_NBO) {
@ -637,7 +640,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
{
ompi_osc_rdma_control_header_t *header =
(ompi_osc_rdma_control_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (header->hdr_base.hdr_flags & OMPI_OSC_RDMA_HDR_FLAG_NBO) {
@ -662,7 +665,7 @@ ompi_osc_rdma_component_fragment_cb(struct mca_btl_base_module_t *btl,
{
ompi_osc_rdma_control_header_t *header =
(ompi_osc_rdma_control_header_t*)
descriptor->des_dst[0].seg_addr.pval;
OMPI_PTR_GET_PVAL(descriptor->des_dst[0].seg_addr);
#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (header->hdr_base.hdr_flags & OMPI_OSC_RDMA_HDR_FLAG_NBO) {

Просмотреть файл

@ -7,6 +7,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -90,8 +92,8 @@ ompi_osc_rdma_sendreq_send_cb(struct mca_btl_base_module_t* btl,
{
ompi_osc_rdma_sendreq_t *sendreq =
(ompi_osc_rdma_sendreq_t*) descriptor->des_cbdata;
ompi_osc_rdma_send_header_t *header =
(ompi_osc_rdma_send_header_t*) descriptor->des_src[0].seg_addr.pval;
ompi_osc_rdma_send_header_t *header = (ompi_osc_rdma_send_header_t*)
OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr);
opal_list_item_t *item;
ompi_osc_rdma_module_t *module = sendreq->req_module;
@ -221,12 +223,13 @@ ompi_osc_rdma_sendreq_send(ompi_osc_rdma_module_t *module,
descriptor->des_flags = MCA_BTL_DES_FLAGS_PRIORITY;
/* pack header */
header = (ompi_osc_rdma_send_header_t*) descriptor->des_src[0].seg_addr.pval;
header = (ompi_osc_rdma_send_header_t*)
OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr);
written_data += sizeof(ompi_osc_rdma_send_header_t);
header->hdr_base.hdr_flags = 0;
header->hdr_windx = sendreq->req_module->p2p_comm->c_contextid;
header->hdr_origin = sendreq->req_module->p2p_comm->c_my_rank;
header->hdr_origin_sendreq.pval = (void*) sendreq;
OMPI_PTR_SET_PVAL(header->hdr_origin_sendreq, (void*) sendreq);
header->hdr_origin_tag = 0;
header->hdr_target_disp = sendreq->req_target_disp;
header->hdr_target_count = sendreq->req_target_count;
@ -255,7 +258,7 @@ ompi_osc_rdma_sendreq_send(ompi_osc_rdma_module_t *module,
/* Set datatype id and / or pack datatype */
ret = ompi_ddt_get_pack_description(sendreq->req_target_datatype, &packed_ddt);
if (OMPI_SUCCESS != ret) goto cleanup;
memcpy((unsigned char*) descriptor->des_src[0].seg_addr.pval + written_data,
memcpy((unsigned char*) OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr) + written_data,
packed_ddt, packed_ddt_len);
written_data += packed_ddt_len;
@ -268,7 +271,7 @@ ompi_osc_rdma_sendreq_send(ompi_osc_rdma_module_t *module,
size_t max_data = sendreq->req_origin_bytes_packed;
iov.iov_len = max_data;
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*) descriptor->des_src[0].seg_addr.pval + written_data);
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*) OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr) + written_data);
ret = ompi_convertor_pack(&sendreq->req_origin_convertor, &iov, &iov_count,
&max_data );
@ -348,8 +351,8 @@ ompi_osc_rdma_replyreq_send_cb(struct mca_btl_base_module_t* btl,
{
ompi_osc_rdma_replyreq_t *replyreq =
(ompi_osc_rdma_replyreq_t*) descriptor->des_cbdata;
ompi_osc_rdma_reply_header_t *header =
(ompi_osc_rdma_reply_header_t*) descriptor->des_src[0].seg_addr.pval;
ompi_osc_rdma_reply_header_t *header = (ompi_osc_rdma_reply_header_t*)
OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr);
if (OMPI_SUCCESS != status) {
/* requeue and return */
@ -432,7 +435,8 @@ ompi_osc_rdma_replyreq_send(ompi_osc_rdma_module_t *module,
descriptor->des_flags = MCA_BTL_DES_FLAGS_PRIORITY;
/* pack header */
header = (ompi_osc_rdma_reply_header_t*) descriptor->des_src[0].seg_addr.pval;
header = (ompi_osc_rdma_reply_header_t*)
OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr);
written_data += sizeof(ompi_osc_rdma_reply_header_t);
header->hdr_base.hdr_type = OMPI_OSC_RDMA_HDR_REPLY;
header->hdr_base.hdr_flags = 0;
@ -447,7 +451,7 @@ ompi_osc_rdma_replyreq_send(ompi_osc_rdma_module_t *module,
size_t max_data = replyreq->rep_target_bytes_packed;
iov.iov_len = max_data;
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*) descriptor->des_src[0].seg_addr.pval + written_data);
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*) OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr) + written_data);
ret = ompi_convertor_pack(&replyreq->rep_target_convertor, &iov, &iov_count,
&max_data );
@ -835,7 +839,8 @@ ompi_osc_rdma_control_send(ompi_osc_rdma_module_t *module,
descriptor->des_src[0].seg_len = sizeof(ompi_osc_rdma_control_header_t);
/* pack header */
header = (ompi_osc_rdma_control_header_t*) descriptor->des_src[0].seg_addr.pval;
header = (ompi_osc_rdma_control_header_t*)
OMPI_PTR_GET_PVAL(descriptor->des_src[0].seg_addr);
header->hdr_base.hdr_type = type;
header->hdr_value[0] = value0;
header->hdr_value[1] = value1;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -103,7 +105,7 @@ void mca_pml_dr_recv_frag_callback(
void* cbdata)
{
mca_btl_base_segment_t* segments = des->des_dst;
mca_pml_dr_hdr_t* hdr = (mca_pml_dr_hdr_t*)segments->seg_addr.pval;
mca_pml_dr_hdr_t* hdr = (mca_pml_dr_hdr_t*) OMPI_PTR_GET_PVAL(segments->seg_addr);
mca_pml_dr_comm_t *comm;
mca_pml_dr_comm_proc_t *proc;
mca_pml_dr_endpoint_t *ep;
@ -147,7 +149,7 @@ void mca_pml_dr_recv_frag_callback(
mca_pml_dr_recv_frag_ack(btl,
ep->bml_endpoint,
&hdr->hdr_common,
hdr->hdr_match.hdr_src_ptr.pval,
OMPI_PTR_GET_PVAL(hdr->hdr_match.hdr_src_ptr),
1, 0);
return;
}
@ -202,7 +204,7 @@ void mca_pml_dr_recv_frag_callback(
mca_pml_dr_recv_frag_ack(btl,
ep->bml_endpoint,
&hdr->hdr_common,
hdr->hdr_match.hdr_src_ptr.pval,
OMPI_PTR_GET_PVAL(hdr->hdr_match.hdr_src_ptr),
~(uint64_t) 0, hdr->hdr_rndv.hdr_msg_length);
return;
} else {
@ -230,7 +232,7 @@ void mca_pml_dr_recv_frag_callback(
mca_pml_dr_recv_frag_ack(btl,
ep->bml_endpoint,
&hdr->hdr_common,
hdr->hdr_match.hdr_src_ptr.pval,
OMPI_PTR_GET_PVAL(hdr->hdr_match.hdr_src_ptr),
~(uint64_t) 0, hdr->hdr_rndv.hdr_msg_length);
} else {
MCA_PML_DR_DEBUG(0,(0, "%s:%d: droping duplicate unmatched rendezvous\n", __FILE__, __LINE__));
@ -283,7 +285,7 @@ void mca_pml_dr_recv_frag_callback(
mca_pml_dr_recv_frag_ack(btl,
ep->bml_endpoint,
&hdr->hdr_common,
hdr->hdr_frag.hdr_src_ptr.pval,
OMPI_PTR_GET_PVAL(hdr->hdr_frag.hdr_src_ptr),
~(uint64_t) 0, 0);
} else {
ompi_comm = ompi_comm_lookup(hdr->hdr_common.hdr_ctx);
@ -297,7 +299,7 @@ void mca_pml_dr_recv_frag_callback(
assert(proc != NULL);
assert(ep == proc->pml_endpoint);
recvreq = (mca_pml_dr_recv_request_t*)hdr->hdr_frag.hdr_dst_ptr.pval;
recvreq = (mca_pml_dr_recv_request_t*) OMPI_PTR_GET_PVAL(hdr->hdr_frag.hdr_dst_ptr);
mca_pml_dr_recv_request_progress(recvreq,btl,segments,des->des_dst_cnt);
}
break;
@ -700,7 +702,7 @@ rematch:
if(do_csum && csum != hdr->hdr_csum) {
mca_pml_dr_recv_frag_ack(btl,
(mca_bml_base_endpoint_t*)ompi_proc->proc_bml,
&hdr->hdr_common, hdr->hdr_src_ptr.pval, 0, 0);
&hdr->hdr_common, OMPI_PTR_GET_PVAL(hdr->hdr_src_ptr), 0, 0);
MCA_PML_DR_DEBUG(0,(0, "%s:%d: received corrupted data 0x%08x != 0x%08x (segments %d length %d)\n",
__FILE__, __LINE__, csum, hdr->hdr_csum, num_segments,
segments[0].seg_len - mca_pml_dr_hdr_size(hdr->hdr_common.hdr_type)));
@ -737,7 +739,7 @@ rematch:
if(do_csum && csum != hdr->hdr_csum) {
mca_pml_dr_recv_frag_ack(btl,
(mca_bml_base_endpoint_t*)ompi_proc->proc_bml,
&hdr->hdr_common, hdr->hdr_src_ptr.pval, 0, 0);
&hdr->hdr_common, OMPI_PTR_GET_PVAL(hdr->hdr_src_ptr), 0, 0);
MCA_PML_DR_DEBUG(0,(0, "%s:%d: received corrupted data 0x%08x != 0x%08x\n",
__FILE__, __LINE__, csum, hdr->hdr_csum));
MCA_PML_DR_RECV_FRAG_RETURN(frag);
@ -763,7 +765,7 @@ rematch:
mca_pml_dr_recv_frag_ack(btl,
(mca_bml_base_endpoint_t*)ompi_proc->proc_bml,
&hdr->hdr_common, hdr->hdr_src_ptr.pval, 1, 0);
&hdr->hdr_common, OMPI_PTR_GET_PVAL(hdr->hdr_src_ptr), 1, 0);
}
if(additional_match) {
@ -808,7 +810,7 @@ void mca_pml_dr_recv_frag_ack(
}
/* fill out header */
ack = (mca_pml_dr_ack_hdr_t*)des->des_src->seg_addr.pval;
ack = (mca_pml_dr_ack_hdr_t*) OMPI_PTR_GET_PVAL(des->des_src->seg_addr);
ack->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_ACK | hdr->hdr_type;
ack->hdr_common.hdr_flags = 0;
ack->hdr_common.hdr_src = hdr->hdr_dst;
@ -817,9 +819,9 @@ void mca_pml_dr_recv_frag_ack(
ack->hdr_common.hdr_ctx = hdr->hdr_ctx;
ack->hdr_vlen = len;
ack->hdr_vmask = mask;
ack->hdr_src_ptr.pval = src_ptr;
assert(ack->hdr_src_ptr.pval);
ack->hdr_dst_ptr.pval = NULL;
OMPI_PTR_SET_PVAL(ack->hdr_src_ptr, src_ptr);
assert(OMPI_PTR_GET_PVAL(ack->hdr_src_ptr));
OMPI_PTR_SET_PVAL(ack->hdr_dst_ptr, NULL);
ack->hdr_common.hdr_csum = (uint16_t)(do_csum ?
opal_csum(ack, sizeof(mca_pml_dr_ack_hdr_t)) :
OPAL_CSUM_ZERO);

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -85,25 +87,25 @@ do { \
OMPI_FREE_LIST_WAIT(&mca_pml_dr.buffers, item, rc); \
buff = (mca_pml_dr_buffer_t*)item; \
buffers[i] = buff; \
frag->segments[i].seg_addr.pval = buff->addr; \
OMPI_PTR_SET_PVAL(frag->segments[i].seg_addr, buff->addr); \
frag->segments[i].seg_len = segs[i].seg_len; \
if( do_csum ) { \
size_t hdr_len = 0; \
if( 0 == i ) { \
hdr_len = mca_pml_dr_hdr_size(hdr->hdr_common.hdr_type);\
memcpy( buff->addr, \
segs[i].seg_addr.pval, \
OMPI_PTR_GET_PVAL(segs[i].seg_addr), \
hdr_len ); \
} \
csum = OPAL_CSUM_BCOPY_PARTIAL( \
((unsigned char*)segs[i].seg_addr.pval)+hdr_len, \
((unsigned char*) OMPI_PTR_GET_PVAL(segs[i].seg_addr))+hdr_len, \
((unsigned char*)buff->addr)+hdr_len, \
segs[i].seg_len-hdr_len, segs[i].seg_len-hdr_len, \
&ui1, &ui2); \
length += segs[i].seg_len - hdr_len; \
} else { \
memcpy( buff->addr, \
segs[i].seg_addr.pval, \
OMPI_PTR_GET_PVAL(segs[i].seg_addr), \
segs[i].seg_len ); \
} \
} \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -49,7 +51,7 @@ if(do_csum && csum != hdr->hdr_match.hdr_csum) { \
mca_pml_dr_recv_frag_ack(btl, \
recvreq->req_endpoint->bml_endpoint, \
&hdr->hdr_common, \
hdr->hdr_match.hdr_src_ptr.pval, \
OMPI_PTR_GET_PVAL(hdr->hdr_match.hdr_src_ptr), \
0, 0); \
MCA_PML_DR_DEBUG(0,(0, "%s:%d: [rank %d -> rank %d] " \
"data checksum failed 0x%08x != 0x%08x\n", \
@ -124,7 +126,7 @@ static void mca_pml_dr_recv_request_construct(mca_pml_dr_recv_request_t* request
request->req_vfrag0.vf_len = 1;
request->req_vfrag0.vf_mask = 1;
request->req_vfrag0.vf_recv.pval = request;
OMPI_PTR_SET_PVAL(request->req_vfrag0.vf_recv, request);
request->req_recv.req_base.req_type = MCA_PML_REQUEST_RECV;
request->req_recv.req_base.req_ompi.req_free = mca_pml_dr_recv_request_free;
request->req_recv.req_base.req_ompi.req_cancel = mca_pml_dr_recv_request_cancel;
@ -189,7 +191,7 @@ void mca_pml_dr_recv_request_ack(
}
/* fill out header */
ack = (mca_pml_dr_ack_hdr_t*)des->des_src->seg_addr.pval;
ack = (mca_pml_dr_ack_hdr_t*) OMPI_PTR_GET_PVAL(des->des_src->seg_addr);
ack->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_ACK | hdr->hdr_type;
ack->hdr_common.hdr_flags = 0;
ack->hdr_common.hdr_dst = recvreq->req_endpoint->dst;
@ -199,7 +201,7 @@ void mca_pml_dr_recv_request_ack(
ack->hdr_vlen = vlen;
ack->hdr_vmask = mask;
ack->hdr_src_ptr = src_ptr;
ack->hdr_dst_ptr.pval = recvreq;
OMPI_PTR_SET_PVAL(ack->hdr_dst_ptr, recvreq);
ack->hdr_common.hdr_csum = (uint16_t)(do_csum?
opal_csum(ack, sizeof(mca_pml_dr_ack_hdr_t)) :
OPAL_CSUM_ZERO);
@ -231,7 +233,7 @@ void mca_pml_dr_recv_request_progress(
size_t bytes_received = 0;
size_t bytes_delivered = 0;
size_t data_offset = 0;
mca_pml_dr_hdr_t* hdr = (mca_pml_dr_hdr_t*)segments->seg_addr.pval;
mca_pml_dr_hdr_t* hdr = (mca_pml_dr_hdr_t*) OMPI_PTR_GET_PVAL(segments->seg_addr);
size_t i;
uint32_t csum = OPAL_CSUM_ZERO;
uint64_t bit;
@ -361,7 +363,7 @@ void mca_pml_dr_recv_request_matched_probe(
size_t num_segments)
{
size_t bytes_packed = 0;
mca_pml_dr_hdr_t* hdr = (mca_pml_dr_hdr_t*)segments->seg_addr.pval;
mca_pml_dr_hdr_t* hdr = (mca_pml_dr_hdr_t*) OMPI_PTR_GET_PVAL(segments->seg_addr);
size_t i;
switch(hdr->hdr_common.hdr_type) {

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -287,7 +289,7 @@ do {
offset -= segment->seg_len; \
} else { \
iov[iov_count].iov_len = segment->seg_len - offset; \
iov[iov_count].iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval + offset); \
iov[iov_count].iov_base = (IOVBASE_TYPE*)((unsigned char*) OMPI_PTR_GET_PVAL(segment->seg_addr) + offset); \
offset = 0; \
iov_count++; \
} \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -69,7 +71,7 @@ static void mca_pml_dr_send_request_construct(mca_pml_dr_send_request_t* req)
req->req_vfrag0.vf_len = 1;
req->req_vfrag0.vf_mask = 1;
req->req_vfrag0.vf_send.pval = req;
OMPI_PTR_SET_PVAL(req->req_vfrag0.vf_send, req);
req->req_send.req_base.req_type = MCA_PML_REQUEST_SEND;
req->req_send.req_base.req_ompi.req_free = mca_pml_dr_send_request_free;
req->req_send.req_base.req_ompi.req_cancel = mca_pml_dr_send_request_cancel;
@ -99,7 +101,7 @@ static void mca_pml_dr_error_completion(
int status)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)descriptor->des_cbdata;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
switch(status) {
case OMPI_ERR_UNREACH:
@ -145,7 +147,7 @@ static void mca_pml_dr_match_completion(
int status)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)descriptor->des_cbdata;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
/* kill pending wdog timer */
MCA_PML_DR_VFRAG_WDOG_STOP(vfrag);
@ -213,7 +215,7 @@ static void mca_pml_dr_rndv_completion(
int status)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)descriptor->des_cbdata;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
bool schedule = false;
/* kill pending wdog timer */
@ -289,7 +291,7 @@ static void mca_pml_dr_frag_completion(
int status)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)descriptor->des_cbdata;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
mca_bml_base_btl_t* bml_btl = vfrag->bml_btl;
bool schedule = false;
@ -389,7 +391,7 @@ int mca_pml_dr_send_request_start_buffered(
segment = descriptor->des_src;
/* pack the data into the BTL supplied buffer */
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval +
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)OMPI_PTR_GET_PVAL(segment->seg_addr) +
sizeof(mca_pml_dr_rendezvous_hdr_t));
iov.iov_len = size;
iov_count = 1;
@ -436,7 +438,7 @@ int mca_pml_dr_send_request_start_buffered(
}
/* build rendezvous header */
hdr = (mca_pml_dr_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_dr_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_csum = 0;
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_RNDV;
@ -447,7 +449,7 @@ int mca_pml_dr_send_request_start_buffered(
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
hdr->hdr_match.hdr_csum = csum;
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
OMPI_PTR_SET_PVAL(hdr->hdr_match.hdr_src_ptr, &sendreq->req_vfrag0);
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
hdr->hdr_common.hdr_csum = (do_csum ?
opal_csum(hdr, sizeof(mca_pml_dr_rendezvous_hdr_t)) :
@ -503,7 +505,7 @@ int mca_pml_dr_send_request_start_copy(
segment = descriptor->des_src;
/* pack the data into the supplied buffer */
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval + sizeof(mca_pml_dr_match_hdr_t));
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)OMPI_PTR_GET_PVAL(segment->seg_addr) + sizeof(mca_pml_dr_match_hdr_t));
iov.iov_len = size;
iov_count = 1;
max_data = size;
@ -519,7 +521,7 @@ int mca_pml_dr_send_request_start_copy(
}
/* build match header */
hdr = (mca_pml_dr_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_dr_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_csum = 0;
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_MATCH;
@ -530,7 +532,7 @@ int mca_pml_dr_send_request_start_copy(
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
hdr->hdr_match.hdr_csum = (size > 0 && do_csum ?
sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO);
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
OMPI_PTR_SET_PVAL(hdr->hdr_match.hdr_src_ptr, &sendreq->req_vfrag0);
hdr->hdr_common.hdr_vid = sendreq->req_vfrag0.vf_id;
hdr->hdr_common.hdr_csum = (do_csum ?
opal_csum(hdr, sizeof(mca_pml_dr_match_hdr_t)) :
@ -593,7 +595,7 @@ int mca_pml_dr_send_request_start_prepare(
segment = descriptor->des_src;
/* build match header */
hdr = (mca_pml_dr_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_dr_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_csum = 0;
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_MATCH;
@ -604,7 +606,7 @@ int mca_pml_dr_send_request_start_prepare(
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
hdr->hdr_match.hdr_csum = (size > 0 && do_csum ?
sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO);
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
OMPI_PTR_SET_PVAL(hdr->hdr_match.hdr_src_ptr, &sendreq->req_vfrag0);
hdr->hdr_common.hdr_vid = sendreq->req_vfrag0.vf_id;
hdr->hdr_common.hdr_csum = (do_csum ?
opal_csum(hdr, sizeof(mca_pml_dr_match_hdr_t)) :
@ -673,7 +675,7 @@ int mca_pml_dr_send_request_start_rndv(
segment = des->des_src;
/* build hdr */
hdr = (mca_pml_dr_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_dr_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = flags;
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_RNDV;
hdr->hdr_common.hdr_dst = sendreq->req_endpoint->dst;
@ -683,7 +685,7 @@ int mca_pml_dr_send_request_start_rndv(
hdr->hdr_common.hdr_csum = 0;
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence;
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0;
OMPI_PTR_SET_PVAL(hdr->hdr_match.hdr_src_ptr, &sendreq->req_vfrag0);
hdr->hdr_match.hdr_csum = size > 0 ? sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO;
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
hdr->hdr_common.hdr_csum = (do_csum ?
@ -726,7 +728,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
*/
mca_pml_dr_endpoint_t* endpoint = sendreq->req_endpoint;
assert(sendreq->req_vfrag0.vf_recv.pval != NULL);
assert(OMPI_PTR_GET_PVAL(sendreq->req_vfrag0.vf_recv) != NULL);
if(OPAL_THREAD_ADD32(&sendreq->req_lock,1) == 1) {
do {
size_t bytes_remaining;
@ -787,7 +789,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
des->des_cbdata = vfrag;
/* setup header */
hdr = (mca_pml_dr_frag_hdr_t*)des->des_src->seg_addr.pval;
hdr = (mca_pml_dr_frag_hdr_t*)OMPI_PTR_GET_PVAL(des->des_src->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_csum = 0;
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_FRAG;
@ -799,7 +801,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
hdr->hdr_frag_idx = vfrag->vf_idx;
hdr->hdr_frag_csum = sendreq->req_send.req_convertor.checksum;
hdr->hdr_frag_offset = offset_in_msg;
hdr->hdr_src_ptr.pval = vfrag;
OMPI_PTR_SET_PVAL(hdr->hdr_src_ptr, vfrag);
hdr->hdr_dst_ptr = sendreq->req_vfrag0.vf_recv;
hdr->hdr_common.hdr_csum = (do_csum ?
opal_csum(hdr, sizeof(mca_pml_dr_frag_hdr_t)) :
@ -911,7 +913,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
des->des_cbdata = vfrag;
/* setup header */
hdr = (mca_pml_dr_frag_hdr_t*)des->des_src->seg_addr.pval;
hdr = (mca_pml_dr_frag_hdr_t*)OMPI_PTR_GET_PVAL(des->des_src->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_csum = 0;
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_FRAG;
@ -924,7 +926,7 @@ int mca_pml_dr_send_request_schedule(mca_pml_dr_send_request_t* sendreq)
hdr->hdr_frag_csum = (do_csum ?
sendreq->req_send.req_convertor.checksum : OPAL_CSUM_ZERO);
hdr->hdr_frag_offset = sendreq->req_send_offset;
hdr->hdr_src_ptr.pval = vfrag;
OMPI_PTR_SET_PVAL(hdr->hdr_src_ptr, vfrag);
hdr->hdr_dst_ptr = sendreq->req_vfrag0.vf_recv;
hdr->hdr_common.hdr_csum = (do_csum ?
opal_csum(hdr, sizeof(mca_pml_dr_frag_hdr_t)): OPAL_CSUM_ZERO);
@ -969,8 +971,8 @@ void mca_pml_dr_send_request_match_ack(
mca_btl_base_module_t* btl,
mca_pml_dr_ack_hdr_t* ack)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)ack->hdr_src_ptr.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)OMPI_PTR_GET_PVAL(ack->hdr_src_ptr);
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
OPAL_THREAD_LOCK(&ompi_request_lock);
@ -1019,8 +1021,8 @@ void mca_pml_dr_send_request_rndv_ack(
mca_btl_base_module_t* btl,
mca_pml_dr_ack_hdr_t* ack)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)ack->hdr_src_ptr.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)OMPI_PTR_GET_PVAL(ack->hdr_src_ptr);
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
OPAL_THREAD_LOCK(&ompi_request_lock);
@ -1099,8 +1101,8 @@ void mca_pml_dr_send_request_frag_ack(
mca_btl_base_module_t* btl,
mca_pml_dr_ack_hdr_t* ack)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)ack->hdr_src_ptr.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*)OMPI_PTR_GET_PVAL(ack->hdr_src_ptr);
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)OMPI_PTR_GET_PVAL(vfrag->vf_send);
bool schedule = false;
MCA_PML_DR_VFRAG_ACK_STOP(vfrag);

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -307,7 +309,7 @@ do {
vfrag->vf_id = OPAL_THREAD_ADD32(&pml_endpoint->vfrag_seq,1); \
vfrag->vf_offset = sendreq->req_send_offset; \
vfrag->vf_max_send_size = max_send_size; \
vfrag->vf_send.pval = sendreq; \
OMPI_PTR_SET_PVAL(vfrag->vf_send, sendreq); \
sendreq->req_vfrag = vfrag; \
} while(0)
@ -376,8 +378,8 @@ do { \
mca_bml_base_alloc(vfrag->bml_btl, &des_new, \
des_old->des_src->seg_len); \
sendreq->req_descriptor = des_new; \
memcpy(des_new->des_src->seg_addr.pval, \
des_old->des_src->seg_addr.pval, \
memcpy(OMPI_PTR_GET_PVAL(des_new->des_src->seg_addr), \
OMPI_PTR_GET_PVAL(des_old->des_src->seg_addr), \
des_old->des_src->seg_len); \
des_new->des_flags = des_old->des_flags; \
des_new->des_cbdata = des_old->des_cbdata; \
@ -409,7 +411,7 @@ do { \
sizeof(mca_pml_dr_rendezvous_hdr_t)); \
des_old = sendreq->req_descriptor; \
/* build hdr */ \
hdr = (mca_pml_dr_hdr_t*)des_new->des_src->seg_addr.pval; \
hdr = (mca_pml_dr_hdr_t*) OMPI_PTR_GET_PVAL(des_new->des_src->seg_addr); \
hdr->hdr_common.hdr_flags = 0; \
hdr->hdr_common.hdr_type = MCA_PML_DR_HDR_TYPE_RNDV; \
hdr->hdr_common.hdr_dst = endpoint->dst; \
@ -417,7 +419,7 @@ do { \
hdr->hdr_common.hdr_src = endpoint->src; \
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag; \
hdr->hdr_match.hdr_seq = sendreq->req_send.req_base.req_sequence; \
hdr->hdr_match.hdr_src_ptr.pval = &sendreq->req_vfrag0; \
OMPI_PTR_SET_PVAL(hdr->hdr_match.hdr_src_ptr, &sendreq->req_vfrag0); \
hdr->hdr_match.hdr_csum = OPAL_CSUM_ZERO; \
hdr->hdr_common.hdr_vid = sendreq->req_vfrag0.vf_id; \
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed; \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -27,8 +29,8 @@ static void mca_pml_dr_vfrag_ack_timeout(int fd, short event, void* vfrag);
static void mca_pml_dr_vfrag_construct(mca_pml_dr_vfrag_t* vfrag)
{
vfrag->vf_send.pval = NULL;
vfrag->vf_recv.pval = NULL;
OMPI_PTR_SET_PVAL(vfrag->vf_send, NULL);
OMPI_PTR_SET_PVAL(vfrag->vf_recv, NULL);
vfrag->vf_id = 0;
vfrag->vf_idx = 0;
vfrag->vf_len = 0;
@ -67,7 +69,8 @@ OBJ_CLASS_INSTANCE(
static void mca_pml_dr_vfrag_wdog_timeout(int fd, short event, void* data)
{
mca_pml_dr_vfrag_t* vfrag = (mca_pml_dr_vfrag_t*) data;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)
OMPI_PTR_GET_PVAL(vfrag->vf_send);
MCA_PML_DR_DEBUG(0,(0, "%s:%d:%s: wdog timeout: 0x%08x vid: %d",
__FILE__, __LINE__, __func__, vfrag, vfrag->vf_id));
@ -155,7 +158,8 @@ static void mca_pml_dr_vfrag_ack_timeout(int fd, short event, void* data)
void mca_pml_dr_vfrag_reset(mca_pml_dr_vfrag_t* vfrag)
{
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)
OMPI_PTR_GET_PVAL(vfrag->vf_send);
/* update counters - give new BTL a fair chance :-) */
vfrag->vf_ack_cnt = 0;
@ -186,7 +190,8 @@ void mca_pml_dr_vfrag_reset(mca_pml_dr_vfrag_t* vfrag)
void mca_pml_dr_vfrag_reschedule(mca_pml_dr_vfrag_t* vfrag)
{
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)vfrag->vf_send.pval;
mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*)
OMPI_PTR_GET_PVAL(vfrag->vf_send);
/* start wdog timer */
MCA_PML_DR_VFRAG_WDOG_START(vfrag);

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -86,7 +88,7 @@ do { \
(vfrag)->vf_ack = 0; \
(vfrag)->vf_wdog_cnt = 0; \
(vfrag)->vf_ack_cnt = 0; \
(vfrag)->vf_recv.pval = NULL; \
OMPI_PTR_SET_PVAL((vfrag)->vf_recv, NULL); \
(vfrag)->vf_state = 0; \
(vfrag)->vf_pending = 0; \
(vfrag)->vf_wdog_tv = mca_pml_dr.wdog_timer; \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -241,10 +243,10 @@ int mca_pml_ob1_send_fin_btl(
fin->des_cbdata = NULL;
/* fill in header */
hdr = (mca_pml_ob1_fin_hdr_t*)fin->des_src->seg_addr.pval;
hdr = (mca_pml_ob1_fin_hdr_t*) OMPI_PTR_GET_PVAL(fin->des_src->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_FIN;
hdr->hdr_des.pval = hdr_des;
OMPI_PTR_SET_PVAL(hdr->hdr_des, hdr_des);
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
#ifdef WORDS_BIGENDIAN
@ -307,25 +309,25 @@ void mca_pml_ob1_process_pending_packets(mca_bml_base_btl_t* bml_btl)
case MCA_PML_OB1_HDR_TYPE_ACK:
rc = mca_pml_ob1_recv_request_ack_send_btl(pckt->proc,
send_dst,
pckt->hdr.hdr_ack.hdr_src_req.lval,
pckt->hdr.hdr_ack.hdr_dst_req.pval,
OMPI_PTR_GET_LVAL(pckt->hdr.hdr_ack.hdr_src_req),
OMPI_PTR_GET_PVAL(pckt->hdr.hdr_ack.hdr_dst_req),
pckt->hdr.hdr_ack.hdr_rdma_offset);
MCA_PML_OB1_PCKT_PENDING_RETURN(pckt);
if(OMPI_ERR_OUT_OF_RESOURCE == rc) {
MCA_PML_OB1_ADD_ACK_TO_PENDING(pckt->proc,
pckt->hdr.hdr_ack.hdr_src_req.lval,
pckt->hdr.hdr_ack.hdr_dst_req.pval,
OMPI_PTR_GET_LVAL(pckt->hdr.hdr_ack.hdr_src_req),
OMPI_PTR_GET_PVAL(pckt->hdr.hdr_ack.hdr_dst_req),
pckt->hdr.hdr_ack.hdr_rdma_offset);
return;
}
break;
case MCA_PML_OB1_HDR_TYPE_FIN:
rc = mca_pml_ob1_send_fin_btl(pckt->proc, send_dst,
pckt->hdr.hdr_fin.hdr_des.pval);
OMPI_PTR_GET_PVAL(pckt->hdr.hdr_fin.hdr_des));
MCA_PML_OB1_PCKT_PENDING_RETURN(pckt);
if(OMPI_ERR_OUT_OF_RESOURCE == rc) {
MCA_PML_OB1_ADD_FIN_TO_PENDING(pckt->proc,
pckt->hdr.hdr_fin.hdr_des.pval, pckt->bml_btl);
OMPI_PTR_GET_PVAL(pckt->hdr.hdr_fin.hdr_des), pckt->bml_btl);
return;
}
break;

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -263,7 +265,7 @@ do { \
\
MCA_PML_OB1_PCKT_PENDING_ALLOC(_pckt,_rc); \
_pckt->hdr.hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_FIN; \
_pckt->hdr.hdr_fin.hdr_des.pval = (D); \
OMPI_PTR_SET_PVAL(_pckt->hdr.hdr_fin.hdr_des, (D)); \
_pckt->proc = (P); \
_pckt->bml_btl = (B); \
OPAL_THREAD_LOCK(&mca_pml_ob1.lock); \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -80,7 +82,7 @@ void mca_pml_ob1_recv_frag_callback(
void* cbdata)
{
mca_btl_base_segment_t* segments = des->des_dst;
mca_pml_ob1_hdr_t* hdr = (mca_pml_ob1_hdr_t*)segments->seg_addr.pval;
mca_pml_ob1_hdr_t* hdr = (mca_pml_ob1_hdr_t*) OMPI_PTR_GET_PVAL(segments->seg_addr);
if(segments->seg_len < sizeof(mca_pml_ob1_common_hdr_t)) {
return;
}
@ -126,7 +128,7 @@ void mca_pml_ob1_recv_frag_callback(
MCA_PML_OB1_ACK_HDR_NTOH(hdr->hdr_ack);
}
#endif
sendreq = (mca_pml_ob1_send_request_t*)hdr->hdr_ack.hdr_src_req.pval;
sendreq = (mca_pml_ob1_send_request_t*) OMPI_PTR_GET_PVAL(hdr->hdr_ack.hdr_src_req);
sendreq->req_recv = hdr->hdr_ack.hdr_dst_req;
sendreq->req_rdma_offset = (size_t)hdr->hdr_ack.hdr_rdma_offset;
if(OPAL_THREAD_ADD32(&sendreq->req_state, 1) == 2 &&
@ -147,7 +149,7 @@ void mca_pml_ob1_recv_frag_callback(
MCA_PML_OB1_FRAG_HDR_NTOH(hdr->hdr_frag);
}
#endif
recvreq = (mca_pml_ob1_recv_request_t*)hdr->hdr_frag.hdr_dst_req.pval;
recvreq = (mca_pml_ob1_recv_request_t*) OMPI_PTR_GET_PVAL(hdr->hdr_frag.hdr_dst_req);
mca_pml_ob1_recv_request_progress(recvreq,btl,segments,des->des_dst_cnt);
break;
}
@ -160,7 +162,7 @@ void mca_pml_ob1_recv_frag_callback(
we remember if we ever change the bml. */
assert(0 == (hdr->hdr_common.hdr_flags & MCA_PML_OB1_HDR_FLAGS_NBO));
#endif
sendreq = (mca_pml_ob1_send_request_t*)hdr->hdr_rdma.hdr_req.pval;
sendreq = (mca_pml_ob1_send_request_t*) OMPI_PTR_GET_PVAL(hdr->hdr_rdma.hdr_req);
mca_pml_ob1_send_request_put(sendreq,btl,&hdr->hdr_rdma);
break;
}
@ -172,7 +174,7 @@ void mca_pml_ob1_recv_frag_callback(
MCA_PML_OB1_FIN_HDR_NTOH(hdr->hdr_fin);
}
#endif
rdma = (mca_btl_base_descriptor_t*)hdr->hdr_fin.hdr_des.pval;
rdma = (mca_btl_base_descriptor_t*) OMPI_PTR_GET_PVAL(hdr->hdr_fin.hdr_des);
rdma->des_cbfunc(btl, NULL, rdma, OMPI_SUCCESS);
break;
}

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -79,10 +81,10 @@ do { \
OMPI_FREE_LIST_WAIT(&mca_pml_ob1.buffers, item, rc); \
buff = (mca_pml_ob1_buffer_t*)item; \
buffers[i] = buff; \
macro_segments[i].seg_addr.pval = buff->addr; \
OMPI_PTR_SET_PVAL(macro_segments[i].seg_addr, buff->addr); \
macro_segments[i].seg_len = segs[i].seg_len; \
memcpy(buff->addr, \
segs[i].seg_addr.pval, \
OMPI_PTR_GET_PVAL(segs[i].seg_addr), \
segs[i].seg_len); \
} \
\

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -192,11 +194,11 @@ int mca_pml_ob1_recv_request_ack_send_btl(
}
/* fill out header */
ack = (mca_pml_ob1_ack_hdr_t*)des->des_src->seg_addr.pval;
ack = (mca_pml_ob1_ack_hdr_t*) OMPI_PTR_GET_PVAL(des->des_src->seg_addr);
ack->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_ACK;
ack->hdr_common.hdr_flags = 0;
ack->hdr_src_req.lval = hdr_src_req;
ack->hdr_dst_req.pval = hdr_dst_req;
OMPI_PTR_SET_LVAL(ack->hdr_src_req, hdr_src_req);
OMPI_PTR_SET_PVAL(ack->hdr_dst_req, hdr_dst_req);
ack->hdr_rdma_offset = hdr_rdma_offset;
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -277,7 +279,7 @@ static int mca_pml_ob1_recv_request_ack(
}
/* let know to shedule function there is no need to put ACK flag */
recvreq->req_ack_sent = true;
return mca_pml_ob1_recv_request_ack_send(proc, hdr->hdr_src_req.lval,
return mca_pml_ob1_recv_request_ack_send(proc, OMPI_PTR_GET_LVAL(hdr->hdr_src_req),
recvreq, recvreq->req_rdma_offset);
}
@ -304,7 +306,8 @@ static void mca_pml_ob1_rget_completion(
}
mca_pml_ob1_send_fin(recvreq->req_recv.req_base.req_proc,
frag->rdma_hdr.hdr_rget.hdr_des.pval, bml_btl);
OMPI_PTR_GET_PVAL(frag->rdma_hdr.hdr_rget.hdr_des),
bml_btl);
/* is receive request complete */
if( OPAL_THREAD_ADD_SIZE_T(&recvreq->req_bytes_received, frag->rdma_length)
@ -436,7 +439,7 @@ void mca_pml_ob1_recv_request_progress(
size_t bytes_received = 0;
size_t bytes_delivered = 0;
size_t data_offset = 0;
mca_pml_ob1_hdr_t* hdr = (mca_pml_ob1_hdr_t*)segments->seg_addr.pval;
mca_pml_ob1_hdr_t* hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segments->seg_addr);
MCA_PML_OB1_COMPUTE_SEGMENT_LENGTH( segments, num_segments,
0, bytes_received );
@ -526,7 +529,7 @@ void mca_pml_ob1_recv_request_matched_probe(
size_t num_segments)
{
size_t bytes_packed = 0;
mca_pml_ob1_hdr_t* hdr = (mca_pml_ob1_hdr_t*)segments->seg_addr.pval;
mca_pml_ob1_hdr_t* hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segments->seg_addr);
switch(hdr->hdr_common.hdr_type) {
case MCA_PML_OB1_HDR_TYPE_MATCH:
@ -676,12 +679,12 @@ int mca_pml_ob1_recv_request_schedule_exclusive( mca_pml_ob1_recv_request_t* rec
ctl->des_cbfunc = mca_pml_ob1_recv_ctl_completion;
/* fill in rdma header */
hdr = (mca_pml_ob1_rdma_hdr_t*)ctl->des_src->seg_addr.pval;
hdr = (mca_pml_ob1_rdma_hdr_t*) OMPI_PTR_GET_PVAL(ctl->des_src->seg_addr);
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_PUT;
hdr->hdr_common.hdr_flags =
(!recvreq->req_ack_sent) ? MCA_PML_OB1_HDR_TYPE_ACK : 0;
hdr->hdr_req = recvreq->req_send;
hdr->hdr_des.pval = dst;
OMPI_PTR_SET_PVAL(hdr->hdr_des, dst);
hdr->hdr_rdma_offset = recvreq->req_rdma_offset;
hdr->hdr_seg_cnt = dst->des_dst_cnt;
memcpy(hdr->hdr_segs, dst->des_dst,

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -290,7 +292,7 @@ do {
offset -= segment->seg_len; \
} else { \
iov[iov_count].iov_len = segment->seg_len - seg_offset; \
iov[iov_count].iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval + seg_offset); \
iov[iov_count].iov_base = (IOVBASE_TYPE*)((unsigned char*)OMPI_PTR_GET_PVAL(segment->seg_addr) + seg_offset); \
iov_count++; \
} \
} \
@ -348,8 +350,8 @@ static inline void mca_pml_ob1_recv_request_schedule(
\
MCA_PML_OB1_PCKT_PENDING_ALLOC(_pckt,_rc); \
_pckt->hdr.hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_ACK; \
_pckt->hdr.hdr_ack.hdr_src_req.lval = (S); \
_pckt->hdr.hdr_ack.hdr_dst_req.pval = (D); \
OMPI_PTR_SET_LVAL(_pckt->hdr.hdr_ack.hdr_src_req, (S)); \
OMPI_PTR_SET_PVAL(_pckt->hdr.hdr_ack.hdr_dst_req, (D)); \
_pckt->hdr.hdr_ack.hdr_rdma_offset = (O); \
_pckt->proc = (P); \
_pckt->bml_btl = NULL; \

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -376,7 +378,7 @@ int mca_pml_ob1_send_request_start_buffered(
segment = descriptor->des_src;
/* pack the data into the BTL supplied buffer */
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval +
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)OMPI_PTR_GET_PVAL(segment->seg_addr) +
sizeof(mca_pml_ob1_rendezvous_hdr_t));
iov.iov_len = size;
iov_count = 1;
@ -391,7 +393,7 @@ int mca_pml_ob1_send_request_start_buffered(
}
/* build rendezvous header */
hdr = (mca_pml_ob1_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_RNDV;
hdr->hdr_match.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
@ -399,7 +401,7 @@ int mca_pml_ob1_send_request_start_buffered(
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
hdr->hdr_match.hdr_seq = (uint16_t)sendreq->req_send.req_base.req_sequence;
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
hdr->hdr_rndv.hdr_src_req.pval = sendreq;
OMPI_PTR_SET_PVAL(hdr->hdr_rndv.hdr_src_req, sendreq);
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
#ifdef WORDS_BIGENDIAN
@ -496,7 +498,7 @@ int mca_pml_ob1_send_request_start_copy( mca_pml_ob1_send_request_t* sendreq,
segment = descriptor->des_src;
/* pack the data into the supplied buffer */
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)segment->seg_addr.pval + sizeof(mca_pml_ob1_match_hdr_t));
iov.iov_base = (IOVBASE_TYPE*)((unsigned char*)OMPI_PTR_GET_PVAL(segment->seg_addr) + sizeof(mca_pml_ob1_match_hdr_t));
iov.iov_len = size;
iov_count = 1;
(void)ompi_convertor_pack( &sendreq->req_send.req_convertor,
@ -505,7 +507,7 @@ int mca_pml_ob1_send_request_start_copy( mca_pml_ob1_send_request_t* sendreq,
}
/* build match header */
hdr = (mca_pml_ob1_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_MATCH;
hdr->hdr_match.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
@ -579,7 +581,7 @@ int mca_pml_ob1_send_request_start_prepare( mca_pml_ob1_send_request_t* sendreq,
segment = descriptor->des_src;
/* build match header */
hdr = (mca_pml_ob1_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_MATCH;
hdr->hdr_match.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
@ -676,7 +678,7 @@ int mca_pml_ob1_send_request_start_rdma(
segment = des->des_src;
/* build match header */
hdr = (mca_pml_ob1_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = MCA_PML_OB1_HDR_FLAGS_CONTIG|MCA_PML_OB1_HDR_FLAGS_PIN;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_RGET;
hdr->hdr_match.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
@ -684,8 +686,8 @@ int mca_pml_ob1_send_request_start_rdma(
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
hdr->hdr_match.hdr_seq = (uint16_t)sendreq->req_send.req_base.req_sequence;
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
hdr->hdr_rndv.hdr_src_req.pval = sendreq;
hdr->hdr_rget.hdr_des.pval = src;
OMPI_PTR_SET_PVAL(hdr->hdr_rndv.hdr_src_req, sendreq);
OMPI_PTR_SET_PVAL(hdr->hdr_rget.hdr_des, src);
hdr->hdr_rget.hdr_seg_cnt = src->des_src_cnt;
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -731,7 +733,7 @@ int mca_pml_ob1_send_request_start_rdma(
segment = des->des_src;
/* build hdr */
hdr = (mca_pml_ob1_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = MCA_PML_OB1_HDR_FLAGS_CONTIG|MCA_PML_OB1_HDR_FLAGS_PIN;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_RNDV;
hdr->hdr_match.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
@ -739,7 +741,7 @@ int mca_pml_ob1_send_request_start_rdma(
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
hdr->hdr_match.hdr_seq = (uint16_t)sendreq->req_send.req_base.req_sequence;
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
hdr->hdr_rndv.hdr_src_req.pval = sendreq;
OMPI_PTR_SET_PVAL(hdr->hdr_rndv.hdr_src_req, sendreq);
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
#ifdef WORDS_BIGENDIAN
@ -814,7 +816,7 @@ int mca_pml_ob1_send_request_start_rndv(
segment = des->des_src;
/* build hdr */
hdr = (mca_pml_ob1_hdr_t*)segment->seg_addr.pval;
hdr = (mca_pml_ob1_hdr_t*)OMPI_PTR_GET_PVAL(segment->seg_addr);
hdr->hdr_common.hdr_flags = flags;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_RNDV;
hdr->hdr_match.hdr_ctx = sendreq->req_send.req_base.req_comm->c_contextid;
@ -822,7 +824,7 @@ int mca_pml_ob1_send_request_start_rndv(
hdr->hdr_match.hdr_tag = sendreq->req_send.req_base.req_tag;
hdr->hdr_match.hdr_seq = (uint16_t)sendreq->req_send.req_base.req_sequence;
hdr->hdr_rndv.hdr_msg_length = sendreq->req_send.req_bytes_packed;
hdr->hdr_rndv.hdr_src_req.pval = sendreq;
OMPI_PTR_SET_PVAL(hdr->hdr_rndv.hdr_src_req, sendreq);
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
#ifdef WORDS_BIGENDIAN
@ -940,11 +942,11 @@ int mca_pml_ob1_send_request_schedule_exclusive(
des->des_cbdata = sendreq;
/* setup header */
hdr = (mca_pml_ob1_frag_hdr_t*)des->des_src->seg_addr.pval;
hdr = (mca_pml_ob1_frag_hdr_t*)OMPI_PTR_GET_PVAL(des->des_src->seg_addr);
hdr->hdr_common.hdr_flags = 0;
hdr->hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_FRAG;
hdr->hdr_frag_offset = sendreq->req_send_offset;
hdr->hdr_src_req.pval = sendreq;
OMPI_PTR_SET_PVAL(hdr->hdr_src_req, sendreq);
hdr->hdr_dst_req = sendreq->req_recv;
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
@ -1019,7 +1021,7 @@ static void mca_pml_ob1_put_completion( mca_btl_base_module_t* btl,
}
mca_pml_ob1_send_fin(sendreq->req_send.req_base.req_proc,
frag->rdma_hdr.hdr_rdma.hdr_des.pval, bml_btl);
OMPI_PTR_GET_PVAL(frag->rdma_hdr.hdr_rdma.hdr_des), bml_btl);
/* check for request completion */
if( OPAL_THREAD_ADD_SIZE_T(&sendreq->req_bytes_delivered, frag->rdma_length)

Просмотреть файл

@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -73,19 +75,91 @@ typedef fd_set ompi_fd_set_t;
/*
* portable assignment of pointer to int
* Convert a 64 bit value to network byte order.
*/
static inline uint64_t hton64(uint64_t val)
{
#ifdef WORDS_BIGENDIAN
return val;
#else
union { uint64_t ll;
uint32_t l[2];
} w, r;
w.ll = val;
r.l[0] = htonl(w.l[1]);
r.l[1] = htonl(w.l[0]);
return r.ll;
#endif
}
/*
* Convert a 64 bit value from network to host byte order.
*/
static inline uint64_t ntoh64(uint64_t val)
{
#ifdef WORDS_BIGENDIAN
return val;
#else
union { uint64_t ll;
uint32_t l[2];
} w, r;
w.ll = val;
r.l[0] = ntohl(w.l[1]);
r.l[1] = ntohl(w.l[0]);
return r.ll;
#endif
}
/*
* Portable structure for transporting pointers
*/
typedef union {
uint64_t lval;
uint32_t ival;
void* pval;
struct {
uint32_t uval;
uint32_t lval;
} sval;
uint64_t internal_lval;
#if SIZEOF_VOID_P == 4
void *internal_pvals[2];
#else /* SIZEOF_VOID_P */
void *internal_pval;
#endif /* SIZEOF_VOID_P */
} ompi_ptr_t;
#define OMPI_PTR_GET_LVAL(ptr) ptr.internal_lval
#define OMPI_PTR_SET_LVAL(ptr, lval) ptr.internal_lval = lval
#if SIZEOF_VOID_P == 4
#ifdef WORDS_BIGENDIAN
#define OMPI_PTR_SET_PVAL(ptr, pval) \
do { \
ptr.internal_pvals[0] = 0x0; \
ptr.internal_pvals[1] = pval; \
} while (0)
#define OMPI_PTR_GET_PVAL(ptr) ptr.internal_pvals[1]
#else /* WORDS_BIGENDIAN */
#define OMPI_PTR_SET_PVAL(ptr, pval) \
do { \
ptr.internal_pvals[0] = pval; \
ptr.internal_pvals[1] = 0x0; \
} while (0)
#define OMPI_PTR_GET_PVAL(ptr) ptr.internal_pvals[0]
#endif /* WORDS_BIGENDIAN */
#else /* SIZEOF_VOID_P */
#define OMPI_PTR_SET_PVAL(ptr, pval) ptr.internal_pval = pval;
#define OMPI_PTR_GET_PVAL(ptr) ptr.internal_pval
#endif /* SIZEOF_VOID_P */
#define OMPI_PTR_T_HTON(ptr) \
do { \
ptr.internal_lval = hton64(ptr.internal_lval); \
} while (0)
#define OMPI_PTR_T_NTOH(ptr) \
do { \
ptr.internal_lval = ntoh64(ptr.internal_lval); \
} while (0)
/*
* handle differences in iovec
*/
@ -107,43 +181,6 @@ typedef int opal_socklen_t;
#endif
/*
* Convert a 64 bit value to network byte order.
*/
static inline uint64_t hton64(uint64_t val)
{
union { uint64_t ll;
uint32_t l[2];
} w, r;
/* platform already in network byte order? */
if(htonl(1) == 1L)
return val;
w.ll = val;
r.l[0] = htonl(w.l[1]);
r.l[1] = htonl(w.l[0]);
return r.ll;
}
/*
* Convert a 64 bit value from network to host byte order.
*/
static inline uint64_t ntoh64(uint64_t val)
{
union { uint64_t ll;
uint32_t l[2];
} w, r;
/* platform already in network byte order? */
if(htonl(1) == 1L)
return val;
w.ll = val;
r.l[0] = ntohl(w.l[1]);
r.l[1] = ntohl(w.l[0]);
return r.ll;
}
#ifdef WORDS_BIGENDIAN
static inline uint16_t opal_swap_bytes2(uint16_t val)
{