Commit 4ac0ae2a authored by Pavan Balaji's avatar Pavan Balaji
Browse files

White space cleanup.

parent 1d429aaa
......@@ -21,7 +21,7 @@
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
/* returns zero in case request is canceled */
int MPID_nem_llc_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req)
int MPID_nem_llc_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req)
{
int canceled;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_CANCEL_RECV);
......@@ -29,11 +29,11 @@ int MPID_nem_llc_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req)
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_CANCEL_RECV);
/* returns zero in case request is canceled */
canceled = LLC_req_approve_recv((LLC_cmd_t *)REQ_FIELD(req, cmds));
canceled = LLC_req_approve_recv((LLC_cmd_t *) REQ_FIELD(req, cmds));
fn_exit:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_CANCEL_RECV);
return canceled;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -14,8 +14,7 @@
#define FUNCNAME MPID_nem_llc_finalize
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
MPID_nem_llc_finalize(void)
int MPID_nem_llc_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int rc;
......@@ -26,9 +25,9 @@ MPID_nem_llc_finalize(void)
rc = LLC_finalize();
MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
fn_exit:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_FINALIZE);
return mpi_errno;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -27,11 +27,10 @@ typedef GENERIC_Q_DECL(struct MPID_Request) rque_t;
typedef GENERIC_Q_DECL(struct MPID_Request) MPIDI_nem_llc_request_queue_t;
*/
typedef struct
{
typedef struct {
uint64_t remote_endpoint_addr;
void *endpoint;
rque_t send_queue; /* MPID_Request Queue */
rque_t send_queue; /* MPID_Request Queue */
unsigned int unsolicited_count;
} MPID_nem_llc_vc_area;
......@@ -52,10 +51,9 @@ typedef struct
VC_FIELD(vc, unsolicited_count)--; \
}
typedef struct
{
typedef struct {
void *cmds;
void *pack_buf; /* to pack non-contiguous data */
void *pack_buf; /* to pack non-contiguous data */
void *rma_buf;
} MPID_nem_llc_req_area;
......@@ -70,69 +68,71 @@ struct llc_cmd_area {
};
/* functions */
int MPID_nem_llc_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
int MPID_nem_llc_finalize (void);
int MPID_nem_llc_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
int MPID_nem_llc_finalize(void);
int MPID_nem_llc_poll(int in_blocking_progress);
int MPID_nem_llc_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p);
int MPID_nem_llc_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc);
int MPID_nem_llc_vc_init (MPIDI_VC_t *vc);
int MPID_nem_llc_vc_destroy(MPIDI_VC_t *vc);
int MPID_nem_llc_vc_terminate (MPIDI_VC_t *vc);
int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
int MPID_nem_llc_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag,
MPID_Request **message,MPI_Status *status);
int MPID_nem_llc_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz);
int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz, MPID_Request **sreq_ptr);
int MPID_nem_llc_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz);
int MPIDI_nem_llc_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume);
int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t *send_queue);
int MPID_nem_llc_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p);
int MPID_nem_llc_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc);
int MPID_nem_llc_vc_init(MPIDI_VC_t * vc);
int MPID_nem_llc_vc_destroy(MPIDI_VC_t * vc);
int MPID_nem_llc_vc_terminate(MPIDI_VC_t * vc);
int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag,
MPI_Status * status);
int MPID_nem_llc_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag,
MPID_Request ** message, MPI_Status * status);
int MPID_nem_llc_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
void *data, MPIDI_msg_sz_t data_sz);
int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
MPIDI_msg_sz_t data_sz, MPID_Request ** sreq_ptr);
int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
MPIDI_msg_sz_t hdr_sz);
int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume);
int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue);
int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int dest, int tag, MPID_Comm * comm, int context_offset,
struct MPID_Request **request);
int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request);
int dest, int tag, MPID_Comm * comm, int context_offset,
struct MPID_Request **request);
int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req);
int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
int length);
int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * buf, int length);
int MPID_nem_llc_kvs_get_binary(int from, const char *postfix, char *buf, int length);
void MPID_nem_llc_anysource_posted(MPID_Request *req);
int MPID_nem_llc_anysource_matched(MPID_Request *req);
int MPID_nem_llc_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
MPI_Status *status);
int MPID_nem_llc_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
int *flag, MPI_Status *status);
int MPID_nem_llc_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
int *flag, MPID_Request **message, MPI_Status *status);
int MPID_nem_llc_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req);
void MPID_nem_llc_anysource_posted(MPID_Request * req);
int MPID_nem_llc_anysource_matched(MPID_Request * req);
int MPID_nem_llc_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
MPI_Status * status);
int MPID_nem_llc_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
int *flag, MPI_Status * status);
int MPID_nem_llc_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
int *flag, MPID_Request ** message, MPI_Status * status);
int MPID_nem_llc_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req);
/*
* temporary llc api
*/
typedef void (*llc_send_f)(void *cba, uint64_t *reqid);
typedef void (*llc_send_f) (void *cba, uint64_t * reqid);
typedef void (*llc_recv_f)
(void *cba, uint64_t addr, void *buf, size_t bsz);
(void *cba, uint64_t addr, void *buf, size_t bsz);
extern ssize_t llc_writev(void *endpt, uint64_t raddr,
const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid);
const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid);
extern int llc_bind(void **vpp_endpt, uint64_t raddr, void *cbarg);
extern int llc_unbind(void *endpt);
extern int llc_poll(int in_blocking_poll,
llc_send_f sfnc, llc_recv_f rfnc);
extern int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc);
extern int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank);
extern int convert_rank_llc2mpi(MPID_Comm * comm, int llc_rank, int *mpi_rank);
typedef struct MPID_nem_llc_netmod_hdr {
int initiator_pg_rank;
#ifndef notdef_hsiz_hack
int reserved_for_alignment;
#endif /* notdef_hsiz_hack */
#endif /* notdef_hsiz_hack */
} MPID_nem_llc_netmod_hdr_t;
#define MPID_nem_llc_segv printf("%d\n", *(int32_t*)0);
#endif /* LLC_MODULE_IMPL_H */
#endif /* LLC_MODULE_IMPL_H */
......@@ -21,21 +21,21 @@
/* src/mpid/ch3/channels/nemesis/include/mpid_nem_nets.h */
MPID_nem_netmod_funcs_t MPIDI_nem_llc_funcs = {
.init = MPID_nem_llc_init,
.finalize = MPID_nem_llc_finalize,
.init = MPID_nem_llc_init,
.finalize = MPID_nem_llc_finalize,
#ifdef ENABLE_CHECKPOINTING
.ckpt_precheck = NULL,
.ckpt_restart = NULL,
.ckpt_continue = NULL,
.ckpt_precheck = NULL,
.ckpt_restart = NULL,
.ckpt_continue = NULL,
#endif
.poll = MPID_nem_llc_poll,
.get_business_card = MPID_nem_llc_get_business_card,
.connect_to_root = MPID_nem_llc_connect_to_root,
.vc_init = MPID_nem_llc_vc_init,
.vc_destroy = MPID_nem_llc_vc_destroy,
.vc_terminate = MPID_nem_llc_vc_terminate,
.anysource_iprobe = MPID_nem_llc_anysource_iprobe,
.anysource_improbe = MPID_nem_llc_anysource_improbe,
.poll = MPID_nem_llc_poll,
.get_business_card = MPID_nem_llc_get_business_card,
.connect_to_root = MPID_nem_llc_connect_to_root,
.vc_init = MPID_nem_llc_vc_init,
.vc_destroy = MPID_nem_llc_vc_destroy,
.vc_terminate = MPID_nem_llc_vc_terminate,
.anysource_iprobe = MPID_nem_llc_anysource_iprobe,
.anysource_improbe = MPID_nem_llc_anysource_improbe,
};
int MPID_nem_llc_my_llc_rank;
......@@ -44,8 +44,7 @@ int MPID_nem_llc_my_llc_rank;
#define FUNCNAME MPID_nem_llc_kvs_put_binary
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
int length)
int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * buf, int length)
{
int mpi_errno = MPI_SUCCESS;
int pmi_errno;
......@@ -122,9 +121,7 @@ int MPID_nem_llc_kvs_get_binary(int from, const char *postfix, char *buf, int le
#define FUNCNAME MPID_nem_llc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
MPID_nem_llc_init (MPIDI_PG_t *pg_p, int pg_rank,
char **bc_val_p, int *val_max_sz_p)
int MPID_nem_llc_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS, pmi_errno, llc_errno;
......@@ -141,10 +138,8 @@ MPID_nem_llc_init (MPIDI_PG_t *pg_p, int pg_rank,
/* Announce my LLC rank */
mpi_errno =
MPID_nem_llc_kvs_put_binary(pg_rank, "llc_rank",
(uint8_t *) & MPID_nem_llc_my_llc_rank,
sizeof(int));
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
"**MPID_nem_ib_kvs_put_binary");
(uint8_t *) & MPID_nem_llc_my_llc_rank, sizeof(int));
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_kvs_put_binary");
dprintf("llc_init,my_pg_rank=%d,my_llc_rank=%d\n",
MPIDI_Process.my_pg_rank, MPID_nem_llc_my_llc_rank);
......@@ -158,10 +153,10 @@ MPID_nem_llc_init (MPIDI_PG_t *pg_p, int pg_rank,
MPIDI_Anysource_improbe_fn = MPID_nem_llc_anysource_improbe;
fn_exit:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_INIT);
return mpi_errno;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -169,15 +164,14 @@ MPID_nem_llc_init (MPIDI_PG_t *pg_p, int pg_rank,
#define FUNCNAME MPID_nem_llc_get_business_card
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
MPID_nem_llc_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p)
int MPID_nem_llc_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_GET_BUSINESS_CARD);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_GET_BUSINESS_CARD);
fn_exit:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_GET_BUSINESS_CARD);
return mpi_errno;
//fn_fail:
......@@ -188,15 +182,14 @@ MPID_nem_llc_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p)
#define FUNCNAME MPID_nem_llc_connect_to_root
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
MPID_nem_llc_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
int MPID_nem_llc_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_CONNECT_TO_ROOT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_CONNECT_TO_ROOT);
fn_exit:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_CONNECT_TO_ROOT);
return mpi_errno;
//fn_fail:
......@@ -211,7 +204,8 @@ MPID_nem_llc_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
#define FUNCNAME MPID_nem_llc_anysource_iprobe
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag,
MPI_Status * status)
{
return MPID_nem_llc_iprobe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, status);
}
......@@ -221,7 +215,9 @@ int MPID_nem_llc_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset,
#define FUNCNAME MPID_nem_llc_anysource_improbe
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_llc_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
int MPID_nem_llc_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag,
MPID_Request ** message, MPI_Status * status)
{
return MPID_nem_llc_improbe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, message, status);
return MPID_nem_llc_improbe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, message,
status);
}
......@@ -18,38 +18,33 @@
/* function prototypes */
static void MPID_nem_llc_send_handler(void *cba,
uint64_t *p_reqid);
static void MPID_nem_llc_recv_handler(void *vp_vc,
uint64_t raddr, void *buf, size_t bsz);
static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid);
static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, size_t bsz);
#undef FUNCNAME
#define FUNCNAME MPID_nem_llc_poll
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
MPID_nem_llc_poll(int in_blocking_progress)
int MPID_nem_llc_poll(int in_blocking_progress)
{
int mpi_errno = MPI_SUCCESS;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_POLL);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_POLL);
{
int rc;
rc = llc_poll(in_blocking_progress,
MPID_nem_llc_send_handler,
MPID_nem_llc_recv_handler);
if (rc != 0) {
mpi_errno = MPI_ERR_OTHER;
MPIU_ERR_POP(mpi_errno);
}
int rc;
rc = llc_poll(in_blocking_progress, MPID_nem_llc_send_handler, MPID_nem_llc_recv_handler);
if (rc != 0) {
mpi_errno = MPI_ERR_OTHER;
MPIU_ERR_POP(mpi_errno);
}
}
fn_exit:
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_POLL);
return mpi_errno;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -57,12 +52,11 @@ MPID_nem_llc_poll(int in_blocking_progress)
#define FUNCNAME MPID_nem_llc_send_handler
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static void MPID_nem_llc_send_handler(void *cba,
uint64_t *p_reqid)
static void MPID_nem_llc_send_handler(void *cba, uint64_t * p_reqid)
{
/* int mpi_errno = 0; */
MPID_Request *sreq = cba; /* from llc_writev(,,,,cbarg,) */
MPID_Request_kind_t kind;
MPID_Request *sreq = cba; /* from llc_writev(,,,,cbarg,) */
MPID_Request_kind_t kind;
/* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
/* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
......@@ -71,106 +65,108 @@ static void MPID_nem_llc_send_handler(void *cba,
MPIU_Assert(sreq != NULL);
if (sreq == (void *)0xdeadbeefUL) {
MPIDI_VC_t *vc = (void *)p_reqid[0];
if (sreq == (void *) 0xdeadbeefUL) {
MPIDI_VC_t *vc = (void *) p_reqid[0];
MPID_nem_llc_vc_area *vc_llc;
MPIU_Assert(vc != NULL);
/* printf("from credit %p (pg_rank %d)\n", vc, vc->pg_rank); */
vc_llc = VC_LLC(vc);
MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
p_reqid[0] = ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue);
p_reqid[0] = !MPIDI_CH3I_Sendq_empty(vc_llc->send_queue);
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_send_handler");
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"send queue %d", (unsigned int)p_reqid[0]);
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "send queue %d", (unsigned int) p_reqid[0]);
goto fn_exit;
}
kind = sreq->kind;
switch (kind) {
unsigned int reqtype;
case MPID_REQUEST_SEND:
case MPID_PREQUEST_SEND: {
reqtype = MPIDI_Request_get_type(sreq);
/* Free temporal buffer for non-contiguous data.
* MPIDI_Request_create_sreq (in mpid_isend.c) sets req->dev.datatype.
* A control message has a req_type of MPIDI_REQUEST_TYPE_RECV and
* msg_type of MPIDI_REQUEST_EAGER_MSG because
* control message send follows
* MPIDI_CH3_iStartMsg/v-->MPID_nem_llc_iStartContigMsg-->MPID_nem_llc_iSendContig
* and MPID_nem_llc_iSendContig set req->dev.state to zero
* because MPID_Request_create (in src/mpid/ch3/src/ch3u_request.c)
* sets it to zero. In addition, eager-short message has req->comm of zero. */
case MPID_PREQUEST_SEND:{
reqtype = MPIDI_Request_get_type(sreq);
/* Free temporal buffer for non-contiguous data.
* MPIDI_Request_create_sreq (in mpid_isend.c) sets req->dev.datatype.
* A control message has a req_type of MPIDI_REQUEST_TYPE_RECV and
* msg_type of MPIDI_REQUEST_EAGER_MSG because
* control message send follows
* MPIDI_CH3_iStartMsg/v-->MPID_nem_llc_iStartContigMsg-->MPID_nem_llc_iSendContig
* and MPID_nem_llc_iSendContig set req->dev.state to zero
* because MPID_Request_create (in src/mpid/ch3/src/ch3u_request.c)
* sets it to zero. In addition, eager-short message has req->comm of zero. */
#ifndef notdef_leak_0001_hack
/* See also MPIDI_CH3_Request_create and _destory() */
/* in src/mpid/ch3/src/ch3u_request.c */
#endif /* notdef_leak_0001_hack */
if (reqtype != MPIDI_REQUEST_TYPE_RECV && sreq->comm) {
/* Exclude control messages which have MPIDI_REQUEST_TYPE_RECV.
* Note that RMA messages should be included.
* Exclude eager-short by requiring req->comm != 0. */
int is_contig;
MPID_Datatype_is_contig(sreq->dev.datatype, &is_contig);
if (!is_contig && REQ_FIELD(sreq, pack_buf)) {
dprintf("llc_send_handler,non-contiguous,free pack_buf\n");
MPIU_Free(REQ_FIELD(sreq, pack_buf));
/* See also MPIDI_CH3_Request_create and _destory() */
/* in src/mpid/ch3/src/ch3u_request.c */
#endif /* notdef_leak_0001_hack */
if (reqtype != MPIDI_REQUEST_TYPE_RECV && sreq->comm) {
/* Exclude control messages which have MPIDI_REQUEST_TYPE_RECV.
* Note that RMA messages should be included.
* Exclude eager-short by requiring req->comm != 0. */
int is_contig;
MPID_Datatype_is_contig(sreq->dev.datatype, &is_contig);
if (!is_contig && REQ_FIELD(sreq, pack_buf)) {
dprintf("llc_send_handler,non-contiguous,free pack_buf\n");
MPIU_Free(REQ_FIELD(sreq, pack_buf));
}
}
}
if ((REQ_FIELD(sreq, rma_buf) != NULL && sreq->dev.datatype_ptr && sreq->dev.segment_size > 0)) {
MPIU_Free(REQ_FIELD(sreq, rma_buf)); // allocated in MPID_nem_llc_SendNoncontig
REQ_FIELD(sreq, rma_buf) = NULL;
}
/* sreq: src/mpid/ch3/include/mpidpre.h */
{
MPIDI_VC_t *vc;
int (*reqFn)(MPIDI_VC_t *vc, MPID_Request *sreq, int *complete);
int complete;
int r_mpi_errno;
p_reqid[0] = 0 /* REQ_LLC(sreq)->woff */;
vc = sreq->ch.vc; /* before callback */
reqFn = sreq->dev.OnDataAvail;
if (reqFn == 0) {
MPIU_Assert(reqtype != MPIDI_REQUEST_TYPE_GET_RESP);
MPIDI_CH3U_Request_complete(sreq);
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
if ((REQ_FIELD(sreq, rma_buf) != NULL && sreq->dev.datatype_ptr &&
sreq->dev.segment_size > 0)) {
MPIU_Free(REQ_FIELD(sreq, rma_buf)); // allocated in MPID_nem_llc_SendNoncontig
REQ_FIELD(sreq, rma_buf) = NULL;
}
else {
complete = 0;
r_mpi_errno = reqFn(vc, sreq, &complete);
if (r_mpi_errno) MPIU_ERR_POP(r_mpi_errno);
if (complete == 0) {
MPIU_Assert(complete == TRUE);
}
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete2");
}
/* push queued messages */
/* sreq: src/mpid/ch3/include/mpidpre.h */
{
MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
MPIDI_VC_t *vc;
int (*reqFn) (MPIDI_VC_t * vc, MPID_Request * sreq, int *complete);
int complete;
int r_mpi_errno;
p_reqid[0] = 0 /* REQ_LLC(sreq)->woff */ ;
vc = sreq->ch.vc; /* before callback */
reqFn = sreq->dev.OnDataAvail;
if (reqFn == 0) {
MPIU_Assert(reqtype != MPIDI_REQUEST_TYPE_GET_RESP);
MPIDI_CH3U_Request_complete(sreq);
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
}
else {
complete = 0;
r_mpi_errno = reqFn(vc, sreq, &complete);
if (r_mpi_errno)
MPIU_ERR_POP(r_mpi_errno);
if (complete == 0) {
MPIU_Assert(complete == TRUE);
}
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete2");
}
/* push queued messages */
{
MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
}
}
break;
}
break; }
default:
printf("send_handler,unknown kind=%08x\n", sreq->kind);
MPID_nem_llc_segv;
break;
}
fn_exit:
fn_exit:
/* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
return /* mpi_errno */;
fn_fail:
return /* mpi_errno */ ;
fn_fail:
goto fn_exit;
}
......@@ -178,12 +174,7 @@ static void MPID_nem_llc_send_handler(void *cba,
#define FUNCNAME MPID_nem_llc_recv_handler
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static void MPID_nem_llc_recv_handler(
void *vp_vc,
uint64_t raddr,
void *buf,
size_t bsz
)
static void MPID_nem_llc_recv_handler(void *vp_vc, uint64_t raddr, void *buf, size_t bsz)
{
int mpi_errno = 0;
MPIDI_VC_t *vc = vp_vc;
......@@ -194,44 +185,41 @@ static void MPID_nem_llc_recv_handler(
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_recv_handler");
{
int pg_rank = (int) raddr;
MPIDI_PG_t *pg = MPIDI_Process.my_pg;
MPIDI_VC_t *vc_from_pg = 0;