From 6a5454b76aaa2c7bdf1eb2f5dbcb10c0229a0013 Mon Sep 17 00:00:00 2001 From: Nysal Jan Date: Wed, 10 Dec 2008 22:07:48 +0000 Subject: [PATCH] Fixes crash in openib BTL on a heterogeneous cluster Refs trac:1700 This commit was SVN r20113. The following Trac tickets were found above: Ticket 1700 --> https://svn.open-mpi.org/trac/ompi/ticket/1700 --- ompi/mca/btl/openib/btl_openib_component.c | 4 ++++ ompi/mca/btl/openib/btl_openib_endpoint.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ompi/mca/btl/openib/btl_openib_component.c b/ompi/mca/btl/openib/btl_openib_component.c index 115dbfb2c9..01937072a8 100644 --- a/ompi/mca/btl/openib/btl_openib_component.c +++ b/ompi/mca/btl/openib/btl_openib_component.c @@ -2836,6 +2836,10 @@ static void handle_wc(mca_btl_openib_device_t* device, const uint32_t cq, case IBV_WC_RECV: OPAL_OUTPUT((-1, "Got WC: RDMA_RECV, qp %d, src qp %d, WR ID %p", wc->qp_num, wc->src_qp, (void*) wc->wr_id)); + +#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT + wc->imm_data = ntohl(wc->imm_data); +#endif if(wc->wc_flags & IBV_WC_WITH_IMM) { endpoint = (mca_btl_openib_endpoint_t*) opal_pointer_array_get_item(device->endpoints, wc->imm_data); diff --git a/ompi/mca/btl/openib/btl_openib_endpoint.c b/ompi/mca/btl/openib/btl_openib_endpoint.c index 8fb86fe50a..66b688b52b 100644 --- a/ompi/mca/btl/openib/btl_openib_endpoint.c +++ b/ompi/mca/btl/openib/btl_openib_endpoint.c @@ -95,7 +95,11 @@ static int post_send(mca_btl_openib_endpoint_t *ep, sr_desc->opcode = IBV_WR_SEND; } else { sr_desc->opcode = IBV_WR_SEND_WITH_IMM; +#if !defined(WORDS_BIGENDIAN) && OMPI_ENABLE_HETEROGENEOUS_SUPPORT + sr_desc->imm_data = htonl(ep->rem_info.rem_index); +#else sr_desc->imm_data = ep->rem_info.rem_index; +#endif } }