From 98f382ba0e9e4c6a3d6711c904b6f7d0cbcc522e Mon Sep 17 00:00:00 2001 From: Mike Dubman Date: Fri, 19 Aug 2011 22:18:17 +0000 Subject: [PATCH] fixes in mxm mtl This commit was SVN r25066. --- ompi/mca/mtl/mxm/mtl_mxm_recv.c | 25 ++++++++++-------- ompi/mca/mtl/mxm/mtl_mxm_send.c | 45 ++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/ompi/mca/mtl/mxm/mtl_mxm_recv.c b/ompi/mca/mtl/mxm/mtl_mxm_recv.c index 4bae7546d5..1d8df92ca9 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_recv.c +++ b/ompi/mca/mtl/mxm/mtl_mxm_recv.c @@ -63,19 +63,22 @@ int ompi_mtl_mxm_irecv(struct mca_mtl_base_module_t* mtl, return ret; } + /* prepare a receive request embedded in the MTL request */ mxm_recv_req = &mtl_mxm_request->mxm.recv; - /* prepare a receive request embedded in the MTL request */ - mxm_recv_req->base.state = MXM_REQ_NEW; - mxm_recv_req->base.mq = (mxm_mq_h)comm->c_pml_comm; - mxm_recv_req->tag = tag; - mxm_recv_req->tag_mask = (tag == MPI_ANY_TAG) ? 0 : 0xffffffffU; - mxm_recv_req->base.conn = (src == MPI_ANY_SOURCE) ? NULL : ompi_mtl_mxm_conn_lookup(comm, src); - - mxm_recv_req->base.data.buffer.ptr = mtl_mxm_request->buf; - mxm_recv_req->base.data.buffer.length = mtl_mxm_request->length; - mxm_recv_req->base.completed_cb = ompi_mtl_mxm_recv_completion_cb; - mxm_recv_req->base.context = mtl_mxm_request; + mxm_recv_req->base.state = MXM_REQ_NEW; + mxm_recv_req->base.mq = ompi_mtl_mxm_mq_lookup(comm); + mxm_recv_req->base.conn = (src == MPI_ANY_SOURCE) ? NULL : + ompi_mtl_mxm_conn_lookup(comm, src); + mxm_recv_req->base.flags = 0; + mxm_recv_req->base.data_type = MXM_REQ_DATA_BUFFER; + mxm_recv_req->base.data.buffer.ptr = mtl_mxm_request->buf; + mxm_recv_req->base.data.buffer.length = mtl_mxm_request->length; + mxm_recv_req->base.data.buffer.mkey = MXM_MKEY_NONE; + mxm_recv_req->base.context = mtl_mxm_request; + mxm_recv_req->base.completed_cb = ompi_mtl_mxm_recv_completion_cb; + mxm_recv_req->tag = tag; + mxm_recv_req->tag_mask = (tag == MPI_ANY_TAG) ? 0 : 0xffffffffU; /* post-recv */ err = mxm_req_recv(mxm_recv_req); diff --git a/ompi/mca/mtl/mxm/mtl_mxm_send.c b/ompi/mca/mtl/mxm/mtl_mxm_send.c index 727d5d741b..b0635e9c22 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_send.c +++ b/ompi/mca/mtl/mxm/mtl_mxm_send.c @@ -41,23 +41,30 @@ int ompi_mtl_mxm_send(struct mca_mtl_base_module_t* mtl, int ret; /* prepare local send request */ - mxm_send_req.base.state = MXM_REQ_NEW; - mxm_send_req.base.mq = ompi_mtl_mxm_mq_lookup(comm); - mxm_send_req.base.conn = ompi_mtl_mxm_conn_lookup(comm, dest); - mxm_send_req.op.send.tag = tag; - mxm_send_req.op.send.imm_data = ompi_comm_rank(comm); - mxm_send_req.base.completed_cb = NULL; + mxm_send_req.base.state = MXM_REQ_NEW; + mxm_send_req.base.mq = ompi_mtl_mxm_mq_lookup(comm); + mxm_send_req.base.conn = ompi_mtl_mxm_conn_lookup(comm, dest); mxm_send_req.base.flags = MXM_REQ_FLAG_WAIT; - if (mode == MCA_PML_BASE_SEND_SYNCHRONOUS) { mxm_send_req.base.flags |= MXM_REQ_FLAG_SEND_SYNC; } - ret = ompi_mtl_datatype_pack(convertor, &mxm_send_req.base.data.buffer.ptr, &mxm_send_req.base.data.buffer.length, + + mxm_send_req.base.data_type = MXM_REQ_DATA_BUFFER; + ret = ompi_mtl_datatype_pack(convertor, &mxm_send_req.base.data.buffer.ptr, + &mxm_send_req.base.data.buffer.length, &free_after); if (OMPI_SUCCESS != ret) { return ret; } + mxm_send_req.base.data.buffer.mkey = MXM_MKEY_NONE; + mxm_send_req.base.context = NULL; + mxm_send_req.base.completed_cb = NULL; + mxm_send_req.opcode = MXM_REQ_OP_SEND; + mxm_send_req.op.send.tag = tag; + mxm_send_req.op.send.imm_data = ompi_comm_rank(comm); + + /* post-send */ err = mxm_req_send(&mxm_send_req); if (MXM_OK != err) { @@ -96,15 +103,19 @@ int ompi_mtl_mxm_isend(struct mca_mtl_base_module_t* mtl, mxm_send_req = &mtl_mxm_request->mxm.send; /* prepare a send request embedded in the MTL request */ - mxm_send_req->base.state = MXM_REQ_NEW; - mxm_send_req->base.mq = ompi_mtl_mxm_mq_lookup(comm); - mxm_send_req->base.conn = ompi_mtl_mxm_conn_lookup(comm, dest); - mxm_send_req->op.send.tag = tag; - mxm_send_req->op.send.imm_data = ompi_comm_rank(comm); - mxm_send_req->base.data.buffer.ptr = mtl_mxm_request->buf; - mxm_send_req->base.data.buffer.length = mtl_mxm_request->length; - mxm_send_req->base.completed_cb = ompi_mtl_mxm_send_completion_cb; - mxm_send_req->base.context = mtl_mxm_request; + mxm_send_req->base.state = MXM_REQ_NEW; + mxm_send_req->base.mq = ompi_mtl_mxm_mq_lookup(comm); + mxm_send_req->base.conn = ompi_mtl_mxm_conn_lookup(comm, dest); + mxm_send_req->base.flags = 0; + mxm_send_req->base.data_type = MXM_REQ_DATA_BUFFER; + mxm_send_req->base.data.buffer.ptr = mtl_mxm_request->buf; + mxm_send_req->base.data.buffer.length = mtl_mxm_request->length; + mxm_send_req->base.data.buffer.mkey = MXM_MKEY_NONE; + mxm_send_req->base.context = mtl_mxm_request; + mxm_send_req->base.completed_cb = ompi_mtl_mxm_send_completion_cb; + mxm_send_req->opcode = MXM_REQ_OP_SEND; + mxm_send_req->op.send.tag = tag; + mxm_send_req->op.send.imm_data = ompi_comm_rank(comm); if (mode == MCA_PML_BASE_SEND_SYNCHRONOUS) { mxm_send_req->base.flags |= MXM_REQ_FLAG_SEND_SYNC;