[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2a1-1-g7944459
Service Account
noreply at mpich.org
Fri Sep 5 12:34:51 CDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 79444598bb51599702cabcecab341b5a20847124 (commit)
from 0eeed17df88f41285e43c61a4f6863c0c0b85fb3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/79444598bb51599702cabcecab341b5a20847124
commit 79444598bb51599702cabcecab341b5a20847124
Author: Igor Ivanov <Igor.Ivanov at itseez.com>
Date: Thu Sep 4 14:21:10 2014 +0300
netmod/mxm: Cleanup code from warnings
Resolved warnings reported by --enable-strict configuration.
Signed-off-by: Igor Ivanov <Igor.Ivanov at itseez.com>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
index df49239..2de472d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
@@ -17,15 +17,17 @@ int MPID_nem_mxm_cancel_send(MPIDI_VC_t * vc, MPID_Request * req)
{
int mpi_errno = MPI_SUCCESS;
mxm_error_t ret = MXM_OK;
+ MPID_nem_mxm_vc_area *vc_area = VC_BASE(req->ch.vc);
+ MPID_nem_mxm_req_area *req_area = REQ_BASE(req);
_dbg_mxm_output(5, "========> Canceling SEND req %p\n", req);
- if (likely(!_mxm_req_test(&REQ_FIELD(req, mxm_req->item.base)))) {
- ret = mxm_req_cancel_send(&REQ_FIELD(req, mxm_req->item.send));
+ if (likely(!_mxm_req_test(&req_area->mxm_req->item.base))) {
+ ret = mxm_req_cancel_send(&req_area->mxm_req->item.send);
if ((MXM_OK == ret) || (MXM_ERR_NO_PROGRESS == ret)) {
- _mxm_req_wait(&REQ_FIELD(req, mxm_req->item.base));
+ _mxm_req_wait(&req_area->mxm_req->item.base);
if (MPIR_STATUS_GET_CANCEL_BIT(req->status)) {
- (VC_FIELD(req->ch.vc, pending_sends)) -= 1;
+ vc_area->pending_sends -= 1;
}
}
else {
@@ -50,13 +52,14 @@ int MPID_nem_mxm_cancel_recv(MPIDI_VC_t * vc, MPID_Request * req)
{
int mpi_errno = MPI_SUCCESS;
mxm_error_t ret = MXM_OK;
+ MPID_nem_mxm_req_area *req_area = REQ_BASE(req);
_dbg_mxm_output(5, "========> Canceling RECV req %p\n", req);
- if (likely(!_mxm_req_test(&REQ_FIELD(req, mxm_req->item.base)))) {
- ret = mxm_req_cancel_recv(&REQ_FIELD(req, mxm_req->item.recv));
+ if (likely(!_mxm_req_test(&req_area->mxm_req->item.base))) {
+ ret = mxm_req_cancel_recv(&req_area->mxm_req->item.recv);
if ((MXM_OK == ret) || (MXM_ERR_NO_PROGRESS == ret)) {
- _mxm_req_wait(&REQ_FIELD(req, mxm_req->item.base));
+ _mxm_req_wait(&req_area-> mxm_req->item.base);
}
else {
mpi_errno = MPI_ERR_INTERN;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
index 54d5833..6d3b9b2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
@@ -148,9 +148,8 @@ typedef struct {
int pending_sends;
} MPID_nem_mxm_vc_area;
-/* direct macro to private fields in VC */
-#define VC_FIELD(vcp, field) (((MPID_nem_mxm_vc_area *)vcp->ch.netmod_area.padding)->field)
-#define VC_BASE(vcp) ((MPID_nem_mxm_vc_area *)vcp->ch.netmod_area.padding)
+/* macro for mxm private in VC */
+#define VC_BASE(vcp) ((MPID_nem_mxm_vc_area *)((vcp)->ch.netmod_area.padding))
/* The req provides a generic buffer in which network modules can store
private fields This removes all dependencies from the req structure
@@ -172,13 +171,12 @@ typedef struct {
mxm_req_buffer_t tmp_buf[MXM_MPICH_MAX_IOV];
} MPID_nem_mxm_req_area;
-/* direct macro to private fields in REQ */
-#define REQ_FIELD(reqp, field) (((MPID_nem_mxm_req_area *)((reqp)->ch.netmod_area.padding))->field)
+/* macro for mxm private in REQ */
#define REQ_BASE(reqp) ((MPID_nem_mxm_req_area *)((reqp)->ch.netmod_area.padding))
typedef struct MPID_nem_mxm_module_t {
char *runtime_version;
- char *compiletime_version;
+ const char *compiletime_version;
mxm_context_opts_t *mxm_ctx_opts;
mxm_ep_opts_t *mxm_ep_opts;
mxm_h mxm_context;
@@ -331,7 +329,7 @@ static inline void _dbg_mxm_out(int level,
}
}
-static void _dbg_mxm_hexdump(void *ptr, int buflen)
+static inline void _dbg_mxm_hexdump(void *ptr, int buflen)
{
unsigned char *buf = (unsigned char *) ptr;
char *str = NULL;
@@ -387,7 +385,6 @@ static inline char *_rank_val_to_str(int rank, char *out, int max)
static inline void _dbg_mxm_req(MPID_Request * req)
{
- FILE *stream = stderr;
char tag_buf[128];
char rank_buf[128];
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
index 44283d7..ca31588 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -92,6 +92,7 @@ MPID_nem_mxm_module_t *mxm_obj;
static int _mxm_init(int rank, int size);
static int _mxm_fini(void);
+static int _mxm_post_init(void);
static int _mxm_connect(MPID_nem_mxm_ep_t * ep, const char *business_card,
MPID_nem_mxm_vc_area * vc_area);
static int _mxm_disconnect(MPID_nem_mxm_ep_t * ep);
@@ -101,30 +102,6 @@ static int _mxm_conf(void);
#undef FUNCNAME
-#define FUNCNAME MPID_nem_mxm_post_init
-#undef FCNAME
-#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_post_init(void)
-{
- int mpi_errno = MPI_SUCCESS;
-
- _mxm_barrier();
-
-#if MXM_API >= MXM_VERSION(3,1)
- /* Current logic guarantees that all VCs have been initialized before post init call */
- if (_mxm_obj.conf.bulk_connect) {
- mxm_ep_wireup(_mxm_obj.mxm_ep);
- }
-#endif
-
- fn_exit:
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
#define FUNCNAME MPID_nem_mxm_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
@@ -153,7 +130,7 @@ int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPID_nem_register_initcomp_cb(MPID_nem_mxm_post_init);
+ mpi_errno = MPID_nem_register_initcomp_cb(_mxm_post_init);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
@@ -250,6 +227,7 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_CH3I_VC *vc_ch = &vc->ch;
+ MPID_nem_mxm_vc_area *vc_area = VC_BASE(vc);
MPIDI_STATE_DECL(MPID_STATE_MXM_VC_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_INIT);
@@ -275,9 +253,9 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
- VC_FIELD(vc, ctx) = vc;
- VC_FIELD(vc, mxm_ep) = &_mxm_obj.endpoint[vc->pg_rank];
- mpi_errno = _mxm_connect(&_mxm_obj.endpoint[vc->pg_rank], business_card, VC_BASE(vc));
+ vc_area->ctx = vc;
+ vc_area->mxm_ep = &_mxm_obj.endpoint[vc->pg_rank];
+ mpi_errno = _mxm_connect(&_mxm_obj.endpoint[vc->pg_rank], business_card, vc_area);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
@@ -286,7 +264,7 @@ int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
- VC_FIELD(vc, pending_sends) = 0;
+ vc_area->pending_sends = 0;
vc->rndvSend_fn = NULL;
vc->rndvRecv_fn = NULL;
@@ -319,8 +297,9 @@ int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc)
* to destroy endpoint here
*/
#if 0
- if (VC_FIELD(vc, ctx) == vc) {
- mpi_errno = _mxm_disconnect(VC_FIELD(vc, mxm_ep));
+ MPID_nem_mxm_vc_area *vc_area = VC_BASE(vc);
+ if (vc_area->ctx == vc) {
+ mpi_errno = _mxm_disconnect(vc_area->mxm_ep);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
}
@@ -340,6 +319,7 @@ int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc)
int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
+ MPID_nem_mxm_vc_area *vc_area = VC_BASE(vc);
MPIDI_STATE_DECL(MPID_STATE_MXM_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_TERMINATE);
@@ -351,7 +331,7 @@ int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**comm_fail", "**comm_fail %d", vc->pg_rank);
}
else {
- while ((VC_FIELD(vc, pending_sends)) > 0)
+ while (vc_area->pending_sends > 0)
MPID_nem_mxm_poll(FALSE);
}
@@ -369,9 +349,7 @@ int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
static int _mxm_conf(void)
{
int mpi_errno = MPI_SUCCESS;
- mxm_error_t ret = MXM_OK;
unsigned long cur_ver;
- char *env_val = NULL;
cur_ver = mxm_get_version();
if (cur_ver != MXM_API) {
@@ -514,6 +492,25 @@ static int _mxm_fini(void)
goto fn_exit;
}
+static int _mxm_post_init(void)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ _mxm_barrier();
+
+#if MXM_API >= MXM_VERSION(3,1)
+ /* Current logic guarantees that all VCs have been initialized before post init call */
+ if (_mxm_obj.conf.bulk_connect) {
+ mxm_ep_wireup(_mxm_obj.mxm_ep);
+ }
+#endif
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
static int _mxm_connect(MPID_nem_mxm_ep_t * ep, const char *business_card,
MPID_nem_mxm_vc_area * vc_area)
{
@@ -576,8 +573,10 @@ static int _mxm_add_comm(MPID_Comm * comm, void *param)
mxm_error_t ret = MXM_OK;
mxm_mq_h mxm_mq;
- _dbg_mxm_output(6, "Add COMM comm %p (context %d rank %d) \n",
- comm, comm->context_id, comm->rank);
+ _dbg_mxm_output(6, "Add COMM comm %p (rank %d type %d context %d | %d size %d | %d) \n",
+ comm, comm->rank, comm->comm_kind,
+ comm->context_id, comm->recvcontext_id,
+ comm->local_size, comm->remote_size);
ret = mxm_mq_create(_mxm_obj.mxm_context, comm->context_id, &mxm_mq);
MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
@@ -597,8 +596,8 @@ static int _mxm_del_comm(MPID_Comm * comm, void *param)
int mpi_errno = MPI_SUCCESS;
mxm_mq_h mxm_mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
- _dbg_mxm_output(6, "Del COMM comm %p (context %d rank %d) \n",
- comm, comm->context_id, comm->rank);
+ _dbg_mxm_output(6, "Del COMM comm %p (rank %d type %d) \n",
+ comm, comm->rank, comm->comm_kind);
if (mxm_mq)
mxm_mq_destroy(mxm_mq);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
index eef92ee..87259f3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -105,8 +105,8 @@ void MPID_nem_mxm_anysource_posted(MPID_Request * req)
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_mxm_anysource_matched(MPID_Request * req)
{
- int mpi_errno = MPI_SUCCESS;
mxm_error_t ret = MXM_OK;
+ MPID_nem_mxm_req_area *req_area = NULL;
int matched = FALSE;
/* This function is called when an anysource request in the posted
@@ -123,12 +123,13 @@ int MPID_nem_mxm_anysource_matched(MPID_Request * req)
_dbg_mxm_output(5, "Any Source ========> Matching req %p \n", req);
- ret = mxm_req_cancel_recv(&REQ_FIELD(req, mxm_req->item.recv));
+ req_area = REQ_BASE(req);
+ ret = mxm_req_cancel_recv(&req_area->mxm_req->item.recv);
if ((MXM_OK == ret) || (MXM_ERR_NO_PROGRESS == ret)) {
MPID_Segment_free(req->dev.segment_ptr);
}
else {
- _mxm_req_wait(&REQ_FIELD(req, mxm_req->item.base));
+ _mxm_req_wait(&req_area->mxm_req->item.base);
matched = TRUE;
}
@@ -146,8 +147,6 @@ int MPID_nem_mxm_anysource_matched(MPID_Request * req)
int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
{
int mpi_errno = MPI_SUCCESS;
- mxm_error_t ret = MXM_OK;
- mxm_recv_req_t *mxm_rreq;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_RECV);
@@ -157,16 +156,15 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
(vc && !vc->ch.is_local));
{
- MPIR_Rank_t source = rreq->dev.match.parts.rank;
MPIR_Context_id_t context_id = rreq->dev.match.parts.context_id;
int tag = rreq->dev.match.parts.tag;
- int ret;
MPIDI_msg_sz_t data_sz;
int dt_contig;
MPI_Aint dt_true_lb;
MPID_Datatype *dt_ptr;
+ MPID_nem_mxm_vc_area *vc_area = VC_BASE(vc);
+ MPID_nem_mxm_req_area *req_area = REQ_BASE(rreq);
- MPIU_Assert((rreq->kind == MPID_REQUEST_RECV) || (rreq->kind == MPID_PREQUEST_RECV));
MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz,
dt_ptr, dt_true_lb);
rreq->dev.OnDataAvail = NULL;
@@ -177,26 +175,26 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
"Recv ========> Getting USER msg for req %p (context %d rank %d tag %d size %d) \n",
rreq, context_id, source, tag, data_sz);
- REQ_FIELD(rreq, ctx) = rreq;
- REQ_FIELD(rreq, iov_buf) = REQ_FIELD(rreq, tmp_buf);
- REQ_FIELD(rreq, iov_count) = 0;
- REQ_FIELD(rreq, iov_buf)[0].ptr = NULL;
- REQ_FIELD(rreq, iov_buf)[0].length = 0;
+ req_area->ctx = rreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
+ req_area->iov_buf[0].ptr = NULL;
+ req_area->iov_buf[0].length = 0;
if (dt_contig) {
- REQ_FIELD(rreq, iov_count) = 1;
- REQ_FIELD(rreq, iov_buf)[0].ptr = (char *) (rreq->dev.user_buf) + dt_true_lb;
- REQ_FIELD(rreq, iov_buf)[0].length = data_sz;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (char *) (rreq->dev.user_buf) + dt_true_lb;
+ req_area->iov_buf[0].length = data_sz;
}
else {
mpi_errno = _mxm_process_rdtype(&rreq, rreq->dev.datatype, dt_ptr, data_sz,
rreq->dev.user_buf, rreq->dev.user_count,
- &REQ_FIELD(rreq, iov_buf), &REQ_FIELD(rreq, iov_count));
+ &req_area->iov_buf, &req_area->iov_count);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
}
- mpi_errno = _mxm_irecv((vc ? VC_FIELD(vc, mxm_ep) : NULL), REQ_BASE(rreq),
+ mpi_errno = _mxm_irecv((vc ? vc_area->mxm_ep : NULL), req_area,
tag,
(rreq->comm ? (mxm_mq_h) rreq->comm->dev.ch.netmod_priv : mxm_obj->
mxm_mq), _mxm_tag_mpi2mxm(tag, context_id));
@@ -217,7 +215,6 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
static int _mxm_handle_rreq(MPID_Request * req)
{
- int mpi_errno = MPI_SUCCESS;
int complete = FALSE;
int dt_contig;
MPI_Aint dt_true_lb;
@@ -225,6 +222,8 @@ static int _mxm_handle_rreq(MPID_Request * req)
MPID_Datatype *dt_ptr;
MPIDI_msg_sz_t data_sz;
MPIDI_VC_t *vc = NULL;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL
MPIU_THREAD_CS_ENTER(MSGQUEUE, req);
complete = MPIDI_CH3U_Recvq_DP(req)
@@ -236,10 +235,13 @@ static int _mxm_handle_rreq(MPID_Request * req)
MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, userbuf_sz, dt_ptr,
dt_true_lb);
+ vc_area = VC_BASE(req->ch.vc);
+ req_area = REQ_BASE(req);
+
_dbg_mxm_output(5, "========> Completing RECV req %p status %d\n", req, req->status.MPI_ERROR);
- _dbg_mxm_out_buf(REQ_FIELD(req, iov_buf)[0].ptr,
- (REQ_FIELD(req, iov_buf)[0].length >
- 16 ? 16 : REQ_FIELD(req, iov_buf)[0].length));
+ _dbg_mxm_out_buf(req_area->iov_buf[0].ptr,
+ (req_area->iov_buf[0].length >
+ 16 ? 16 : req_area->iov_buf[0].length));
if (req->dev.recv_data_sz <= userbuf_sz) {
data_sz = req->dev.recv_data_sz;
@@ -282,10 +284,10 @@ static int _mxm_handle_rreq(MPID_Request * req)
}
}
- if (REQ_FIELD(req, iov_count) > MXM_MPICH_MAX_IOV) {
- MPIU_Free(REQ_FIELD(req, iov_buf));
- REQ_FIELD(req, iov_buf) = REQ_FIELD(req, tmp_buf);
- REQ_FIELD(req, iov_count) = 0;
+ if (req_area->iov_count > MXM_MPICH_MAX_IOV) {
+ MPIU_Free(req_area->iov_buf);
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
}
MPIDI_CH3U_Handle_recv_req(vc, req, &complete);
@@ -299,24 +301,26 @@ static void _mxm_recv_completion_cb(void *context)
{
MPID_Request *req = (MPID_Request *) context;
mxm_recv_req_t *mxm_rreq;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIU_Assert(req);
- MPIU_Assert((req->kind == MPID_REQUEST_RECV) || (req->kind == MPID_PREQUEST_RECV));
_dbg_mxm_out_req(req);
- _mxm_to_mpi_status(REQ_FIELD(req, mxm_req->item.base.error), &req->status);
+ req_area = REQ_BASE(req);
+ _mxm_to_mpi_status(req_area->mxm_req->item.base.error, &req->status);
- mxm_rreq = &REQ_FIELD(req, mxm_req->item.recv);
+ mxm_rreq = &req_area->mxm_req->item.recv;
req->status.MPI_TAG = _mxm_tag_mxm2mpi(mxm_rreq->completion.sender_tag);
req->status.MPI_SOURCE = mxm_rreq->completion.sender_imm;
req->dev.recv_data_sz = mxm_rreq->completion.actual_len;
MPIR_STATUS_SET_COUNT(req->status, req->dev.recv_data_sz);
if (req->ch.vc) {
- list_enqueue(&VC_FIELD(req->ch.vc, mxm_ep->free_queue), &REQ_FIELD(req, mxm_req->queue));
+ MPID_nem_mxm_vc_area *vc_area = VC_BASE(req->ch.vc);
+ list_enqueue(&vc_area->mxm_ep->free_queue, &req_area->mxm_req->queue);
}
else {
- list_enqueue(&mxm_obj->free_queue, &REQ_FIELD(req, mxm_req->queue));
+ list_enqueue(&mxm_obj->free_queue, &req_area->mxm_req->queue);
}
if (likely(!MPIR_STATUS_GET_CANCEL_BIT(req->status))) {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
index 001908a..c5d6d8a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
@@ -19,13 +19,14 @@ int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, i
int mpi_errno = MPI_SUCCESS;
mxm_error_t err;
mxm_recv_req_t mxm_req;
+ MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
MPIDI_STATE_DECL(MPID_STATE_MXM_PROBE);
MPIDI_FUNC_ENTER(MPID_STATE_MXM_PROBE);
mxm_req.base.state = MXM_REQ_NEW;
mxm_req.base.mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
- mxm_req.base.conn = (vc ? VC_FIELD(vc, mxm_ep->mxm_conn) : 0);
+ mxm_req.base.conn = (vc_area ? vc_area->mxm_ep->mxm_conn : 0);
mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
mxm_req.tag_mask = _mxm_tag_mask(tag);
@@ -63,13 +64,14 @@ int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
int mpi_errno = MPI_SUCCESS;
mxm_error_t err;
mxm_recv_req_t mxm_req;
+ MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
MPIDI_STATE_DECL(MPID_STATE_MXM_IPROBE);
MPIDI_FUNC_ENTER(MPID_STATE_MXM_IPROBE);
mxm_req.base.state = MXM_REQ_NEW;
mxm_req.base.mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
- mxm_req.base.conn = (vc ? VC_FIELD(vc, mxm_ep->mxm_conn) : 0);
+ mxm_req.base.conn = (vc_area ? vc_area->mxm_ep->mxm_conn : 0);
mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
mxm_req.tag_mask = _mxm_tag_mask(tag);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
index fe13044..701ed35 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -19,10 +19,11 @@ static int _mxm_handle_sreq(MPID_Request * req);
static void _mxm_send_completion_cb(void *context);
static int _mxm_isend(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req,
int type, mxm_mq_h mxm_mq, int mxm_rank, int id, mxm_tag_t tag, int block);
+#if 0 /* Consider using this function in case non contiguous data */
static int _mxm_process_sdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
MPID_Datatype * dt_ptr, MPIDI_msg_sz_t data_sz, const void *buf,
int count, mxm_req_buffer_t ** iov_buf, int *iov_count);
-
+#endif
#undef FUNCNAME
#define FUNCNAME MPID_nem_mxm_iSendContig
@@ -32,6 +33,8 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
void *data, MPIDI_msg_sz_t data_sz)
{
int mpi_errno = MPI_SUCCESS;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISENDCONTIGMSG);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISENDCONTIGMSG);
@@ -42,27 +45,30 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MP
MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (void *) &(sreq->dev.pending_pkt);
- REQ_FIELD(sreq, iov_buf)[0].length = sizeof(MPIDI_CH3_Pkt_t);
- if (data_sz) {
- REQ_FIELD(sreq, iov_count) = 2;
- REQ_FIELD(sreq, iov_buf)[1].ptr = (void *) data;
- REQ_FIELD(sreq, iov_buf)[1].length = data_sz;
- }
-
_dbg_mxm_output(5,
"iSendContig ========> Sending ADI msg (to=%d type=%d) for req %p (data_size %d, %d) \n",
vc->pg_rank, sreq->dev.pending_pkt.type, sreq, sizeof(MPIDI_CH3_Pkt_t),
data_sz);
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area->ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (void *) &(sreq->dev.pending_pkt);
+ req_area->iov_buf[0].length = sizeof(MPIDI_CH3_Pkt_t);
+ if (data_sz) {
+ req_area->iov_count = 2;
+ req_area->iov_buf[1].ptr = (void *) data;
+ req_area->iov_buf[1].length = data_sz;
+ }
+
+ vc_area->pending_sends += 1;
sreq->ch.vc = vc;
sreq->ch.noncontig = FALSE;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_AM,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_AM,
mxm_obj->mxm_mq, mxm_obj->mxm_rank, MXM_MPICH_HID_ADI_MSG, 0, 0);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
@@ -84,6 +90,8 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
{
int mpi_errno = MPI_SUCCESS;
MPID_Request *sreq = NULL;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISTARTCONTIGMSG);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISTARTCONTIGMSG);
@@ -106,22 +114,25 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_
vc->pg_rank, sreq->dev.pending_pkt.type, sreq, sizeof(MPIDI_CH3_Pkt_t),
data_sz);
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (void *) &(sreq->dev.pending_pkt);
- REQ_FIELD(sreq, iov_buf)[0].length = sizeof(MPIDI_CH3_Pkt_t);
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area->ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (void *) &(sreq->dev.pending_pkt);
+ req_area->iov_buf[0].length = sizeof(MPIDI_CH3_Pkt_t);
if (data_sz) {
- REQ_FIELD(sreq, iov_count) = 2;
- REQ_FIELD(sreq, iov_buf)[1].ptr = (void *) data;
- REQ_FIELD(sreq, iov_buf)[1].length = data_sz;
+ req_area->iov_count = 2;
+ req_area->iov_buf[1].ptr = (void *) data;
+ req_area->iov_buf[1].length = data_sz;
}
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area->pending_sends += 1;
sreq->ch.vc = vc;
sreq->ch.noncontig = FALSE;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_AM,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_AM,
mxm_obj->mxm_mq, mxm_obj->mxm_rank, MXM_MPICH_HID_ADI_MSG, 0, 0);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
@@ -144,6 +155,8 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
{
int mpi_errno = MPI_SUCCESS;
MPIDI_msg_sz_t last;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SENDNONCONTIGMSG);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SENDNONCONTIGMSG);
@@ -158,11 +171,14 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
vc->pg_rank, sreq->dev.pending_pkt.type, sreq, sizeof(MPIDI_CH3_Pkt_t),
sreq->dev.segment_size);
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (void *) &(sreq->dev.pending_pkt);
- REQ_FIELD(sreq, iov_buf)[0].length = sizeof(MPIDI_CH3_Pkt_t);
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area->ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (void *) &(sreq->dev.pending_pkt);
+ req_area->iov_buf[0].length = sizeof(MPIDI_CH3_Pkt_t);
MPIU_Assert(sreq->dev.segment_first == 0);
last = sreq->dev.segment_size;
@@ -172,16 +188,16 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, sreq->dev.tmpbuf);
MPIU_Assert(last == sreq->dev.segment_size);
- REQ_FIELD(sreq, iov_count) = 2;
- REQ_FIELD(sreq, iov_buf)[1].ptr = sreq->dev.tmpbuf;
- REQ_FIELD(sreq, iov_buf)[1].length = last;
+ req_area->iov_count = 2;
+ req_area->iov_buf[1].ptr = sreq->dev.tmpbuf;
+ req_area->iov_buf[1].length = last;
}
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area->pending_sends += 1;
sreq->ch.vc = vc;
sreq->ch.noncontig = TRUE;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_AM,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_AM,
mxm_obj->mxm_mq, mxm_obj->mxm_rank, MXM_MPICH_HID_ADI_MSG, 0, 0);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
@@ -207,6 +223,8 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPI_Aint dt_true_lb;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SEND);
@@ -233,17 +251,20 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
"Send ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 0;
- REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
- REQ_FIELD(sreq, iov_buf)[0].length = 0;
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area->ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
+ req_area->iov_buf[0].ptr = NULL;
+ req_area->iov_buf[0].length = 0;
if (data_sz) {
if (dt_contig) {
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
- REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (char *) (buf) + dt_true_lb;
+ req_area->iov_buf[0].length = data_sz;
}
else {
MPIDI_msg_sz_t last;
@@ -261,17 +282,17 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
- REQ_FIELD(sreq, iov_buf)[0].length = last;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = sreq->dev.tmpbuf;
+ req_area->iov_buf[0].length = last;
}
sreq->ch.noncontig = TRUE;
}
}
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area->pending_sends += 1;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND,
(mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
comm->context_id
+
@@ -304,6 +325,8 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPI_Aint dt_true_lb;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SSEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SSEND);
@@ -330,17 +353,20 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
"sSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 0;
- REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
- REQ_FIELD(sreq, iov_buf)[0].length = 0;
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area->ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
+ req_area->iov_buf[0].ptr = NULL;
+ req_area->iov_buf[0].length = 0;
if (data_sz) {
if (dt_contig) {
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
- REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (char *) (buf) + dt_true_lb;
+ req_area->iov_buf[0].length = data_sz;
}
else {
MPIDI_msg_sz_t last;
@@ -358,17 +384,17 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
- REQ_FIELD(sreq, iov_buf)[0].length = last;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = sreq->dev.tmpbuf;
+ req_area->iov_buf[0].length = last;
}
sreq->ch.noncontig = TRUE;
}
}
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area->pending_sends += 1;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_SYNC,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_SYNC,
(mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
comm->context_id
+
@@ -401,6 +427,8 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPI_Aint dt_true_lb;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISEND);
@@ -427,17 +455,20 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
"iSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 0;
- REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
- REQ_FIELD(sreq, iov_buf)[0].length = 0;
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area->ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
+ req_area->iov_buf[0].ptr = NULL;
+ req_area->iov_buf[0].length = 0;
if (data_sz) {
if (dt_contig) {
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
- REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (char *) (buf) + dt_true_lb;
+ req_area->iov_buf[0].length = data_sz;
}
else {
MPIDI_msg_sz_t last;
@@ -455,17 +486,17 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatype
MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
- REQ_FIELD(sreq, iov_buf)[0].length = last;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = sreq->dev.tmpbuf;
+ req_area->iov_buf[0].length = last;
}
sreq->ch.noncontig = TRUE;
}
}
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area->pending_sends += 1;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND,
(mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
comm->context_id
+
@@ -499,6 +530,8 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatyp
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPI_Aint dt_true_lb;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISSEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISSEND);
@@ -525,17 +558,20 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatyp
"isSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
- REQ_FIELD(sreq, ctx) = sreq;
- REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
- REQ_FIELD(sreq, iov_count) = 0;
- REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
- REQ_FIELD(sreq, iov_buf)[0].length = 0;
+ vc_area = VC_BASE(vc);
+ req_area = REQ_BASE(sreq);
+
+ req_area-> ctx = sreq;
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
+ req_area->iov_buf[0].ptr = NULL;
+ req_area->iov_buf[0].length = 0;
if (data_sz) {
if (dt_contig) {
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
- REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = (char *) (buf) + dt_true_lb;
+ req_area->iov_buf[0].length = data_sz;
}
else {
MPIDI_msg_sz_t last;
@@ -553,17 +589,17 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, int count, MPI_Datatyp
MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
- REQ_FIELD(sreq, iov_count) = 1;
- REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
- REQ_FIELD(sreq, iov_buf)[0].length = last;
+ req_area->iov_count = 1;
+ req_area->iov_buf[0].ptr = sreq->dev.tmpbuf;
+ req_area->iov_buf[0].length = last;
}
sreq->ch.noncontig = TRUE;
}
}
- (VC_FIELD(vc, pending_sends)) += 1;
+ vc_area->pending_sends += 1;
- mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_SYNC,
+ mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_SYNC,
(mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
comm->context_id
+
@@ -587,21 +623,26 @@ static int _mxm_handle_sreq(MPID_Request * req)
{
int complete = FALSE;
int (*reqFn) (MPIDI_VC_t *, MPID_Request *, int *);
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
+
+ vc_area = VC_BASE(req->ch.vc);
+ req_area = REQ_BASE(req);
_dbg_mxm_output(5, "========> Completing SEND req %p status %d\n", req, req->status.MPI_ERROR);
- _dbg_mxm_out_buf(REQ_FIELD(req, iov_buf)[0].ptr,
- (REQ_FIELD(req, iov_buf)[0].length >
- 16 ? 16 : REQ_FIELD(req, iov_buf)[0].length));
+ _dbg_mxm_out_buf(req_area->iov_buf[0].ptr,
+ (req_area->iov_buf[0].length >
+ 16 ? 16 : req_area->iov_buf[0].length));
- (VC_FIELD(req->ch.vc, pending_sends)) -= 1;
+ vc_area->pending_sends -= 1;
if (((req->dev.datatype_ptr != NULL) && (req->dev.tmpbuf != NULL))) {
MPIU_Free(req->dev.tmpbuf);
}
- if (REQ_FIELD(req, iov_count) > MXM_MPICH_MAX_IOV) {
- MPIU_Free(REQ_FIELD(req, iov_buf));
- REQ_FIELD(req, iov_buf) = REQ_FIELD(req, tmp_buf);
- REQ_FIELD(req, iov_count) = 0;
+ if (req_area->iov_count > MXM_MPICH_MAX_IOV) {
+ MPIU_Free(req_area->iov_buf);
+ req_area->iov_buf = req_area->tmp_buf;
+ req_area->iov_count = 0;
}
reqFn = req->dev.OnDataAvail;
@@ -625,13 +666,18 @@ static int _mxm_handle_sreq(MPID_Request * req)
static void _mxm_send_completion_cb(void *context)
{
MPID_Request *req = (MPID_Request *) context;
+ MPID_nem_mxm_vc_area *vc_area = NULL;
+ MPID_nem_mxm_req_area *req_area = NULL;
MPIU_Assert(req);
_dbg_mxm_out_req(req);
- _mxm_to_mpi_status(REQ_FIELD(req, mxm_req->item.base.error), &req->status);
+ vc_area = VC_BASE(req->ch.vc);
+ req_area = REQ_BASE(req);
- list_enqueue(&VC_FIELD(req->ch.vc, mxm_ep->free_queue), &REQ_FIELD(req, mxm_req->queue));
+ _mxm_to_mpi_status(req_area->mxm_req->item.base.error, &req->status);
+
+ list_enqueue(&vc_area->mxm_ep->free_queue, &req_area->mxm_req->queue);
if (likely(!MPIR_STATUS_GET_CANCEL_BIT(req->status))) {
_mxm_handle_sreq(req);
@@ -718,7 +764,7 @@ static int _mxm_isend(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req,
goto fn_exit;
}
-
+#if 0 /* Consider using this function in case non contiguous data */
static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
MPID_Datatype * dt_ptr, MPIDI_msg_sz_t data_sz, const void *buf,
int count, mxm_req_buffer_t ** iov_buf, int *iov_count)
@@ -791,3 +837,4 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
fn_fail:
goto fn_exit;
}
+#endif
-----------------------------------------------------------------------
Summary of changes:
.../ch3/channels/nemesis/netmod/mxm/mxm_cancel.c | 17 +-
.../ch3/channels/nemesis/netmod/mxm/mxm_impl.h | 13 +-
.../ch3/channels/nemesis/netmod/mxm/mxm_init.c | 75 +++---
.../ch3/channels/nemesis/netmod/mxm/mxm_poll.c | 66 +++---
.../ch3/channels/nemesis/netmod/mxm/mxm_probe.c | 6 +-
.../ch3/channels/nemesis/netmod/mxm/mxm_send.c | 241 ++++++++++++--------
6 files changed, 235 insertions(+), 183 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list