[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b3-47-gf02bffb
Service Account
noreply at mpich.org
Thu Jun 11 01:28:32 CDT 2015
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 f02bffbe7a73d6cf073d7a4f33ef4e53bf8eb078 (commit)
via 4ac0ae2ab94990ff3d1c7ec86411477d40c683e7 (commit)
via 1d429aaa788a2a0a303466c2146952581f2f2441 (commit)
via 47a198a1f135be41b212bea8fe3d5b460178ee9e (commit)
via f5019b87833b49685922799bab44558117ca499b (commit)
via b4616189d5458a6e3ea676ee3927ae8ebd345107 (commit)
via 420aa4235d36e03ab9d44ed32a56c34b5e493b69 (commit)
via fbcad150b08bb6afdf2bdfc780339643a0f30d46 (commit)
via 9a48ceb5e2106023a60fe60e3122d8ec173ce5da (commit)
via d50aaa1db32a92a2ab1abac9481f921cc1144b44 (commit)
via bd18d4eb08a4c63b02245d224b27f9c1c3379324 (commit)
via ffd152c87db9c9da9321624342fc3ff0dc272fc0 (commit)
via be3e6ed8cac9de31e84655daa4e78001505acf27 (commit)
via c9dac7f92f05b35a1bafeee5fa61a03cb5370f92 (commit)
via b455f5bea6cff8947b9faebfd3e2e3b18812b323 (commit)
via 2cfc91c82b4557ca7929ae167a2edeb59eb8c07d (commit)
via fa86b9a4b4f3b24be5e6be6d7a6087301c309260 (commit)
via 5717e183d227edfefc9839fc9a93a35c77f2941e (commit)
via 4c69be3c998d2acc968d2e676ee60750936ddfa8 (commit)
via 430e9f4b06fd65553f9eb0f031ac6a9b2bcb6b83 (commit)
via 3b6058a8e098052d632ec49a3a5b44dc6bb88fe5 (commit)
via 8d4b6043faaf81c88b5aee0587dfc018f7c023ac (commit)
via 76a58dcb2e0f7ce6a8ee1f4953c1c468151232e0 (commit)
via 7e637ced66463d003f30d0e7c0fc199cae544955 (commit)
via 1210b71a35822bcf7a4ce6d2efe332cb5b1e28fe (commit)
via 96b4b7b323ff35e9732406fc4c3c86d98b7b75ff (commit)
via f96034aa5f31b107d697fc6c1aab743952017784 (commit)
via 3b1b0500eea64807b2464d7d453cfd0c481e2913 (commit)
via f94e850cb4f4ad7410d858134ef4e7695fc90181 (commit)
via 44f705288de2ab3063b535f1bc140ee4932e5f04 (commit)
via de26b71298dd7485f322059418bc078e49222c8b (commit)
via fbd66c66c9ad42a172baf4fb16d31c2b0fdca87d (commit)
via 708ff5f3004fdb3cd89d6b370910b69b6ebdafc7 (commit)
via 41e583976f9ad1960e0e821a144bdba243abac79 (commit)
via 1679ba2a4c46657dd0fc1b8b7cb67996f160f00a (commit)
from c38c3c798119fad98ed5dcacc4d0a27ffb93a449 (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/f02bffbe7a73d6cf073d7a4f33ef4e53bf8eb078
commit f02bffbe7a73d6cf073d7a4f33ef4e53bf8eb078
Author: Pavan Balaji <balaji at anl.gov>
Date: Thu Jun 11 01:21:29 2015 -0500
Fix llc Makefile file inclusions.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
index a031962..dce467c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
@@ -9,7 +9,7 @@ if BUILD_NEMESIS_NETMOD_LLC
# AM_CPPFLAGS += -I...
-lib_lib at MPILIBNAME@_la_SOURCES += \
+mpi_core_sources += \
src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c \
src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c \
src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c \
http://git.mpich.org/mpich.git/commitdiff/4ac0ae2ab94990ff3d1c7ec86411477d40c683e7
commit 4ac0ae2ab94990ff3d1c7ec86411477d40c683e7
Author: Pavan Balaji <balaji at anl.gov>
Date: Thu Jun 11 01:17:10 2015 -0500
White space cleanup.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
index 19fb7b4..0f20681 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
@@ -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;
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
index 5b9597f..c737e19 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
@@ -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;
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h
index df888c7..421fc0c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h
@@ -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 */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
index a246572..366940a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
@@ -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);
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
index 27f2fcf..44d419e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
@@ -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;
-
- if (
- (pg != 0)
- && ((pg_rank >= 0) && (pg_rank < MPIDI_PG_Get_size(pg)))
- ) {
- /*
- * MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
- */
- MPIDI_PG_Get_vc_set_active(pg, pg_rank, &vc_from_pg);
- }
- else {
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc %p or", pg);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank < %d",
- MPIDI_PG_Get_size(pg));
- vc_from_pg = vc; /* XXX */
- }
- if (vc != vc_from_pg) {
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
- }
- if (vc == 0) {
- vc = vc_from_pg;
- }
+ int pg_rank = (int) raddr;
+ MPIDI_PG_t *pg = MPIDI_Process.my_pg;
+ MPIDI_VC_t *vc_from_pg = 0;
+
+ if ((pg != 0)
+ && ((pg_rank >= 0) && (pg_rank < MPIDI_PG_Get_size(pg)))
+) {
+ /*
+ * MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
+ */
+ MPIDI_PG_Get_vc_set_active(pg, pg_rank, &vc_from_pg);
+ }
+ else {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc %p or", pg);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank < %d", MPIDI_PG_Get_size(pg));
+ vc_from_pg = vc; /* XXX */
+ }
+ if (vc != vc_from_pg) {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
+ }
+ if (vc == 0) {
+ vc = vc_from_pg;
+ }
}
if (vc != 0) {
mpi_errno = MPID_nem_handle_pkt(vc, buf, bsz);
- if (mpi_errno != 0) {
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "MPID_nem_handle_pkt() = %d", mpi_errno);
- }
+ if (mpi_errno != 0) {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "MPID_nem_handle_pkt() = %d", mpi_errno);
+ }
}
- fn_exit:
+ fn_exit:
/* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_RECV_HANDLER); */
- return ;
+ return;
//fn_fail:
goto fn_exit;
}
@@ -261,9 +249,11 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
/* Save data size for llc_poll */
req->dev.recv_data_sz = data_sz;
-#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
- dprintf("llc_recv_posted,%d<-%d,vc=%p,req=%p,user_buf=%p,data_sz=%ld,datatype=%08x,dt_contig=%d\n",
- MPIDI_Process.my_pg_rank, vc->pg_rank, vc, req, req->dev.user_buf, req->dev.recv_data_sz, req->dev.datatype, dt_contig);
+#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
+ dprintf
+ ("llc_recv_posted,%d<-%d,vc=%p,req=%p,user_buf=%p,data_sz=%ld,datatype=%08x,dt_contig=%d\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, vc, req, req->dev.user_buf, req->dev.recv_data_sz,
+ req->dev.datatype, dt_contig);
#endif
void *write_to_buf;
@@ -272,8 +262,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
}
else {
REQ_FIELD(req, pack_buf) = MPIU_Malloc(data_sz);
- MPIU_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER,
- "**outofmemory");
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
write_to_buf = REQ_FIELD(req, pack_buf);
}
@@ -281,7 +270,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
dprintf("llc_isend,LLC_my_rank=%d\n", LLC_my_rank);
-#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
+#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
dprintf("llc_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
#endif
@@ -289,51 +278,53 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
cmd[0].opcode = LLC_OPCODE_RECV;
cmd[0].comm = LLC_COMM_MPICH;
- cmd[0].req_id = (uint64_t)cmd;
-
+ cmd[0].req_id = (uint64_t) cmd;
+
if (req->dev.match.parts.rank == MPI_ANY_SOURCE) {
cmd[0].rank = LLC_ANY_SOURCE;
cmd[0].mask.rank = 0;
- } else {
+ }
+ else {
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
}
/* req->comm is set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
if (req->dev.match.parts.tag == MPI_ANY_TAG) {
- *(int32_t*)((uint8_t*)&cmd[0].tag) = LLC_ANY_TAG;
- *(int32_t*)((uint8_t*)&cmd[0].mask.tag) = 0;
+ *(int32_t *) ((uint8_t *) & cmd[0].tag) = LLC_ANY_TAG;
+ *(int32_t *) ((uint8_t *) & cmd[0].mask.tag) = 0;
}
else {
- *(int32_t*)((uint8_t*)&cmd[0].tag) = req->dev.match.parts.tag;
+ *(int32_t *) ((uint8_t *) & cmd[0].tag) = req->dev.match.parts.tag;
}
- *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ *(MPIR_Context_id_t *) ((uint8_t *) & cmd[0].tag + sizeof(int32_t)) =
req->dev.match.parts.context_id;
MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
- memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ memset((uint8_t *) & cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
dprintf("llc_recv_posted,tag=");
- for(i = 0; i < sizeof(LLC_tag_t); i++) {
- dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
+ for (i = 0; i < sizeof(LLC_tag_t); i++) {
+ dprintf("%02x", (int) *((uint8_t *) & cmd[0].tag + i));
}
dprintf("\n");
-
- cmd[0].iov_local[0].addr = (uint64_t)write_to_buf;
+
+ cmd[0].iov_local[0].addr = (uint64_t) write_to_buf;
cmd[0].iov_local[0].length = data_sz;
cmd[0].niov_local = 1;
-
+
cmd[0].iov_remote[0].addr = 0;
cmd[0].iov_remote[0].length = data_sz;;
cmd[0].niov_remote = 1;
-
- ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = req;
+
+ ((struct llc_cmd_area *) cmd[0].usr_area)->cbarg = req;
if (req->dev.match.parts.rank == MPI_ANY_SOURCE) {
- ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE; /* FIXME : should 0 ? */
- } else {
- ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = MPI_ANY_SOURCE; /* FIXME : should 0 ? */
+ }
+ else {
+ ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
}
REQ_FIELD(req, cmds) = cmd;
@@ -352,7 +343,7 @@ int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
#define FUNCNAME MPID_nem_llc_anysource_posted
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-void MPID_nem_llc_anysource_posted(MPID_Request *req)
+void MPID_nem_llc_anysource_posted(MPID_Request * req)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_AYSOURCE_POSTED);
@@ -368,7 +359,7 @@ void MPID_nem_llc_anysource_posted(MPID_Request *req)
#define FUNCNAME MPID_nem_llc_anysource_matched
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_llc_anysource_matched(MPID_Request *req)
+int MPID_nem_llc_anysource_matched(MPID_Request * req)
{
int matched = FALSE;
@@ -377,8 +368,8 @@ int MPID_nem_llc_anysource_matched(MPID_Request *req)
/* FIXME : How to call a cancel_recv function */
/* If LLC_postedq is still having this request, delete it.
- Ohterwise, return TURE */
- matched = LLC_req_approve_recv((LLC_cmd_t *)REQ_FIELD(req, cmds));
+ * Ohterwise, return TURE */
+ matched = LLC_req_approve_recv((LLC_cmd_t *) REQ_FIELD(req, cmds));
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ANYSOURCE_MATCHED);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
index 1892f3b..eaf151c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
@@ -21,8 +21,8 @@
#define FUNCNAME MPID_nem_llc_probe
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-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_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+ MPI_Status * status)
{
int mpi_errno = MPI_SUCCESS;
@@ -31,10 +31,10 @@ int MPID_nem_llc_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
dprintf("llc_probe,source=%d,tag=%d\n", source, tag);
/* NOTE : This function is not used. Because 'vc->comm_ops->probe()' is not used */
-fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_PROBE);
return mpi_errno;
-fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -42,8 +42,8 @@ fn_fail:
#define FUNCNAME MPID_nem_llc_iprobe
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-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_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+ int *flag, MPI_Status * status)
{
int mpi_errno = MPI_SUCCESS, llc_errno;
int rank;
@@ -59,21 +59,23 @@ int MPID_nem_llc_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
mask.tag = ~0;
if (tag == MPI_ANY_TAG) {
- *(int32_t*)((uint8_t *)&_tag) = LLC_ANY_TAG;
- *(int32_t*)((uint8_t *)&mask.tag) = 0;
- } else {
- *(int32_t*)((uint8_t *)&_tag) = tag;
+ *(int32_t *) ((uint8_t *) & _tag) = LLC_ANY_TAG;
+ *(int32_t *) ((uint8_t *) & mask.tag) = 0;
+ }
+ else {
+ *(int32_t *) ((uint8_t *) & _tag) = tag;
}
- *(MPIR_Context_id_t*)((uint8_t*)&_tag + sizeof(int32_t)) =
+ *(MPIR_Context_id_t *) ((uint8_t *) & _tag + sizeof(int32_t)) =
comm->recvcontext_id + context_offset;
- memset((uint8_t*)&_tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ memset((uint8_t *) & _tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
if (source == MPI_ANY_SOURCE) {
rank = LLC_ANY_SOURCE;
mask.rank = 0;
- } else {
+ }
+ else {
MPIU_Assert(vc);
rank = VC_FIELD(vc, remote_endpoint_addr);
}
@@ -84,23 +86,25 @@ int MPID_nem_llc_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
status->MPI_ERROR = MPI_SUCCESS;
if (source != MPI_ANY_SOURCE) {
status->MPI_SOURCE = source;
- } else {
+ }
+ else {
int found = 0;
found = convert_rank_llc2mpi(comm, probe.rank, &status->MPI_SOURCE);
MPIU_Assert(found);
- }
+ }
status->MPI_TAG = probe.tag & 0xffffffff;
MPIR_STATUS_SET_COUNT(*status, probe.len);
- } else {
+ }
+ else {
*flag = 0;
- MPID_Progress_poke(); /* do LLC_poll */
+ MPID_Progress_poke(); /* do LLC_poll */
}
-fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_IPROBE);
return mpi_errno;
-fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -108,8 +112,8 @@ fn_fail:
#define FUNCNAME MPID_nem_llc_improbe
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-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_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+ int *flag, MPID_Request ** message, MPI_Status * status)
{
int mpi_errno = MPI_SUCCESS;
int rank;
@@ -126,21 +130,23 @@ int MPID_nem_llc_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
mask.tag = ~0;
if (tag == MPI_ANY_TAG) {
- *(int32_t*)((uint8_t *)&_tag) = LLC_ANY_TAG;
- *(int32_t*)((uint8_t *)&mask.tag) = 0;
- } else {
- *(int32_t*)((uint8_t *)&_tag) = tag;
+ *(int32_t *) ((uint8_t *) & _tag) = LLC_ANY_TAG;
+ *(int32_t *) ((uint8_t *) & mask.tag) = 0;
+ }
+ else {
+ *(int32_t *) ((uint8_t *) & _tag) = tag;
}
- *(MPIR_Context_id_t*)((uint8_t*)&_tag + sizeof(int32_t)) =
+ *(MPIR_Context_id_t *) ((uint8_t *) & _tag + sizeof(int32_t)) =
comm->recvcontext_id + context_offset;
- memset((uint8_t*)&_tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ memset((uint8_t *) & _tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
if (source == MPI_ANY_SOURCE) {
rank = LLC_ANY_SOURCE;
mask.rank = 0;
- } else {
+ }
+ else {
MPIU_Assert(vc);
rank = VC_FIELD(vc, remote_endpoint_addr);
}
@@ -163,11 +169,12 @@ int MPID_nem_llc_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
req->status.MPI_ERROR = MPI_SUCCESS;
if (source != MPI_ANY_SOURCE) {
req->status.MPI_SOURCE = source;
- } else {
+ }
+ else {
int found = 0;
found = convert_rank_llc2mpi(comm, probe.rank, &req->status.MPI_SOURCE);
MPIU_Assert(found);
- }
+ }
req->status.MPI_TAG = probe.tag & 0xffffffff;
req->dev.recv_data_sz = probe.len;
MPIR_STATUS_SET_COUNT(req->status, req->dev.recv_data_sz);
@@ -177,25 +184,26 @@ int MPID_nem_llc_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
/* receive message in req->dev.tmpbuf */
LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
- cmd[0].opcode = 0; // not use
+ cmd[0].opcode = 0; // not use
cmd[0].comm = LLC_COMM_MPICH;
- cmd[0].req_id = (uint64_t)cmd;
+ cmd[0].req_id = (uint64_t) cmd;
cmd[0].rank = msg->rank;
// cmd[0].tag = 0; // not use
- cmd[0].iov_local[0].addr = (uint64_t)req->dev.tmpbuf;
+ cmd[0].iov_local[0].addr = (uint64_t) req->dev.tmpbuf;
cmd[0].iov_local[0].length = req->dev.recv_data_sz;
cmd[0].niov_local = 1;
cmd[0].iov_remote[0].addr = 0;
cmd[0].iov_remote[0].length = req->dev.recv_data_sz;
cmd[0].niov_remote = 1;
-
- ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = req;
+
+ ((struct llc_cmd_area *) cmd[0].usr_area)->cbarg = req;
if (source == MPI_ANY_SOURCE) {
- ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE;
- } else {
- ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = MPI_ANY_SOURCE;
+ }
+ else {
+ ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
}
LLC_recv_msg(cmd, msg);
@@ -214,17 +222,17 @@ int MPID_nem_llc_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
status->MPI_SOURCE = req->status.MPI_SOURCE;
status->MPI_TAG = req->status.MPI_TAG;
MPIR_STATUS_SET_COUNT(*status, req->dev.recv_data_sz);
- } else {
+ }
+ else {
*flag = 0;
*message = NULL;
- MPID_Progress_poke(); /* do LLC_poll */
+ MPID_Progress_poke(); /* do LLC_poll */
}
-fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_IMPROBE);
return mpi_errno;
-fn_fail:
+ fn_fail:
goto fn_exit;
}
-
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
index 87891a8..1c77ea2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
@@ -21,8 +21,8 @@
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
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 **req_out)
+ int dest, int tag, MPID_Comm * comm, int context_offset,
+ struct MPID_Request **req_out)
{
int mpi_errno = MPI_SUCCESS, llc_errno;
int dt_contig;
@@ -34,14 +34,16 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ISEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ISEND);
- dprintf("llc_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
- MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
+ dprintf
+ ("llc_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm,
+ context_offset);
int LLC_my_rank;
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
dprintf("llc_isend,LLC_my_rank=%d\n", LLC_my_rank);
- struct MPID_Request * sreq = MPID_Request_create();
+ struct MPID_Request *sreq = MPID_Request_create();
MPIU_Assert(sreq != NULL);
MPIU_Object_set_ref(sreq, 2);
sreq->kind = MPID_REQUEST_SEND;
@@ -56,12 +58,12 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
/* See also MPIDI_Request_create_sreq() */
/* in src/mpid/ch3/include/mpidimpl.h */
MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
-#endif /* notdef_leak_0002_hack */
+#endif /* notdef_leak_0002_hack */
sreq->dev.datatype = datatype;
#ifndef notdef_leak_0002_hack
sreq->comm = comm;
MPIR_Comm_add_ref(comm);
-#endif /* notdef_leak_0002_hack */
+#endif /* notdef_leak_0002_hack */
#ifndef notdef_scan_hack
/* used for MPI_Cancel() */
@@ -73,7 +75,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
sreq->dev.match.parts.rank = dest;
sreq->dev.match.parts.tag = tag;
sreq->dev.match.parts.context_id = comm->context_id + context_offset;
-#endif /* notdef_scan_hack */
+#endif /* notdef_scan_hack */
dprintf("llc_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
@@ -83,36 +85,34 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
cmd[0].opcode = LLC_OPCODE_SEND;
cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
- cmd[0].req_id = (uint64_t)cmd;
-
+ cmd[0].req_id = (uint64_t) cmd;
+
/* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
/* See src/mpid/ch3/src/mpid_isend.c */
- *(int32_t*)((uint8_t*)&cmd[0].tag) = tag;
- *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ *(int32_t *) ((uint8_t *) & cmd[0].tag) = tag;
+ *(MPIR_Context_id_t *) ((uint8_t *) & cmd[0].tag + sizeof(int32_t)) =
comm->context_id + context_offset;
MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
- memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ memset((uint8_t *) & cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
dprintf("llc_isend,tag=");
- for(i = 0; i < sizeof(LLC_tag_t); i++) {
- dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
+ for (i = 0; i < sizeof(LLC_tag_t); i++) {
+ dprintf("%02x", (int) *((uint8_t *) & cmd[0].tag + i));
}
dprintf("\n");
/* Prepare RDMA-write from buffer */
- MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
- dt_true_lb);
- dprintf("llc_isend,dt_contig=%d,data_sz=%ld\n",
- dt_contig, data_sz);
+ MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
+ dprintf("llc_isend,dt_contig=%d,data_sz=%ld\n", dt_contig, data_sz);
const void *write_from_buf;
if (dt_contig) {
- write_from_buf = (void *)((char *)buf + dt_true_lb);
+ write_from_buf = (void *) ((char *) buf + dt_true_lb);
#ifndef notdef_leak_0002_hack
REQ_FIELD(sreq, pack_buf) = 0;
-#endif /* notdef_leak_0002_hack */
+#endif /* notdef_leak_0002_hack */
}
else {
/* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
@@ -122,7 +122,7 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
/* See also MPIDI_CH3_Request_create and _destory() */
/* in src/mpid/ch3/src/ch3u_request.c */
sreq->dev.segment_ptr = segment_ptr;
-#endif /* notdef_leak_0001_hack */
+#endif /* notdef_leak_0001_hack */
MPID_Segment_init(buf, count, datatype, segment_ptr, 0);
MPIDI_msg_sz_t segment_first = 0;
@@ -130,25 +130,23 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
MPIDI_msg_sz_t last = segment_size;
MPIU_Assert(last > 0);
REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
- MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER,
- "**outofmemory");
- MPID_Segment_pack(segment_ptr, segment_first, &last,
- (char *) (REQ_FIELD(sreq, pack_buf)));
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+ MPID_Segment_pack(segment_ptr, segment_first, &last, (char *) (REQ_FIELD(sreq, pack_buf)));
MPIU_Assert(last == data_sz);
write_from_buf = REQ_FIELD(sreq, pack_buf);
}
- cmd[0].iov_local[0].addr = (uint64_t)write_from_buf;
+ cmd[0].iov_local[0].addr = (uint64_t) write_from_buf;
cmd[0].iov_local[0].length = data_sz;
cmd[0].niov_local = 1;
-
+
cmd[0].iov_remote[0].addr = 0;
cmd[0].iov_remote[0].length = data_sz;
cmd[0].niov_remote = 1;
-
- ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
- ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
-
+
+ ((struct llc_cmd_area *) cmd[0].usr_area)->cbarg = sreq;
+ ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+
llc_errno = LLC_post(cmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
@@ -164,7 +162,8 @@ int MPID_nem_llc_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Data
#define FUNCNAME MPID_nem_llc_iStartContigMsg
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-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_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 mpi_errno = MPI_SUCCESS;
MPID_Request *sreq = NULL;
@@ -179,21 +178,16 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_iStartContigMsg");
- MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "vc.pg_rank = %d", vc->pg_rank);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "hdr_sz = %d", (int)hdr_sz);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "data_sz = %d", (int)data_sz);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "hdr type = %d", ((MPIDI_CH3_Pkt_t *)hdr)->type);
+ MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "vc.pg_rank = %d", vc->pg_rank);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "hdr_sz = %d", (int) hdr_sz);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "data_sz = %d", (int) data_sz);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "hdr type = %d", ((MPIDI_CH3_Pkt_t *) hdr)->type);
/* create a request */
sreq = MPID_Request_create();
- MPIU_Assert (sreq != NULL);
+ MPIU_Assert(sreq != NULL);
MPIU_Object_set_ref(sreq, 2);
sreq->kind = MPID_REQUEST_SEND;
@@ -204,59 +198,55 @@ int MPID_nem_llc_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
REQ_FIELD(sreq, rma_buf) = NULL;
/* sreq: src/mpid/ch3/include/mpidpre.h */
- sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
- sreq->dev.iov[0].MPID_IOV_BUF =
- (MPID_IOV_BUF_CAST) &sreq->dev.pending_pkt;
- sreq->dev.iov[0].MPID_IOV_LEN = sizeof (MPIDI_CH3_Pkt_t);
+ sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) hdr;
+ sreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) & sreq->dev.pending_pkt;
+ sreq->dev.iov[0].MPID_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
sreq->dev.iov_count = 1;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPID_IOV_LEN);
if (data_sz > 0) {
- sreq->dev.iov[1].MPID_IOV_BUF = data;
- sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
- sreq->dev.iov_count = 2;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ sreq->dev.iov[1].MPID_IOV_BUF = data;
+ sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
+ sreq->dev.iov_count = 2;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int) sreq->dev.iov[0].MPID_IOV_LEN);
}
vc_llc = VC_LLC(vc);
- if ( ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue) ) {
- need_to_queue = 1;
- goto queue_it;
+ if (!MPIDI_CH3I_Sendq_empty(vc_llc->send_queue)) {
+ need_to_queue = 1;
+ goto queue_it;
}
{
- int ret;
-
- ret = llc_writev(vc_llc->endpoint,
- vc_llc->remote_endpoint_addr,
- sreq->dev.iov, sreq->dev.iov_count,
- sreq, &REQ_LLC(sreq)->cmds);
- if (ret < 0) {
- mpi_errno = MPI_ERR_OTHER;
- MPIU_ERR_POP(mpi_errno);
- }
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
- if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
- need_to_queue = 2; /* YYY */
- }
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ int ret;
+
+ ret = llc_writev(vc_llc->endpoint,
+ vc_llc->remote_endpoint_addr,
+ sreq->dev.iov, sreq->dev.iov_count, sreq, &REQ_LLC(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int) sreq->dev.iov[0].MPID_IOV_LEN);
+ if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
+ need_to_queue = 2; /* YYY */
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int) sreq->dev.iov[0].MPID_IOV_LEN);
}
-queue_it:
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "need_to_que %d", need_to_queue);
+ queue_it:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
if (need_to_queue > 0) {
- MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
+ MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
}
- fn_exit:
+ fn_exit:
*sreq_ptr = sreq;
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ISTARTCONTIGMSG);
return mpi_errno;
- fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -264,7 +254,8 @@ queue_it:
#define FUNCNAME MPID_nem_llc_iSendContig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-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_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 mpi_errno = MPI_SUCCESS;
MPID_nem_llc_vc_area *vc_llc = 0;
@@ -281,72 +272,65 @@ int MPID_nem_llc_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_iSendContig");
- MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
+ MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
MPIU_DBG_PKT(vc, hdr, "isendcontig");
{
- MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *)hdr;
+ MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *) hdr;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "pkt->type = %d", pkt->type);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "pkt->type = %d", pkt->type);
}
- MPIU_Assert (sreq != NULL);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "OnDataAvail= %p", sreq->dev.OnDataAvail);
+ MPIU_Assert(sreq != NULL);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "OnDataAvail= %p", sreq->dev.OnDataAvail);
sreq->ch.vc = vc;
sreq->dev.iov_offset = 0;
/* sreq: src/mpid/ch3/include/mpidpre.h */
- sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
- sreq->dev.iov[0].MPID_IOV_BUF =
- (MPID_IOV_BUF_CAST) &sreq->dev.pending_pkt;
- sreq->dev.iov[0].MPID_IOV_LEN = sizeof (MPIDI_CH3_Pkt_t);
+ sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) hdr;
+ sreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) & sreq->dev.pending_pkt;
+ sreq->dev.iov[0].MPID_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
sreq->dev.iov_count = 1;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPID_IOV_LEN);
if (data_sz > 0) {
- sreq->dev.iov[1].MPID_IOV_BUF = data;
- sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
- sreq->dev.iov_count = 2;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "IOV_LEN = %d", (int)sreq->dev.iov[1].MPID_IOV_LEN);
+ sreq->dev.iov[1].MPID_IOV_BUF = data;
+ sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
+ sreq->dev.iov_count = 2;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int) sreq->dev.iov[1].MPID_IOV_LEN);
}
vc_llc = VC_LLC(vc);
- if ( ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue) ) {
- need_to_queue = 1;
- goto queue_it;
+ if (!MPIDI_CH3I_Sendq_empty(vc_llc->send_queue)) {
+ need_to_queue = 1;
+ goto queue_it;
}
{
- int ret;
-
- ret = llc_writev(vc_llc->endpoint,
- vc_llc->remote_endpoint_addr,
- sreq->dev.iov, sreq->dev.iov_count,
- sreq, &REQ_LLC(sreq)->cmds);
- if (ret < 0) {
- mpi_errno = MPI_ERR_OTHER;
- MPIU_ERR_POP(mpi_errno);
- }
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "WRITEV() = %d", ret);
- if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
- need_to_queue = 2; /* YYY */
- }
+ int ret;
+
+ ret = llc_writev(vc_llc->endpoint,
+ vc_llc->remote_endpoint_addr,
+ sreq->dev.iov, sreq->dev.iov_count, sreq, &REQ_LLC(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "WRITEV() = %d", ret);
+ if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
+ need_to_queue = 2; /* YYY */
+ }
}
-queue_it:
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "need_to_que %d", need_to_queue);
+ queue_it:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
if (need_to_queue > 0) {
- MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
+ MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
}
- fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ISENDCONTIGMSG);
return mpi_errno;
- fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -354,7 +338,8 @@ queue_it:
#define FUNCNAME MPID_nem_llc_SendNoncontig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_llc_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
+int MPID_nem_llc_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
+ MPIDI_msg_sz_t hdr_sz)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
@@ -370,27 +355,28 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
MPIU_Assert(sreq->dev.segment_first == 0);
REQ_FIELD(sreq, rma_buf) = NULL;
- sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
- sreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) &sreq->dev.pending_pkt;
- sreq->dev.iov[0].MPID_IOV_LEN = sizeof (MPIDI_CH3_Pkt_t);
+ sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *) hdr;
+ sreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) & sreq->dev.pending_pkt;
+ sreq->dev.iov[0].MPID_IOV_LEN = sizeof(MPIDI_CH3_Pkt_t);
sreq->dev.iov_count = 1;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[0].MPID_IOV_LEN);
data_sz = sreq->dev.segment_size;
if (data_sz > 0) {
- REQ_FIELD(sreq, rma_buf) = MPIU_Malloc((size_t)sreq->dev.segment_size);
+ REQ_FIELD(sreq, rma_buf) = MPIU_Malloc((size_t) sreq->dev.segment_size);
MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, rma_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
- MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &data_sz, (char *)REQ_FIELD(sreq, rma_buf));
+ MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &data_sz,
+ (char *) REQ_FIELD(sreq, rma_buf));
sreq->dev.iov[1].MPID_IOV_BUF = REQ_FIELD(sreq, rma_buf);
sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
sreq->dev.iov_count = 2;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int)sreq->dev.iov[1].MPID_IOV_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int) sreq->dev.iov[1].MPID_IOV_LEN);
}
sreq->ch.vc = vc;
vc_llc = VC_LLC(vc);
- if ( ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue) ) {
+ if (!MPIDI_CH3I_Sendq_empty(vc_llc->send_queue)) {
need_to_queue = 1;
goto queue_it;
}
@@ -399,29 +385,28 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
int ret;
ret = llc_writev(vc_llc->endpoint,
- vc_llc->remote_endpoint_addr,
- sreq->dev.iov, sreq->dev.iov_count,
- sreq, &REQ_LLC(sreq)->cmds);
+ vc_llc->remote_endpoint_addr,
+ sreq->dev.iov, sreq->dev.iov_count, sreq, &REQ_LLC(sreq)->cmds);
if (ret < 0) {
mpi_errno = MPI_ERR_OTHER;
MPIU_ERR_POP(mpi_errno);
}
- if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
- need_to_queue = 2; /* YYY */
+ if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
+ need_to_queue = 2; /* YYY */
}
}
- queue_it:
+ queue_it:
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
if (need_to_queue > 0) {
MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
}
- fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
return mpi_errno;
- fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -429,7 +414,7 @@ int MPID_nem_llc_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
#define FUNCNAME MPID_nem_llc_send_queued
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
+int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t * send_queue)
{
int mpi_errno = MPI_SUCCESS;
MPID_nem_llc_vc_area *vc_llc;
@@ -441,40 +426,39 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
vc_llc = VC_LLC(vc);
MPIU_Assert(vc_llc != NULL);
- while ( ! MPIDI_CH3I_Sendq_empty(*send_queue) ) {
- ssize_t ret = 0;
- MPID_Request *sreq;
- void *endpt = vc_llc->endpoint;
- MPID_IOV *iovs;
- int niov;
-
- sreq = MPIDI_CH3I_Sendq_head(*send_queue);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "sreq %p", sreq);
-
- if (mpi_errno == MPI_SUCCESS) {
- iovs = &sreq->dev.iov[sreq->dev.iov_offset];
- niov = sreq->dev.iov_count;
-
- ret = llc_writev(endpt, vc_llc->remote_endpoint_addr,
- iovs, niov, sreq, &REQ_LLC(sreq)->cmds);
- if (ret < 0) {
- mpi_errno = MPI_ERR_OTHER;
- }
- }
- if (mpi_errno != MPI_SUCCESS) {
- MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
- sreq->status.MPI_ERROR = mpi_errno;
-
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "OnDataAvail = %p", sreq->dev.OnDataAvail);
- MPIDI_CH3U_Request_complete(sreq);
- continue;
- }
- if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "skip %p", sreq);
- break;
- }
- MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
+ while (!MPIDI_CH3I_Sendq_empty(*send_queue)) {
+ ssize_t ret = 0;
+ MPID_Request *sreq;
+ void *endpt = vc_llc->endpoint;
+ MPID_IOV *iovs;
+ int niov;
+
+ sreq = MPIDI_CH3I_Sendq_head(*send_queue);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "sreq %p", sreq);
+
+ if (mpi_errno == MPI_SUCCESS) {
+ iovs = &sreq->dev.iov[sreq->dev.iov_offset];
+ niov = sreq->dev.iov_count;
+
+ ret = llc_writev(endpt, vc_llc->remote_endpoint_addr,
+ iovs, niov, sreq, &REQ_LLC(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ }
+ }
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
+ sreq->status.MPI_ERROR = mpi_errno;
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "OnDataAvail = %p", sreq->dev.OnDataAvail);
+ MPIDI_CH3U_Request_complete(sreq);
+ continue;
+ }
+ if (!MPIDI_nem_llc_Rqst_iov_update(sreq, ret)) {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "skip %p", sreq);
+ break;
+ }
+ MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
}
fn_exit:
@@ -488,7 +472,7 @@ int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
#define FUNCNAME MPIDI_nem_llc_Rqst_iov_update
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_nem_llc_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
+int MPIDI_nem_llc_Rqst_iov_update(MPID_Request * mreq, MPIDI_msg_sz_t consume)
{
int ret = TRUE;
/* MPIDI_msg_sz_t oconsume = consume; */
@@ -499,63 +483,56 @@ int MPIDI_nem_llc_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
MPIU_Assert(consume >= 0);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : consume %d", (int)consume);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : iov_count %d", mreq->dev.iov_count);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : consume %d", (int) consume);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : iov_count %d", mreq->dev.iov_count);
nv = mreq->dev.iov_count;
for (iv = mreq->dev.iov_offset; iv < nv; iv++) {
- MPID_IOV *iov = &mreq->dev.iov[iv];
-
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : iov[iv] %d", iv);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : consume b %d", (int)consume);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : iov_len b %d", (int)iov->MPID_IOV_LEN);
- if (iov->MPID_IOV_LEN > consume) {
- iov->MPID_IOV_BUF = ((char *) iov->MPID_IOV_BUF) + consume;
- iov->MPID_IOV_LEN -= consume;
- consume = 0;
- ret = FALSE;
- break;
- }
- consume -= iov->MPID_IOV_LEN;
- iov->MPID_IOV_LEN = 0;
+ MPID_IOV *iov = &mreq->dev.iov[iv];
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : iov[iv] %d", iv);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : consume b %d", (int) consume);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : iov_len b %d", (int) iov->MPID_IOV_LEN);
+ if (iov->MPID_IOV_LEN > consume) {
+ iov->MPID_IOV_BUF = ((char *) iov->MPID_IOV_BUF) + consume;
+ iov->MPID_IOV_LEN -= consume;
+ consume = 0;
+ ret = FALSE;
+ break;
+ }
+ consume -= iov->MPID_IOV_LEN;
+ iov->MPID_IOV_LEN = 0;
}
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : consume %d", (int)consume);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : consume %d", (int) consume);
mreq->dev.iov_count = nv - iv;
mreq->dev.iov_offset = iv;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() = %d", ret);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_update() = %d", ret);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_LLC_RQST_IOV_UPDATE);
return ret;
}
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)
{
ssize_t nw = 0;
LLC_cmd_t *lcmd = 0;
#ifndef notdef_hsiz_hack
uint32_t bsiz;
-#endif /* notdef_hsiz_hack */
+#endif /* notdef_hsiz_hack */
dprintf("writev,raddr=%ld,niov=%d,sreq=%p", raddr, niov, cbarg);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev(%d)", (int)raddr);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev(%d)", (int) raddr);
{
uint8_t *buff = 0;
#ifdef notdef_hsiz_hack
uint32_t bsiz;
-#endif /* notdef_hsiz_hack */
+#endif /* notdef_hsiz_hack */
{
int iv, nv = niov;
@@ -572,42 +549,45 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
if (bsiz > 0) {
buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
if (buff == 0) {
- nw = -1; /* ENOMEM */
+ nw = -1; /* ENOMEM */
goto bad;
}
}
-#else /* notdef_hsiz_hack */
+#else /* notdef_hsiz_hack */
buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
if (buff == 0) {
- nw = -1; /* ENOMEM */
+ nw = -1; /* ENOMEM */
goto bad;
}
-#endif /* notdef_hsiz_hack */
+#endif /* notdef_hsiz_hack */
}
-
+
lcmd = LLC_cmd_alloc2(1, 1, 1);
if (lcmd == 0) {
- if (buff != 0) { MPIU_Free(buff); buff = 0; }
- nw = -1; /* ENOMEM */
+ if (buff != 0) {
+ MPIU_Free(buff);
+ buff = 0;
+ }
+ nw = -1; /* ENOMEM */
goto bad;
}
UNSOLICITED_NUM_INC(cbarg);
lcmd->opcode = LLC_OPCODE_UNSOLICITED;
lcmd->comm = LLC_COMM_MPICH;
- lcmd->rank = (uint32_t)raddr; /* XXX */
- lcmd->req_id = (uint64_t)lcmd;
-
- lcmd->iov_local[0].addr = (uintptr_t)buff;
+ lcmd->rank = (uint32_t) raddr; /* XXX */
+ lcmd->req_id = (uint64_t) lcmd;
+
+ lcmd->iov_local[0].addr = (uintptr_t) buff;
lcmd->iov_local[0].length = bsiz;
lcmd->niov_local = 1;
-
+
lcmd->iov_remote[0].addr = 0;
lcmd->iov_remote[0].length = bsiz;
lcmd->niov_remote = 1;
-
+
{
- struct llc_cmd_area *usr = (void *)lcmd->usr_area;
+ struct llc_cmd_area *usr = (void *) lcmd->usr_area;
usr->cbarg = cbarg;
usr->raddr = lcmd->rank;
}
@@ -617,45 +597,44 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
{
int iv, nv = niov;
char *bp;
- size_t bz;
+ size_t bz;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
- bp = (void *)lcmd->iov_local[0].addr;
- bz = lcmd->iov_local[0].length;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
+ bp = (void *) lcmd->iov_local[0].addr;
+ bz = lcmd->iov_local[0].length;
- /* Prepare netmod header */
- ((MPID_nem_llc_netmod_hdr_t*)bp)->initiator_pg_rank = MPIDI_Process.my_pg_rank;
- bp += sizeof(MPID_nem_llc_netmod_hdr_t);
+ /* Prepare netmod header */
+ ((MPID_nem_llc_netmod_hdr_t *) bp)->initiator_pg_rank = MPIDI_Process.my_pg_rank;
+ bp += sizeof(MPID_nem_llc_netmod_hdr_t);
#ifndef notdef_hsiz_hack
- lcmd->iov_local[0].length += sizeof (MPID_nem_llc_netmod_hdr_t);
- lcmd->iov_remote[0].length += sizeof (MPID_nem_llc_netmod_hdr_t);
-#endif /* notdef_hsiz_hack */
-
- /* Pack iovs into buff */
- for (iv = 0; iv < nv; iv++) {
- size_t len = iovs[iv].iov_len;
-
- if (len <= 0) {
- continue;
- }
- if (len > bz) {
- len = bz;
- }
- memcpy(bp, iovs[iv].iov_base, len);
- if ((bz -= len) <= 0) {
- break;
- }
- bp += len;
- }
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
- {
- void *bb = (void *)lcmd->iov_local[0].addr;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "wptr = %d", (int)(bp - (char *)bb));
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "blocklengt = %d", (int)lcmd->iov_local[0].length);
- MPIU_DBG_PKT(endpt, bb, "writev");
- }
+ lcmd->iov_local[0].length += sizeof(MPID_nem_llc_netmod_hdr_t);
+ lcmd->iov_remote[0].length += sizeof(MPID_nem_llc_netmod_hdr_t);
+#endif /* notdef_hsiz_hack */
+
+ /* Pack iovs into buff */
+ for (iv = 0; iv < nv; iv++) {
+ size_t len = iovs[iv].iov_len;
+
+ if (len <= 0) {
+ continue;
+ }
+ if (len > bz) {
+ len = bz;
+ }
+ memcpy(bp, iovs[iv].iov_base, len);
+ if ((bz -= len) <= 0) {
+ break;
+ }
+ bp += len;
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
+ {
+ void *bb = (void *) lcmd->iov_local[0].addr;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "wptr = %d", (int) (bp - (char *) bb));
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "blocklengt = %d", (int) lcmd->iov_local[0].length);
+ MPIU_DBG_PKT(endpt, bb, "writev");
+ }
}
{
int llc_errno;
@@ -666,7 +645,7 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
}
else {
if (lcmd->iov_local[0].addr != 0) {
- MPIU_Free((void *)lcmd->iov_local[0].addr);
+ MPIU_Free((void *) lcmd->iov_local[0].addr);
lcmd->iov_local[0].addr = 0;
}
(void) LLC_cmd_free(lcmd, 1);
@@ -676,22 +655,22 @@ ssize_t llc_writev(void *endpt, uint64_t raddr,
}
else {
#ifdef notdef_hsiz_hack
- nw = (ssize_t)lcmd->iov_local[0].length;
-#else /* notdef_hsiz_hack */
+ nw = (ssize_t) lcmd->iov_local[0].length;
+#else /* notdef_hsiz_hack */
nw = bsiz;
-#endif /* notdef_hsiz_hack */
+#endif /* notdef_hsiz_hack */
}
}
if (vpp_reqid != 0) {
vpp_reqid[0] = lcmd;
}
-
- bad:
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int)nw);
+
+ bad:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int) nw);
return nw;
}
-int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
+int convert_rank_llc2mpi(MPID_Comm * comm, int llc_rank, int *mpi_rank)
{
int size, rank;
int found = 0;
@@ -715,8 +694,9 @@ int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
found = 1;
break;
}
- } else if (llc_rank == VC_FIELD(vc, remote_endpoint_addr)) {
- *mpi_rank = rank; // rank number in the req->comm
+ }
+ else if (llc_rank == VC_FIELD(vc, remote_endpoint_addr)) {
+ *mpi_rank = rank; // rank number in the req->comm
found = 1;
break;
}
@@ -725,8 +705,7 @@ int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
return found;
}
-int llc_poll(int in_blocking_poll,
- llc_send_f sfnc, llc_recv_f rfnc)
+int llc_poll(int in_blocking_poll, llc_send_f sfnc, llc_recv_f rfnc)
{
int mpi_errno = MPI_SUCCESS;
@@ -734,230 +713,239 @@ int llc_poll(int in_blocking_poll,
int nevents;
LLC_event_t events[1];
- while(1) {
+ while (1) {
llc_errno = LLC_poll(LLC_COMM_MPICH, 1, events, &nevents);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_poll");
LLC_cmd_t *lcmd;
void *vp_sreq;
uint64_t reqid = 0;
-
- if(nevents == 0) {
+
+ if (nevents == 0) {
break;
}
MPIU_Assert(nevents == 1);
-
- switch(events[0].type) {
- case LLC_EVENT_SEND_LEFT: {
- dprintf("llc_poll,EVENT_SEND_LEFT\n");
- lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
- MPIU_Assert(lcmd != 0);
- MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND);
-
- if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
- printf("llc_poll,error_code=%d\n", events[0].side.initiator.error_code);
- MPID_nem_llc_segv;
- }
-
- /* Call send_handler. First arg is a pointer to MPID_Request */
- (*sfnc)(((struct llc_cmd_area *)lcmd->usr_area)->cbarg, &reqid);
-
- /* Don't free iov_local[0].addr */
-
- llc_errno = LLC_cmd_free(lcmd, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
- break; }
-
- case LLC_EVENT_UNSOLICITED_LEFT: {
- dprintf("llc_poll,EVENT_UNSOLICITED_LEFT\n");
- lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
- MPIU_Assert(lcmd != 0);
- MPIU_Assert(lcmd->opcode == LLC_OPCODE_UNSOLICITED);
-
- struct llc_cmd_area *usr;
- usr = (void *)lcmd->usr_area;
- vp_sreq = usr->cbarg;
-
- UNSOLICITED_NUM_DEC(vp_sreq);
-
- if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
- printf("llc_poll,error_code=%d\n", events[0].side.initiator.error_code);
- MPID_nem_llc_segv;
+
+ switch (events[0].type) {
+ case LLC_EVENT_SEND_LEFT:{
+ dprintf("llc_poll,EVENT_SEND_LEFT\n");
+ lcmd = (LLC_cmd_t *) events[0].side.initiator.req_id;
+ MPIU_Assert(lcmd != 0);
+ MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND);
+
+ if (events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
+ printf("llc_poll,error_code=%d\n", events[0].side.initiator.error_code);
+ MPID_nem_llc_segv;
+ }
+
+ /* Call send_handler. First arg is a pointer to MPID_Request */
+ (*sfnc) (((struct llc_cmd_area *) lcmd->usr_area)->cbarg, &reqid);
+
+ /* Don't free iov_local[0].addr */
+
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+ break;
}
- (*sfnc)(vp_sreq, &reqid);
-
- if (lcmd->iov_local[0].addr != 0) {
- MPIU_Free((void *)lcmd->iov_local[0].addr);
- lcmd->iov_local[0].addr = 0;
+
+ case LLC_EVENT_UNSOLICITED_LEFT:{
+ dprintf("llc_poll,EVENT_UNSOLICITED_LEFT\n");
+ lcmd = (LLC_cmd_t *) events[0].side.initiator.req_id;
+ MPIU_Assert(lcmd != 0);
+ MPIU_Assert(lcmd->opcode == LLC_OPCODE_UNSOLICITED);
+
+ struct llc_cmd_area *usr;
+ usr = (void *) lcmd->usr_area;
+ vp_sreq = usr->cbarg;
+
+ UNSOLICITED_NUM_DEC(vp_sreq);
+
+ if (events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
+ printf("llc_poll,error_code=%d\n", events[0].side.initiator.error_code);
+ MPID_nem_llc_segv;
+ }
+ (*sfnc) (vp_sreq, &reqid);
+
+ if (lcmd->iov_local[0].addr != 0) {
+ MPIU_Free((void *) lcmd->iov_local[0].addr);
+ lcmd->iov_local[0].addr = 0;
+ }
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+
+ break;
}
- llc_errno = LLC_cmd_free(lcmd, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
-
- break; }
- case LLC_EVENT_UNSOLICITED_ARRIVED: {
- void *vp_vc = 0;
- void *buff;
- size_t bsiz;
-
- buff = events[0].side.responder.addr;
- bsiz = events[0].side.responder.length;
+ case LLC_EVENT_UNSOLICITED_ARRIVED:{
+ void *vp_vc = 0;
+ void *buff;
+ size_t bsiz;
+
+ buff = events[0].side.responder.addr;
+ bsiz = events[0].side.responder.length;
#ifndef notdef_hsiz_hack
#if defined(__sparc__)
- MPIU_Assert(((uintptr_t)buff % 8) == 0);
+ MPIU_Assert(((uintptr_t) buff % 8) == 0);
#endif
-#endif /* notdef_hsiz_hack */
- {
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "LLC_leng = %d", (int)bsiz);
- MPIU_DBG_PKT(vp_vc, buff, "poll");
- }
- dprintf("llc_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
- MPIDI_Process.my_pg_rank,
- ((MPID_nem_llc_netmod_hdr_t*)buff)->initiator_pg_rank
- );
+#endif /* notdef_hsiz_hack */
+ {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "LLC_leng = %d", (int) bsiz);
+ MPIU_DBG_PKT(vp_vc, buff, "poll");
+ }
+ dprintf("llc_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
+ MPIDI_Process.my_pg_rank,
+ ((MPID_nem_llc_netmod_hdr_t *) buff)->initiator_pg_rank);
#ifdef notdef_hsiz_hack
- (*rfnc)(vp_vc,
- ((MPID_nem_llc_netmod_hdr_t*)buff)->initiator_pg_rank,
- (uint8_t*)buff + sizeof(MPID_nem_llc_netmod_hdr_t),
- bsiz);
-#else /* notdef_hsiz_hack */
- (*rfnc)(vp_vc,
- ((MPID_nem_llc_netmod_hdr_t*)buff)->initiator_pg_rank,
- (uint8_t*)buff + sizeof(MPID_nem_llc_netmod_hdr_t),
- bsiz - sizeof(MPID_nem_llc_netmod_hdr_t));
-#endif /* notdef_hsiz_hack */
- llc_errno = LLC_release_buffer(&events[0]);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
-
- break; }
- case LLC_EVENT_RECV_MATCHED: {
- dprintf("llc_poll,EVENT_RECV_MATCHED\n");
- lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
- MPID_Request *req = ((struct llc_cmd_area*)lcmd->usr_area)->cbarg;
-
- if (req->kind != MPID_REQUEST_MPROBE) {
- /* Unpack non-contiguous dt */
- int is_contig;
- MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
- if (!is_contig) {
- dprintf("llc_poll,unpack noncontiguous data to user buffer\n");
-
- /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
- /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
-
- /* set_request_info() sets req->dev.recv_data_sz to pkt->data_sz.
- * pkt->data_sz is sender's request size.
- */
- MPIDI_msg_sz_t unpack_sz = events[0].side.initiator.length;
- MPID_Segment seg;
- MPI_Aint last;
-
- /* user_buf etc. are set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, &seg,
- 0);
- last = unpack_sz;
- MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, pack_buf));
- if (last != unpack_sz) {
- /* --BEGIN ERROR HANDLING-- */
- /* received data was not entirely consumed by unpack()
- * because too few bytes remained to fill the next basic
- * datatype */
- MPIR_STATUS_SET_COUNT(req->status, last);
- req->status.MPI_ERROR =
- MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
- MPI_ERR_TYPE, "**llc_poll", 0);
- /* --END ERROR HANDLING-- */
+ (*rfnc) (vp_vc,
+ ((MPID_nem_llc_netmod_hdr_t *) buff)->initiator_pg_rank,
+ (uint8_t *) buff + sizeof(MPID_nem_llc_netmod_hdr_t), bsiz);
+#else /* notdef_hsiz_hack */
+ (*rfnc) (vp_vc,
+ ((MPID_nem_llc_netmod_hdr_t *) buff)->initiator_pg_rank,
+ (uint8_t *) buff + sizeof(MPID_nem_llc_netmod_hdr_t),
+ bsiz - sizeof(MPID_nem_llc_netmod_hdr_t));
+#endif /* notdef_hsiz_hack */
+ llc_errno = LLC_release_buffer(&events[0]);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
+
+ break;
+ }
+ case LLC_EVENT_RECV_MATCHED:{
+ dprintf("llc_poll,EVENT_RECV_MATCHED\n");
+ lcmd = (LLC_cmd_t *) events[0].side.initiator.req_id;
+ MPID_Request *req = ((struct llc_cmd_area *) lcmd->usr_area)->cbarg;
+
+ if (req->kind != MPID_REQUEST_MPROBE) {
+ /* Unpack non-contiguous dt */
+ int is_contig;
+ MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
+ if (!is_contig) {
+ dprintf("llc_poll,unpack noncontiguous data to user buffer\n");
+
+ /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
+ /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
+
+ /* set_request_info() sets req->dev.recv_data_sz to pkt->data_sz.
+ * pkt->data_sz is sender's request size.
+ */
+ MPIDI_msg_sz_t unpack_sz = events[0].side.initiator.length;
+ MPID_Segment seg;
+ MPI_Aint last;
+
+ /* user_buf etc. are set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype,
+ &seg, 0);
+ last = unpack_sz;
+ MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, pack_buf));
+ if (last != unpack_sz) {
+ /* --BEGIN ERROR HANDLING-- */
+ /* received data was not entirely consumed by unpack()
+ * because too few bytes remained to fill the next basic
+ * datatype */
+ MPIR_STATUS_SET_COUNT(req->status, last);
+ req->status.MPI_ERROR =
+ MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME,
+ __LINE__, MPI_ERR_TYPE, "**llc_poll", 0);
+ /* --END ERROR HANDLING-- */
+ }
+ dprintf("llc_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
+ REQ_FIELD(req, pack_buf));
+ MPIU_Free(REQ_FIELD(req, pack_buf));
+ }
+
+ req->status.MPI_TAG = events[0].side.initiator.tag & 0xffffffff;;
+ if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
+ req->status.MPI_SOURCE = req->dev.match.parts.rank;
+ }
+ else {
+ /* 'events[0].side.initiator.rank' is LLC rank.
+ * Convert it to a rank number in the communicator. */
+ int found = 0;
+ found =
+ convert_rank_llc2mpi(req->comm, events[0].side.initiator.rank,
+ &req->status.MPI_SOURCE);
+ MPIU_Assert(found);
+ }
+
+ if (unlikely(events[0].side.initiator.error_code == LLC_ERROR_TRUNCATE)) {
+ req->status.MPI_ERROR = MPI_ERR_TRUNCATE;
+ MPIR_STATUS_SET_COUNT(req->status, lcmd->iov_local[0].length);
+ }
+ else {
+ MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
}
- dprintf("llc_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
- REQ_FIELD(req, pack_buf));
- MPIU_Free(REQ_FIELD(req, pack_buf));
- }
- req->status.MPI_TAG = events[0].side.initiator.tag & 0xffffffff;;
- if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
- req->status.MPI_SOURCE = req->dev.match.parts.rank;
- } else {
- /* 'events[0].side.initiator.rank' is LLC rank.
- * Convert it to a rank number in the communicator. */
- int found = 0;
- found = convert_rank_llc2mpi(req->comm, events[0].side.initiator.rank, &req->status.MPI_SOURCE);
+ /* Dequeue request from posted queue.
+ * It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ int found = MPIDI_CH3U_Recvq_DP(req);
MPIU_Assert(found);
}
- if (unlikely(events[0].side.initiator.error_code == LLC_ERROR_TRUNCATE)) {
- req->status.MPI_ERROR = MPI_ERR_TRUNCATE;
- MPIR_STATUS_SET_COUNT(req->status, lcmd->iov_local[0].length);
- } else {
- MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
- }
+ /* Mark completion on rreq */
+ MPIDI_CH3U_Request_complete(req);
- /* Dequeue request from posted queue.
- It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- int found = MPIDI_CH3U_Recvq_DP(req);
- MPIU_Assert(found);
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+ break;
}
+ case LLC_EVENT_TARGET_PROC_FAIL:{
+ MPID_Request *req;
- /* Mark completion on rreq */
- MPIDI_CH3U_Request_complete(req);
-
- llc_errno = LLC_cmd_free(lcmd, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
- break; }
- case LLC_EVENT_TARGET_PROC_FAIL: {
- MPID_Request *req;
+ lcmd = (LLC_cmd_t *) events[0].side.initiator.req_id;
+ MPIU_Assert(lcmd != 0);
- lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
- MPIU_Assert(lcmd != 0);
+ req = ((struct llc_cmd_area *) lcmd->usr_area)->cbarg;
- req = ((struct llc_cmd_area*)lcmd->usr_area)->cbarg;
+ if (lcmd->opcode == LLC_OPCODE_UNSOLICITED) {
+ struct llc_cmd_area *usr;
+ usr = (void *) lcmd->usr_area;
+ vp_sreq = usr->cbarg;
- if (lcmd->opcode == LLC_OPCODE_UNSOLICITED) {
- struct llc_cmd_area *usr;
- usr = (void *)lcmd->usr_area;
- vp_sreq = usr->cbarg;
+ UNSOLICITED_NUM_DEC(vp_sreq);
- UNSOLICITED_NUM_DEC(vp_sreq);
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
- req->status.MPI_ERROR = MPI_SUCCESS;
- MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+ MPIDI_CH3U_Request_complete(req);
- MPIDI_CH3U_Request_complete(req);
-
- if (lcmd->iov_local[0].addr != 0) {
- MPIU_Free((void *)lcmd->iov_local[0].addr);
- lcmd->iov_local[0].addr = 0;
+ if (lcmd->iov_local[0].addr != 0) {
+ MPIU_Free((void *) lcmd->iov_local[0].addr);
+ lcmd->iov_local[0].addr = 0;
+ }
}
- } else if (lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND) {
- req->status.MPI_ERROR = MPI_SUCCESS;
- MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+ else if (lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND) {
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
- MPIDI_CH3U_Request_complete(req);
- } else if (lcmd->opcode == LLC_OPCODE_RECV) {
- /* Probably ch3 dequeued and completed this request. */
+ MPIDI_CH3U_Request_complete(req);
+ }
+ else if (lcmd->opcode == LLC_OPCODE_RECV) {
+ /* Probably ch3 dequeued and completed this request. */
#if 0
- MPIDI_CH3U_Recvq_DP(req);
- req->status.MPI_ERROR = MPI_SUCCESS;
- MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
- MPIDI_CH3U_Request_complete(req);
+ MPIDI_CH3U_Recvq_DP(req);
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+ MPIDI_CH3U_Request_complete(req);
#endif
- } else {
- printf("llc_poll,target dead, unknown opcode=%d\n", lcmd->opcode);
- MPID_nem_llc_segv;
- }
+ }
+ else {
+ printf("llc_poll,target dead, unknown opcode=%d\n", lcmd->opcode);
+ MPID_nem_llc_segv;
+ }
- llc_errno = LLC_cmd_free(lcmd, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
- break; }
+ break;
+ }
default:
printf("llc_poll,unknown event type=%d\n", events[0].type);
MPID_nem_llc_segv;
}
}
-
- fn_exit:
+
+ fn_exit:
return mpi_errno;
- fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -966,8 +954,8 @@ int llc_poll(int in_blocking_poll,
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
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 mpi_errno = MPI_SUCCESS, llc_errno;
int dt_contig;
@@ -979,14 +967,16 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ISSEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ISSEND);
- dprintf("llc_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
- MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
+ dprintf
+ ("llc_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm,
+ context_offset);
int LLC_my_rank;
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
dprintf("llc_isend,LLC_my_rank=%d\n", LLC_my_rank);
- struct MPID_Request * sreq = MPID_Request_create();
+ struct MPID_Request *sreq = MPID_Request_create();
MPIU_Assert(sreq != NULL);
MPIU_Object_set_ref(sreq, 2);
sreq->kind = MPID_REQUEST_SEND;
@@ -1020,33 +1010,31 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
cmd[0].opcode = LLC_OPCODE_SSEND;
cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
- cmd[0].req_id = (uint64_t)cmd;
+ cmd[0].req_id = (uint64_t) cmd;
/* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
/* See src/mpid/ch3/src/mpid_isend.c */
- *(int32_t*)((uint8_t*)&cmd[0].tag) = tag;
- *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ *(int32_t *) ((uint8_t *) & cmd[0].tag) = tag;
+ *(MPIR_Context_id_t *) ((uint8_t *) & cmd[0].tag + sizeof(int32_t)) =
comm->context_id + context_offset;
MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
- memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ memset((uint8_t *) & cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
dprintf("llc_isend,tag=");
- for(i = 0; i < sizeof(LLC_tag_t); i++) {
- dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
+ for (i = 0; i < sizeof(LLC_tag_t); i++) {
+ dprintf("%02x", (int) *((uint8_t *) & cmd[0].tag + i));
}
dprintf("\n");
/* Prepare RDMA-write from buffer */
- MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
- dt_true_lb);
- dprintf("llc_isend,dt_contig=%d,data_sz=%ld\n",
- dt_contig, data_sz);
+ MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
+ dprintf("llc_isend,dt_contig=%d,data_sz=%ld\n", dt_contig, data_sz);
const void *write_from_buf;
if (dt_contig) {
- write_from_buf = (void *)((char *)buf + dt_true_lb);
+ write_from_buf = (void *) ((char *) buf + dt_true_lb);
REQ_FIELD(sreq, pack_buf) = 0;
}
else {
@@ -1063,15 +1051,13 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
MPIDI_msg_sz_t last = segment_size;
MPIU_Assert(last > 0);
REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
- MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER,
- "**outofmemory");
- MPID_Segment_pack(segment_ptr, segment_first, &last,
- (char *) (REQ_FIELD(sreq, pack_buf)));
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+ MPID_Segment_pack(segment_ptr, segment_first, &last, (char *) (REQ_FIELD(sreq, pack_buf)));
MPIU_Assert(last == data_sz);
write_from_buf = REQ_FIELD(sreq, pack_buf);
}
- cmd[0].iov_local[0].addr = (uint64_t)write_from_buf;
+ cmd[0].iov_local[0].addr = (uint64_t) write_from_buf;
cmd[0].iov_local[0].length = data_sz;
cmd[0].niov_local = 1;
@@ -1079,8 +1065,8 @@ int MPID_nem_llc_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
cmd[0].iov_remote[0].length = data_sz;
cmd[0].niov_remote = 1;
- ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
- ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *) cmd[0].usr_area)->cbarg = sreq;
+ ((struct llc_cmd_area *) cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
llc_errno = LLC_post(cmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
index bf4c0ae..55e6c25 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
@@ -18,7 +18,7 @@
/* function prototypes */
-static int llc_vc_init (MPIDI_VC_t *vc);
+static int llc_vc_init(MPIDI_VC_t * vc);
static MPIDI_Comm_ops_t comm_ops = {
.recv_posted = MPID_nem_llc_recv_posted,
@@ -28,13 +28,13 @@ static MPIDI_Comm_ops_t comm_ops = {
.isend = MPID_nem_llc_isend,
.irsend = MPID_nem_llc_isend,
.issend = MPID_nem_llc_issend,
-
+
.send_init = NULL,
.bsend_init = NULL,
.rsend_init = NULL,
.ssend_init = NULL,
.startall = NULL,
-
+
.cancel_send = NULL,
.cancel_recv = MPID_nem_llc_cancel_recv,
@@ -47,21 +47,21 @@ static MPIDI_Comm_ops_t comm_ops = {
#define FUNCNAME MPID_nem_llc_vc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int
-MPID_nem_llc_vc_init (MPIDI_VC_t *vc)
+int MPID_nem_llc_vc_init(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_VC_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_VC_INIT);
- mpi_errno = llc_vc_init (vc);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ mpi_errno = llc_vc_init(vc);
+ if (mpi_errno)
+ MPIU_ERR_POP(mpi_errno);
- fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_INIT);
return mpi_errno;
- fn_fail:
+ fn_fail:
goto fn_exit;
}
@@ -69,7 +69,7 @@ MPID_nem_llc_vc_init (MPIDI_VC_t *vc)
#define FUNCNAME MPID_nem_llc_vc_destroy
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_llc_vc_destroy(MPIDI_VC_t *vc)
+int MPID_nem_llc_vc_destroy(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_VC_DESTROY);
@@ -78,9 +78,9 @@ int MPID_nem_llc_vc_destroy(MPIDI_VC_t *vc)
/* free any resources associated with this VC here */
{
- MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
+ MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
- vc_llc->endpoint = 0;
+ vc_llc->endpoint = 0;
}
/* wait until all UNSOLICITED are done */
@@ -88,7 +88,7 @@ int MPID_nem_llc_vc_destroy(MPIDI_VC_t *vc)
MPID_nem_llc_poll(1);
}
- fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_DESTROY);
return mpi_errno;
//fn_fail:
@@ -99,18 +99,18 @@ int MPID_nem_llc_vc_destroy(MPIDI_VC_t *vc)
#define FUNCNAME MPID_nem_llc_vc_terminate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_llc_vc_terminate (MPIDI_VC_t *vc)
+int MPID_nem_llc_vc_terminate(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_VC_TERMINATE);
-
+
dprintf("llc_vc_terminate,enter,%d->%d\n", MPIDI_Process.my_pg_rank, vc->pg_rank);
- mpi_errno = MPIDI_CH3U_Handle_connection (vc, MPIDI_VC_EVENT_TERMINATED);
+ mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
- fn_exit:
+ fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_TERMINATE);
return mpi_errno;
//fn_fail:
@@ -123,101 +123,97 @@ int MPID_nem_llc_vc_terminate (MPIDI_VC_t *vc)
#define FUNCNAME llc_vc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int llc_vc_init (MPIDI_VC_t *vc)
+static int llc_vc_init(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
-
+
{
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "MPID_NEM_VC_NETMOD_AREA_LEN = %d\n",
- MPID_NEM_VC_NETMOD_AREA_LEN);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "MPID_NEM_REQ_NETMOD_AREA_LEN = %d",
- MPID_NEM_REQ_NETMOD_AREA_LEN);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "MPID_nem_llc_vc_area = %d\n",
- (int) sizeof (MPID_nem_llc_vc_area));
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_NEM_VC_NETMOD_AREA_LEN = %d\n", MPID_NEM_VC_NETMOD_AREA_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_NEM_REQ_NETMOD_AREA_LEN = %d", MPID_NEM_REQ_NETMOD_AREA_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_nem_llc_vc_area = %d\n", (int) sizeof(MPID_nem_llc_vc_area));
}
/* MPIDI_CH3I_VC: src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h */
{
- MPIDI_CH3I_VC *vc_ch = &vc->ch;
- MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
-
- vc_llc->endpoint = vc;
- mpi_errno =
- MPID_nem_llc_kvs_get_binary(vc->pg_rank,
- "llc_rank",
- (char *) &vc_llc->remote_endpoint_addr,
- sizeof(int));
- MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
- "**MPID_nem_ib_kvs_get_binary");
- dprintf("llc_vc_init,my_pg_rank=%d,pg_rank=%d,my_llc_rank=%d,llc_rank=%ld\n",
- MPIDI_Process.my_pg_rank, vc->pg_rank, MPID_nem_llc_my_llc_rank, vc_llc->remote_endpoint_addr);
-
- vc_llc->send_queue.head = 0; /* GENERIC_Q_DECL */
- vc_llc->send_queue.tail = 0; /* GENERIC_Q_DECL */
-
- vc->eager_max_msg_sz = (12 * 1024);
- vc->ready_eager_max_msg_sz = (12 * 1024);
- /* vc->rndvSend_fn = 0*/
- /* vc->rndvRecv_fn = 0*/
- vc->sendNoncontig_fn = MPID_nem_llc_SendNoncontig;
+ MPIDI_CH3I_VC *vc_ch = &vc->ch;
+ MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
+
+ vc_llc->endpoint = vc;
+ mpi_errno =
+ MPID_nem_llc_kvs_get_binary(vc->pg_rank,
+ "llc_rank",
+ (char *) &vc_llc->remote_endpoint_addr, sizeof(int));
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPID_nem_ib_kvs_get_binary");
+ dprintf("llc_vc_init,my_pg_rank=%d,pg_rank=%d,my_llc_rank=%d,llc_rank=%ld\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, MPID_nem_llc_my_llc_rank,
+ vc_llc->remote_endpoint_addr);
+
+ vc_llc->send_queue.head = 0; /* GENERIC_Q_DECL */
+ vc_llc->send_queue.tail = 0; /* GENERIC_Q_DECL */
+
+ vc->eager_max_msg_sz = (12 * 1024);
+ vc->ready_eager_max_msg_sz = (12 * 1024);
+ /* vc->rndvSend_fn = 0 */
+ /* vc->rndvRecv_fn = 0 */
+ vc->sendNoncontig_fn = MPID_nem_llc_SendNoncontig;
#ifdef ENABLE_COMM_OVERRIDES
- vc->comm_ops = &comm_ops;
+ vc->comm_ops = &comm_ops;
#endif
- vc_ch->iStartContigMsg = MPID_nem_llc_iStartContigMsg;
- vc_ch->iSendContig = MPID_nem_llc_iSendContig;
+ vc_ch->iStartContigMsg = MPID_nem_llc_iStartContigMsg;
+ vc_ch->iSendContig = MPID_nem_llc_iSendContig;
#ifdef ENABLE_CHECKPOINTING
- vc_ch->ckpt_pause_send_vc = 0 /* MPID_nem_llc_ckpt_pause_send_vc */;
- vc_ch->ckpt_continue_vc = 0 /* MPID_nem_llc_ckpt_continue_vc */;
- vc_ch->ckpt_restart_vc = 0 /* = MPID_nem_llc_ckpt_restart_vc */;
+ vc_ch->ckpt_pause_send_vc = 0 /* MPID_nem_llc_ckpt_pause_send_vc */ ;
+ vc_ch->ckpt_continue_vc = 0 /* MPID_nem_llc_ckpt_continue_vc */ ;
+ vc_ch->ckpt_restart_vc = 0 /* = MPID_nem_llc_ckpt_restart_vc */ ;
#endif
- MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
+ MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
}
- fn_exit:
+ fn_exit:
return mpi_errno;
- fn_fail:
+ fn_fail:
goto fn_exit;
}
-#if 0 /* not use */
+#if 0 /* not use */
#undef FUNCNAME
#define FUNCNAME MPID_nem_llc_vc_prnt
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int MPID_nem_llc_vc_prnt(MPIDI_VC_t *vc)
+static int MPID_nem_llc_vc_prnt(MPIDI_VC_t * vc)
{
int mpi_errno = MPI_SUCCESS;
/* MPIU_OBJECT_HEADER; */
- /* src/include/mpihandlemem.h */
- /* int handle; */
- /* MPIU_THREAD_OBJECT_HOOK */
- /* MPIU_Handle_ref_count ref_count; */
+ /* src/include/mpihandlemem.h */
+ /* int handle; */
+ /* MPIU_THREAD_OBJECT_HOOK */
+ /* MPIU_Handle_ref_count ref_count; */
/* MPIDI_VC_State_t state; */
/* struct MPIDI_PG *pg; */
/* int pg_rank; */
/* int lpid; */
/* MPID_Node_id_t node_id; */
/* int port_name_tag; */
- /* MPID_Seqnum_t seqnum_send; */ /* MPID_USE_SEQUENCE_NUMBERS */
- /* MPID_Seqnum_t seqnum_recv; */ /* MPID_CH3_MSGS_UNORDERED */
+ /* MPID_Seqnum_t seqnum_send; *//* MPID_USE_SEQUENCE_NUMBERS */
+ /* MPID_Seqnum_t seqnum_recv; *//* MPID_CH3_MSGS_UNORDERED */
/* MPIDI_CH3_Pkt_send_container_t *msg_reorder_queue; */
/* int (*rndvSend_fn)(); */
/* int (*rndvRecv_fn)(); */
/* int eager_max_msg_sz; */
/* int ready_eager_max_msg_sz; */
/* int (*sendNonconfig_gn)(); */
- /* MPIDI_Comm_ops_t *comm_ops; */ /* ENABLE_COMM_OVERRIDES */
- /* MPIDI_CH3_VC_DECL */ /* MPIDI_CH3_VC_DECL */
- /* src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h */
+ /* MPIDI_Comm_ops_t *comm_ops; *//* ENABLE_COMM_OVERRIDES */
+ /* MPIDI_CH3_VC_DECL *//* MPIDI_CH3_VC_DECL */
+ /* src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h */
return mpi_errno;
}
http://git.mpich.org/mpich.git/commitdiff/1d429aaa788a2a0a303466c2146952581f2f2441
commit 1d429aaa788a2a0a303466c2146952581f2f2441
Author: Pavan Balaji <balaji at anl.gov>
Date: Thu Jun 11 01:13:36 2015 -0500
Renamed tofu to llc.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/Makefile.mk
index 3aed298..b7c17ee 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/netmod/Makefile.mk
@@ -12,3 +12,4 @@ include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/ib/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/mxm/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/ofi/Makefile.mk
+include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
new file mode 100644
index 0000000..a031962
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
@@ -0,0 +1,27 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+## See COPYRIGHT in top-level directory.
+##
+
+if BUILD_NEMESIS_NETMOD_LLC
+
+# AM_CPPFLAGS += -I...
+
+lib_lib at MPILIBNAME@_la_SOURCES += \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c \
+ $(EOA)
+
+noinst_HEADERS += \
+ src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h \
+ $(EOA)
+
+endif BUILD_NEMESIS_NETMOD_LLC
+
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/llc/errnames.txt
similarity index 94%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
rename to src/mpid/ch3/channels/nemesis/netmod/llc/errnames.txt
index 4be3371..312e843 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/errnames.txt
@@ -13,5 +13,5 @@
**PMI_KVS_Put:PMI_KVS_Put failed
**PMS_KVS_Get:PMS_KVS_Get failed
**fail:fail failed
-**llctofu_poll:llctofu_poll failed
+**llc_poll:llc_poll failed
**outofmemory:outofmemory failed
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
similarity index 57%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
index 6e554a2..19fb7b4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
@@ -7,32 +7,32 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
-//#define MPID_NEM_TOFU_DEBUG_PROBE
-#ifdef MPID_NEM_TOFU_DEBUG_PROBE
+//#define MPID_NEM_LLC_DEBUG_PROBE
+#ifdef MPID_NEM_LLC_DEBUG_PROBE
#define dprintf printf
#else
#define dprintf(...)
#endif
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_cancel_recv
+#define FUNCNAME MPID_nem_llc_cancel_recv
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
/* returns zero in case request is canceled */
-int MPID_nem_tofu_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_TOFU_CANCEL_RECV);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_CANCEL_RECV);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_CANCEL_RECV);
+ 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));
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_CANCEL_RECV);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_CANCEL_RECV);
return canceled;
fn_fail:
goto fn_exit;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
similarity index 62%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
index 82896a6..5b9597f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
@@ -7,27 +7,27 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_finalize
+#define FUNCNAME MPID_nem_llc_finalize
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
-MPID_nem_tofu_finalize(void)
+MPID_nem_llc_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int rc;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_FINALIZE);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_FINALIZE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_FINALIZE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_FINALIZE);
rc = LLC_finalize();
MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_FINALIZE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h
new file mode 100644
index 0000000..df888c7
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h
@@ -0,0 +1,138 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+
+#ifndef LLC_MODULE_IMPL_H
+#define LLC_MODULE_IMPL_H
+
+#ifdef USE_PMI2_API
+#include "pmi2.h"
+#else
+#include "pmi.h"
+#endif
+#include "mpid_nem_impl.h"
+#include "llc.h"
+
+extern int MPID_nem_llc_my_llc_rank;
+
+/* The vc provides a generic buffer in which network modules can store
+ * private fields This removes all dependencies from the VC struction
+ * on the network module, facilitating dynamic module loading. */
+
+/*
+ * GENERIC_Q_*:
+ * src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h
+ */
+typedef GENERIC_Q_DECL(struct MPID_Request) rque_t;
+/*
+typedef GENERIC_Q_DECL(struct MPID_Request) MPIDI_nem_llc_request_queue_t;
+ */
+
+typedef struct
+{
+ uint64_t remote_endpoint_addr;
+ void *endpoint;
+ rque_t send_queue; /* MPID_Request Queue */
+ unsigned int unsolicited_count;
+} MPID_nem_llc_vc_area;
+
+/* macro for llc private in VC */
+#define VC_LLC(vc) ((MPID_nem_llc_vc_area *)(vc)->ch.netmod_area.padding)
+#define VC_FIELD(vcp, field) (((MPID_nem_llc_vc_area *)(vc)->ch.netmod_area.padding)->field)
+
+#define UNSOLICITED_NUM_INC(req) \
+{ \
+ MPID_Request *sreq = req; \
+ MPIDI_VC_t *vc = sreq->ch.vc; \
+ VC_FIELD(vc, unsolicited_count)++; \
+}
+#define UNSOLICITED_NUM_DEC(req) \
+{ \
+ MPID_Request *sreq = req; \
+ MPIDI_VC_t *vc = sreq->ch.vc; \
+ VC_FIELD(vc, unsolicited_count)--; \
+}
+
+typedef struct
+{
+ void *cmds;
+ void *pack_buf; /* to pack non-contiguous data */
+
+ void *rma_buf;
+} MPID_nem_llc_req_area;
+
+#define REQ_LLC(req) \
+ ((MPID_nem_llc_req_area *)(&(req)->ch.netmod_area.padding))
+#define REQ_FIELD(reqp, field) (((MPID_nem_llc_req_area *)((reqp)->ch.netmod_area.padding))->field)
+
+struct llc_cmd_area {
+ void *cbarg;
+ uint32_t raddr;
+};
+
+/* 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_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_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 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 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_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);
+
+/*
+ * temporary llc api
+ */
+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);
+
+extern ssize_t llc_writev(void *endpt, uint64_t raddr,
+ 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 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 */
+} MPID_nem_llc_netmod_hdr_t;
+
+#define MPID_nem_llc_segv printf("%d\n", *(int32_t*)0);
+
+#endif /* LLC_MODULE_IMPL_H */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
similarity index 53%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
index 8d28176..a246572 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
@@ -7,10 +7,10 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
-//#define MPID_NEM_TOFU_DEBUG_INIT
-#ifdef MPID_NEM_TOFU_DEBUG_INIT
+//#define MPID_NEM_LLC_DEBUG_INIT
+#ifdef MPID_NEM_LLC_DEBUG_INIT
#define dprintf printf
#else
#define dprintf(...)
@@ -20,31 +20,31 @@
/* src/mpid/ch3/channels/nemesis/include/mpid_nem_nets.h */
-MPID_nem_netmod_funcs_t MPIDI_nem_tofu_funcs = {
- .init = MPID_nem_tofu_init,
- .finalize = MPID_nem_tofu_finalize,
+MPID_nem_netmod_funcs_t MPIDI_nem_llc_funcs = {
+ .init = MPID_nem_llc_init,
+ .finalize = MPID_nem_llc_finalize,
#ifdef ENABLE_CHECKPOINTING
.ckpt_precheck = NULL,
.ckpt_restart = NULL,
.ckpt_continue = NULL,
#endif
- .poll = MPID_nem_tofu_poll,
- .get_business_card = MPID_nem_tofu_get_business_card,
- .connect_to_root = MPID_nem_tofu_connect_to_root,
- .vc_init = MPID_nem_tofu_vc_init,
- .vc_destroy = MPID_nem_tofu_vc_destroy,
- .vc_terminate = MPID_nem_tofu_vc_terminate,
- .anysource_iprobe = MPID_nem_tofu_anysource_iprobe,
- .anysource_improbe = MPID_nem_tofu_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_tofu_my_llc_rank;
+int MPID_nem_llc_my_llc_rank;
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_kvs_put_binary
+#define FUNCNAME MPID_nem_llc_kvs_put_binary
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
+int MPID_nem_llc_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
int length)
{
int mpi_errno = MPI_SUCCESS;
@@ -53,8 +53,8 @@ int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t *
char key[256], val[256], str[256];
int j;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_KVS_PUT_BINARY);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_KVS_PUT_BINARY);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_KVS_PUT_BINARY);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_KVS_PUT_BINARY);
mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
@@ -71,17 +71,17 @@ int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t *
pmi_errno = PMI_KVS_Put(kvs_name, key, val);
MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMI_KVS_Put");
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_KVS_PUT_BINARY);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_KVS_PUT_BINARY);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_kvs_get_binary
+#define FUNCNAME MPID_nem_llc_kvs_get_binary
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int length)
+int MPID_nem_llc_kvs_get_binary(int from, const char *postfix, char *buf, int length)
{
int mpi_errno = MPI_SUCCESS;
int pmi_errno;
@@ -89,8 +89,8 @@ int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int l
char key[256], val[256], str[256];
int j;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_KVS_GET_BINARY);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_KVS_GET_BINARY);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_KVS_GET_BINARY);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_KVS_GET_BINARY);
mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
dprintf("kvs_get_binary,kvs_name=%s\n", kvs_name);
@@ -112,116 +112,116 @@ int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int l
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_KVS_GET_BINARY);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_KVS_GET_BINARY);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_init
+#define FUNCNAME MPID_nem_llc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
-MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank,
+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;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_INIT);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_INIT);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_INIT);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_INIT);
llc_errno = LLC_init(TYPE_MPI);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_init");
- llc_errno = LLC_comm_rank(LLC_COMM_MPICH, &MPID_nem_tofu_my_llc_rank);
+ llc_errno = LLC_comm_rank(LLC_COMM_MPICH, &MPID_nem_llc_my_llc_rank);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_comm_rank");
/* Announce my LLC rank */
mpi_errno =
- MPID_nem_tofu_kvs_put_binary(pg_rank, "llc_rank",
- (uint8_t *) & MPID_nem_tofu_my_llc_rank,
+ 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");
- dprintf("tofu_init,my_pg_rank=%d,my_llc_rank=%d\n",
- MPIDI_Process.my_pg_rank, MPID_nem_tofu_my_llc_rank);
+ dprintf("llc_init,my_pg_rank=%d,my_llc_rank=%d\n",
+ MPIDI_Process.my_pg_rank, MPID_nem_llc_my_llc_rank);
/* Wait until the key-value propagates among all ranks */
pmi_errno = PMI_Barrier();
MPIU_ERR_CHKANDJUMP(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**PMI_Barrier");
mpi_errno =
- MPIDI_CH3I_Register_anysource_notification(MPID_nem_tofu_anysource_posted,
- MPID_nem_tofu_anysource_matched);
+ MPIDI_CH3I_Register_anysource_notification(MPID_nem_llc_anysource_posted,
+ MPID_nem_llc_anysource_matched);
- MPIDI_Anysource_improbe_fn = MPID_nem_tofu_anysource_improbe;
+ MPIDI_Anysource_improbe_fn = MPID_nem_llc_anysource_improbe;
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_INIT);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_get_business_card
+#define FUNCNAME MPID_nem_llc_get_business_card
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
-MPID_nem_tofu_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p)
+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_TOFU_GET_BUSINESS_CARD);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_GET_BUSINESS_CARD);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_GET_BUSINESS_CARD);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_GET_BUSINESS_CARD);
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_GET_BUSINESS_CARD);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_GET_BUSINESS_CARD);
return mpi_errno;
//fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_connect_to_root
+#define FUNCNAME MPID_nem_llc_connect_to_root
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
-MPID_nem_tofu_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
+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_TOFU_CONNECT_TO_ROOT);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_CONNECT_TO_ROOT);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_CONNECT_TO_ROOT);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_CONNECT_TO_ROOT);
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_CONNECT_TO_ROOT);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_CONNECT_TO_ROOT);
return mpi_errno;
//fn_fail:
goto fn_exit;
}
/* ============================================== */
-/* ================ tofu_probe.c ================ */
+/* ================ llc_probe.c ================ */
/* ============================================== */
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_anysource_iprobe
+#define FUNCNAME MPID_nem_llc_anysource_iprobe
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_tofu_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_tofu_iprobe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, status);
+ return MPID_nem_llc_iprobe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, status);
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_anysource_improbe
+#define FUNCNAME MPID_nem_llc_anysource_improbe
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_tofu_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_tofu_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);
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
similarity index 69%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
index 3102d70..27f2fcf 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
@@ -7,10 +7,10 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
-//#define MPID_NEM_TOFU_DEBUG_POLL
-#ifdef MPID_NEM_TOFU_DEBUG_POLL
+//#define MPID_NEM_LLC_DEBUG_POLL
+#ifdef MPID_NEM_LLC_DEBUG_POLL
#define dprintf printf
#else
#define dprintf(...)
@@ -18,28 +18,28 @@
/* function prototypes */
-static void MPID_nem_tofu_send_handler(void *cba,
+static void MPID_nem_llc_send_handler(void *cba,
uint64_t *p_reqid);
-static void MPID_nem_tofu_recv_handler(void *vp_vc,
+static void MPID_nem_llc_recv_handler(void *vp_vc,
uint64_t raddr, void *buf, size_t bsz);
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_poll
+#define FUNCNAME MPID_nem_llc_poll
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
-MPID_nem_tofu_poll(int in_blocking_progress)
+MPID_nem_llc_poll(int in_blocking_progress)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_POLL);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_POLL);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_POLL);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_POLL);
{
int rc;
- rc = llctofu_poll(in_blocking_progress,
- MPID_nem_tofu_send_handler,
- MPID_nem_tofu_recv_handler);
+ 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);
@@ -47,42 +47,42 @@ MPID_nem_tofu_poll(int in_blocking_progress)
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_POLL);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_POLL);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_send_handler
+#define FUNCNAME MPID_nem_llc_send_handler
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static void MPID_nem_tofu_send_handler(void *cba,
+static void MPID_nem_llc_send_handler(void *cba,
uint64_t *p_reqid)
{
/* int mpi_errno = 0; */
- MPID_Request *sreq = cba; /* from llctofu_writev(,,,,cbarg,) */
+ MPID_Request *sreq = cba; /* from llc_writev(,,,,cbarg,) */
MPID_Request_kind_t kind;
- /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SEND_HANDLER); */
+ /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
- /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SEND_HANDLER); */
+ /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
- MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_send_handler");
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_send_handler");
MPIU_Assert(sreq != NULL);
if (sreq == (void *)0xdeadbeefUL) {
MPIDI_VC_t *vc = (void *)p_reqid[0];
- MPID_nem_tofu_vc_area *vc_tofu;
+ MPID_nem_llc_vc_area *vc_llc;
MPIU_Assert(vc != NULL);
/* printf("from credit %p (pg_rank %d)\n", vc, vc->pg_rank); */
- vc_tofu = VC_TOFU(vc);
- MPID_nem_tofu_send_queued(vc, &vc_tofu->send_queue);
+ vc_llc = VC_LLC(vc);
+ MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
- p_reqid[0] = ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue);
- MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_send_handler");
+ 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]);
@@ -101,8 +101,8 @@ static void MPID_nem_tofu_send_handler(void *cba,
* 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_tofu_iStartContigMsg-->MPID_nem_tofu_iSendContig
- * and MPID_nem_tofu_iSendContig set req->dev.state to zero
+ * 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
@@ -116,13 +116,13 @@ static void MPID_nem_tofu_send_handler(void *cba,
int is_contig;
MPID_Datatype_is_contig(sreq->dev.datatype, &is_contig);
if (!is_contig && REQ_FIELD(sreq, pack_buf)) {
- dprintf("tofu_send_handler,non-contiguous,free pack_buf\n");
+ 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_tofu_SendNoncontig
+ MPIU_Free(REQ_FIELD(sreq, rma_buf)); // allocated in MPID_nem_llc_SendNoncontig
REQ_FIELD(sreq, rma_buf) = NULL;
}
@@ -133,7 +133,7 @@ static void MPID_nem_tofu_send_handler(void *cba,
int complete;
int r_mpi_errno;
- p_reqid[0] = 0 /* REQ_TOFU(sreq)->woff */;
+ p_reqid[0] = 0 /* REQ_LLC(sreq)->woff */;
vc = sreq->ch.vc; /* before callback */
reqFn = sreq->dev.OnDataAvail;
@@ -155,30 +155,30 @@ static void MPID_nem_tofu_send_handler(void *cba,
/* push queued messages */
{
- MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
+ MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
- MPID_nem_tofu_send_queued(vc, &vc_tofu->send_queue);
+ MPID_nem_llc_send_queued(vc, &vc_llc->send_queue);
}
}
break; }
default:
printf("send_handler,unknown kind=%08x\n", sreq->kind);
- MPID_nem_tofu_segv;
+ MPID_nem_llc_segv;
break;
}
fn_exit:
- /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SEND_HANDLER); */
+ /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_SEND_HANDLER); */
return /* mpi_errno */;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_recv_handler
+#define FUNCNAME MPID_nem_llc_recv_handler
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static void MPID_nem_tofu_recv_handler(
+static void MPID_nem_llc_recv_handler(
void *vp_vc,
uint64_t raddr,
void *buf,
@@ -187,11 +187,11 @@ static void MPID_nem_tofu_recv_handler(
{
int mpi_errno = 0;
MPIDI_VC_t *vc = vp_vc;
- /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_RECV_HANDLER); */
+ /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_RECV_HANDLER); */
- /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_RECV_HANDLER); */
+ /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_RECV_HANDLER); */
- MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_recv_handler");
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_recv_handler");
{
int pg_rank = (int) raddr;
@@ -230,17 +230,17 @@ static void MPID_nem_tofu_recv_handler(
}
fn_exit:
- /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_RECV_HANDLER); */
+ /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_RECV_HANDLER); */
return ;
//fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_recv_posted
+#define FUNCNAME MPID_nem_llc_recv_posted
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
+int MPID_nem_llc_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
{
int mpi_errno = MPI_SUCCESS, llc_errno;
int dt_contig;
@@ -249,20 +249,20 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
MPI_Aint dt_true_lb;
int i;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_RECV_POSTED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_RECV_POSTED);
/* req->dev.datatype is set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, data_sz, dt_ptr,
dt_true_lb);
- /* Don't save VC because it's not used in llctofu_poll */
+ /* Don't save VC because it's not used in llc_poll */
- /* Save data size for llctofu_poll */
+ /* Save data size for llc_poll */
req->dev.recv_data_sz = data_sz;
#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
- dprintf("tofu_recv_posted,%d<-%d,vc=%p,req=%p,user_buf=%p,data_sz=%ld,datatype=%08x,dt_contig=%d\n",
+ dprintf("llc_recv_posted,%d<-%d,vc=%p,req=%p,user_buf=%p,data_sz=%ld,datatype=%08x,dt_contig=%d\n",
MPIDI_Process.my_pg_rank, vc->pg_rank, vc, req, req->dev.user_buf, req->dev.recv_data_sz, req->dev.datatype, dt_contig);
#endif
@@ -279,10 +279,10 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
int LLC_my_rank;
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
- dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+ dprintf("llc_isend,LLC_my_rank=%d\n", LLC_my_rank);
#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
- dprintf("tofu_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+ dprintf("llc_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
#endif
LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
@@ -314,7 +314,7 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
- dprintf("tofu_recv_posted,tag=");
+ dprintf("llc_recv_posted,tag=");
for(i = 0; i < sizeof(LLC_tag_t); i++) {
dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
}
@@ -329,11 +329,11 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
cmd[0].iov_remote[0].length = data_sz;;
cmd[0].niov_remote = 1;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = req;
+ ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = req;
if (req->dev.match.parts.rank == MPI_ANY_SOURCE) {
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE; /* FIXME : should 0 ? */
+ ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE; /* FIXME : should 0 ? */
} else {
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
}
REQ_FIELD(req, cmds) = cmd;
@@ -342,45 +342,45 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_RECV_POSTED);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_anysource_posted
+#define FUNCNAME MPID_nem_llc_anysource_posted
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-void MPID_nem_tofu_anysource_posted(MPID_Request *req)
+void MPID_nem_llc_anysource_posted(MPID_Request *req)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_AYSOURCE_POSTED);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_AYSOURCE_POSTED);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_AYSOURCE_POSTED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_AYSOURCE_POSTED);
- mpi_errno = MPID_nem_tofu_recv_posted(NULL, req);
+ mpi_errno = MPID_nem_llc_recv_posted(NULL, req);
MPIU_Assert(mpi_errno == MPI_SUCCESS);
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_AYSOURCE_POSTED);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_AYSOURCE_POSTED);
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_anysource_matched
+#define FUNCNAME MPID_nem_llc_anysource_matched
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_anysource_matched(MPID_Request *req)
+int MPID_nem_llc_anysource_matched(MPID_Request *req)
{
int matched = FALSE;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ANYSOURCE_MATCHED);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ANYSOURCE_MATCHED);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ANYSOURCE_MATCHED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ANYSOURCE_MATCHED);
/* FIXME : How to call a cancel_recv function */
/* If LLC_postedq is still having this request, delete it.
Ohterwise, return TURE */
matched = LLC_req_approve_recv((LLC_cmd_t *)REQ_FIELD(req, cmds));
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ANYSOURCE_MATCHED);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ANYSOURCE_MATCHED);
return matched;
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
similarity index 78%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
index ac25659..1892f3b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
@@ -7,10 +7,10 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
-//#define MPID_NEM_TOFU_DEBUG_PROBE
-#ifdef MPID_NEM_TOFU_DEBUG_PROBE
+//#define MPID_NEM_LLC_DEBUG_PROBE
+#ifdef MPID_NEM_LLC_DEBUG_PROBE
#define dprintf printf
#else
#define dprintf(...)
@@ -18,31 +18,31 @@
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_probe
+#define FUNCNAME MPID_nem_llc_probe
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+int MPID_nem_llc_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
MPI_Status *status)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_PROBE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_PROBE);
- dprintf("tofu_probe,source=%d,tag=%d\n", source, tag);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_PROBE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_PROBE);
+ dprintf("llc_probe,source=%d,tag=%d\n", source, tag);
/* NOTE : This function is not used. Because 'vc->comm_ops->probe()' is not used */
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_PROBE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_PROBE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_iprobe
+#define FUNCNAME MPID_nem_llc_iprobe
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+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 mpi_errno = MPI_SUCCESS, llc_errno;
@@ -51,9 +51,9 @@ int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
LLC_probe_t probe;
LLC_match_mask_t mask;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_IPROBE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_IPROBE);
- dprintf("tofu_iprobe,source=%d,tag=%d\n", source, tag);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_IPROBE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_IPROBE);
+ dprintf("llc_iprobe,source=%d,tag=%d\n", source, tag);
mask.rank = ~0;
mask.tag = ~0;
@@ -98,17 +98,17 @@ int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_IPROBE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_IPROBE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_improbe
+#define FUNCNAME MPID_nem_llc_improbe
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+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 mpi_errno = MPI_SUCCESS;
@@ -118,9 +118,9 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
LLC_match_mask_t mask;
LLC_cmd_t *msg = NULL;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_IMPROBE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_IMPROBE);
- dprintf("tofu_improbe,source=%d,tag=%d\n", source, tag);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_IMPROBE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_IMPROBE);
+ dprintf("llc_improbe,source=%d,tag=%d\n", source, tag);
mask.rank = ~0;
mask.tag = ~0;
@@ -191,21 +191,21 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
cmd[0].iov_remote[0].length = req->dev.recv_data_sz;
cmd[0].niov_remote = 1;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = req;
+ ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = req;
if (source == MPI_ANY_SOURCE) {
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE;
+ ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE;
} else {
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
}
LLC_recv_msg(cmd, msg);
/* Wait until the reception of data is completed */
do {
- mpi_errno = MPID_nem_tofu_poll(0);
+ mpi_errno = MPID_nem_llc_poll(0);
} while (!MPID_Request_is_complete(req));
-// MPIDI_CH3U_Request_complete(req); // This operation is done in llctofu_poll.
+// MPIDI_CH3U_Request_complete(req); // This operation is done in llc_poll.
*message = req;
@@ -222,7 +222,7 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_IMPROBE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_IMPROBE);
return mpi_errno;
fn_fail:
goto fn_exit;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
similarity index 79%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
index 3fab77e..87891a8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
@@ -7,20 +7,20 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
-//#define MPID_NEM_TOFU_DEBUG_SEND
-#ifdef MPID_NEM_TOFU_DEBUG_SEND
+//#define MPID_NEM_LLC_DEBUG_SEND
+#ifdef MPID_NEM_LLC_DEBUG_SEND
#define dprintf printf
#else
#define dprintf(...)
#endif
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_isend
+#define FUNCNAME MPID_nem_llc_isend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+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 **req_out)
{
@@ -31,22 +31,22 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
MPI_Aint dt_true_lb;
int i;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISEND);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISEND);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ISEND);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ISEND);
- dprintf("tofu_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
+ dprintf("llc_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
int LLC_my_rank;
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
- dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+ dprintf("llc_isend,LLC_my_rank=%d\n", LLC_my_rank);
struct MPID_Request * sreq = MPID_Request_create();
MPIU_Assert(sreq != NULL);
MPIU_Object_set_ref(sreq, 2);
sreq->kind = MPID_REQUEST_SEND;
- /* Used in tofullc_poll --> MPID_nem_tofu_send_handler */
+ /* Used in llc_poll --> MPID_nem_llc_send_handler */
sreq->ch.vc = vc;
sreq->dev.OnDataAvail = 0;
/* Don't save iov_offset because it's not used. */
@@ -75,7 +75,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
sreq->dev.match.parts.context_id = comm->context_id + context_offset;
#endif /* notdef_scan_hack */
- dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+ dprintf("llc_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
REQ_FIELD(sreq, rma_buf) = NULL;
@@ -94,7 +94,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
- dprintf("tofu_isend,tag=");
+ dprintf("llc_isend,tag=");
for(i = 0; i < sizeof(LLC_tag_t); i++) {
dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
}
@@ -103,7 +103,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
/* Prepare RDMA-write from buffer */
MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
dt_true_lb);
- dprintf("tofu_isend,dt_contig=%d,data_sz=%ld\n",
+ dprintf("llc_isend,dt_contig=%d,data_sz=%ld\n",
dt_contig, data_sz);
@@ -146,39 +146,39 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
cmd[0].iov_remote[0].length = data_sz;
cmd[0].niov_remote = 1;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
+ ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
llc_errno = LLC_post(cmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
fn_exit:
*req_out = sreq;
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISEND);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ISEND);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_iStartContigMsg
+#define FUNCNAME MPID_nem_llc_iStartContigMsg
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_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_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 mpi_errno = MPI_SUCCESS;
MPID_Request *sreq = NULL;
- MPID_nem_tofu_vc_area *vc_tofu = 0;
+ MPID_nem_llc_vc_area *vc_llc = 0;
int need_to_queue = 0;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ISTARTCONTIGMSG);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ISTARTCONTIGMSG);
- dprintf("tofu_iStartContigMsg,%d->%d,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
+ dprintf("llc_iStartContigMsg,%d->%d,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
MPIDI_Process.my_pg_rank, vc->pg_rank, hdr, hdr_sz, data, data_sz);
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
- MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_iStartContigMsg");
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_iStartContigMsg");
MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"vc.pg_rank = %d", vc->pg_rank);
@@ -219,8 +219,8 @@ int MPID_nem_tofu_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_
"IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
}
- vc_tofu = VC_TOFU(vc);
- if ( ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue) ) {
+ vc_llc = VC_LLC(vc);
+ if ( ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue) ) {
need_to_queue = 1;
goto queue_it;
}
@@ -228,17 +228,17 @@ int MPID_nem_tofu_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_
{
int ret;
- ret = llctofu_writev(vc_tofu->endpoint,
- vc_tofu->remote_endpoint_addr,
+ ret = llc_writev(vc_llc->endpoint,
+ vc_llc->remote_endpoint_addr,
sreq->dev.iov, sreq->dev.iov_count,
- sreq, &REQ_TOFU(sreq)->cmds);
+ sreq, &REQ_LLC(sreq)->cmds);
if (ret < 0) {
mpi_errno = MPI_ERR_OTHER;
MPIU_ERR_POP(mpi_errno);
}
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
- if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
need_to_queue = 2; /* YYY */
}
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
@@ -249,38 +249,38 @@ queue_it:
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"need_to_que %d", need_to_queue);
if (need_to_queue > 0) {
- MPIDI_CH3I_Sendq_enqueue(&vc_tofu->send_queue, sreq);
+ MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
}
fn_exit:
*sreq_ptr = sreq;
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ISTARTCONTIGMSG);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_iSendContig
+#define FUNCNAME MPID_nem_llc_iSendContig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_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_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 mpi_errno = MPI_SUCCESS;
- MPID_nem_tofu_vc_area *vc_tofu = 0;
+ MPID_nem_llc_vc_area *vc_llc = 0;
int need_to_queue = 0;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ISENDCONTIGMSG);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ISENDCONTIGMSG);
if (sreq->kind == MPID_REQUEST_UNDEFINED) {
sreq->kind = MPID_REQUEST_SEND;
}
- dprintf("tofu_iSendConitig,sreq=%p,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
+ dprintf("llc_iSendConitig,sreq=%p,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
sreq, hdr, hdr_sz, data, data_sz);
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
- MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_iSendContig");
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_iSendContig");
MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
MPIU_DBG_PKT(vc, hdr, "isendcontig");
{
@@ -312,8 +312,8 @@ int MPID_nem_tofu_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPI
"IOV_LEN = %d", (int)sreq->dev.iov[1].MPID_IOV_LEN);
}
- vc_tofu = VC_TOFU(vc);
- if ( ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue) ) {
+ vc_llc = VC_LLC(vc);
+ if ( ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue) ) {
need_to_queue = 1;
goto queue_it;
}
@@ -321,17 +321,17 @@ int MPID_nem_tofu_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPI
{
int ret;
- ret = llctofu_writev(vc_tofu->endpoint,
- vc_tofu->remote_endpoint_addr,
+ ret = llc_writev(vc_llc->endpoint,
+ vc_llc->remote_endpoint_addr,
sreq->dev.iov, sreq->dev.iov_count,
- sreq, &REQ_TOFU(sreq)->cmds);
+ sreq, &REQ_LLC(sreq)->cmds);
if (ret < 0) {
mpi_errno = MPI_ERR_OTHER;
MPIU_ERR_POP(mpi_errno);
}
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"WRITEV() = %d", ret);
- if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
need_to_queue = 2; /* YYY */
}
}
@@ -340,31 +340,31 @@ queue_it:
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"need_to_que %d", need_to_queue);
if (need_to_queue > 0) {
- MPIDI_CH3I_Sendq_enqueue(&vc_tofu->send_queue, sreq);
+ MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ISENDCONTIGMSG);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_SendNoncontig
+#define FUNCNAME MPID_nem_llc_SendNoncontig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
+int MPID_nem_llc_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG);
- MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_SendNoncontig");
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "llc_SendNoncontig");
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
MPIDI_msg_sz_t data_sz;
- MPID_nem_tofu_vc_area *vc_tofu = 0;
+ MPID_nem_llc_vc_area *vc_llc = 0;
int need_to_queue = 0;
MPIU_Assert(sreq->dev.segment_first == 0);
@@ -389,8 +389,8 @@ int MPID_nem_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, M
}
sreq->ch.vc = vc;
- vc_tofu = VC_TOFU(vc);
- if ( ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue) ) {
+ vc_llc = VC_LLC(vc);
+ if ( ! MPIDI_CH3I_Sendq_empty(vc_llc->send_queue) ) {
need_to_queue = 1;
goto queue_it;
}
@@ -398,16 +398,16 @@ int MPID_nem_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, M
{
int ret;
- ret = llctofu_writev(vc_tofu->endpoint,
- vc_tofu->remote_endpoint_addr,
+ ret = llc_writev(vc_llc->endpoint,
+ vc_llc->remote_endpoint_addr,
sreq->dev.iov, sreq->dev.iov_count,
- sreq, &REQ_TOFU(sreq)->cmds);
+ sreq, &REQ_LLC(sreq)->cmds);
if (ret < 0) {
mpi_errno = MPI_ERR_OTHER;
MPIU_ERR_POP(mpi_errno);
}
- if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
need_to_queue = 2; /* YYY */
}
}
@@ -415,36 +415,36 @@ int MPID_nem_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, M
queue_it:
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
if (need_to_queue > 0) {
- MPIDI_CH3I_Sendq_enqueue(&vc_tofu->send_queue, sreq);
+ MPIDI_CH3I_Sendq_enqueue(&vc_llc->send_queue, sreq);
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_SENDNONCONTIG);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_send_queued
+#define FUNCNAME MPID_nem_llc_send_queued
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
+int MPID_nem_llc_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
{
int mpi_errno = MPI_SUCCESS;
- MPID_nem_tofu_vc_area *vc_tofu;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SEND_QUEUED);
+ MPID_nem_llc_vc_area *vc_llc;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_SEND_QUEUED);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SEND_QUEUED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_SEND_QUEUED);
MPIU_Assert(vc != NULL);
- vc_tofu = VC_TOFU(vc);
- MPIU_Assert(vc_tofu != NULL);
+ vc_llc = VC_LLC(vc);
+ MPIU_Assert(vc_llc != NULL);
while ( ! MPIDI_CH3I_Sendq_empty(*send_queue) ) {
ssize_t ret = 0;
MPID_Request *sreq;
- void *endpt = vc_tofu->endpoint;
+ void *endpt = vc_llc->endpoint;
MPID_IOV *iovs;
int niov;
@@ -455,8 +455,8 @@ int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
iovs = &sreq->dev.iov[sreq->dev.iov_offset];
niov = sreq->dev.iov_count;
- ret = llctofu_writev(endpt, vc_tofu->remote_endpoint_addr,
- iovs, niov, sreq, &REQ_TOFU(sreq)->cmds);
+ ret = llc_writev(endpt, vc_llc->remote_endpoint_addr,
+ iovs, niov, sreq, &REQ_LLC(sreq)->cmds);
if (ret < 0) {
mpi_errno = MPI_ERR_OTHER;
}
@@ -470,7 +470,7 @@ int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
MPIDI_CH3U_Request_complete(sreq);
continue;
}
- if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ if ( ! MPIDI_nem_llc_Rqst_iov_update(sreq, ret) ) {
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "skip %p", sreq);
break;
}
@@ -478,24 +478,24 @@ int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SEND_QUEUED);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_SEND_QUEUED);
return mpi_errno;
//fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPIDI_nem_tofu_Rqst_iov_update
+#define FUNCNAME MPIDI_nem_llc_Rqst_iov_update
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
+int MPIDI_nem_llc_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
{
int ret = TRUE;
/* MPIDI_msg_sz_t oconsume = consume; */
int iv, nv;
- MPIDI_STATE_DECL(MPID_STATE_MPIDI_NEM_TOFU_RQST_IOV_UPDATE);
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_NEM_LLC_RQST_IOV_UPDATE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_NEM_TOFU_RQST_IOV_UPDATE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_NEM_LLC_RQST_IOV_UPDATE);
MPIU_Assert(consume >= 0);
@@ -535,11 +535,11 @@ int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"iov_update() = %d", ret);
- MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_TOFU_RQST_IOV_UPDATE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_LLC_RQST_IOV_UPDATE);
return ret;
}
-ssize_t llctofu_writev(void *endpt, uint64_t raddr,
+ssize_t llc_writev(void *endpt, uint64_t raddr,
const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid)
{
ssize_t nw = 0;
@@ -550,7 +550,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
dprintf("writev,raddr=%ld,niov=%d,sreq=%p", raddr, niov, cbarg);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev(%d)", (int)raddr);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev(%d)", (int)raddr);
{
uint8_t *buff = 0;
#ifdef notdef_hsiz_hack
@@ -570,14 +570,14 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
}
#ifdef notdef_hsiz_hack
if (bsiz > 0) {
- buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_tofu_netmod_hdr_t));
+ buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
if (buff == 0) {
nw = -1; /* ENOMEM */
goto bad;
}
}
#else /* notdef_hsiz_hack */
- buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_tofu_netmod_hdr_t));
+ buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_llc_netmod_hdr_t));
if (buff == 0) {
nw = -1; /* ENOMEM */
goto bad;
@@ -607,7 +607,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
lcmd->niov_remote = 1;
{
- struct llctofu_cmd_area *usr = (void *)lcmd->usr_area;
+ struct llc_cmd_area *usr = (void *)lcmd->usr_area;
usr->cbarg = cbarg;
usr->raddr = lcmd->rank;
}
@@ -619,16 +619,16 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
char *bp;
size_t bz;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev() : nv %d", nv);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nv %d", nv);
bp = (void *)lcmd->iov_local[0].addr;
bz = lcmd->iov_local[0].length;
/* Prepare netmod header */
- ((MPID_nem_tofu_netmod_hdr_t*)bp)->initiator_pg_rank = MPIDI_Process.my_pg_rank;
- bp += sizeof(MPID_nem_tofu_netmod_hdr_t);
+ ((MPID_nem_llc_netmod_hdr_t*)bp)->initiator_pg_rank = MPIDI_Process.my_pg_rank;
+ bp += sizeof(MPID_nem_llc_netmod_hdr_t);
#ifndef notdef_hsiz_hack
- lcmd->iov_local[0].length += sizeof (MPID_nem_tofu_netmod_hdr_t);
- lcmd->iov_remote[0].length += sizeof (MPID_nem_tofu_netmod_hdr_t);
+ lcmd->iov_local[0].length += sizeof (MPID_nem_llc_netmod_hdr_t);
+ lcmd->iov_remote[0].length += sizeof (MPID_nem_llc_netmod_hdr_t);
#endif /* notdef_hsiz_hack */
/* Pack iovs into buff */
@@ -647,7 +647,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
}
bp += len;
}
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev() : iv %d", iv);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : iv %d", iv);
{
void *bb = (void *)lcmd->iov_local[0].addr;
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
@@ -687,7 +687,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
}
bad:
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev() : nw %d", (int)nw);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llc_writev() : nw %d", (int)nw);
return nw;
}
@@ -710,7 +710,7 @@ int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
* - VC_FIELD(vc, remote_endpoint_addr) is 0.
*/
if (vc->pg_rank == MPIDI_Process.my_pg_rank || vc_ch->is_local == 1) {
- if (llc_rank == MPID_nem_tofu_my_llc_rank) {
+ if (llc_rank == MPID_nem_llc_my_llc_rank) {
*mpi_rank = rank;
found = 1;
break;
@@ -725,8 +725,8 @@ int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
return found;
}
-int llctofu_poll(int in_blocking_poll,
- llctofu_send_f sfnc, llctofu_recv_f rfnc)
+int llc_poll(int in_blocking_poll,
+ llc_send_f sfnc, llc_recv_f rfnc)
{
int mpi_errno = MPI_SUCCESS;
@@ -749,18 +749,18 @@ int llctofu_poll(int in_blocking_poll,
switch(events[0].type) {
case LLC_EVENT_SEND_LEFT: {
- dprintf("llctofu_poll,EVENT_SEND_LEFT\n");
+ dprintf("llc_poll,EVENT_SEND_LEFT\n");
lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND);
if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
- printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
- MPID_nem_tofu_segv;
+ printf("llc_poll,error_code=%d\n", events[0].side.initiator.error_code);
+ MPID_nem_llc_segv;
}
/* Call send_handler. First arg is a pointer to MPID_Request */
- (*sfnc)(((struct llctofu_cmd_area *)lcmd->usr_area)->cbarg, &reqid);
+ (*sfnc)(((struct llc_cmd_area *)lcmd->usr_area)->cbarg, &reqid);
/* Don't free iov_local[0].addr */
@@ -769,20 +769,20 @@ int llctofu_poll(int in_blocking_poll,
break; }
case LLC_EVENT_UNSOLICITED_LEFT: {
- dprintf("llctofu_poll,EVENT_UNSOLICITED_LEFT\n");
+ dprintf("llc_poll,EVENT_UNSOLICITED_LEFT\n");
lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
MPIU_Assert(lcmd->opcode == LLC_OPCODE_UNSOLICITED);
- struct llctofu_cmd_area *usr;
+ struct llc_cmd_area *usr;
usr = (void *)lcmd->usr_area;
vp_sreq = usr->cbarg;
UNSOLICITED_NUM_DEC(vp_sreq);
if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
- printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
- MPID_nem_tofu_segv;
+ printf("llc_poll,error_code=%d\n", events[0].side.initiator.error_code);
+ MPID_nem_llc_segv;
}
(*sfnc)(vp_sreq, &reqid);
@@ -811,36 +811,36 @@ int llctofu_poll(int in_blocking_poll,
"LLC_leng = %d", (int)bsiz);
MPIU_DBG_PKT(vp_vc, buff, "poll");
}
- dprintf("tofu_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
+ dprintf("llc_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
MPIDI_Process.my_pg_rank,
- ((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank
+ ((MPID_nem_llc_netmod_hdr_t*)buff)->initiator_pg_rank
);
#ifdef notdef_hsiz_hack
(*rfnc)(vp_vc,
- ((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
- (uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
+ ((MPID_nem_llc_netmod_hdr_t*)buff)->initiator_pg_rank,
+ (uint8_t*)buff + sizeof(MPID_nem_llc_netmod_hdr_t),
bsiz);
#else /* notdef_hsiz_hack */
(*rfnc)(vp_vc,
- ((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
- (uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
- bsiz - sizeof(MPID_nem_tofu_netmod_hdr_t));
+ ((MPID_nem_llc_netmod_hdr_t*)buff)->initiator_pg_rank,
+ (uint8_t*)buff + sizeof(MPID_nem_llc_netmod_hdr_t),
+ bsiz - sizeof(MPID_nem_llc_netmod_hdr_t));
#endif /* notdef_hsiz_hack */
llc_errno = LLC_release_buffer(&events[0]);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
break; }
case LLC_EVENT_RECV_MATCHED: {
- dprintf("llctofu_poll,EVENT_RECV_MATCHED\n");
+ dprintf("llc_poll,EVENT_RECV_MATCHED\n");
lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
- MPID_Request *req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
+ MPID_Request *req = ((struct llc_cmd_area*)lcmd->usr_area)->cbarg;
if (req->kind != MPID_REQUEST_MPROBE) {
/* Unpack non-contiguous dt */
int is_contig;
MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
if (!is_contig) {
- dprintf("llctofu_poll,unpack noncontiguous data to user buffer\n");
+ dprintf("llc_poll,unpack noncontiguous data to user buffer\n");
/* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
/* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
@@ -865,10 +865,10 @@ int llctofu_poll(int in_blocking_poll,
MPIR_STATUS_SET_COUNT(req->status, last);
req->status.MPI_ERROR =
MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
- MPI_ERR_TYPE, "**llctofu_poll", 0);
+ MPI_ERR_TYPE, "**llc_poll", 0);
/* --END ERROR HANDLING-- */
}
- dprintf("llctofu_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
+ dprintf("llc_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
REQ_FIELD(req, pack_buf));
MPIU_Free(REQ_FIELD(req, pack_buf));
}
@@ -909,10 +909,10 @@ int llctofu_poll(int in_blocking_poll,
lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
- req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
+ req = ((struct llc_cmd_area*)lcmd->usr_area)->cbarg;
if (lcmd->opcode == LLC_OPCODE_UNSOLICITED) {
- struct llctofu_cmd_area *usr;
+ struct llc_cmd_area *usr;
usr = (void *)lcmd->usr_area;
vp_sreq = usr->cbarg;
@@ -941,8 +941,8 @@ int llctofu_poll(int in_blocking_poll,
MPIDI_CH3U_Request_complete(req);
#endif
} else {
- printf("llctofu_poll,target dead, unknown opcode=%d\n", lcmd->opcode);
- MPID_nem_tofu_segv;
+ printf("llc_poll,target dead, unknown opcode=%d\n", lcmd->opcode);
+ MPID_nem_llc_segv;
}
llc_errno = LLC_cmd_free(lcmd, 1);
@@ -950,8 +950,8 @@ int llctofu_poll(int in_blocking_poll,
break; }
default:
- printf("llctofu_poll,unknown event type=%d\n", events[0].type);
- MPID_nem_tofu_segv;
+ printf("llc_poll,unknown event type=%d\n", events[0].type);
+ MPID_nem_llc_segv;
}
}
@@ -962,10 +962,10 @@ int llctofu_poll(int in_blocking_poll,
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_issend
+#define FUNCNAME MPID_nem_llc_issend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+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)
{
@@ -976,22 +976,22 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
MPI_Aint dt_true_lb;
int i;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISSEND);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISSEND);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_ISSEND);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_ISSEND);
- dprintf("tofu_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
+ dprintf("llc_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
int LLC_my_rank;
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
- dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+ dprintf("llc_isend,LLC_my_rank=%d\n", LLC_my_rank);
struct MPID_Request * sreq = MPID_Request_create();
MPIU_Assert(sreq != NULL);
MPIU_Object_set_ref(sreq, 2);
sreq->kind = MPID_REQUEST_SEND;
- /* Used in tofullc_poll --> MPID_nem_tofu_send_handler */
+ /* Used in llc_poll --> MPID_nem_llc_send_handler */
sreq->ch.vc = vc;
sreq->dev.OnDataAvail = 0;
/* Don't save iov_offset because it's not used. */
@@ -1014,7 +1014,7 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
sreq->dev.match.parts.tag = tag;
sreq->dev.match.parts.context_id = comm->context_id + context_offset;
- dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+ dprintf("llc_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
cmd[0].opcode = LLC_OPCODE_SSEND;
@@ -1031,7 +1031,7 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
- dprintf("tofu_isend,tag=");
+ dprintf("llc_isend,tag=");
for(i = 0; i < sizeof(LLC_tag_t); i++) {
dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
}
@@ -1040,7 +1040,7 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
/* Prepare RDMA-write from buffer */
MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
dt_true_lb);
- dprintf("tofu_isend,dt_contig=%d,data_sz=%ld\n",
+ dprintf("llc_isend,dt_contig=%d,data_sz=%ld\n",
dt_contig, data_sz);
@@ -1079,15 +1079,15 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
cmd[0].iov_remote[0].length = data_sz;
cmd[0].niov_remote = 1;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ ((struct llc_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
+ ((struct llc_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
llc_errno = LLC_post(cmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
fn_exit:
*request = sreq;
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISSEND);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_ISSEND);
return mpi_errno;
fn_fail:
goto fn_exit;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
similarity index 55%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
rename to src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
index 4cf6791..bf4c0ae 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
@@ -7,10 +7,10 @@
#include "mpid_nem_impl.h"
-#include "tofu_impl.h"
+#include "llc_impl.h"
-//#define MPID_NEM_TOFU_DEBUG_VC
-#ifdef MPID_NEM_TOFU_DEBUG_VC
+//#define MPID_NEM_LLC_DEBUG_VC
+#ifdef MPID_NEM_LLC_DEBUG_VC
#define dprintf printf
#else
#define dprintf(...)
@@ -18,16 +18,16 @@
/* function prototypes */
-static int tofu_vc_init (MPIDI_VC_t *vc);
+static int llc_vc_init (MPIDI_VC_t *vc);
static MPIDI_Comm_ops_t comm_ops = {
- .recv_posted = MPID_nem_tofu_recv_posted,
- .send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
- .rsend = MPID_nem_tofu_isend,
- .ssend = MPID_nem_tofu_issend,
- .isend = MPID_nem_tofu_isend,
- .irsend = MPID_nem_tofu_isend,
- .issend = MPID_nem_tofu_issend,
+ .recv_posted = MPID_nem_llc_recv_posted,
+ .send = MPID_nem_llc_isend, /* wait is performed separately after calling this */
+ .rsend = MPID_nem_llc_isend,
+ .ssend = MPID_nem_llc_issend,
+ .isend = MPID_nem_llc_isend,
+ .irsend = MPID_nem_llc_isend,
+ .issend = MPID_nem_llc_issend,
.send_init = NULL,
.bsend_init = NULL,
@@ -36,82 +36,82 @@ static MPIDI_Comm_ops_t comm_ops = {
.startall = NULL,
.cancel_send = NULL,
- .cancel_recv = MPID_nem_tofu_cancel_recv,
+ .cancel_recv = MPID_nem_llc_cancel_recv,
- .probe = MPID_nem_tofu_probe,
- .iprobe = MPID_nem_tofu_iprobe,
- .improbe = MPID_nem_tofu_improbe
+ .probe = MPID_nem_llc_probe,
+ .iprobe = MPID_nem_llc_iprobe,
+ .improbe = MPID_nem_llc_improbe
};
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_vc_init
+#define FUNCNAME MPID_nem_llc_vc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int
-MPID_nem_tofu_vc_init (MPIDI_VC_t *vc)
+MPID_nem_llc_vc_init (MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_INIT);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_VC_INIT);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_INIT);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_VC_INIT);
- mpi_errno = tofu_vc_init (vc);
+ mpi_errno = llc_vc_init (vc);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_INIT);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_vc_destroy
+#define FUNCNAME MPID_nem_llc_vc_destroy
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_vc_destroy(MPIDI_VC_t *vc)
+int MPID_nem_llc_vc_destroy(MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_VC_DESTROY);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_VC_DESTROY);
/* free any resources associated with this VC here */
{
- MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
+ MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
- vc_tofu->endpoint = 0;
+ vc_llc->endpoint = 0;
}
/* wait until all UNSOLICITED are done */
while (VC_FIELD(vc, unsolicited_count)) {
- MPID_nem_tofu_poll(1);
+ MPID_nem_llc_poll(1);
}
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_DESTROY);
return mpi_errno;
//fn_fail:
goto fn_exit;
}
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_vc_terminate
+#define FUNCNAME MPID_nem_llc_vc_terminate
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc)
+int MPID_nem_llc_vc_terminate (MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_LLC_VC_TERMINATE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_LLC_VC_TERMINATE);
- dprintf("tofu_vc_terminate,enter,%d->%d\n", MPIDI_Process.my_pg_rank, vc->pg_rank);
+ dprintf("llc_vc_terminate,enter,%d->%d\n", MPIDI_Process.my_pg_rank, vc->pg_rank);
mpi_errno = MPIDI_CH3U_Handle_connection (vc, MPIDI_VC_EVENT_TERMINATED);
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_LLC_VC_TERMINATE);
return mpi_errno;
//fn_fail:
goto fn_exit;
@@ -120,10 +120,10 @@ int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc)
/* ============================================== */
#undef FUNCNAME
-#define FUNCNAME tofu_vc_init
+#define FUNCNAME llc_vc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int tofu_vc_init (MPIDI_VC_t *vc)
+static int llc_vc_init (MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
@@ -137,45 +137,45 @@ static int tofu_vc_init (MPIDI_VC_t *vc)
"MPID_NEM_REQ_NETMOD_AREA_LEN = %d",
MPID_NEM_REQ_NETMOD_AREA_LEN);
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "MPID_nem_tofu_vc_area = %d\n",
- (int) sizeof (MPID_nem_tofu_vc_area));
+ "MPID_nem_llc_vc_area = %d\n",
+ (int) sizeof (MPID_nem_llc_vc_area));
}
/* MPIDI_CH3I_VC: src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h */
{
MPIDI_CH3I_VC *vc_ch = &vc->ch;
- MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
+ MPID_nem_llc_vc_area *vc_llc = VC_LLC(vc);
- vc_tofu->endpoint = vc;
+ vc_llc->endpoint = vc;
mpi_errno =
- MPID_nem_tofu_kvs_get_binary(vc->pg_rank,
+ MPID_nem_llc_kvs_get_binary(vc->pg_rank,
"llc_rank",
- (char *) &vc_tofu->remote_endpoint_addr,
+ (char *) &vc_llc->remote_endpoint_addr,
sizeof(int));
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
"**MPID_nem_ib_kvs_get_binary");
- dprintf("tofu_vc_init,my_pg_rank=%d,pg_rank=%d,my_llc_rank=%d,llc_rank=%ld\n",
- MPIDI_Process.my_pg_rank, vc->pg_rank, MPID_nem_tofu_my_llc_rank, vc_tofu->remote_endpoint_addr);
+ dprintf("llc_vc_init,my_pg_rank=%d,pg_rank=%d,my_llc_rank=%d,llc_rank=%ld\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, MPID_nem_llc_my_llc_rank, vc_llc->remote_endpoint_addr);
- vc_tofu->send_queue.head = 0; /* GENERIC_Q_DECL */
- vc_tofu->send_queue.tail = 0; /* GENERIC_Q_DECL */
+ vc_llc->send_queue.head = 0; /* GENERIC_Q_DECL */
+ vc_llc->send_queue.tail = 0; /* GENERIC_Q_DECL */
vc->eager_max_msg_sz = (12 * 1024);
vc->ready_eager_max_msg_sz = (12 * 1024);
/* vc->rndvSend_fn = 0*/
/* vc->rndvRecv_fn = 0*/
- vc->sendNoncontig_fn = MPID_nem_tofu_SendNoncontig;
+ vc->sendNoncontig_fn = MPID_nem_llc_SendNoncontig;
#ifdef ENABLE_COMM_OVERRIDES
vc->comm_ops = &comm_ops;
#endif
- vc_ch->iStartContigMsg = MPID_nem_tofu_iStartContigMsg;
- vc_ch->iSendContig = MPID_nem_tofu_iSendContig;
+ vc_ch->iStartContigMsg = MPID_nem_llc_iStartContigMsg;
+ vc_ch->iSendContig = MPID_nem_llc_iSendContig;
#ifdef ENABLE_CHECKPOINTING
- vc_ch->ckpt_pause_send_vc = 0 /* MPID_nem_tofu_ckpt_pause_send_vc */;
- vc_ch->ckpt_continue_vc = 0 /* MPID_nem_tofu_ckpt_continue_vc */;
- vc_ch->ckpt_restart_vc = 0 /* = MPID_nem_tofu_ckpt_restart_vc */;
+ vc_ch->ckpt_pause_send_vc = 0 /* MPID_nem_llc_ckpt_pause_send_vc */;
+ vc_ch->ckpt_continue_vc = 0 /* MPID_nem_llc_ckpt_continue_vc */;
+ vc_ch->ckpt_restart_vc = 0 /* = MPID_nem_llc_ckpt_restart_vc */;
#endif
MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
@@ -189,10 +189,10 @@ static int tofu_vc_init (MPIDI_VC_t *vc)
#if 0 /* not use */
#undef FUNCNAME
-#define FUNCNAME MPID_nem_tofu_vc_prnt
+#define FUNCNAME MPID_nem_llc_vc_prnt
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int MPID_nem_tofu_vc_prnt(MPIDI_VC_t *vc)
+static int MPID_nem_llc_vc_prnt(MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4 b/src/mpid/ch3/channels/nemesis/netmod/llc/subconfigure.m4
similarity index 84%
rename from src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
rename to src/mpid/ch3/channels/nemesis/netmod/llc/subconfigure.m4
index 14cb2ac..eb96cc9 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
+++ b/src/mpid/ch3/channels/nemesis/netmod/llc/subconfigure.m4
@@ -4,16 +4,16 @@ dnl MPICH_SUBCFG_AFTER=src/mpid/ch3/channels/nemesis
AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
AM_COND_IF([BUILD_CH3_NEMESIS],[
for net in $nemesis_networks ; do
- AS_CASE([$net],[tofu],[build_nemesis_netmod_tofu=yes])
+ AS_CASE([$net],[llc],[build_nemesis_netmod_llc=yes])
done
])
- AM_CONDITIONAL([BUILD_NEMESIS_NETMOD_TOFU],[test "X$build_nemesis_netmod_tofu" = "Xyes"])
+ AM_CONDITIONAL([BUILD_NEMESIS_NETMOD_LLC],[test "X$build_nemesis_netmod_llc" = "Xyes"])
])dnl
AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[
-AM_COND_IF([BUILD_NEMESIS_NETMOD_TOFU],[
- AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:nemesis:tofu])
+AM_COND_IF([BUILD_NEMESIS_NETMOD_LLC],[
+ AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:nemesis:llc])
PAC_SET_HEADER_LIB_PATH(libmemcached)
PAC_SET_HEADER_LIB_PATH(ibverbs)
@@ -52,6 +52,6 @@ dnl dlopen(NULL, RTLD_LAZY)
dnl ],[ac_cv_func_dlopen=yes],[ac_cv_func_dlopen=no])
AC_DEFINE([ENABLE_COMM_OVERRIDES], 1, [define to add per-vc function pointers to override send and recv functions])
-])dnl end AM_COND_IF(BUILD_NEMESIS_NETMOD_TOFU,...)
+])dnl end AM_COND_IF(BUILD_NEMESIS_NETMOD_LLC,...)
])dnl end _BODY
[#] end of __file__
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
deleted file mode 100644
index 3a97876..0000000
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-## -*- Mode: Makefile; -*-
-## vim: set ft=automake :
-##
-## (C) 2011 by Argonne National Laboratory.
-## See COPYRIGHT in top-level directory.
-##
-
-if BUILD_NEMESIS_NETMOD_TOFU
-
-# AM_CPPFLAGS += -I...
-
-lib_lib at MPILIBNAME@_la_SOURCES += \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c \
- $(EOA)
-
-noinst_HEADERS += \
- src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h \
- $(EOA)
-
-endif BUILD_NEMESIS_NETMOD_TOFU
-
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
deleted file mode 100644
index bb1ecc3..0000000
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
-
-#ifndef TOFU_MODULE_IMPL_H
-#define TOFU_MODULE_IMPL_H
-
-#ifdef USE_PMI2_API
-#include "pmi2.h"
-#else
-#include "pmi.h"
-#endif
-#include "mpid_nem_impl.h"
-#include "llc.h"
-
-extern int MPID_nem_tofu_my_llc_rank;
-
-/* The vc provides a generic buffer in which network modules can store
- * private fields This removes all dependencies from the VC struction
- * on the network module, facilitating dynamic module loading. */
-
-/*
- * GENERIC_Q_*:
- * src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h
- */
-typedef GENERIC_Q_DECL(struct MPID_Request) rque_t;
-/*
-typedef GENERIC_Q_DECL(struct MPID_Request) MPIDI_nem_tofu_request_queue_t;
- */
-
-typedef struct
-{
- uint64_t remote_endpoint_addr;
- void *endpoint;
- rque_t send_queue; /* MPID_Request Queue */
- unsigned int unsolicited_count;
-} MPID_nem_tofu_vc_area;
-
-/* macro for tofu private in VC */
-#define VC_TOFU(vc) ((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)
-#define VC_FIELD(vcp, field) (((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)->field)
-
-#define UNSOLICITED_NUM_INC(req) \
-{ \
- MPID_Request *sreq = req; \
- MPIDI_VC_t *vc = sreq->ch.vc; \
- VC_FIELD(vc, unsolicited_count)++; \
-}
-#define UNSOLICITED_NUM_DEC(req) \
-{ \
- MPID_Request *sreq = req; \
- MPIDI_VC_t *vc = sreq->ch.vc; \
- VC_FIELD(vc, unsolicited_count)--; \
-}
-
-typedef struct
-{
- void *cmds;
- void *pack_buf; /* to pack non-contiguous data */
-
- void *rma_buf;
-} MPID_nem_tofu_req_area;
-
-#define REQ_TOFU(req) \
- ((MPID_nem_tofu_req_area *)(&(req)->ch.netmod_area.padding))
-#define REQ_FIELD(reqp, field) (((MPID_nem_tofu_req_area *)((reqp)->ch.netmod_area.padding))->field)
-
-struct llctofu_cmd_area {
- void *cbarg;
- uint32_t raddr;
-};
-
-/* functions */
-int MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
-int MPID_nem_tofu_finalize (void);
-int MPID_nem_tofu_poll(int in_blocking_progress);
-int MPID_nem_tofu_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p);
-int MPID_nem_tofu_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc);
-int MPID_nem_tofu_vc_init (MPIDI_VC_t *vc);
-int MPID_nem_tofu_vc_destroy(MPIDI_VC_t *vc);
-int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc);
-
-int MPID_nem_tofu_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
-int MPID_nem_tofu_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag,
- MPID_Request **message,MPI_Status *status);
-
-int MPID_nem_tofu_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_tofu_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_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz);
-
-int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume);
-int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue);
-
-int MPID_nem_tofu_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 MPID_nem_tofu_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 MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req);
-int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
- int length);
-int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int length);
-void MPID_nem_tofu_anysource_posted(MPID_Request *req);
-int MPID_nem_tofu_anysource_matched(MPID_Request *req);
-int MPID_nem_tofu_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
- MPI_Status *status);
-int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
- int *flag, MPI_Status *status);
-int MPID_nem_tofu_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_tofu_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req);
-
-/*
- * temporary llctofu api
- */
-typedef void (*llctofu_send_f)(void *cba, uint64_t *reqid);
-typedef void (*llctofu_recv_f)
- (void *cba, uint64_t addr, void *buf, size_t bsz);
-
-extern ssize_t llctofu_writev(void *endpt, uint64_t raddr,
- const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid);
-extern int llctofu_bind(void **vpp_endpt, uint64_t raddr, void *cbarg);
-extern int llctofu_unbind(void *endpt);
-
-extern int llctofu_poll(int in_blocking_poll,
- llctofu_send_f sfnc, llctofu_recv_f rfnc);
-
-extern int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank);
-typedef struct MPID_nem_tofu_netmod_hdr {
- int initiator_pg_rank;
-#ifndef notdef_hsiz_hack
- int reserved_for_alignment;
-#endif /* notdef_hsiz_hack */
-} MPID_nem_tofu_netmod_hdr_t;
-
-#define MPID_nem_tofu_segv printf("%d\n", *(int32_t*)0);
-
-#endif /* TOFU_MODULE_IMPL_H */
http://git.mpich.org/mpich.git/commitdiff/47a198a1f135be41b212bea8fe3d5b460178ee9e
commit 47a198a1f135be41b212bea8fe3d5b460178ee9e
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Thu Mar 12 13:47:20 2015 +0900
Delete incorrect decrement
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 39f3576..3fab77e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -921,7 +921,6 @@ int llctofu_poll(int in_blocking_poll,
req->status.MPI_ERROR = MPI_SUCCESS;
MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
- MPID_Request_release(req); /* ref count was incremented when added to queue */
MPIDI_CH3U_Request_complete(req);
if (lcmd->iov_local[0].addr != 0) {
@@ -932,7 +931,6 @@ int llctofu_poll(int in_blocking_poll,
req->status.MPI_ERROR = MPI_SUCCESS;
MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
- MPID_Request_release(req); /* ref count was incremented when added to queue */
MPIDI_CH3U_Request_complete(req);
} else if (lcmd->opcode == LLC_OPCODE_RECV) {
/* Probably ch3 dequeued and completed this request. */
http://git.mpich.org/mpich.git/commitdiff/f5019b87833b49685922799bab44558117ca499b
commit f5019b87833b49685922799bab44558117ca499b
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Thu Mar 12 13:15:58 2015 +0900
Avoid optimization when compiling with O2
LLC_probe is called before a value of tag is set, when compiling with O2.
To avoid this, change the order of setting.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
index 2bb6ae4..ac25659 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
@@ -58,14 +58,6 @@ int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
mask.rank = ~0;
mask.tag = ~0;
- if (source == MPI_ANY_SOURCE) {
- rank = LLC_ANY_SOURCE;
- mask.rank = 0;
- } else {
- MPIU_Assert(vc);
- rank = VC_FIELD(vc, remote_endpoint_addr);
- }
-
if (tag == MPI_ANY_TAG) {
*(int32_t*)((uint8_t *)&_tag) = LLC_ANY_TAG;
*(int32_t*)((uint8_t *)&mask.tag) = 0;
@@ -78,6 +70,14 @@ int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
memset((uint8_t*)&_tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+ if (source == MPI_ANY_SOURCE) {
+ rank = LLC_ANY_SOURCE;
+ mask.rank = 0;
+ } else {
+ MPIU_Assert(vc);
+ rank = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
llc_errno = LLC_probe(LLC_COMM_MPICH, rank, _tag, &mask, &probe);
if (llc_errno == LLC_SUCCESS) {
*flag = 1;
@@ -125,14 +125,6 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
mask.rank = ~0;
mask.tag = ~0;
- if (source == MPI_ANY_SOURCE) {
- rank = LLC_ANY_SOURCE;
- mask.rank = 0;
- } else {
- MPIU_Assert(vc);
- rank = VC_FIELD(vc, remote_endpoint_addr);
- }
-
if (tag == MPI_ANY_TAG) {
*(int32_t*)((uint8_t *)&_tag) = LLC_ANY_TAG;
*(int32_t*)((uint8_t *)&mask.tag) = 0;
@@ -145,6 +137,14 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
memset((uint8_t*)&_tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+ if (source == MPI_ANY_SOURCE) {
+ rank = LLC_ANY_SOURCE;
+ mask.rank = 0;
+ } else {
+ MPIU_Assert(vc);
+ rank = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
msg = LLC_mprobe(LLC_COMM_MPICH, rank, _tag, &mask, &probe);
if (msg) {
MPID_Request *req;
http://git.mpich.org/mpich.git/commitdiff/b4616189d5458a6e3ea676ee3927ae8ebd345107
commit b4616189d5458a6e3ea676ee3927ae8ebd345107
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Wed Feb 25 09:15:30 2015 +0900
Handle TARGET_PROC_FAIL event
netmod-tofu receive TARGET_PROC_FAIL event when a command posted is
failed by SIGUSR1. ie. Target rank is dead.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 9679116..39f3576 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -903,6 +903,54 @@ int llctofu_poll(int in_blocking_poll,
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
break; }
+ case LLC_EVENT_TARGET_PROC_FAIL: {
+ MPID_Request *req;
+
+ lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
+ MPIU_Assert(lcmd != 0);
+
+ req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
+
+ if (lcmd->opcode == LLC_OPCODE_UNSOLICITED) {
+ struct llctofu_cmd_area *usr;
+ usr = (void *)lcmd->usr_area;
+ vp_sreq = usr->cbarg;
+
+ UNSOLICITED_NUM_DEC(vp_sreq);
+
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+
+ MPID_Request_release(req); /* ref count was incremented when added to queue */
+ MPIDI_CH3U_Request_complete(req);
+
+ if (lcmd->iov_local[0].addr != 0) {
+ MPIU_Free((void *)lcmd->iov_local[0].addr);
+ lcmd->iov_local[0].addr = 0;
+ }
+ } else if (lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND) {
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+
+ MPID_Request_release(req); /* ref count was incremented when added to queue */
+ MPIDI_CH3U_Request_complete(req);
+ } else if (lcmd->opcode == LLC_OPCODE_RECV) {
+ /* Probably ch3 dequeued and completed this request. */
+#if 0
+ MPIDI_CH3U_Recvq_DP(req);
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ MPIU_ERR_SET(req->status.MPI_ERROR, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail");
+ MPIDI_CH3U_Request_complete(req);
+#endif
+ } else {
+ printf("llctofu_poll,target dead, unknown opcode=%d\n", lcmd->opcode);
+ MPID_nem_tofu_segv;
+ }
+
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+
+ break; }
default:
printf("llctofu_poll,unknown event type=%d\n", events[0].type);
MPID_nem_tofu_segv;
http://git.mpich.org/mpich.git/commitdiff/420aa4235d36e03ab9d44ed32a56c34b5e493b69
commit 420aa4235d36e03ab9d44ed32a56c34b5e493b69
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Feb 24 17:14:45 2015 +0900
Fix build warnings in netmod-tofu
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
index e10314c..8d28176 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -127,9 +127,6 @@ MPID_nem_tofu_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;
- int rc;
- int i;
- int llc_rank;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_INIT);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index 9c78fe1..3102d70 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -289,7 +289,7 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
cmd[0].opcode = LLC_OPCODE_RECV;
cmd[0].comm = LLC_COMM_MPICH;
- cmd[0].req_id = cmd;
+ cmd[0].req_id = (uint64_t)cmd;
if (req->dev.match.parts.rank == MPI_ANY_SOURCE) {
cmd[0].rank = LLC_ANY_SOURCE;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
index 43b3f70..2bb6ae4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
@@ -179,7 +179,7 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
cmd[0].opcode = 0; // not use
cmd[0].comm = LLC_COMM_MPICH;
- cmd[0].req_id = cmd;
+ cmd[0].req_id = (uint64_t)cmd;
cmd[0].rank = msg->rank;
// cmd[0].tag = 0; // not use
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 216116f..9679116 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -83,7 +83,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
cmd[0].opcode = LLC_OPCODE_SEND;
cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
- cmd[0].req_id = cmd;
+ cmd[0].req_id = (uint64_t)cmd;
/* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
/* See src/mpid/ch3/src/mpid_isend.c */
@@ -109,7 +109,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
const void *write_from_buf;
if (dt_contig) {
- write_from_buf = buf + dt_true_lb;
+ write_from_buf = (void *)((char *)buf + dt_true_lb);
#ifndef notdef_leak_0002_hack
REQ_FIELD(sreq, pack_buf) = 0;
#endif /* notdef_leak_0002_hack */
@@ -531,7 +531,7 @@ int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
mreq->dev.iov_offset = iv;
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
- "iov_update() : iov_offset %d", mreq->dev.iov_offset);
+ "iov_update() : iov_offset %ld", mreq->dev.iov_offset);
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"iov_update() = %d", ret);
@@ -596,7 +596,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
lcmd->opcode = LLC_OPCODE_UNSOLICITED;
lcmd->comm = LLC_COMM_MPICH;
lcmd->rank = (uint32_t)raddr; /* XXX */
- lcmd->req_id = lcmd;
+ lcmd->req_id = (uint64_t)lcmd;
lcmd->iov_local[0].addr = (uintptr_t)buff;
lcmd->iov_local[0].length = bsiz;
@@ -750,7 +750,7 @@ int llctofu_poll(int in_blocking_poll,
switch(events[0].type) {
case LLC_EVENT_SEND_LEFT: {
dprintf("llctofu_poll,EVENT_SEND_LEFT\n");
- lcmd = events[0].side.initiator.req_id;
+ lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND);
@@ -770,7 +770,7 @@ int llctofu_poll(int in_blocking_poll,
case LLC_EVENT_UNSOLICITED_LEFT: {
dprintf("llctofu_poll,EVENT_UNSOLICITED_LEFT\n");
- lcmd = events[0].side.initiator.req_id;
+ lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
MPIU_Assert(lcmd->opcode == LLC_OPCODE_UNSOLICITED);
@@ -796,7 +796,6 @@ int llctofu_poll(int in_blocking_poll,
break; }
case LLC_EVENT_UNSOLICITED_ARRIVED: {
void *vp_vc = 0;
- uint64_t addr;
void *buff;
size_t bsiz;
@@ -833,7 +832,7 @@ int llctofu_poll(int in_blocking_poll,
break; }
case LLC_EVENT_RECV_MATCHED: {
dprintf("llctofu_poll,EVENT_RECV_MATCHED\n");
- lcmd = events[0].side.initiator.req_id;
+ lcmd = (LLC_cmd_t *)events[0].side.initiator.req_id;
MPID_Request *req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
if (req->kind != MPID_REQUEST_MPROBE) {
@@ -975,7 +974,7 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
cmd[0].opcode = LLC_OPCODE_SSEND;
cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
- cmd[0].req_id = cmd;
+ cmd[0].req_id = (uint64_t)cmd;
/* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
/* See src/mpid/ch3/src/mpid_isend.c */
@@ -1001,7 +1000,7 @@ int MPID_nem_tofu_issend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Da
const void *write_from_buf;
if (dt_contig) {
- write_from_buf = buf + dt_true_lb;
+ write_from_buf = (void *)((char *)buf + dt_true_lb);
REQ_FIELD(sreq, pack_buf) = 0;
}
else {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index b23d10f..4cf6791 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -187,6 +187,7 @@ static int tofu_vc_init (MPIDI_VC_t *vc)
goto fn_exit;
}
+#if 0 /* not use */
#undef FUNCNAME
#define FUNCNAME MPID_nem_tofu_vc_prnt
#undef FCNAME
@@ -220,4 +221,4 @@ static int MPID_nem_tofu_vc_prnt(MPIDI_VC_t *vc)
return mpi_errno;
}
-
+#endif
http://git.mpich.org/mpich.git/commitdiff/fbcad150b08bb6afdf2bdfc780339643a0f30d46
commit fbcad150b08bb6afdf2bdfc780339643a0f30d46
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Feb 3 16:48:56 2015 +0900
Override rsend and irsend
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index 0c2f122..b23d10f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -23,10 +23,10 @@ static int tofu_vc_init (MPIDI_VC_t *vc);
static MPIDI_Comm_ops_t comm_ops = {
.recv_posted = MPID_nem_tofu_recv_posted,
.send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
- .rsend = NULL,
+ .rsend = MPID_nem_tofu_isend,
.ssend = MPID_nem_tofu_issend,
.isend = MPID_nem_tofu_isend,
- .irsend = NULL,
+ .irsend = MPID_nem_tofu_isend,
.issend = MPID_nem_tofu_issend,
.send_init = NULL,
http://git.mpich.org/mpich.git/commitdiff/9a48ceb5e2106023a60fe60e3122d8ec173ce5da
commit 9a48ceb5e2106023a60fe60e3122d8ec173ce5da
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Feb 3 16:47:29 2015 +0900
Add cancel_recv function
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
index 371f13a..3a97876 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
@@ -16,6 +16,7 @@ lib_lib at MPILIBNAME@_la_SOURCES += \
src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c \
src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c \
src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c \
$(EOA)
noinst_HEADERS += \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c
new file mode 100644
index 0000000..6e554a2
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_cancel.c
@@ -0,0 +1,39 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+
+//#define MPID_NEM_TOFU_DEBUG_PROBE
+#ifdef MPID_NEM_TOFU_DEBUG_PROBE
+#define dprintf printf
+#else
+#define dprintf(...)
+#endif
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_cancel_recv
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+/* returns zero in case request is canceled */
+int MPID_nem_tofu_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req)
+{
+ int canceled;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_CANCEL_RECV);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_CANCEL_RECV);
+
+ /* returns zero in case request is canceled */
+ canceled = LLC_req_approve_recv((LLC_cmd_t *)REQ_FIELD(req, cmds));
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_CANCEL_RECV);
+ return canceled;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index f577aaf..bb1ecc3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -108,6 +108,7 @@ int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, i
int *flag, MPI_Status *status);
int MPID_nem_tofu_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_tofu_cancel_recv(struct MPIDI_VC *vc, struct MPID_Request *req);
/*
* temporary llctofu api
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index 2eba534..0c2f122 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -36,7 +36,7 @@ static MPIDI_Comm_ops_t comm_ops = {
.startall = NULL,
.cancel_send = NULL,
- .cancel_recv = NULL,
+ .cancel_recv = MPID_nem_tofu_cancel_recv,
.probe = MPID_nem_tofu_probe,
.iprobe = MPID_nem_tofu_iprobe,
http://git.mpich.org/mpich.git/commitdiff/d50aaa1db32a92a2ab1abac9481f921cc1144b44
commit d50aaa1db32a92a2ab1abac9481f921cc1144b44
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Fri Jan 23 10:27:58 2015 +0900
Revert "Override rsend and irsend"
This reverts commit 3911459b5f0fd6bb2281f49564aa632b88d348a5.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index 188427d..2eba534 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -23,10 +23,10 @@ static int tofu_vc_init (MPIDI_VC_t *vc);
static MPIDI_Comm_ops_t comm_ops = {
.recv_posted = MPID_nem_tofu_recv_posted,
.send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
- .rsend = MPID_nem_tofu_isend,
+ .rsend = NULL,
.ssend = MPID_nem_tofu_issend,
.isend = MPID_nem_tofu_isend,
- .irsend = MPID_nem_tofu_isend,
+ .irsend = NULL,
.issend = MPID_nem_tofu_issend,
.send_init = NULL,
http://git.mpich.org/mpich.git/commitdiff/bd18d4eb08a4c63b02245d224b27f9c1c3379324
commit bd18d4eb08a4c63b02245d224b27f9c1c3379324
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Wed Jan 21 12:41:19 2015 +0900
Fix conversion from LLC rank to MPI rank
vc for a local process is not initialize by vc_init. Therefore, it does
not have a LLC rank.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 4079a05..216116f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -700,7 +700,22 @@ int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
for (rank = 0; rank < size; rank++) {
MPIDI_Comm_get_vc(comm, rank, &vc);
- if (llc_rank == VC_FIELD(vc, remote_endpoint_addr)) {
+ MPIDI_CH3I_VC *vc_ch = &vc->ch;
+
+ /* Self-vc isn't initialized, so vc_ch->is_local is 0.
+ *
+ * If vc_ch->is_local is 1, vc_init is not called.
+ * - vc->comm_ops is not overridden, so send to / receive from this vc
+ * are not via LLC_post.
+ * - VC_FIELD(vc, remote_endpoint_addr) is 0.
+ */
+ if (vc->pg_rank == MPIDI_Process.my_pg_rank || vc_ch->is_local == 1) {
+ if (llc_rank == MPID_nem_tofu_my_llc_rank) {
+ *mpi_rank = rank;
+ found = 1;
+ break;
+ }
+ } else if (llc_rank == VC_FIELD(vc, remote_endpoint_addr)) {
*mpi_rank = rank; // rank number in the req->comm
found = 1;
break;
http://git.mpich.org/mpich.git/commitdiff/ffd152c87db9c9da9321624342fc3ff0dc272fc0
commit ffd152c87db9c9da9321624342fc3ff0dc272fc0
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Wed Jan 21 08:54:58 2015 +0900
Delete debug code
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
index a6e55fc..43b3f70 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
@@ -203,7 +203,6 @@ int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
/* Wait until the reception of data is completed */
do {
mpi_errno = MPID_nem_tofu_poll(0);
- MPIU_ERR_POP(mpi_errno);
} while (!MPID_Request_is_complete(req));
// MPIDI_CH3U_Request_complete(req); // This operation is done in llctofu_poll.
http://git.mpich.org/mpich.git/commitdiff/be3e6ed8cac9de31e84655daa4e78001505acf27
commit be3e6ed8cac9de31e84655daa4e78001505acf27
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Jan 20 14:41:28 2015 +0900
Fix implementation when receiving a event
- LLC_event_t has a data length which sender has requested, so use the
value to unpack and set MPI_Status.
- When received data was truncated in LLC, error_code is LLC_ERROR_TRUNCATE.
In this case, set the error code of MPI_Status to MPI_ERR_TRUNCATE.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 7c696eb..4079a05 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -830,7 +830,11 @@ int llctofu_poll(int in_blocking_poll,
/* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
/* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
- MPIDI_msg_sz_t unpack_sz = req->dev.recv_data_sz;
+
+ /* set_request_info() sets req->dev.recv_data_sz to pkt->data_sz.
+ * pkt->data_sz is sender's request size.
+ */
+ MPIDI_msg_sz_t unpack_sz = events[0].side.initiator.length;
MPID_Segment seg;
MPI_Aint last;
@@ -865,7 +869,13 @@ int llctofu_poll(int in_blocking_poll,
found = convert_rank_llc2mpi(req->comm, events[0].side.initiator.rank, &req->status.MPI_SOURCE);
MPIU_Assert(found);
}
- MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
+
+ if (unlikely(events[0].side.initiator.error_code == LLC_ERROR_TRUNCATE)) {
+ req->status.MPI_ERROR = MPI_ERR_TRUNCATE;
+ MPIR_STATUS_SET_COUNT(req->status, lcmd->iov_local[0].length);
+ } else {
+ MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
+ }
/* Dequeue request from posted queue.
It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
http://git.mpich.org/mpich.git/commitdiff/c9dac7f92f05b35a1bafeee5fa61a03cb5370f92
commit c9dac7f92f05b35a1bafeee5fa61a03cb5370f92
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Wed Jan 14 17:32:23 2015 +0900
Modify some functions for RMA
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index 21a01ce..f577aaf 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -57,6 +57,7 @@ typedef struct
void *cmds;
void *pack_buf; /* to pack non-contiguous data */
+ void *rma_buf;
} MPID_nem_tofu_req_area;
#define REQ_TOFU(req) \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index 8784a73..9c78fe1 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -95,7 +95,6 @@ static void MPID_nem_tofu_send_handler(void *cba,
case MPID_REQUEST_SEND:
case MPID_PREQUEST_SEND: {
reqtype = MPIDI_Request_get_type(sreq);
- MPIU_Assert(reqtype != MPIDI_REQUEST_TYPE_GET_RESP);
/* Free temporal buffer for non-contiguous data.
* MPIDI_Request_create_sreq (in mpid_isend.c) sets req->dev.datatype.
@@ -121,7 +120,12 @@ static void MPID_nem_tofu_send_handler(void *cba,
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_tofu_SendNoncontig
+ REQ_FIELD(sreq, rma_buf) = NULL;
+ }
+
/* sreq: src/mpid/ch3/include/mpidpre.h */
{
MPIDI_VC_t *vc;
@@ -134,6 +138,8 @@ static void MPID_nem_tofu_send_handler(void *cba,
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");
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 5371e24..7c696eb 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -77,6 +77,8 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+ REQ_FIELD(sreq, rma_buf) = NULL;
+
LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
cmd[0].opcode = LLC_OPCODE_SEND;
cmd[0].comm = LLC_COMM_MPICH;
@@ -199,6 +201,8 @@ int MPID_nem_tofu_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_
sreq->dev.OnDataAvail = 0;
sreq->dev.iov_offset = 0;
+ REQ_FIELD(sreq, rma_buf) = NULL;
+
/* sreq: src/mpid/ch3/include/mpidpre.h */
sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
sreq->dev.iov[0].MPID_IOV_BUF =
@@ -269,6 +273,9 @@ int MPID_nem_tofu_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPI
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+ if (sreq->kind == MPID_REQUEST_UNDEFINED) {
+ sreq->kind = MPID_REQUEST_SEND;
+ }
dprintf("tofu_iSendConitig,sreq=%p,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
sreq, hdr, hdr_sz, data, data_sz);
@@ -350,17 +357,71 @@ queue_it:
int MPID_nem_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
{
int mpi_errno = MPI_SUCCESS;
- /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG); */
-
- /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG); */
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG);
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_SendNoncontig");
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
+ MPIDI_msg_sz_t data_sz;
+ MPID_nem_tofu_vc_area *vc_tofu = 0;
+ int need_to_queue = 0;
+
+ MPIU_Assert(sreq->dev.segment_first == 0);
+ REQ_FIELD(sreq, rma_buf) = NULL;
+
+ sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
+ sreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) &sreq->dev.pending_pkt;
+ sreq->dev.iov[0].MPID_IOV_LEN = sizeof (MPIDI_CH3_Pkt_t);
+ sreq->dev.iov_count = 1;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+
+ data_sz = sreq->dev.segment_size;
+ if (data_sz > 0) {
+ REQ_FIELD(sreq, rma_buf) = MPIU_Malloc((size_t)sreq->dev.segment_size);
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, rma_buf), mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+ MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &data_sz, (char *)REQ_FIELD(sreq, rma_buf));
+
+ sreq->dev.iov[1].MPID_IOV_BUF = REQ_FIELD(sreq, rma_buf);
+ sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
+ sreq->dev.iov_count = 2;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "IOV_LEN = %d", (int)sreq->dev.iov[1].MPID_IOV_LEN);
+ }
+
+ sreq->ch.vc = vc;
+ vc_tofu = VC_TOFU(vc);
+ if ( ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue) ) {
+ need_to_queue = 1;
+ goto queue_it;
+ }
+
+ {
+ int ret;
+
+ ret = llctofu_writev(vc_tofu->endpoint,
+ vc_tofu->remote_endpoint_addr,
+ sreq->dev.iov, sreq->dev.iov_count,
+ sreq, &REQ_TOFU(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+
+ if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ need_to_queue = 2; /* YYY */
+ }
+ }
+
+ queue_it:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "need_to_que %d", need_to_queue);
+ if (need_to_queue > 0) {
+ MPIDI_CH3I_Sendq_enqueue(&vc_tofu->send_queue, sreq);
+ }
+
fn_exit:
- /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG); */
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG);
return mpi_errno;
- //fn_fail:
+ fn_fail:
goto fn_exit;
}
http://git.mpich.org/mpich.git/commitdiff/b455f5bea6cff8947b9faebfd3e2e3b18812b323
commit b455f5bea6cff8947b9faebfd3e2e3b18812b323
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Thu Jan 8 08:50:33 2015 +0900
x86 don't care 8byte alignment in llctofu_poll
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index a2cf3a9..5371e24 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -727,8 +727,9 @@ int llctofu_poll(int in_blocking_poll,
buff = events[0].side.responder.addr;
bsiz = events[0].side.responder.length;
#ifndef notdef_hsiz_hack
+#if defined(__sparc__)
MPIU_Assert(((uintptr_t)buff % 8) == 0);
- MPIU_Assert(bsiz >= sizeof (MPID_nem_tofu_netmod_hdr_t));
+#endif
#endif /* notdef_hsiz_hack */
{
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
http://git.mpich.org/mpich.git/commitdiff/2cfc91c82b4557ca7929ae167a2edeb59eb8c07d
commit 2cfc91c82b4557ca7929ae167a2edeb59eb8c07d
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Wed Jan 7 13:27:30 2015 +0900
Override rsend and irsend
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index 2eba534..188427d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -23,10 +23,10 @@ static int tofu_vc_init (MPIDI_VC_t *vc);
static MPIDI_Comm_ops_t comm_ops = {
.recv_posted = MPID_nem_tofu_recv_posted,
.send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
- .rsend = NULL,
+ .rsend = MPID_nem_tofu_isend,
.ssend = MPID_nem_tofu_issend,
.isend = MPID_nem_tofu_isend,
- .irsend = NULL,
+ .irsend = MPID_nem_tofu_isend,
.issend = MPID_nem_tofu_issend,
.send_init = NULL,
http://git.mpich.org/mpich.git/commitdiff/fa86b9a4b4f3b24be5e6be6d7a6087301c309260
commit fa86b9a4b4f3b24be5e6be6d7a6087301c309260
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Jan 6 17:46:10 2015 +0900
Implement issend in netmod-tofu
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index f6f7a9b..21a01ce 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -92,6 +92,9 @@ int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue);
int MPID_nem_tofu_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 MPID_nem_tofu_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 MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req);
int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
int length);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 8038d19..a2cf3a9 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -676,7 +676,7 @@ int llctofu_poll(int in_blocking_poll,
dprintf("llctofu_poll,EVENT_SEND_LEFT\n");
lcmd = events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
- MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND);
+ MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND || lcmd->opcode == LLC_OPCODE_SSEND);
if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
@@ -828,3 +828,135 @@ int llctofu_poll(int in_blocking_poll,
fn_fail:
goto fn_exit;
}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_issend
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_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 mpi_errno = MPI_SUCCESS, llc_errno;
+ int dt_contig;
+ MPIDI_msg_sz_t data_sz;
+ MPID_Datatype *dt_ptr;
+ MPI_Aint dt_true_lb;
+ int i;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISSEND);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISSEND);
+
+ dprintf("tofu_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
+
+ int LLC_my_rank;
+ LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
+ dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+
+ struct MPID_Request * sreq = MPID_Request_create();
+ MPIU_Assert(sreq != NULL);
+ MPIU_Object_set_ref(sreq, 2);
+ sreq->kind = MPID_REQUEST_SEND;
+
+ /* Used in tofullc_poll --> MPID_nem_tofu_send_handler */
+ sreq->ch.vc = vc;
+ sreq->dev.OnDataAvail = 0;
+ /* Don't save iov_offset because it's not used. */
+
+ /* Save it because it's used in send_handler */
+ /* See also MPIDI_Request_create_sreq() */
+ /* in src/mpid/ch3/include/mpidimpl.h */
+ MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
+ sreq->dev.datatype = datatype;
+ sreq->comm = comm;
+ MPIR_Comm_add_ref(comm);
+
+ /* used for MPI_Cancel() */
+ sreq->status.MPI_ERROR = MPI_SUCCESS;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
+ sreq->dev.cancel_pending = FALSE;
+ /* Do not reset dev.state after calling MPIDI_Request_set_type() */
+ /* sreq->dev.state = 0; */
+ sreq->dev.match.parts.rank = dest;
+ sreq->dev.match.parts.tag = tag;
+ sreq->dev.match.parts.context_id = comm->context_id + context_offset;
+
+ dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+
+ LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
+ cmd[0].opcode = LLC_OPCODE_SSEND;
+ cmd[0].comm = LLC_COMM_MPICH;
+ cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
+ cmd[0].req_id = cmd;
+
+ /* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
+ /* See src/mpid/ch3/src/mpid_isend.c */
+ *(int32_t*)((uint8_t*)&cmd[0].tag) = tag;
+ *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ comm->context_id + context_offset;
+ MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
+ memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ 0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+
+ dprintf("tofu_isend,tag=");
+ for(i = 0; i < sizeof(LLC_tag_t); i++) {
+ dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
+ }
+ dprintf("\n");
+
+ /* Prepare RDMA-write from buffer */
+ MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
+ dt_true_lb);
+ dprintf("tofu_isend,dt_contig=%d,data_sz=%ld\n",
+ dt_contig, data_sz);
+
+
+ const void *write_from_buf;
+ if (dt_contig) {
+ write_from_buf = buf + dt_true_lb;
+ REQ_FIELD(sreq, pack_buf) = 0;
+ }
+ else {
+ /* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
+ struct MPID_Segment *segment_ptr = MPID_Segment_alloc();
+ MPIU_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+ /* See also MPIDI_CH3_Request_create and _destory() */
+ /* in src/mpid/ch3/src/ch3u_request.c */
+ sreq->dev.segment_ptr = segment_ptr;
+
+ MPID_Segment_init(buf, count, datatype, segment_ptr, 0);
+ MPIDI_msg_sz_t segment_first = 0;
+ MPIDI_msg_sz_t segment_size = data_sz;
+ MPIDI_msg_sz_t last = segment_size;
+ MPIU_Assert(last > 0);
+ REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER,
+ "**outofmemory");
+ MPID_Segment_pack(segment_ptr, segment_first, &last,
+ (char *) (REQ_FIELD(sreq, pack_buf)));
+ MPIU_Assert(last == data_sz);
+ write_from_buf = REQ_FIELD(sreq, pack_buf);
+ }
+
+ cmd[0].iov_local[0].addr = (uint64_t)write_from_buf;
+ cmd[0].iov_local[0].length = data_sz;
+ cmd[0].niov_local = 1;
+
+ cmd[0].iov_remote[0].addr = 0;
+ cmd[0].iov_remote[0].length = data_sz;
+ cmd[0].niov_remote = 1;
+
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+
+ llc_errno = LLC_post(cmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
+
+ fn_exit:
+ *request = sreq;
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISSEND);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index 1c5b71f..2eba534 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -24,10 +24,10 @@ static MPIDI_Comm_ops_t comm_ops = {
.recv_posted = MPID_nem_tofu_recv_posted,
.send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
.rsend = NULL,
- .ssend = NULL,
+ .ssend = MPID_nem_tofu_issend,
.isend = MPID_nem_tofu_isend,
.irsend = NULL,
- .issend = NULL,
+ .issend = MPID_nem_tofu_issend,
.send_init = NULL,
.bsend_init = NULL,
http://git.mpich.org/mpich.git/commitdiff/5717e183d227edfefc9839fc9a93a35c77f2941e
commit 5717e183d227edfefc9839fc9a93a35c77f2941e
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Jan 6 09:47:05 2015 +0900
Implement iprobe and improbe in netmod-tofu
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
index 176a164..371f13a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
@@ -15,6 +15,7 @@ lib_lib at MPILIBNAME@_la_SOURCES += \
src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c \
src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c \
src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c \
$(EOA)
noinst_HEADERS += \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index 010008b..f6f7a9b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -98,6 +98,12 @@ int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t *
int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int length);
void MPID_nem_tofu_anysource_posted(MPID_Request *req);
int MPID_nem_tofu_anysource_matched(MPID_Request *req);
+int MPID_nem_tofu_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ MPI_Status *status);
+int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ int *flag, MPI_Status *status);
+int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ int *flag, MPID_Request **message, MPI_Status *status);
/*
* temporary llctofu api
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
index 291f8e3..e10314c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -159,6 +159,8 @@ MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank,
MPIDI_CH3I_Register_anysource_notification(MPID_nem_tofu_anysource_posted,
MPID_nem_tofu_anysource_matched);
+ MPIDI_Anysource_improbe_fn = MPID_nem_tofu_anysource_improbe;
+
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_INIT);
return mpi_errno;
@@ -214,7 +216,7 @@ MPID_nem_tofu_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_tofu_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
{
- return MPI_SUCCESS;
+ return MPID_nem_tofu_iprobe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, status);
}
@@ -224,5 +226,5 @@ int MPID_nem_tofu_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_tofu_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
{
- return MPI_SUCCESS;
+ return MPID_nem_tofu_improbe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, message, status);
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
new file mode 100644
index 0000000..a6e55fc
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_probe.c
@@ -0,0 +1,231 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+
+//#define MPID_NEM_TOFU_DEBUG_PROBE
+#ifdef MPID_NEM_TOFU_DEBUG_PROBE
+#define dprintf printf
+#else
+#define dprintf(...)
+#endif
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_probe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ MPI_Status *status)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_PROBE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_PROBE);
+ dprintf("tofu_probe,source=%d,tag=%d\n", source, tag);
+
+ /* NOTE : This function is not used. Because 'vc->comm_ops->probe()' is not used */
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_PROBE);
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_iprobe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ int *flag, MPI_Status *status)
+{
+ int mpi_errno = MPI_SUCCESS, llc_errno;
+ int rank;
+ LLC_tag_t _tag;
+ LLC_probe_t probe;
+ LLC_match_mask_t mask;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_IPROBE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_IPROBE);
+ dprintf("tofu_iprobe,source=%d,tag=%d\n", source, tag);
+
+ mask.rank = ~0;
+ mask.tag = ~0;
+
+ if (source == MPI_ANY_SOURCE) {
+ rank = LLC_ANY_SOURCE;
+ mask.rank = 0;
+ } else {
+ MPIU_Assert(vc);
+ rank = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
+ if (tag == MPI_ANY_TAG) {
+ *(int32_t*)((uint8_t *)&_tag) = LLC_ANY_TAG;
+ *(int32_t*)((uint8_t *)&mask.tag) = 0;
+ } else {
+ *(int32_t*)((uint8_t *)&_tag) = tag;
+ }
+
+ *(MPIR_Context_id_t*)((uint8_t*)&_tag + sizeof(int32_t)) =
+ comm->recvcontext_id + context_offset;
+ memset((uint8_t*)&_tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ 0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+
+ llc_errno = LLC_probe(LLC_COMM_MPICH, rank, _tag, &mask, &probe);
+ if (llc_errno == LLC_SUCCESS) {
+ *flag = 1;
+ status->MPI_ERROR = MPI_SUCCESS;
+ if (source != MPI_ANY_SOURCE) {
+ status->MPI_SOURCE = source;
+ } else {
+ int found = 0;
+ found = convert_rank_llc2mpi(comm, probe.rank, &status->MPI_SOURCE);
+ MPIU_Assert(found);
+ }
+ status->MPI_TAG = probe.tag & 0xffffffff;
+ MPIR_STATUS_SET_COUNT(*status, probe.len);
+ } else {
+ *flag = 0;
+
+ MPID_Progress_poke(); /* do LLC_poll */
+ }
+
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_IPROBE);
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_improbe
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_improbe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset,
+ int *flag, MPID_Request **message, MPI_Status *status)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int rank;
+ LLC_tag_t _tag;
+ LLC_probe_t probe;
+ LLC_match_mask_t mask;
+ LLC_cmd_t *msg = NULL;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_IMPROBE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_IMPROBE);
+ dprintf("tofu_improbe,source=%d,tag=%d\n", source, tag);
+
+ mask.rank = ~0;
+ mask.tag = ~0;
+
+ if (source == MPI_ANY_SOURCE) {
+ rank = LLC_ANY_SOURCE;
+ mask.rank = 0;
+ } else {
+ MPIU_Assert(vc);
+ rank = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
+ if (tag == MPI_ANY_TAG) {
+ *(int32_t*)((uint8_t *)&_tag) = LLC_ANY_TAG;
+ *(int32_t*)((uint8_t *)&mask.tag) = 0;
+ } else {
+ *(int32_t*)((uint8_t *)&_tag) = tag;
+ }
+
+ *(MPIR_Context_id_t*)((uint8_t*)&_tag + sizeof(int32_t)) =
+ comm->recvcontext_id + context_offset;
+ memset((uint8_t*)&_tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ 0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+
+ msg = LLC_mprobe(LLC_COMM_MPICH, rank, _tag, &mask, &probe);
+ if (msg) {
+ MPID_Request *req;
+
+ *flag = 1;
+
+ req = MPID_Request_create();
+ MPIU_Object_set_ref(req, 2);
+ req->kind = MPID_REQUEST_MPROBE;
+ req->comm = comm;
+ MPIR_Comm_add_ref(comm);
+ req->ch.vc = vc;
+
+ MPIDI_Request_set_msg_type(req, MPIDI_REQUEST_EAGER_MSG);
+ req->dev.recv_pending_count = 1;
+ req->status.MPI_ERROR = MPI_SUCCESS;
+ if (source != MPI_ANY_SOURCE) {
+ req->status.MPI_SOURCE = source;
+ } else {
+ int found = 0;
+ found = convert_rank_llc2mpi(comm, probe.rank, &req->status.MPI_SOURCE);
+ MPIU_Assert(found);
+ }
+ req->status.MPI_TAG = probe.tag & 0xffffffff;
+ req->dev.recv_data_sz = probe.len;
+ MPIR_STATUS_SET_COUNT(req->status, req->dev.recv_data_sz);
+ req->dev.tmpbuf = MPIU_Malloc(req->dev.recv_data_sz);
+ MPIU_Assert(req->dev.tmpbuf);
+
+ /* receive message in req->dev.tmpbuf */
+ LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
+
+ cmd[0].opcode = 0; // not use
+ cmd[0].comm = LLC_COMM_MPICH;
+ cmd[0].req_id = cmd;
+ cmd[0].rank = msg->rank;
+ // cmd[0].tag = 0; // not use
+
+ cmd[0].iov_local[0].addr = (uint64_t)req->dev.tmpbuf;
+ cmd[0].iov_local[0].length = req->dev.recv_data_sz;
+ cmd[0].niov_local = 1;
+
+ cmd[0].iov_remote[0].addr = 0;
+ cmd[0].iov_remote[0].length = req->dev.recv_data_sz;
+ cmd[0].niov_remote = 1;
+
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = req;
+ if (source == MPI_ANY_SOURCE) {
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE;
+ } else {
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
+ LLC_recv_msg(cmd, msg);
+
+ /* Wait until the reception of data is completed */
+ do {
+ mpi_errno = MPID_nem_tofu_poll(0);
+ MPIU_ERR_POP(mpi_errno);
+ } while (!MPID_Request_is_complete(req));
+
+// MPIDI_CH3U_Request_complete(req); // This operation is done in llctofu_poll.
+
+ *message = req;
+
+ /* TODO : Should we change status ? */
+ //status->MPI_ERROR = MPI_SUCCESS;
+ status->MPI_SOURCE = req->status.MPI_SOURCE;
+ status->MPI_TAG = req->status.MPI_TAG;
+ MPIR_STATUS_SET_COUNT(*status, req->dev.recv_data_sz);
+ } else {
+ *flag = 0;
+ *message = NULL;
+
+ MPID_Progress_poke(); /* do LLC_poll */
+ }
+
+fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_IMPROBE);
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
+
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 8882e4c..8038d19 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -759,62 +759,57 @@ int llctofu_poll(int in_blocking_poll,
lcmd = events[0].side.initiator.req_id;
MPID_Request *req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
- /* Unpack non-contiguous dt */
- int is_contig;
- MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
- if (!is_contig) {
- dprintf("llctofu_poll,unpack noncontiguous data to user buffer\n");
-
- /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
- /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
- MPIDI_msg_sz_t unpack_sz = req->dev.recv_data_sz;
- MPID_Segment seg;
- MPI_Aint last;
-
- /* user_buf etc. are set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, &seg,
- 0);
- last = unpack_sz;
- MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, pack_buf));
- if (last != unpack_sz) {
- /* --BEGIN ERROR HANDLING-- */
- /* received data was not entirely consumed by unpack()
- * because too few bytes remained to fill the next basic
- * datatype */
- MPIR_STATUS_SET_COUNT(req->status, last);
- req->status.MPI_ERROR =
- MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
- MPI_ERR_TYPE, "**llctofu_poll", 0);
- /* --END ERROR HANDLING-- */
+ if (req->kind != MPID_REQUEST_MPROBE) {
+ /* Unpack non-contiguous dt */
+ int is_contig;
+ MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
+ if (!is_contig) {
+ dprintf("llctofu_poll,unpack noncontiguous data to user buffer\n");
+
+ /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
+ /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
+ MPIDI_msg_sz_t unpack_sz = req->dev.recv_data_sz;
+ MPID_Segment seg;
+ MPI_Aint last;
+
+ /* user_buf etc. are set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, &seg,
+ 0);
+ last = unpack_sz;
+ MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, pack_buf));
+ if (last != unpack_sz) {
+ /* --BEGIN ERROR HANDLING-- */
+ /* received data was not entirely consumed by unpack()
+ * because too few bytes remained to fill the next basic
+ * datatype */
+ MPIR_STATUS_SET_COUNT(req->status, last);
+ req->status.MPI_ERROR =
+ MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
+ MPI_ERR_TYPE, "**llctofu_poll", 0);
+ /* --END ERROR HANDLING-- */
+ }
+ dprintf("llctofu_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
+ REQ_FIELD(req, pack_buf));
+ MPIU_Free(REQ_FIELD(req, pack_buf));
}
- dprintf("llctofu_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
- REQ_FIELD(req, pack_buf));
- MPIU_Free(REQ_FIELD(req, pack_buf));
- }
- req->status.MPI_TAG = events[0].side.initiator.tag & 0xffffffff;;
- if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
- req->status.MPI_SOURCE = req->dev.match.parts.rank;
- } else {
- /* 'events[0].side.initiator.rank' is LLC rank.
- * Convert it to a rank number in the communicator. */
- int found = 0;
- found = convert_rank_llc2mpi(req->comm, events[0].side.initiator.rank, &req->status.MPI_SOURCE);
+ req->status.MPI_TAG = events[0].side.initiator.tag & 0xffffffff;;
+ if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
+ req->status.MPI_SOURCE = req->dev.match.parts.rank;
+ } else {
+ /* 'events[0].side.initiator.rank' is LLC rank.
+ * Convert it to a rank number in the communicator. */
+ int found = 0;
+ found = convert_rank_llc2mpi(req->comm, events[0].side.initiator.rank, &req->status.MPI_SOURCE);
+ MPIU_Assert(found);
+ }
+ MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
+
+ /* Dequeue request from posted queue.
+ It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ int found = MPIDI_CH3U_Recvq_DP(req);
MPIU_Assert(found);
}
- MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
-
- /* Dequeue request from posted queue.
- It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- int found = MPIDI_CH3U_Recvq_DP(req);
- MPIU_Assert(found);
-
- MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
-
- /* Dequeue request from posted queue.
- It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- int found = MPIDI_CH3U_Recvq_DP(req);
- MPIU_Assert(found);
/* Mark completion on rreq */
MPIDI_CH3U_Request_complete(req);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index e28db85..1c5b71f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -38,9 +38,9 @@ static MPIDI_Comm_ops_t comm_ops = {
.cancel_send = NULL,
.cancel_recv = NULL,
- .probe = NULL,
- .iprobe = NULL,
- .improbe = NULL
+ .probe = MPID_nem_tofu_probe,
+ .iprobe = MPID_nem_tofu_iprobe,
+ .improbe = MPID_nem_tofu_improbe
};
#undef FUNCNAME
http://git.mpich.org/mpich.git/commitdiff/4c69be3c998d2acc968d2e676ee60750936ddfa8
commit 4c69be3c998d2acc968d2e676ee60750936ddfa8
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Fri Dec 26 15:38:29 2014 +0900
Implement tag matching for ANY_SOURCE and ANY_TAG
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index c9c6796..010008b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -96,6 +96,8 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req);
int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
int length);
int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int length);
+void MPID_nem_tofu_anysource_posted(MPID_Request *req);
+int MPID_nem_tofu_anysource_matched(MPID_Request *req);
/*
* temporary llctofu api
@@ -112,6 +114,7 @@ extern int llctofu_unbind(void *endpt);
extern int llctofu_poll(int in_blocking_poll,
llctofu_send_f sfnc, llctofu_recv_f rfnc);
+extern int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank);
typedef struct MPID_nem_tofu_netmod_hdr {
int initiator_pg_rank;
#ifndef notdef_hsiz_hack
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
index 9928871..291f8e3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -155,6 +155,10 @@ MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank,
pmi_errno = PMI_Barrier();
MPIU_ERR_CHKANDJUMP(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**PMI_Barrier");
+ mpi_errno =
+ MPIDI_CH3I_Register_anysource_notification(MPID_nem_tofu_anysource_posted,
+ MPID_nem_tofu_anysource_matched);
+
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_INIT);
return mpi_errno;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index 69c8132..8784a73 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -255,8 +255,10 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
/* Save data size for llctofu_poll */
req->dev.recv_data_sz = data_sz;
+#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
dprintf("tofu_recv_posted,%d<-%d,vc=%p,req=%p,user_buf=%p,data_sz=%ld,datatype=%08x,dt_contig=%d\n",
MPIDI_Process.my_pg_rank, vc->pg_rank, vc, req, req->dev.user_buf, req->dev.recv_data_sz, req->dev.datatype, dt_contig);
+#endif
void *write_to_buf;
if (dt_contig) {
@@ -273,18 +275,33 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+#if 0 /* FIXME : vc is NULL when rank is MPI_ANY_SOURCE */
dprintf("tofu_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+#endif
LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
cmd[0].opcode = LLC_OPCODE_RECV;
cmd[0].comm = LLC_COMM_MPICH;
- cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
cmd[0].req_id = cmd;
+ if (req->dev.match.parts.rank == MPI_ANY_SOURCE) {
+ cmd[0].rank = LLC_ANY_SOURCE;
+ cmd[0].mask.rank = 0;
+ } else {
+ cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
/* req->comm is set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- *(int32_t*)((uint8_t*)&cmd[0].tag) = req->dev.match.parts.tag;
- *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ if (req->dev.match.parts.tag == MPI_ANY_TAG) {
+ *(int32_t*)((uint8_t*)&cmd[0].tag) = LLC_ANY_TAG;
+ *(int32_t*)((uint8_t*)&cmd[0].mask.tag) = 0;
+ }
+ else {
+ *(int32_t*)((uint8_t*)&cmd[0].tag) = req->dev.match.parts.tag;
+ }
+
+ *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
req->dev.match.parts.context_id;
MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
@@ -307,7 +324,13 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
cmd[0].niov_remote = 1;
((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = req;
- ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ if (req->dev.match.parts.rank == MPI_ANY_SOURCE) {
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = MPI_ANY_SOURCE; /* FIXME : should 0 ? */
+ } else {
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+ }
+
+ REQ_FIELD(req, cmds) = cmd;
llc_errno = LLC_post(cmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
@@ -318,3 +341,40 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
fn_fail:
goto fn_exit;
}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_anysource_posted
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+void MPID_nem_tofu_anysource_posted(MPID_Request *req)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_AYSOURCE_POSTED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_AYSOURCE_POSTED);
+
+ mpi_errno = MPID_nem_tofu_recv_posted(NULL, req);
+ MPIU_Assert(mpi_errno == MPI_SUCCESS);
+
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_AYSOURCE_POSTED);
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_anysource_matched
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_anysource_matched(MPID_Request *req)
+{
+ int matched = FALSE;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ANYSOURCE_MATCHED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ANYSOURCE_MATCHED);
+
+ /* FIXME : How to call a cancel_recv function */
+ /* If LLC_postedq is still having this request, delete it.
+ Ohterwise, return TURE */
+ matched = LLC_req_approve_recv((LLC_cmd_t *)REQ_FIELD(req, cmds));
+
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ANYSOURCE_MATCHED);
+
+ return matched;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 1755870..8882e4c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -630,6 +630,25 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
return nw;
}
+int convert_rank_llc2mpi(MPID_Comm *comm, int llc_rank, int *mpi_rank)
+{
+ int size, rank;
+ int found = 0;
+ MPIDI_VC_t *vc;
+ size = MPIR_Comm_size(comm);
+
+ for (rank = 0; rank < size; rank++) {
+ MPIDI_Comm_get_vc(comm, rank, &vc);
+ if (llc_rank == VC_FIELD(vc, remote_endpoint_addr)) {
+ *mpi_rank = rank; // rank number in the req->comm
+ found = 1;
+ break;
+ }
+ }
+
+ return found;
+}
+
int llctofu_poll(int in_blocking_poll,
llctofu_send_f sfnc, llctofu_recv_f rfnc)
{
@@ -773,8 +792,23 @@ int llctofu_poll(int in_blocking_poll,
MPIU_Free(REQ_FIELD(req, pack_buf));
}
- req->status.MPI_TAG = req->dev.match.parts.tag;
- req->status.MPI_SOURCE = req->dev.match.parts.rank;
+ req->status.MPI_TAG = events[0].side.initiator.tag & 0xffffffff;;
+ if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
+ req->status.MPI_SOURCE = req->dev.match.parts.rank;
+ } else {
+ /* 'events[0].side.initiator.rank' is LLC rank.
+ * Convert it to a rank number in the communicator. */
+ int found = 0;
+ found = convert_rank_llc2mpi(req->comm, events[0].side.initiator.rank, &req->status.MPI_SOURCE);
+ MPIU_Assert(found);
+ }
+ MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
+
+ /* Dequeue request from posted queue.
+ It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ int found = MPIDI_CH3U_Recvq_DP(req);
+ MPIU_Assert(found);
+
MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
/* Dequeue request from posted queue.
http://git.mpich.org/mpich.git/commitdiff/430e9f4b06fd65553f9eb0f031ac6a9b2bcb6b83
commit 430e9f4b06fd65553f9eb0f031ac6a9b2bcb6b83
Author: Norio yamaguchi <norio.yamaguchi at riken.jp>
Date: Thu Dec 18 14:17:52 2014 +0900
Performance : allocate a memory for a command and vectors at once
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index f74df64..69c8132 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -275,7 +275,7 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
dprintf("tofu_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
- LLC_cmd_t *cmd = LLC_cmd_alloc(1);
+ LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
cmd[0].opcode = LLC_OPCODE_RECV;
cmd[0].comm = LLC_COMM_MPICH;
@@ -298,12 +298,10 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
dprintf("\n");
- cmd[0].iov_local = LLC_iov_alloc(1);
cmd[0].iov_local[0].addr = (uint64_t)write_to_buf;
cmd[0].iov_local[0].length = data_sz;
cmd[0].niov_local = 1;
- cmd[0].iov_remote = LLC_iov_alloc(1);
cmd[0].iov_remote[0].addr = 0;
cmd[0].iov_remote[0].length = data_sz;;
cmd[0].niov_remote = 1;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 1f76824..1755870 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -77,7 +77,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
- LLC_cmd_t *cmd = LLC_cmd_alloc(1);
+ LLC_cmd_t *cmd = LLC_cmd_alloc2(1, 1, 1);
cmd[0].opcode = LLC_OPCODE_SEND;
cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
@@ -136,12 +136,10 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
write_from_buf = REQ_FIELD(sreq, pack_buf);
}
- cmd[0].iov_local = LLC_iov_alloc(1);
cmd[0].iov_local[0].addr = (uint64_t)write_from_buf;
cmd[0].iov_local[0].length = data_sz;
cmd[0].niov_local = 1;
- cmd[0].iov_remote = LLC_iov_alloc(1);
cmd[0].iov_remote[0].addr = 0;
cmd[0].iov_remote[0].length = data_sz;
cmd[0].niov_remote = 1;
@@ -526,14 +524,12 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
#endif /* notdef_hsiz_hack */
}
- lcmd = LLC_cmd_alloc(1);
+ lcmd = LLC_cmd_alloc2(1, 1, 1);
if (lcmd == 0) {
if (buff != 0) { MPIU_Free(buff); buff = 0; }
nw = -1; /* ENOMEM */
goto bad;
}
- lcmd[0].iov_local = LLC_iov_alloc(1);
- lcmd[0].iov_remote = LLC_iov_alloc(1);
UNSOLICITED_NUM_INC(cbarg);
lcmd->opcode = LLC_OPCODE_UNSOLICITED;
@@ -673,10 +669,6 @@ int llctofu_poll(int in_blocking_poll,
/* Don't free iov_local[0].addr */
- llc_errno = LLC_iov_free(lcmd[0].iov_remote, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
- llc_errno = LLC_iov_free(lcmd[0].iov_local, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
break; }
@@ -703,10 +695,6 @@ int llctofu_poll(int in_blocking_poll,
MPIU_Free((void *)lcmd->iov_local[0].addr);
lcmd->iov_local[0].addr = 0;
}
- llc_errno = LLC_iov_free(lcmd[0].iov_remote, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
- llc_errno = LLC_iov_free(lcmd[0].iov_local, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
@@ -797,10 +785,6 @@ int llctofu_poll(int in_blocking_poll,
/* Mark completion on rreq */
MPIDI_CH3U_Request_complete(req);
- llc_errno = LLC_iov_free(lcmd[0].iov_remote, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
- llc_errno = LLC_iov_free(lcmd[0].iov_local, 1);
- MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
break; }
http://git.mpich.org/mpich.git/commitdiff/3b6058a8e098052d632ec49a3a5b44dc6bb88fe5
commit 3b6058a8e098052d632ec49a3a5b44dc6bb88fe5
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Mon Dec 1 08:51:03 2014 +0900
Disable dependence on libmemcached
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4 b/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
index ca5310b..14cb2ac 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
@@ -23,7 +23,7 @@ AM_COND_IF([BUILD_NEMESIS_NETMOD_TOFU],[
if test "${libmemcached_found}" = "yes" ; then
AC_MSG_NOTICE([libmemcached is going to be linked.])
else
- AC_MSG_ERROR([Internal error: libmemcached was not found])
+ AC_MSG_NOTICE([libmemcached was not found])
fi
PAC_CHECK_HEADER_LIB([infiniband/verbs.h],ibverbs,ibv_open_device,ibverbs_found=yes,ibverbs_found=no)
http://git.mpich.org/mpich.git/commitdiff/8d4b6043faaf81c88b5aee0587dfc018f7c023ac
commit 8d4b6043faaf81c88b5aee0587dfc018f7c023ac
Author: Massa. Hatanaka <mhatanaka at riken.jp>
Date: Sat Dec 13 23:31:31 2014 +0900
Bug Fixes for netmod-llc
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index 6af0daf..c9c6796 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -114,6 +114,9 @@ extern int llctofu_poll(int in_blocking_poll,
typedef struct MPID_nem_tofu_netmod_hdr {
int initiator_pg_rank;
+#ifndef notdef_hsiz_hack
+ int reserved_for_alignment;
+#endif /* notdef_hsiz_hack */
} MPID_nem_tofu_netmod_hdr_t;
#define MPID_nem_tofu_segv printf("%d\n", *(int32_t*)0);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index 7144947..f74df64 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -106,6 +106,10 @@ static void MPID_nem_tofu_send_handler(void *cba,
* and MPID_nem_tofu_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.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 38e5370..1f76824 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -52,7 +52,28 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
/* Don't save iov_offset because it's not used. */
/* Save it because it's used in send_handler */
+#ifndef notdef_leak_0002_hack
+ /* See also MPIDI_Request_create_sreq() */
+ /* in src/mpid/ch3/include/mpidimpl.h */
+ MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
+#endif /* notdef_leak_0002_hack */
sreq->dev.datatype = datatype;
+#ifndef notdef_leak_0002_hack
+ sreq->comm = comm;
+ MPIR_Comm_add_ref(comm);
+#endif /* notdef_leak_0002_hack */
+#ifndef notdef_scan_hack
+
+ /* used for MPI_Cancel() */
+ sreq->status.MPI_ERROR = MPI_SUCCESS;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
+ sreq->dev.cancel_pending = FALSE;
+ /* Do not reset dev.state after calling MPIDI_Request_set_type() */
+ /* sreq->dev.state = 0; */
+ sreq->dev.match.parts.rank = dest;
+ sreq->dev.match.parts.tag = tag;
+ sreq->dev.match.parts.context_id = comm->context_id + context_offset;
+#endif /* notdef_scan_hack */
dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
@@ -87,11 +108,19 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
const void *write_from_buf;
if (dt_contig) {
write_from_buf = buf + dt_true_lb;
+#ifndef notdef_leak_0002_hack
+ REQ_FIELD(sreq, pack_buf) = 0;
+#endif /* notdef_leak_0002_hack */
}
else {
/* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
struct MPID_Segment *segment_ptr = MPID_Segment_alloc();
MPIU_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+#ifndef notdef_leak_0001_hack
+ /* See also MPIDI_CH3_Request_create and _destory() */
+ /* in src/mpid/ch3/src/ch3u_request.c */
+ sreq->dev.segment_ptr = segment_ptr;
+#endif /* notdef_leak_0001_hack */
MPID_Segment_init(buf, count, datatype, segment_ptr, 0);
MPIDI_msg_sz_t segment_first = 0;
@@ -456,13 +485,18 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
{
ssize_t nw = 0;
LLC_cmd_t *lcmd = 0;
+#ifndef notdef_hsiz_hack
+ uint32_t bsiz;
+#endif /* notdef_hsiz_hack */
dprintf("writev,raddr=%ld,niov=%d,sreq=%p", raddr, niov, cbarg);
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev(%d)", (int)raddr);
{
uint8_t *buff = 0;
+#ifdef notdef_hsiz_hack
uint32_t bsiz;
+#endif /* notdef_hsiz_hack */
{
int iv, nv = niov;
@@ -475,6 +509,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
}
bsiz += len;
}
+#ifdef notdef_hsiz_hack
if (bsiz > 0) {
buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_tofu_netmod_hdr_t));
if (buff == 0) {
@@ -482,6 +517,13 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
goto bad;
}
}
+#else /* notdef_hsiz_hack */
+ buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_tofu_netmod_hdr_t));
+ if (buff == 0) {
+ nw = -1; /* ENOMEM */
+ goto bad;
+ }
+#endif /* notdef_hsiz_hack */
}
lcmd = LLC_cmd_alloc(1);
@@ -527,6 +569,10 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
/* Prepare netmod header */
((MPID_nem_tofu_netmod_hdr_t*)bp)->initiator_pg_rank = MPIDI_Process.my_pg_rank;
bp += sizeof(MPID_nem_tofu_netmod_hdr_t);
+#ifndef notdef_hsiz_hack
+ lcmd->iov_local[0].length += sizeof (MPID_nem_tofu_netmod_hdr_t);
+ lcmd->iov_remote[0].length += sizeof (MPID_nem_tofu_netmod_hdr_t);
+#endif /* notdef_hsiz_hack */
/* Pack iovs into buff */
for (iv = 0; iv < nv; iv++) {
@@ -572,7 +618,11 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
}
}
else {
+#ifdef notdef_hsiz_hack
nw = (ssize_t)lcmd->iov_local[0].length;
+#else /* notdef_hsiz_hack */
+ nw = bsiz;
+#endif /* notdef_hsiz_hack */
}
}
if (vpp_reqid != 0) {
@@ -669,6 +719,10 @@ int llctofu_poll(int in_blocking_poll,
buff = events[0].side.responder.addr;
bsiz = events[0].side.responder.length;
+#ifndef notdef_hsiz_hack
+ MPIU_Assert(((uintptr_t)buff % 8) == 0);
+ MPIU_Assert(bsiz >= sizeof (MPID_nem_tofu_netmod_hdr_t));
+#endif /* notdef_hsiz_hack */
{
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
"LLC_leng = %d", (int)bsiz);
@@ -678,10 +732,17 @@ int llctofu_poll(int in_blocking_poll,
MPIDI_Process.my_pg_rank,
((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank
);
+#ifdef notdef_hsiz_hack
(*rfnc)(vp_vc,
((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
(uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
bsiz);
+#else /* notdef_hsiz_hack */
+ (*rfnc)(vp_vc,
+ ((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
+ (uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
+ bsiz - sizeof(MPID_nem_tofu_netmod_hdr_t));
+#endif /* notdef_hsiz_hack */
llc_errno = LLC_release_buffer(&events[0]);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
http://git.mpich.org/mpich.git/commitdiff/76a58dcb2e0f7ce6a8ee1f4953c1c468151232e0
commit 76a58dcb2e0f7ce6a8ee1f4953c1c468151232e0
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Wed Oct 29 17:40:12 2014 +0900
Fix memory leak
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
index a96357e..4be3371 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
@@ -2,6 +2,7 @@
**LLC_cmd_free:LLC_cmd_free failed
**LLC_comm_rank:LLC_comm_rank failed
**LLC_init:LLC_init failed
+**LLC_iov_free:LLC_iov_free failed
**LLC_poll:LLC_poll failed
**LLC_post:LLC_post failed
**LLC_release_buffer:LLC_release_buffer failed
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 38a1f16..38e5370 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -623,6 +623,10 @@ int llctofu_poll(int in_blocking_poll,
/* Don't free iov_local[0].addr */
+ llc_errno = LLC_iov_free(lcmd[0].iov_remote, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
+ llc_errno = LLC_iov_free(lcmd[0].iov_local, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
break; }
@@ -649,6 +653,10 @@ int llctofu_poll(int in_blocking_poll,
MPIU_Free((void *)lcmd->iov_local[0].addr);
lcmd->iov_local[0].addr = 0;
}
+ llc_errno = LLC_iov_free(lcmd[0].iov_remote, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
+ llc_errno = LLC_iov_free(lcmd[0].iov_local, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
@@ -728,6 +736,10 @@ int llctofu_poll(int in_blocking_poll,
/* Mark completion on rreq */
MPIDI_CH3U_Request_complete(req);
+ llc_errno = LLC_iov_free(lcmd[0].iov_remote, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
+ llc_errno = LLC_iov_free(lcmd[0].iov_local, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_iov_free");
llc_errno = LLC_cmd_free(lcmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
break; }
http://git.mpich.org/mpich.git/commitdiff/7e637ced66463d003f30d0e7c0fc199cae544955
commit 7e637ced66463d003f30d0e7c0fc199cae544955
Author: Norio Yamaguchi <yamaguchi at kangaroo2.aics27.riken.jp>
Date: Fri Oct 10 18:04:14 2014 +0900
Fix for SC14
1. Correspond to the changes of the LLC interface
2. Use communicator LLC_COM_MPICH
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
index 6f6b2d8..9928871 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -135,10 +135,10 @@ MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank,
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_INIT);
- llc_errno = LLC_init();
+ llc_errno = LLC_init(TYPE_MPI);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_init");
- llc_errno = LLC_comm_rank(LLC_COMM_WORLD, &MPID_nem_tofu_my_llc_rank);
+ llc_errno = LLC_comm_rank(LLC_COMM_MPICH, &MPID_nem_tofu_my_llc_rank);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_comm_rank");
/* Announce my LLC rank */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index 116aa4f..7144947 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -266,7 +266,7 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
}
int LLC_my_rank;
- LLC_comm_rank(LLC_COMM_WORLD, &LLC_my_rank);
+ LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
dprintf("tofu_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
@@ -274,7 +274,7 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
LLC_cmd_t *cmd = LLC_cmd_alloc(1);
cmd[0].opcode = LLC_OPCODE_RECV;
- cmd[0].comm = LLC_COMM_WORLD;
+ cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
cmd[0].req_id = cmd;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 088627e..38a1f16 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -38,7 +38,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
int LLC_my_rank;
- LLC_comm_rank(LLC_COMM_WORLD, &LLC_my_rank);
+ LLC_comm_rank(LLC_COMM_MPICH, &LLC_my_rank);
dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
struct MPID_Request * sreq = MPID_Request_create();
@@ -58,7 +58,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
LLC_cmd_t *cmd = LLC_cmd_alloc(1);
cmd[0].opcode = LLC_OPCODE_SEND;
- cmd[0].comm = LLC_COMM_WORLD;
+ cmd[0].comm = LLC_COMM_MPICH;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
cmd[0].req_id = cmd;
@@ -495,7 +495,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
UNSOLICITED_NUM_INC(cbarg);
lcmd->opcode = LLC_OPCODE_UNSOLICITED;
- lcmd->comm = LLC_COMM_WORLD;
+ lcmd->comm = LLC_COMM_MPICH;
lcmd->rank = (uint32_t)raddr; /* XXX */
lcmd->req_id = lcmd;
@@ -594,7 +594,7 @@ int llctofu_poll(int in_blocking_poll,
LLC_event_t events[1];
while(1) {
- llc_errno = LLC_poll(1, events, &nevents);
+ llc_errno = LLC_poll(LLC_COMM_MPICH, 1, events, &nevents);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_poll");
LLC_cmd_t *lcmd;
http://git.mpich.org/mpich.git/commitdiff/1210b71a35822bcf7a4ce6d2efe332cb5b1e28fe
commit 1210b71a35822bcf7a4ce6d2efe332cb5b1e28fe
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Fri Oct 3 09:37:45 2014 +0900
Revert "Time trace with rdtsc"
This reverts commit 05059e74e6869b62f9d10d9e8874aa1d6df5c1a1.
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index ee0bde4..1e18a17 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -65,20 +65,6 @@
#include <limits.h>
#endif
-#if 1 /* for rdtsc timer */
-extern uint64_t rdtsc_prog_start, rdtsc_prog_end, rdtsc_wait_sum;
-static inline uint64_t MPI_rdtsc_light(void )
-{
- uint64_t x;
- __asm__ __volatile__("rdtscp;" /* rdtscp don't jump over earlier instructions */
- "shl $32, %%rdx;"
- "or %%rdx, %%rax" :
- "=a"(x) :
- :
- "%rcx", "%rdx", "memory");
- return x;
-}
-#endif
#if defined(HAVE_LONG_LONG_INT)
/* tt#1776: some platforms have "long long" but not a LLONG_MAX/ULLONG_MAX,
* usually because some feature test macro has turned them off in glibc's
diff --git a/src/mpi/pt2pt/wait.c b/src/mpi/pt2pt/wait.c
index 7326a71..6773c82 100644
--- a/src/mpi/pt2pt/wait.c
+++ b/src/mpi/pt2pt/wait.c
@@ -19,9 +19,6 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) __attribute__((weak,alias
#endif
/* -- End Profiling Symbol Block */
-#if 1 /* for rdtsc timer */
-uint64_t rdtsc_prog_start, rdtsc_prog_end, rdtsc_wait_sum;
-#endif
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
the MPI routines */
#ifndef MPICH_MPI_FROM_PMPI
diff --git a/src/mpi/timer/wtime.c b/src/mpi/timer/wtime.c
index bc48629..a0338f0 100644
--- a/src/mpi/timer/wtime.c
+++ b/src/mpi/timer/wtime.c
@@ -53,14 +53,8 @@ double MPI_Wtime( void )
MPIR_ERRTEST_INITIALIZED_ORDIE();
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WTIME);
-#if 1 /* for rdtsc timer */
- uint64_t _t = MPI_rdtsc_light();
- if(_t & (0xffffULL<<48)) { _t &= ~(0xffffULL<<48); }
- d = _t;
-#else
MPID_Wtime( &t );
MPID_Wtime_todouble( &t, &d );
-#endif
MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WTIME);
return d;
diff --git a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h
index 8aec95a..13a9c79 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h
@@ -7,21 +7,9 @@
#if !defined(MPICH_MPIDI_CH3_POST_H_INCLUDED)
#define MPICH_MPIDI_CH3_POST_H_INCLUDED
-#if 1 /* for rdtsc timer */
-#define MPIDI_CH3_Progress_start(progress_state_) \
- (progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count); \
- rdtsc_prog_start = MPI_rdtsc_light();
-#define MPIDI_CH3_Progress_end(progress_state_) \
- rdtsc_prog_end = MPI_rdtsc_light(); \
- if (rdtsc_prog_end < rdtsc_prog_start) \
- rdtsc_wait_sum += ((rdtsc_prog_end - rdtsc_prog_start) & ((1ULL << 48) - 1)); \
- else \
- rdtsc_wait_sum += (rdtsc_prog_end - rdtsc_prog_start);
-#else
#define MPIDI_CH3_Progress_start(progress_state_) \
(progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count);
#define MPIDI_CH3_Progress_end(progress_state_)
-#endif
enum {
MPIDI_CH3_start_packet_handler_id = 128,
diff --git a/src/mpid/ch3/src/mpid_finalize.c b/src/mpid/ch3/src/mpid_finalize.c
index 60ac9d1..1d60f85 100644
--- a/src/mpid/ch3/src/mpid_finalize.c
+++ b/src/mpid/ch3/src/mpid_finalize.c
@@ -22,27 +22,6 @@ int MPID_Finalize(void)
MPIDI_FUNC_ENTER(MPID_STATE_MPID_FINALIZE);
-#if 1 /* for rdtsc timer */
-
- { /* MPID_Wtime_init */
- unsigned long long t1, t2;
- struct timeval tv1, tv2;
- double td1, td2, nsec_per_tick;
-
- gettimeofday(&tv1, NULL);
- t1 = MPI_rdtsc_light();
- usleep(250000);
- gettimeofday(&tv2, NULL);
- t2 = MPI_rdtsc_light();
-
- td1 = (tv1.tv_sec * 1000000.0 + tv1.tv_usec) * 1000;
- td2 = (tv2.tv_sec * 1000000.0 + tv2.tv_usec) * 1000;
-
- nsec_per_tick = (td2 - td1) / (double)(t2 - t1);
-
- printf("[%2d] : %llu(tick) * %f(nsec/tick) = %f(msec)\n", MPIDI_Process.my_pg_rank, rdtsc_wait_sum, nsec_per_tick, rdtsc_wait_sum * nsec_per_tick / 1000000.0);
- }
-#endif
/*
* Wait for all posted receives to complete. For now we are not doing
* this since it will cause invalid programs to hang.
http://git.mpich.org/mpich.git/commitdiff/96b4b7b323ff35e9732406fc4c3c86d98b7b75ff
commit 96b4b7b323ff35e9732406fc4c3c86d98b7b75ff
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Thu Oct 2 14:09:37 2014 +0900
Wait until all UNSOLICITED are done
Sender does not know if UNSOLICITED command was sent or not.
So process might be finished before the command is sent.
To avoid this, wait until all UNSOLICITED are done.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index f3d610f..6af0daf 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -32,12 +32,26 @@ typedef struct
uint64_t remote_endpoint_addr;
void *endpoint;
rque_t send_queue; /* MPID_Request Queue */
+ unsigned int unsolicited_count;
} MPID_nem_tofu_vc_area;
/* macro for tofu private in VC */
#define VC_TOFU(vc) ((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)
#define VC_FIELD(vcp, field) (((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)->field)
+#define UNSOLICITED_NUM_INC(req) \
+{ \
+ MPID_Request *sreq = req; \
+ MPIDI_VC_t *vc = sreq->ch.vc; \
+ VC_FIELD(vc, unsolicited_count)++; \
+}
+#define UNSOLICITED_NUM_DEC(req) \
+{ \
+ MPID_Request *sreq = req; \
+ MPIDI_VC_t *vc = sreq->ch.vc; \
+ VC_FIELD(vc, unsolicited_count)--; \
+}
+
typedef struct
{
void *cmds;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 5227f80..088627e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -493,6 +493,7 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
lcmd[0].iov_local = LLC_iov_alloc(1);
lcmd[0].iov_remote = LLC_iov_alloc(1);
+ UNSOLICITED_NUM_INC(cbarg);
lcmd->opcode = LLC_OPCODE_UNSOLICITED;
lcmd->comm = LLC_COMM_WORLD;
lcmd->rank = (uint32_t)raddr; /* XXX */
@@ -636,6 +637,7 @@ int llctofu_poll(int in_blocking_poll,
usr = (void *)lcmd->usr_area;
vp_sreq = usr->cbarg;
+ UNSOLICITED_NUM_DEC(vp_sreq);
if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index f2a5ae6..e28db85 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -83,6 +83,11 @@ int MPID_nem_tofu_vc_destroy(MPIDI_VC_t *vc)
vc_tofu->endpoint = 0;
}
+ /* wait until all UNSOLICITED are done */
+ while (VC_FIELD(vc, unsolicited_count)) {
+ MPID_nem_tofu_poll(1);
+ }
+
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
return mpi_errno;
http://git.mpich.org/mpich.git/commitdiff/f96034aa5f31b107d697fc6c1aab743952017784
commit f96034aa5f31b107d697fc6c1aab743952017784
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Jun 17 18:56:47 2014 +0900
Time trace with rdtsc
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 1e18a17..ee0bde4 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -65,6 +65,20 @@
#include <limits.h>
#endif
+#if 1 /* for rdtsc timer */
+extern uint64_t rdtsc_prog_start, rdtsc_prog_end, rdtsc_wait_sum;
+static inline uint64_t MPI_rdtsc_light(void )
+{
+ uint64_t x;
+ __asm__ __volatile__("rdtscp;" /* rdtscp don't jump over earlier instructions */
+ "shl $32, %%rdx;"
+ "or %%rdx, %%rax" :
+ "=a"(x) :
+ :
+ "%rcx", "%rdx", "memory");
+ return x;
+}
+#endif
#if defined(HAVE_LONG_LONG_INT)
/* tt#1776: some platforms have "long long" but not a LLONG_MAX/ULLONG_MAX,
* usually because some feature test macro has turned them off in glibc's
diff --git a/src/mpi/pt2pt/wait.c b/src/mpi/pt2pt/wait.c
index 6773c82..7326a71 100644
--- a/src/mpi/pt2pt/wait.c
+++ b/src/mpi/pt2pt/wait.c
@@ -19,6 +19,9 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) __attribute__((weak,alias
#endif
/* -- End Profiling Symbol Block */
+#if 1 /* for rdtsc timer */
+uint64_t rdtsc_prog_start, rdtsc_prog_end, rdtsc_wait_sum;
+#endif
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
the MPI routines */
#ifndef MPICH_MPI_FROM_PMPI
diff --git a/src/mpi/timer/wtime.c b/src/mpi/timer/wtime.c
index a0338f0..bc48629 100644
--- a/src/mpi/timer/wtime.c
+++ b/src/mpi/timer/wtime.c
@@ -53,8 +53,14 @@ double MPI_Wtime( void )
MPIR_ERRTEST_INITIALIZED_ORDIE();
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WTIME);
+#if 1 /* for rdtsc timer */
+ uint64_t _t = MPI_rdtsc_light();
+ if(_t & (0xffffULL<<48)) { _t &= ~(0xffffULL<<48); }
+ d = _t;
+#else
MPID_Wtime( &t );
MPID_Wtime_todouble( &t, &d );
+#endif
MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WTIME);
return d;
diff --git a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h
index 13a9c79..8aec95a 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_post.h
@@ -7,9 +7,21 @@
#if !defined(MPICH_MPIDI_CH3_POST_H_INCLUDED)
#define MPICH_MPIDI_CH3_POST_H_INCLUDED
+#if 1 /* for rdtsc timer */
+#define MPIDI_CH3_Progress_start(progress_state_) \
+ (progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count); \
+ rdtsc_prog_start = MPI_rdtsc_light();
+#define MPIDI_CH3_Progress_end(progress_state_) \
+ rdtsc_prog_end = MPI_rdtsc_light(); \
+ if (rdtsc_prog_end < rdtsc_prog_start) \
+ rdtsc_wait_sum += ((rdtsc_prog_end - rdtsc_prog_start) & ((1ULL << 48) - 1)); \
+ else \
+ rdtsc_wait_sum += (rdtsc_prog_end - rdtsc_prog_start);
+#else
#define MPIDI_CH3_Progress_start(progress_state_) \
(progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count);
#define MPIDI_CH3_Progress_end(progress_state_)
+#endif
enum {
MPIDI_CH3_start_packet_handler_id = 128,
diff --git a/src/mpid/ch3/src/mpid_finalize.c b/src/mpid/ch3/src/mpid_finalize.c
index 1d60f85..60ac9d1 100644
--- a/src/mpid/ch3/src/mpid_finalize.c
+++ b/src/mpid/ch3/src/mpid_finalize.c
@@ -22,6 +22,27 @@ int MPID_Finalize(void)
MPIDI_FUNC_ENTER(MPID_STATE_MPID_FINALIZE);
+#if 1 /* for rdtsc timer */
+
+ { /* MPID_Wtime_init */
+ unsigned long long t1, t2;
+ struct timeval tv1, tv2;
+ double td1, td2, nsec_per_tick;
+
+ gettimeofday(&tv1, NULL);
+ t1 = MPI_rdtsc_light();
+ usleep(250000);
+ gettimeofday(&tv2, NULL);
+ t2 = MPI_rdtsc_light();
+
+ td1 = (tv1.tv_sec * 1000000.0 + tv1.tv_usec) * 1000;
+ td2 = (tv2.tv_sec * 1000000.0 + tv2.tv_usec) * 1000;
+
+ nsec_per_tick = (td2 - td1) / (double)(t2 - t1);
+
+ printf("[%2d] : %llu(tick) * %f(nsec/tick) = %f(msec)\n", MPIDI_Process.my_pg_rank, rdtsc_wait_sum, nsec_per_tick, rdtsc_wait_sum * nsec_per_tick / 1000000.0);
+ }
+#endif
/*
* Wait for all posted receives to complete. For now we are not doing
* this since it will cause invalid programs to hang.
http://git.mpich.org/mpich.git/commitdiff/3b1b0500eea64807b2464d7d453cfd0c481e2913
commit 3b1b0500eea64807b2464d7d453cfd0c481e2913
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Mon Jun 16 19:15:14 2014 +0900
Add memory release operation
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
index c0291ac..a96357e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
@@ -4,6 +4,7 @@
**LLC_init:LLC_init failed
**LLC_poll:LLC_poll failed
**LLC_post:LLC_post failed
+**LLC_release_buffer:LLC_release_buffer failed
**MPIDI_PG_GetConnKVSname:MPIDI_PG_GetConnKVSname failed
**MPID_nem_ib_kvs_get_binary:MPID_nem_ib_kvs_get_binary failed
**MPID_nem_ib_kvs_put_binary:MPID_nem_ib_kvs_put_binary failed
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index f0049e6..5227f80 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -672,6 +672,8 @@ int llctofu_poll(int in_blocking_poll,
((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
(uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
bsiz);
+ llc_errno = LLC_release_buffer(&events[0]);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_release_buffer");
break; }
case LLC_EVENT_RECV_MATCHED: {
@@ -724,6 +726,8 @@ int llctofu_poll(int in_blocking_poll,
/* Mark completion on rreq */
MPIDI_CH3U_Request_complete(req);
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
break; }
default:
printf("llctofu_poll,unknown event type=%d\n", events[0].type);
http://git.mpich.org/mpich.git/commitdiff/f94e850cb4f4ad7410d858134ef4e7695fc90181
commit f94e850cb4f4ad7410d858134ef4e7695fc90181
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Jun 10 13:04:21 2014 +0900
Fix the buffer address for send/recv
The data format to transmit or receive may be contiguous and have the
nonzero lower bound.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index f5b7c33..116aa4f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -256,7 +256,7 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
void *write_to_buf;
if (dt_contig) {
- write_to_buf = (void *) ((char *) req->dev.user_buf /*+ REQ_FIELD(req, lmt_dt_true_lb) */);
+ write_to_buf = (void *) ((char *) req->dev.user_buf + dt_true_lb);
}
else {
REQ_FIELD(req, pack_buf) = MPIU_Malloc(data_sz);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 5bc4684..f0049e6 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -86,7 +86,7 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
const void *write_from_buf;
if (dt_contig) {
- write_from_buf = buf;
+ write_from_buf = buf + dt_true_lb;
}
else {
/* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
http://git.mpich.org/mpich.git/commitdiff/44f705288de2ab3063b535f1bc140ee4932e5f04
commit 44f705288de2ab3063b535f1bc140ee4932e5f04
Author: Norio Yamaguchi <norio.yamaguchi at riken.jp>
Date: Tue Jun 10 09:13:48 2014 +0900
Fix update request status after receiving data
The values of request status are used when using collective
communication. So update them after receiving data.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 3c28d47..5bc4684 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -712,6 +712,10 @@ int llctofu_poll(int in_blocking_poll,
MPIU_Free(REQ_FIELD(req, pack_buf));
}
+ req->status.MPI_TAG = req->dev.match.parts.tag;
+ req->status.MPI_SOURCE = req->dev.match.parts.rank;
+ MPIR_STATUS_SET_COUNT(req->status, events[0].side.initiator.length);
+
/* Dequeue request from posted queue.
It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
int found = MPIDI_CH3U_Recvq_DP(req);
http://git.mpich.org/mpich.git/commitdiff/de26b71298dd7485f322059418bc078e49222c8b
commit de26b71298dd7485f322059418bc078e49222c8b
Author: Masamichi Takagi <masamichi.takagi at riken.jp>
Date: Thu Jun 5 17:09:47 2014 +0900
Rename from match field of LLC_cmd_t to tag
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
index a8ac8c9..6f6b2d8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -9,7 +9,7 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
-#define MPID_NEM_TOFU_DEBUG_INIT
+//#define MPID_NEM_TOFU_DEBUG_INIT
#ifdef MPID_NEM_TOFU_DEBUG_INIT
#define dprintf printf
#else
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index 4b98a64..f5b7c33 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -9,7 +9,7 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
-#define MPID_NEM_TOFU_DEBUG_POLL
+//#define MPID_NEM_TOFU_DEBUG_POLL
#ifdef MPID_NEM_TOFU_DEBUG_POLL
#define dprintf printf
#else
@@ -279,14 +279,17 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
cmd[0].req_id = cmd;
/* req->comm is set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
- MPIU_Assert(sizeof(LLC_match_t) >= sizeof(MPIDI_Message_match_parts_t));
- memcpy(cmd[0].match.bits, &req->dev.match.parts, sizeof(MPIDI_Message_match_parts_t));
- memset((uint8_t*)cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
- 0, sizeof(LLC_match_t) - sizeof(MPIDI_Message_match_parts_t));
-
- dprintf("tofu_recv_posted,match.bits=");
- for(i = 0; i < sizeof(LLC_match_t); i++) {
- dprintf("%02x", cmd[0].match.bits[i]);
+ *(int32_t*)((uint8_t*)&cmd[0].tag) = req->dev.match.parts.tag;
+ *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ req->dev.match.parts.context_id;
+ MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
+ memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ 0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+
+
+ dprintf("tofu_recv_posted,tag=");
+ for(i = 0; i < sizeof(LLC_tag_t); i++) {
+ dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
}
dprintf("\n");
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 66190f9..3c28d47 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -9,7 +9,7 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
-#define MPID_NEM_TOFU_DEBUG_SEND
+//#define MPID_NEM_TOFU_DEBUG_SEND
#ifdef MPID_NEM_TOFU_DEBUG_SEND
#define dprintf printf
#else
@@ -64,16 +64,16 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
/* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
/* See src/mpid/ch3/src/mpid_isend.c */
- ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->rank = comm->rank;
- ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->tag = tag;
- ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->context_id = comm->context_id + context_offset;
- MPIU_Assert(sizeof(LLC_match_t) >= sizeof(MPIDI_Message_match_parts_t));
- memset((uint8_t*)&cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
- 0, sizeof(LLC_match_t) - sizeof(MPIDI_Message_match_parts_t));
-
- dprintf("tofu_isend,match.bits=");
- for(i = 0; i < sizeof(LLC_match_t); i++) {
- dprintf("%02x", cmd[0].match.bits[i]);
+ *(int32_t*)((uint8_t*)&cmd[0].tag) = tag;
+ *(MPIR_Context_id_t*)((uint8_t*)&cmd[0].tag + sizeof(int32_t)) =
+ comm->context_id + context_offset;
+ MPIU_Assert(sizeof(LLC_tag_t) >= sizeof(int32_t) + sizeof(MPIR_Context_id_t));
+ memset((uint8_t*)&cmd[0].tag + sizeof(int32_t) + sizeof(MPIR_Context_id_t),
+ 0, sizeof(LLC_tag_t) - sizeof(int32_t) - sizeof(MPIR_Context_id_t));
+
+ dprintf("tofu_isend,tag=");
+ for(i = 0; i < sizeof(LLC_tag_t); i++) {
+ dprintf("%02x", (int)*((uint8_t*)&cmd[0].tag + i));
}
dprintf("\n");
@@ -636,6 +636,7 @@ int llctofu_poll(int in_blocking_poll,
usr = (void *)lcmd->usr_area;
vp_sreq = usr->cbarg;
+
if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
MPID_nem_tofu_segv;
@@ -651,7 +652,6 @@ int llctofu_poll(int in_blocking_poll,
break; }
case LLC_EVENT_UNSOLICITED_ARRIVED: {
- dprintf("llctofu_poll,EVENT_UNSOLICITED_ARRIVED\n");
void *vp_vc = 0;
uint64_t addr;
void *buff;
@@ -664,6 +664,10 @@ int llctofu_poll(int in_blocking_poll,
"LLC_leng = %d", (int)bsiz);
MPIU_DBG_PKT(vp_vc, buff, "poll");
}
+ dprintf("tofu_poll,EVENT_UNSOLICITED_ARRIVED,%d<-%d\n",
+ MPIDI_Process.my_pg_rank,
+ ((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank
+ );
(*rfnc)(vp_vc,
((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
(uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index c4ebd9c..f2a5ae6 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -9,7 +9,7 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
-#define MPID_NEM_TOFU_DEBUG_VC
+//#define MPID_NEM_TOFU_DEBUG_VC
#ifdef MPID_NEM_TOFU_DEBUG_VC
#define dprintf printf
#else
@@ -100,6 +100,8 @@ int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc)
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+
+ dprintf("tofu_vc_terminate,enter,%d->%d\n", MPIDI_Process.my_pg_rank, vc->pg_rank);
mpi_errno = MPIDI_CH3U_Handle_connection (vc, MPIDI_VC_EVENT_TERMINATED);
http://git.mpich.org/mpich.git/commitdiff/fbd66c66c9ad42a172baf4fb16d31c2b0fdca87d
commit fbd66c66c9ad42a172baf4fb16d31c2b0fdca87d
Author: Masamichi Takagi <masamichi.takagi at gmail.com>
Date: Tue Apr 22 10:23:55 2014 +0900
Add entries in errnames.txt
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
index d2016e2..c0291ac 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
@@ -1,7 +1,15 @@
**LLC_cmd_free:LLC_cmd_free failed
+**LLC_comm_rank:LLC_comm_rank failed
+**LLC_init:LLC_init failed
**LLC_poll:LLC_poll failed
**LLC_post:LLC_post failed
+**MPIDI_PG_GetConnKVSname:MPIDI_PG_GetConnKVSname failed
+**MPID_nem_ib_kvs_get_binary:MPID_nem_ib_kvs_get_binary failed
+**MPID_nem_ib_kvs_put_binary:MPID_nem_ib_kvs_put_binary failed
+**PMI_Barrier:PMI_Barrier failed
+**PMI_KVS_Put:PMI_KVS_Put failed
+**PMS_KVS_Get:PMS_KVS_Get failed
**fail:fail failed
**llctofu_poll:llctofu_poll failed
**outofmemory:outofmemory failed
http://git.mpich.org/mpich.git/commitdiff/708ff5f3004fdb3cd89d6b370910b69b6ebdafc7
commit 708ff5f3004fdb3cd89d6b370910b69b6ebdafc7
Author: Masamichi Takagi <masamichi.takagi at gmail.com>
Date: Tue Apr 8 17:48:36 2014 +0900
Implementing the Tofu netmod
Squash this because it's a mixed commit.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
index bf32469..f3d610f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -12,6 +12,8 @@
#include "mpid_nem_impl.h"
#include "llc.h"
+extern int MPID_nem_tofu_my_llc_rank;
+
/* The vc provides a generic buffer in which network modules can store
* private fields This removes all dependencies from the VC struction
* on the network module, facilitating dynamic module loading. */
@@ -34,6 +36,7 @@ typedef struct
/* macro for tofu private in VC */
#define VC_TOFU(vc) ((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)
+#define VC_FIELD(vcp, field) (((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)->field)
typedef struct
{
@@ -46,6 +49,11 @@ typedef struct
((MPID_nem_tofu_req_area *)(&(req)->ch.netmod_area.padding))
#define REQ_FIELD(reqp, field) (((MPID_nem_tofu_req_area *)((reqp)->ch.netmod_area.padding))->field)
+struct llctofu_cmd_area {
+ void *cbarg;
+ uint32_t raddr;
+};
+
/* functions */
int MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
int MPID_nem_tofu_finalize (void);
@@ -71,6 +79,9 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req);
+int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
+ int length);
+int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int length);
/*
* temporary llctofu api
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
index 66a958b..a8ac8c9 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -9,6 +9,13 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
+#define MPID_NEM_TOFU_DEBUG_INIT
+#ifdef MPID_NEM_TOFU_DEBUG_INIT
+#define dprintf printf
+#else
+#define dprintf(...)
+#endif
+
/* global variables */
/* src/mpid/ch3/channels/nemesis/include/mpid_nem_nets.h */
@@ -31,28 +38,84 @@ MPID_nem_netmod_funcs_t MPIDI_nem_tofu_funcs = {
.anysource_improbe = MPID_nem_tofu_anysource_improbe,
};
+int MPID_nem_tofu_my_llc_rank;
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_kvs_put_binary
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_kvs_put_binary(int from, const char *postfix, const uint8_t * buf,
+ int length)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int pmi_errno;
+ char *kvs_name;
+ char key[256], val[256], str[256];
+ int j;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_KVS_PUT_BINARY);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_KVS_PUT_BINARY);
+
+ mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
+ dprintf("kvs_put_binary,kvs_name=%s\n", kvs_name);
+
+ sprintf(key, "bc/%d/%s", from, postfix);
+ val[0] = 0;
+ for (j = 0; j < length; j++) {
+ sprintf(str, "%02x", buf[j]);
+ strcat(val, str);
+ }
+ dprintf("kvs_put_binary,rank=%d,from=%d,PMI_KVS_Put(%s, %s, %s)\n",
+ MPIDI_Process.my_pg_rank, from, kvs_name, key, val);
+ pmi_errno = PMI_KVS_Put(kvs_name, key, val);
+ MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMI_KVS_Put");
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_KVS_PUT_BINARY);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
-static MPIDI_Comm_ops_t comm_ops = {
- .recv_posted = MPID_nem_tofu_recv_posted,
- .send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
- .rsend = NULL,
- .ssend = NULL,
- .isend = MPID_nem_tofu_isend,
- .irsend = NULL,
- .issend = NULL,
-
- .send_init = NULL,
- .bsend_init = NULL,
- .rsend_init = NULL,
- .ssend_init = NULL,
- .start_all = NULL,
-
- .cancel_send = NULL,
- .cancel_recv = NULL,
-
- .prove = NULL,
- .iprove = NULL,
- .improve = NULL
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_kvs_get_binary
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_kvs_get_binary(int from, const char *postfix, char *buf, int length)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int pmi_errno;
+ char *kvs_name;
+ char key[256], val[256], str[256];
+ int j;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_KVS_GET_BINARY);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_KVS_GET_BINARY);
+
+ mpi_errno = MPIDI_PG_GetConnKVSname(&kvs_name);
+ dprintf("kvs_get_binary,kvs_name=%s\n", kvs_name);
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**MPIDI_PG_GetConnKVSname");
+
+ sprintf(key, "bc/%d/%s", from, postfix);
+ dprintf("kvs_put_binary,rank=%d,from=%d,PMI_KVS_Get(%s, %s, %s)\n",
+ MPIDI_Process.my_pg_rank, from, kvs_name, key, val);
+ pmi_errno = PMI_KVS_Get(kvs_name, key, val, 256);
+ MPIU_ERR_CHKANDJUMP(pmi_errno, mpi_errno, MPI_ERR_OTHER, "**PMS_KVS_Get");
+
+ dprintf("rank=%d,obtained val=%s\n", MPIDI_Process.my_pg_rank, val);
+ char *strp = val;
+ for (j = 0; j < length; j++) {
+ memcpy(str, strp, 2);
+ str[2] = 0;
+ buf[j] = strtol(str, NULL, 16);
+ strp += 2;
+ }
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_KVS_GET_BINARY);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
}
#undef FUNCNAME
@@ -63,14 +126,34 @@ int
MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank,
char **bc_val_p, int *val_max_sz_p)
{
- int mpi_errno = MPI_SUCCESS;
+ int mpi_errno = MPI_SUCCESS, pmi_errno, llc_errno;
int rc;
+ int i;
+ int llc_rank;
+
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_INIT);
- rc = LLC_init();
- MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
+ llc_errno = LLC_init();
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_init");
+
+ llc_errno = LLC_comm_rank(LLC_COMM_WORLD, &MPID_nem_tofu_my_llc_rank);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_comm_rank");
+
+ /* Announce my LLC rank */
+ mpi_errno =
+ MPID_nem_tofu_kvs_put_binary(pg_rank, "llc_rank",
+ (uint8_t *) & MPID_nem_tofu_my_llc_rank,
+ sizeof(int));
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
+ "**MPID_nem_ib_kvs_put_binary");
+ dprintf("tofu_init,my_pg_rank=%d,my_llc_rank=%d\n",
+ MPIDI_Process.my_pg_rank, MPID_nem_tofu_my_llc_rank);
+
+ /* Wait until the key-value propagates among all ranks */
+ pmi_errno = PMI_Barrier();
+ MPIU_ERR_CHKANDJUMP(pmi_errno != PMI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**PMI_Barrier");
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_INIT);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
index f1996cd..4b98a64 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -9,6 +9,13 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
+#define MPID_NEM_TOFU_DEBUG_POLL
+#ifdef MPID_NEM_TOFU_DEBUG_POLL
+#define dprintf printf
+#else
+#define dprintf(...)
+#endif
+
/* function prototypes */
static void MPID_nem_tofu_send_handler(void *cba,
@@ -89,12 +96,26 @@ static void MPID_nem_tofu_send_handler(void *cba,
case MPID_PREQUEST_SEND: {
reqtype = MPIDI_Request_get_type(sreq);
MPIU_Assert(reqtype != MPIDI_REQUEST_TYPE_GET_RESP);
-
- int is_contig;
- MPID_Datatype_is_contig(sreq->dev.datatype, &is_contig);
- if (!is_contig && REQ_FIELD(sreq, pack_buf)) {
- dprintf("tofu_send_handler,non-contiguous,free pack_buf\n");
- MPIU_Free(REQ_FIELD(req, pack_buf));
+
+ /* 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_tofu_iStartContigMsg-->MPID_nem_tofu_iSendContig
+ * and MPID_nem_tofu_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. */
+ 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("tofu_send_handler,non-contiguous,free pack_buf\n");
+ MPIU_Free(REQ_FIELD(sreq, pack_buf));
+ }
}
/* sreq: src/mpid/ch3/include/mpidpre.h */
@@ -131,6 +152,8 @@ static void MPID_nem_tofu_send_handler(void *cba,
}
break; }
default:
+ printf("send_handler,unknown kind=%08x\n", sreq->kind);
+ MPID_nem_tofu_segv;
break;
}
@@ -209,21 +232,27 @@ static void MPID_nem_tofu_recv_handler(
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
{
- int mpi_errno = MPI_SUCCESS;
+ int mpi_errno = MPI_SUCCESS, llc_errno;
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPID_Datatype *dt_ptr;
MPI_Aint dt_true_lb;
+ int i;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
- /* req->dev.datatype is set in MPIDI_CH3U_Recvq_FDU_or_AEP (in src/mpid/ch3/src/ch3u_recvq.c) */
+ /* req->dev.datatype is set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, data_sz, dt_ptr,
dt_true_lb);
- /* stash vc for ib_poll */
- req->ch.vc = vc;
+ /* Don't save VC because it's not used in llctofu_poll */
+
+ /* Save data size for llctofu_poll */
+ req->dev.recv_data_sz = data_sz;
+
+ dprintf("tofu_recv_posted,%d<-%d,vc=%p,req=%p,user_buf=%p,data_sz=%ld,datatype=%08x,dt_contig=%d\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, vc, req, req->dev.user_buf, req->dev.recv_data_sz, req->dev.datatype, dt_contig);
void *write_to_buf;
if (dt_contig) {
@@ -236,28 +265,47 @@ int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
write_to_buf = REQ_FIELD(req, pack_buf);
}
+ int LLC_my_rank;
+ LLC_comm_rank(LLC_COMM_WORLD, &LLC_my_rank);
+ dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+
+ dprintf("tofu_recv_posted,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+
+ LLC_cmd_t *cmd = LLC_cmd_alloc(1);
+
cmd[0].opcode = LLC_OPCODE_RECV;
cmd[0].comm = LLC_COMM_WORLD;
cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
+ cmd[0].req_id = cmd;
- ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->rank = comm->rank;
- ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->tag = tag;
- ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->context_id = comm->context_id + context_offset;
+ /* req->comm is set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
MPIU_Assert(sizeof(LLC_match_t) >= sizeof(MPIDI_Message_match_parts_t));
- memset((uint8_t*)&cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
+ memcpy(cmd[0].match.bits, &req->dev.match.parts, sizeof(MPIDI_Message_match_parts_t));
+ memset((uint8_t*)cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
0, sizeof(LLC_match_t) - sizeof(MPIDI_Message_match_parts_t));
+ dprintf("tofu_recv_posted,match.bits=");
+ for(i = 0; i < sizeof(LLC_match_t); i++) {
+ dprintf("%02x", cmd[0].match.bits[i]);
+ }
+ dprintf("\n");
+
+ cmd[0].iov_local = LLC_iov_alloc(1);
cmd[0].iov_local[0].addr = (uint64_t)write_to_buf;
cmd[0].iov_local[0].length = data_sz;
cmd[0].niov_local = 1;
+ cmd[0].iov_remote = LLC_iov_alloc(1);
cmd[0].iov_remote[0].addr = 0;
cmd[0].iov_remote[0].length = data_sz;;
cmd[0].niov_remote = 1;
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = req;
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+
llc_errno = LLC_post(cmd, 1);
- ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, -1, printf("LLC_post failed\n"));
+ MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
index 294c5db..66190f9 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -9,27 +9,57 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
+#define MPID_NEM_TOFU_DEBUG_SEND
+#ifdef MPID_NEM_TOFU_DEBUG_SEND
+#define dprintf printf
+#else
+#define dprintf(...)
+#endif
+
#undef FUNCNAME
#define FUNCNAME MPID_nem_tofu_isend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_tofu_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 )
+ struct MPID_Request **req_out)
{
- int mpi_errno = MPI_SUCCESS;
+ int mpi_errno = MPI_SUCCESS, llc_errno;
int dt_contig;
MPIDI_msg_sz_t data_sz;
MPID_Datatype *dt_ptr;
MPI_Aint dt_true_lb;
+ int i;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISEND);
+ dprintf("tofu_isend,%d->%d,buf=%p,count=%d,datatype=%08x,dest=%d,tag=%08x,comm=%p,context_offset=%d\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, buf, count, datatype, dest, tag, comm, context_offset);
+
+ int LLC_my_rank;
+ LLC_comm_rank(LLC_COMM_WORLD, &LLC_my_rank);
+ dprintf("tofu_isend,LLC_my_rank=%d\n", LLC_my_rank);
+
+ struct MPID_Request * sreq = MPID_Request_create();
+ MPIU_Assert(sreq != NULL);
+ MPIU_Object_set_ref(sreq, 2);
+ sreq->kind = MPID_REQUEST_SEND;
+
+ /* Used in tofullc_poll --> MPID_nem_tofu_send_handler */
+ sreq->ch.vc = vc;
+ sreq->dev.OnDataAvail = 0;
+ /* Don't save iov_offset because it's not used. */
+
+ /* Save it because it's used in send_handler */
+ sreq->dev.datatype = datatype;
+
+ dprintf("tofu_isend,remote_endpoint_addr=%ld\n", VC_FIELD(vc, remote_endpoint_addr));
+
LLC_cmd_t *cmd = LLC_cmd_alloc(1);
cmd[0].opcode = LLC_OPCODE_SEND;
cmd[0].comm = LLC_COMM_WORLD;
- cmd[0].rank = vc_tofu->remote_endpoint_addr;
+ cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
cmd[0].req_id = cmd;
/* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
@@ -41,12 +71,20 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
memset((uint8_t*)&cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
0, sizeof(LLC_match_t) - sizeof(MPIDI_Message_match_parts_t));
+ dprintf("tofu_isend,match.bits=");
+ for(i = 0; i < sizeof(LLC_match_t); i++) {
+ dprintf("%02x", cmd[0].match.bits[i]);
+ }
+ dprintf("\n");
/* Prepare RDMA-write from buffer */
MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
dt_true_lb);
+ dprintf("tofu_isend,dt_contig=%d,data_sz=%ld\n",
+ dt_contig, data_sz);
- void *write_from_buf;
+
+ const void *write_from_buf;
if (dt_contig) {
write_from_buf = buf;
}
@@ -60,13 +98,13 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
MPIDI_msg_sz_t segment_size = data_sz;
MPIDI_msg_sz_t last = segment_size;
MPIU_Assert(last > 0);
- REQ_FIELD(req, pack_buf) = MPIU_Malloc((size_t) data_sz);
- MPIU_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER,
+ REQ_FIELD(sreq, pack_buf) = MPIU_Malloc((size_t) data_sz);
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(sreq, pack_buf), mpi_errno, MPI_ERR_OTHER,
"**outofmemory");
MPID_Segment_pack(segment_ptr, segment_first, &last,
- (char *) (REQ_FIELD(req, pack_buf)));
+ (char *) (REQ_FIELD(sreq, pack_buf)));
MPIU_Assert(last == data_sz);
- write_from_buf = REQ_FIELD(req, lmt_pack_buf);
+ write_from_buf = REQ_FIELD(sreq, pack_buf);
}
cmd[0].iov_local = LLC_iov_alloc(1);
@@ -79,10 +117,14 @@ int MPID_nem_tofu_isend(struct MPIDI_VC *vc, const void *buf, int count, MPI_Dat
cmd[0].iov_remote[0].length = data_sz;
cmd[0].niov_remote = 1;
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->cbarg = sreq;
+ ((struct llctofu_cmd_area *)cmd[0].usr_area)->raddr = VC_FIELD(vc, remote_endpoint_addr);
+
llc_errno = LLC_post(cmd, 1);
MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
fn_exit:
+ *req_out = sreq;
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISEND);
return mpi_errno;
fn_fail:
@@ -103,6 +145,9 @@ int MPID_nem_tofu_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+ dprintf("tofu_iStartContigMsg,%d->%d,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, hdr, hdr_sz, data, data_sz);
+
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_iStartContigMsg");
MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
@@ -197,6 +242,9 @@ int MPID_nem_tofu_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPI
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+ dprintf("tofu_iSendConitig,sreq=%p,hdr=%p,hdr_sz=%ld,data=%p,data_sz=%ld\n",
+ sreq, hdr, hdr_sz, data, data_sz);
+
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_iSendContig");
MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
@@ -403,17 +451,14 @@ int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
return ret;
}
-struct llctofu_cmd_area {
- void *cbarg;
- uint32_t raddr;
-};
-
ssize_t llctofu_writev(void *endpt, uint64_t raddr,
const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid)
{
ssize_t nw = 0;
LLC_cmd_t *lcmd = 0;
+ dprintf("writev,raddr=%ld,niov=%d,sreq=%p", raddr, niov, cbarg);
+
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev(%d)", (int)raddr);
{
uint8_t *buff = 0;
@@ -445,7 +490,11 @@ ssize_t llctofu_writev(void *endpt, uint64_t raddr,
nw = -1; /* ENOMEM */
goto bad;
}
+ lcmd[0].iov_local = LLC_iov_alloc(1);
+ lcmd[0].iov_remote = LLC_iov_alloc(1);
+
lcmd->opcode = LLC_OPCODE_UNSOLICITED;
+ lcmd->comm = LLC_COMM_WORLD;
lcmd->rank = (uint32_t)raddr; /* XXX */
lcmd->req_id = lcmd;
@@ -542,7 +591,7 @@ int llctofu_poll(int in_blocking_poll,
int llc_errno;
int nevents;
LLC_event_t events[1];
-
+
while(1) {
llc_errno = LLC_poll(1, events, &nevents);
MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_poll");
@@ -557,13 +606,32 @@ int llctofu_poll(int in_blocking_poll,
MPIU_Assert(nevents == 1);
switch(events[0].type) {
- case LLC_EVENT_SEND_LEFT:
- case LLC_EVENT_UNSOLICITED_LEFT: {
-
+ case LLC_EVENT_SEND_LEFT: {
+ dprintf("llctofu_poll,EVENT_SEND_LEFT\n");
lcmd = events[0].side.initiator.req_id;
MPIU_Assert(lcmd != 0);
MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND);
+ if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
+ printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
+ MPID_nem_tofu_segv;
+ }
+
+ /* Call send_handler. First arg is a pointer to MPID_Request */
+ (*sfnc)(((struct llctofu_cmd_area *)lcmd->usr_area)->cbarg, &reqid);
+
+ /* Don't free iov_local[0].addr */
+
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+ break; }
+
+ case LLC_EVENT_UNSOLICITED_LEFT: {
+ dprintf("llctofu_poll,EVENT_UNSOLICITED_LEFT\n");
+ lcmd = events[0].side.initiator.req_id;
+ MPIU_Assert(lcmd != 0);
+ MPIU_Assert(lcmd->opcode == LLC_OPCODE_UNSOLICITED);
+
struct llctofu_cmd_area *usr;
usr = (void *)lcmd->usr_area;
vp_sreq = usr->cbarg;
@@ -583,6 +651,7 @@ int llctofu_poll(int in_blocking_poll,
break; }
case LLC_EVENT_UNSOLICITED_ARRIVED: {
+ dprintf("llctofu_poll,EVENT_UNSOLICITED_ARRIVED\n");
void *vp_vc = 0;
uint64_t addr;
void *buff;
@@ -602,10 +671,11 @@ int llctofu_poll(int in_blocking_poll,
break; }
case LLC_EVENT_RECV_MATCHED: {
+ dprintf("llctofu_poll,EVENT_RECV_MATCHED\n");
lcmd = events[0].side.initiator.req_id;
MPID_Request *req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
- /* unpack non-contiguous dt */
+ /* Unpack non-contiguous dt */
int is_contig;
MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
if (!is_contig) {
@@ -613,10 +683,11 @@ int llctofu_poll(int in_blocking_poll,
/* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
/* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
- MPIDI_msg_sz_t unpack_sz = req->ch.lmt_data_sz;
+ MPIDI_msg_sz_t unpack_sz = req->dev.recv_data_sz;
MPID_Segment seg;
MPI_Aint last;
+ /* user_buf etc. are set in MPID_irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, &seg,
0);
last = unpack_sz;
@@ -634,12 +705,11 @@ int llctofu_poll(int in_blocking_poll,
}
dprintf("llctofu_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
REQ_FIELD(req, pack_buf));
- MPIU_Free(REQ_FIELD(req, pack_buf), (size_t) req->ch.lmt_data_sz);
+ MPIU_Free(REQ_FIELD(req, pack_buf));
}
/* Dequeue request from posted queue.
- A request is posted to the queue, for example, in the following path.
- MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ It's posted in MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
int found = MPIDI_CH3U_Recvq_DP(req);
MPIU_Assert(found);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
index 2ca0eab..c4ebd9c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -8,14 +8,40 @@
#include "mpid_nem_impl.h"
#include "tofu_impl.h"
-#ifdef NOTDEF
-#include <llc/llc-tofu.h>
-#endif /* NOTDEF */
+
+#define MPID_NEM_TOFU_DEBUG_VC
+#ifdef MPID_NEM_TOFU_DEBUG_VC
+#define dprintf printf
+#else
+#define dprintf(...)
+#endif
/* function prototypes */
static int tofu_vc_init (MPIDI_VC_t *vc);
+static MPIDI_Comm_ops_t comm_ops = {
+ .recv_posted = MPID_nem_tofu_recv_posted,
+ .send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
+ .rsend = NULL,
+ .ssend = NULL,
+ .isend = MPID_nem_tofu_isend,
+ .irsend = NULL,
+ .issend = NULL,
+
+ .send_init = NULL,
+ .bsend_init = NULL,
+ .rsend_init = NULL,
+ .ssend_init = NULL,
+ .startall = NULL,
+
+ .cancel_send = NULL,
+ .cancel_recv = NULL,
+
+ .probe = NULL,
+ .iprobe = NULL,
+ .improbe = NULL
+};
#undef FUNCNAME
#define FUNCNAME MPID_nem_tofu_vc_init
@@ -52,18 +78,8 @@ int MPID_nem_tofu_vc_destroy(MPIDI_VC_t *vc)
/* free any resources associated with this VC here */
{
-#ifdef NOTDEF
- int rc;
-#endif /* NOTDEF */
MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
-#ifdef NOTDEF
- rc = llctofu_unbind(vc_tofu->endpoint);
- if (rc != 0 /* LLC_SUCCESS */) {
- mpi_errno = MPI_ERR_OTHER;
- MPIU_ERR_POP(mpi_errno);
- }
-#endif /* NOTDEF */
vc_tofu->endpoint = 0;
}
@@ -103,6 +119,8 @@ int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc)
static int tofu_vc_init (MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
+
+
{
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
@@ -121,26 +139,19 @@ static int tofu_vc_init (MPIDI_VC_t *vc)
MPIDI_CH3I_VC *vc_ch = &vc->ch;
MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
-#ifdef NOTDEF
- vc_tofu->endpoint = 0;
-#else /* NOTDEF */
vc_tofu->endpoint = vc;
-#endif /* NOTDEF */
- vc_tofu->remote_endpoint_addr = vc->pg_rank;
+ mpi_errno =
+ MPID_nem_tofu_kvs_get_binary(vc->pg_rank,
+ "llc_rank",
+ (char *) &vc_tofu->remote_endpoint_addr,
+ sizeof(int));
+ MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER,
+ "**MPID_nem_ib_kvs_get_binary");
+ dprintf("tofu_vc_init,my_pg_rank=%d,pg_rank=%d,my_llc_rank=%d,llc_rank=%ld\n",
+ MPIDI_Process.my_pg_rank, vc->pg_rank, MPID_nem_tofu_my_llc_rank, vc_tofu->remote_endpoint_addr);
+
vc_tofu->send_queue.head = 0; /* GENERIC_Q_DECL */
vc_tofu->send_queue.tail = 0; /* GENERIC_Q_DECL */
-#ifdef NOTDEF
-
- {
- int rc;
- rc = llctofu_bind(&vc_tofu->endpoint,
- vc_tofu->remote_endpoint_addr, vc /* cba */);
- if (rc != 0 /* LLC_SUCCESS */) {
- mpi_errno = MPI_ERR_OTHER;
- MPIU_ERR_POP(mpi_errno);
- }
- }
-#endif /* NOTDEF */
vc->eager_max_msg_sz = (12 * 1024);
vc->ready_eager_max_msg_sz = (12 * 1024);
@@ -148,7 +159,7 @@ static int tofu_vc_init (MPIDI_VC_t *vc)
/* vc->rndvRecv_fn = 0*/
vc->sendNoncontig_fn = MPID_nem_tofu_SendNoncontig;
#ifdef ENABLE_COMM_OVERRIDES
- vc->comm_ops = 0 /* &comm_ops */;
+ vc->comm_ops = &comm_ops;
#endif
vc_ch->iStartContigMsg = MPID_nem_tofu_iStartContigMsg;
@@ -165,7 +176,7 @@ static int tofu_vc_init (MPIDI_VC_t *vc)
fn_exit:
return mpi_errno;
- //fn_fail:
+ fn_fail:
goto fn_exit;
}
http://git.mpich.org/mpich.git/commitdiff/41e583976f9ad1960e0e821a144bdba243abac79
commit 41e583976f9ad1960e0e821a144bdba243abac79
Author: Masamichi Takagi <masamichi.takagi at gmail.com>
Date: Tue Apr 8 12:05:13 2014 +0900
Add errnames.txt for the Tofu netmod
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
new file mode 100644
index 0000000..d2016e2
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/errnames.txt
@@ -0,0 +1,7 @@
+
+**LLC_cmd_free:LLC_cmd_free failed
+**LLC_poll:LLC_poll failed
+**LLC_post:LLC_post failed
+**fail:fail failed
+**llctofu_poll:llctofu_poll failed
+**outofmemory:outofmemory failed
http://git.mpich.org/mpich.git/commitdiff/1679ba2a4c46657dd0fc1b8b7cb67996f160f00a
commit 1679ba2a4c46657dd0fc1b8b7cb67996f160f00a
Author: Masamichi Takagi <masamichi.takagi at gmail.com>
Date: Tue Apr 8 09:30:45 2014 +0900
Add Hatanaka version of MTR netmod files (tofu/*)
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
new file mode 100644
index 0000000..176a164
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/Makefile.mk
@@ -0,0 +1,25 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+## See COPYRIGHT in top-level directory.
+##
+
+if BUILD_NEMESIS_NETMOD_TOFU
+
+# AM_CPPFLAGS += -I...
+
+lib_lib at MPILIBNAME@_la_SOURCES += \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c \
+ $(EOA)
+
+noinst_HEADERS += \
+ src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h \
+ $(EOA)
+
+endif BUILD_NEMESIS_NETMOD_TOFU
+
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4 b/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
new file mode 100644
index 0000000..ca5310b
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/subconfigure.m4
@@ -0,0 +1,57 @@
+[#] start of __file__
+dnl MPICH_SUBCFG_AFTER=src/mpid/ch3/channels/nemesis
+
+AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
+ AM_COND_IF([BUILD_CH3_NEMESIS],[
+ for net in $nemesis_networks ; do
+ AS_CASE([$net],[tofu],[build_nemesis_netmod_tofu=yes])
+ done
+ ])
+ AM_CONDITIONAL([BUILD_NEMESIS_NETMOD_TOFU],[test "X$build_nemesis_netmod_tofu" = "Xyes"])
+
+])dnl
+
+AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[
+AM_COND_IF([BUILD_NEMESIS_NETMOD_TOFU],[
+ AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:nemesis:tofu])
+
+ PAC_SET_HEADER_LIB_PATH(libmemcached)
+ PAC_SET_HEADER_LIB_PATH(ibverbs)
+ PAC_SET_HEADER_LIB_PATH(llc)
+
+ PAC_CHECK_HEADER_LIB(libmemcached/memcached.h,memcached,memcached,libmemcached_found=yes,libmemcached_found=no)
+ if test "${libmemcached_found}" = "yes" ; then
+ AC_MSG_NOTICE([libmemcached is going to be linked.])
+ else
+ AC_MSG_ERROR([Internal error: libmemcached was not found])
+ fi
+
+ PAC_CHECK_HEADER_LIB([infiniband/verbs.h],ibverbs,ibv_open_device,ibverbs_found=yes,ibverbs_found=no)
+ if test "${ibverbs_found}" = "yes" ; then
+ AC_MSG_NOTICE([libibverbs is going to be linked.])
+ else
+ AC_MSG_ERROR([Internal error: ibverbs was not found])
+ fi
+
+ PAC_CHECK_HEADER_LIB(llc.h,llc,LLC_init,llc_found=yes,llc_found=no)
+ if test "${llc_found}" = "yes" ; then
+ AC_MSG_NOTICE([libllc is going to be linked.])
+ else
+ AC_MSG_ERROR([Internal error: llc was not found])
+ fi
+
+ #AC_CHECK_HEADERS([stdlib.h dlfcn.h])
+ #AC_CHECK_FUNCS([dlopen])
+ #AC_SEARCH_LIBS([dlopen], [dl])
+
+dnl AC_TRY_COMPILE([
+dnl #include <stdio.h>
+dnl #include <dlfcn.h>
+dnl ],[
+dnl dlopen(NULL, RTLD_LAZY)
+dnl ],[ac_cv_func_dlopen=yes],[ac_cv_func_dlopen=no])
+
+ AC_DEFINE([ENABLE_COMM_OVERRIDES], 1, [define to add per-vc function pointers to override send and recv functions])
+])dnl end AM_COND_IF(BUILD_NEMESIS_NETMOD_TOFU,...)
+])dnl end _BODY
+[#] end of __file__
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c
new file mode 100644
index 0000000..82896a6
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_fini.c
@@ -0,0 +1,34 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_finalize
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int
+MPID_nem_tofu_finalize(void)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int rc;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_FINALIZE);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_FINALIZE);
+
+ rc = LLC_finalize();
+ MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_FINALIZE);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
new file mode 100644
index 0000000..bf32469
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_impl.h
@@ -0,0 +1,96 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+
+#ifndef TOFU_MODULE_IMPL_H
+#define TOFU_MODULE_IMPL_H
+
+#ifdef USE_PMI2_API
+#include "pmi2.h"
+#else
+#include "pmi.h"
+#endif
+#include "mpid_nem_impl.h"
+#include "llc.h"
+
+/* The vc provides a generic buffer in which network modules can store
+ * private fields This removes all dependencies from the VC struction
+ * on the network module, facilitating dynamic module loading. */
+
+/*
+ * GENERIC_Q_*:
+ * src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h
+ */
+typedef GENERIC_Q_DECL(struct MPID_Request) rque_t;
+/*
+typedef GENERIC_Q_DECL(struct MPID_Request) MPIDI_nem_tofu_request_queue_t;
+ */
+
+typedef struct
+{
+ uint64_t remote_endpoint_addr;
+ void *endpoint;
+ rque_t send_queue; /* MPID_Request Queue */
+} MPID_nem_tofu_vc_area;
+
+/* macro for tofu private in VC */
+#define VC_TOFU(vc) ((MPID_nem_tofu_vc_area *)(vc)->ch.netmod_area.padding)
+
+typedef struct
+{
+ void *cmds;
+ void *pack_buf; /* to pack non-contiguous data */
+
+} MPID_nem_tofu_req_area;
+
+#define REQ_TOFU(req) \
+ ((MPID_nem_tofu_req_area *)(&(req)->ch.netmod_area.padding))
+#define REQ_FIELD(reqp, field) (((MPID_nem_tofu_req_area *)((reqp)->ch.netmod_area.padding))->field)
+
+/* functions */
+int MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
+int MPID_nem_tofu_finalize (void);
+int MPID_nem_tofu_poll(int in_blocking_progress);
+int MPID_nem_tofu_get_business_card (int my_rank, char **bc_val_p, int *val_max_sz_p);
+int MPID_nem_tofu_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc);
+int MPID_nem_tofu_vc_init (MPIDI_VC_t *vc);
+int MPID_nem_tofu_vc_destroy(MPIDI_VC_t *vc);
+int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc);
+
+int MPID_nem_tofu_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
+int MPID_nem_tofu_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag,
+ MPID_Request **message,MPI_Status *status);
+
+int MPID_nem_tofu_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_tofu_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_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz);
+
+int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume);
+int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue);
+
+int MPID_nem_tofu_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 MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req);
+
+/*
+ * temporary llctofu api
+ */
+typedef void (*llctofu_send_f)(void *cba, uint64_t *reqid);
+typedef void (*llctofu_recv_f)
+ (void *cba, uint64_t addr, void *buf, size_t bsz);
+
+extern ssize_t llctofu_writev(void *endpt, uint64_t raddr,
+ const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid);
+extern int llctofu_bind(void **vpp_endpt, uint64_t raddr, void *cbarg);
+extern int llctofu_unbind(void *endpt);
+
+extern int llctofu_poll(int in_blocking_poll,
+ llctofu_send_f sfnc, llctofu_recv_f rfnc);
+
+typedef struct MPID_nem_tofu_netmod_hdr {
+ int initiator_pg_rank;
+} MPID_nem_tofu_netmod_hdr_t;
+
+#define MPID_nem_tofu_segv printf("%d\n", *(int32_t*)0);
+
+#endif /* TOFU_MODULE_IMPL_H */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
new file mode 100644
index 0000000..66a958b
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_init.c
@@ -0,0 +1,141 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+
+/* global variables */
+
+/* src/mpid/ch3/channels/nemesis/include/mpid_nem_nets.h */
+
+MPID_nem_netmod_funcs_t MPIDI_nem_tofu_funcs = {
+ .init = MPID_nem_tofu_init,
+ .finalize = MPID_nem_tofu_finalize,
+#ifdef ENABLE_CHECKPOINTING
+ .ckpt_precheck = NULL,
+ .ckpt_restart = NULL,
+ .ckpt_continue = NULL,
+#endif
+ .poll = MPID_nem_tofu_poll,
+ .get_business_card = MPID_nem_tofu_get_business_card,
+ .connect_to_root = MPID_nem_tofu_connect_to_root,
+ .vc_init = MPID_nem_tofu_vc_init,
+ .vc_destroy = MPID_nem_tofu_vc_destroy,
+ .vc_terminate = MPID_nem_tofu_vc_terminate,
+ .anysource_iprobe = MPID_nem_tofu_anysource_iprobe,
+ .anysource_improbe = MPID_nem_tofu_anysource_improbe,
+};
+
+
+static MPIDI_Comm_ops_t comm_ops = {
+ .recv_posted = MPID_nem_tofu_recv_posted,
+ .send = MPID_nem_tofu_isend, /* wait is performed separately after calling this */
+ .rsend = NULL,
+ .ssend = NULL,
+ .isend = MPID_nem_tofu_isend,
+ .irsend = NULL,
+ .issend = NULL,
+
+ .send_init = NULL,
+ .bsend_init = NULL,
+ .rsend_init = NULL,
+ .ssend_init = NULL,
+ .start_all = NULL,
+
+ .cancel_send = NULL,
+ .cancel_recv = NULL,
+
+ .prove = NULL,
+ .iprove = NULL,
+ .improve = NULL
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_init
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int
+MPID_nem_tofu_init (MPIDI_PG_t *pg_p, int pg_rank,
+ char **bc_val_p, int *val_max_sz_p)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int rc;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_INIT);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_INIT);
+
+ rc = LLC_init();
+ MPIU_ERR_CHKANDJUMP(rc != 0, mpi_errno, MPI_ERR_OTHER, "**fail");
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_INIT);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_get_business_card
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int
+MPID_nem_tofu_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_TOFU_GET_BUSINESS_CARD);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_GET_BUSINESS_CARD);
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_GET_BUSINESS_CARD);
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_connect_to_root
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int
+MPID_nem_tofu_connect_to_root (const char *business_card, MPIDI_VC_t *new_vc)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_CONNECT_TO_ROOT);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_CONNECT_TO_ROOT);
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_CONNECT_TO_ROOT);
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+/* ============================================== */
+/* ================ tofu_probe.c ================ */
+/* ============================================== */
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_anysource_iprobe
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_nem_tofu_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
+{
+ return MPI_SUCCESS;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_anysource_improbe
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_nem_tofu_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
+{
+ return MPI_SUCCESS;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
new file mode 100644
index 0000000..f1996cd
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_poll.c
@@ -0,0 +1,267 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+
+/* function prototypes */
+
+static void MPID_nem_tofu_send_handler(void *cba,
+ uint64_t *p_reqid);
+static void MPID_nem_tofu_recv_handler(void *vp_vc,
+ uint64_t raddr, void *buf, size_t bsz);
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_poll
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int
+MPID_nem_tofu_poll(int in_blocking_progress)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_POLL);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_POLL);
+
+ {
+ int rc;
+ rc = llctofu_poll(in_blocking_progress,
+ MPID_nem_tofu_send_handler,
+ MPID_nem_tofu_recv_handler);
+ if (rc != 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+ }
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_POLL);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_send_handler
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+static void MPID_nem_tofu_send_handler(void *cba,
+ uint64_t *p_reqid)
+{
+ /* int mpi_errno = 0; */
+ MPID_Request *sreq = cba; /* from llctofu_writev(,,,,cbarg,) */
+ MPID_Request_kind_t kind;
+ /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SEND_HANDLER); */
+
+ /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SEND_HANDLER); */
+
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_send_handler");
+
+ MPIU_Assert(sreq != NULL);
+
+ if (sreq == (void *)0xdeadbeefUL) {
+ MPIDI_VC_t *vc = (void *)p_reqid[0];
+ MPID_nem_tofu_vc_area *vc_tofu;
+
+ MPIU_Assert(vc != NULL);
+ /* printf("from credit %p (pg_rank %d)\n", vc, vc->pg_rank); */
+
+ vc_tofu = VC_TOFU(vc);
+ MPID_nem_tofu_send_queued(vc, &vc_tofu->send_queue);
+
+ p_reqid[0] = ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue);
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_send_handler");
+ 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);
+ MPIU_Assert(reqtype != MPIDI_REQUEST_TYPE_GET_RESP);
+
+ int is_contig;
+ MPID_Datatype_is_contig(sreq->dev.datatype, &is_contig);
+ if (!is_contig && REQ_FIELD(sreq, pack_buf)) {
+ dprintf("tofu_send_handler,non-contiguous,free pack_buf\n");
+ MPIU_Free(REQ_FIELD(req, pack_buf));
+ }
+
+ /* 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_TOFU(sreq)->woff */;
+
+ vc = sreq->ch.vc; /* before callback */
+ reqFn = sreq->dev.OnDataAvail;
+ if (reqFn == 0) {
+ 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_tofu_vc_area *vc_tofu = VC_TOFU(vc);
+
+ MPID_nem_tofu_send_queued(vc, &vc_tofu->send_queue);
+ }
+ }
+ break; }
+ default:
+ break;
+ }
+
+ fn_exit:
+ /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SEND_HANDLER); */
+ return /* mpi_errno */;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_recv_handler
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+static void MPID_nem_tofu_recv_handler(
+ void *vp_vc,
+ uint64_t raddr,
+ void *buf,
+ size_t bsz
+)
+{
+ int mpi_errno = 0;
+ MPIDI_VC_t *vc = vp_vc;
+ /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_RECV_HANDLER); */
+
+ /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_RECV_HANDLER); */
+
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_recv_handler");
+
+ {
+ int pg_rank = (int) raddr;
+ MPIDI_PG_t *pg = MPIDI_Process.my_pg;
+ MPIDI_VC_t *vc_from_pg = 0;
+
+ if (
+ (pg != 0)
+ && ((pg_rank >= 0) && (pg_rank < MPIDI_PG_Get_size(pg)))
+ ) {
+ /*
+ * MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
+ */
+ MPIDI_PG_Get_vc_set_active(pg, pg_rank, &vc_from_pg);
+ }
+ else {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc %p or", pg);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank %d", pg_rank);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad pg_rank < %d",
+ MPIDI_PG_Get_size(pg));
+ vc_from_pg = vc; /* XXX */
+ }
+ if (vc != vc_from_pg) {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bad vc for pg_rank %d", pg_rank);
+ }
+ if (vc == 0) {
+ vc = vc_from_pg;
+ }
+ }
+ if (vc != 0) {
+ mpi_errno = MPID_nem_handle_pkt(vc, buf, bsz);
+ if (mpi_errno != 0) {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_nem_handle_pkt() = %d", mpi_errno);
+ }
+ }
+
+ fn_exit:
+ /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_RECV_HANDLER); */
+ return ;
+ //fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_recv_posted
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_recv_posted(struct MPIDI_VC *vc, struct MPID_Request *req)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int dt_contig;
+ MPIDI_msg_sz_t data_sz;
+ MPID_Datatype *dt_ptr;
+ MPI_Aint dt_true_lb;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
+
+ /* req->dev.datatype is set in MPIDI_CH3U_Recvq_FDU_or_AEP (in src/mpid/ch3/src/ch3u_recvq.c) */
+ MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, data_sz, dt_ptr,
+ dt_true_lb);
+
+ /* stash vc for ib_poll */
+ req->ch.vc = vc;
+
+ void *write_to_buf;
+ if (dt_contig) {
+ write_to_buf = (void *) ((char *) req->dev.user_buf /*+ REQ_FIELD(req, lmt_dt_true_lb) */);
+ }
+ else {
+ REQ_FIELD(req, pack_buf) = MPIU_Malloc(data_sz);
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER,
+ "**outofmemory");
+ write_to_buf = REQ_FIELD(req, pack_buf);
+ }
+
+ cmd[0].opcode = LLC_OPCODE_RECV;
+ cmd[0].comm = LLC_COMM_WORLD;
+ cmd[0].rank = VC_FIELD(vc, remote_endpoint_addr);
+
+ ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->rank = comm->rank;
+ ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->tag = tag;
+ ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->context_id = comm->context_id + context_offset;
+ MPIU_Assert(sizeof(LLC_match_t) >= sizeof(MPIDI_Message_match_parts_t));
+ memset((uint8_t*)&cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
+ 0, sizeof(LLC_match_t) - sizeof(MPIDI_Message_match_parts_t));
+
+
+ cmd[0].iov_local[0].addr = (uint64_t)write_to_buf;
+ cmd[0].iov_local[0].length = data_sz;
+ cmd[0].niov_local = 1;
+
+ cmd[0].iov_remote[0].addr = 0;
+ cmd[0].iov_remote[0].length = data_sz;;
+ cmd[0].niov_remote = 1;
+
+ llc_errno = LLC_post(cmd, 1);
+ ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, -1, printf("LLC_post failed\n"));
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_RECV_POSTED);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
new file mode 100644
index 0000000..294c5db
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_send.c
@@ -0,0 +1,660 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_isend
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_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 mpi_errno = MPI_SUCCESS;
+ int dt_contig;
+ MPIDI_msg_sz_t data_sz;
+ MPID_Datatype *dt_ptr;
+ MPI_Aint dt_true_lb;
+
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISEND);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISEND);
+
+ LLC_cmd_t *cmd = LLC_cmd_alloc(1);
+ cmd[0].opcode = LLC_OPCODE_SEND;
+ cmd[0].comm = LLC_COMM_WORLD;
+ cmd[0].rank = vc_tofu->remote_endpoint_addr;
+ cmd[0].req_id = cmd;
+
+ /* Prepare bit-vector to perform tag-match. We use the same bit-vector as in CH3 layer. */
+ /* See src/mpid/ch3/src/mpid_isend.c */
+ ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->rank = comm->rank;
+ ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->tag = tag;
+ ((MPIDI_Message_match_parts_t*)(&cmd[0].match.bits))->context_id = comm->context_id + context_offset;
+ MPIU_Assert(sizeof(LLC_match_t) >= sizeof(MPIDI_Message_match_parts_t));
+ memset((uint8_t*)&cmd[0].match.bits + sizeof(MPIDI_Message_match_parts_t),
+ 0, sizeof(LLC_match_t) - sizeof(MPIDI_Message_match_parts_t));
+
+
+ /* Prepare RDMA-write from buffer */
+ MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
+ dt_true_lb);
+
+ void *write_from_buf;
+ if (dt_contig) {
+ write_from_buf = buf;
+ }
+ else {
+ /* See MPIDI_CH3_EagerNoncontigSend (in ch3u_eager.c) */
+ struct MPID_Segment *segment_ptr = MPID_Segment_alloc();
+ MPIU_ERR_CHKANDJUMP(!segment_ptr, mpi_errno, MPI_ERR_OTHER, "**outofmemory");
+
+ MPID_Segment_init(buf, count, datatype, segment_ptr, 0);
+ MPIDI_msg_sz_t segment_first = 0;
+ MPIDI_msg_sz_t segment_size = data_sz;
+ MPIDI_msg_sz_t last = segment_size;
+ MPIU_Assert(last > 0);
+ REQ_FIELD(req, pack_buf) = MPIU_Malloc((size_t) data_sz);
+ MPIU_ERR_CHKANDJUMP(!REQ_FIELD(req, pack_buf), mpi_errno, MPI_ERR_OTHER,
+ "**outofmemory");
+ MPID_Segment_pack(segment_ptr, segment_first, &last,
+ (char *) (REQ_FIELD(req, pack_buf)));
+ MPIU_Assert(last == data_sz);
+ write_from_buf = REQ_FIELD(req, lmt_pack_buf);
+ }
+
+ cmd[0].iov_local = LLC_iov_alloc(1);
+ cmd[0].iov_local[0].addr = (uint64_t)write_from_buf;
+ cmd[0].iov_local[0].length = data_sz;
+ cmd[0].niov_local = 1;
+
+ cmd[0].iov_remote = LLC_iov_alloc(1);
+ cmd[0].iov_remote[0].addr = 0;
+ cmd[0].iov_remote[0].length = data_sz;
+ cmd[0].niov_remote = 1;
+
+ llc_errno = LLC_post(cmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno != LLC_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**LLC_post");
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISEND);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_iStartContigMsg
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_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 mpi_errno = MPI_SUCCESS;
+ MPID_Request *sreq = NULL;
+ MPID_nem_tofu_vc_area *vc_tofu = 0;
+ int need_to_queue = 0;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+
+ MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_iStartContigMsg");
+ MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "vc.pg_rank = %d", vc->pg_rank);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "my_pg_rank = %d", MPIDI_Process.my_pg_rank);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "hdr_sz = %d", (int)hdr_sz);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "data_sz = %d", (int)data_sz);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "hdr type = %d", ((MPIDI_CH3_Pkt_t *)hdr)->type);
+
+ /* create a request */
+ sreq = MPID_Request_create();
+ MPIU_Assert (sreq != NULL);
+ MPIU_Object_set_ref(sreq, 2);
+ sreq->kind = MPID_REQUEST_SEND;
+
+ sreq->ch.vc = vc;
+ sreq->dev.OnDataAvail = 0;
+ sreq->dev.iov_offset = 0;
+
+ /* sreq: src/mpid/ch3/include/mpidpre.h */
+ sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
+ sreq->dev.iov[0].MPID_IOV_BUF =
+ (MPID_IOV_BUF_CAST) &sreq->dev.pending_pkt;
+ sreq->dev.iov[0].MPID_IOV_LEN = sizeof (MPIDI_CH3_Pkt_t);
+ sreq->dev.iov_count = 1;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ if (data_sz > 0) {
+ sreq->dev.iov[1].MPID_IOV_BUF = data;
+ sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
+ sreq->dev.iov_count = 2;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ }
+
+ vc_tofu = VC_TOFU(vc);
+ if ( ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue) ) {
+ need_to_queue = 1;
+ goto queue_it;
+ }
+
+ {
+ int ret;
+
+ ret = llctofu_writev(vc_tofu->endpoint,
+ vc_tofu->remote_endpoint_addr,
+ sreq->dev.iov, sreq->dev.iov_count,
+ sreq, &REQ_TOFU(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ need_to_queue = 2; /* YYY */
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ }
+
+queue_it:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "need_to_que %d", need_to_queue);
+ if (need_to_queue > 0) {
+ MPIDI_CH3I_Sendq_enqueue(&vc_tofu->send_queue, sreq);
+ }
+
+ fn_exit:
+ *sreq_ptr = sreq;
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISTARTCONTIGMSG);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_iSendContig
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_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 mpi_errno = MPI_SUCCESS;
+ MPID_nem_tofu_vc_area *vc_tofu = 0;
+ int need_to_queue = 0;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+
+ MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_iSendContig");
+ MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
+ MPIU_DBG_PKT(vc, hdr, "isendcontig");
+ {
+ MPIDI_CH3_Pkt_t *pkt = (MPIDI_CH3_Pkt_t *)hdr;
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "pkt->type = %d", pkt->type);
+ }
+
+ MPIU_Assert (sreq != NULL);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "OnDataAvail= %p", sreq->dev.OnDataAvail);
+ sreq->ch.vc = vc;
+ sreq->dev.iov_offset = 0;
+
+ /* sreq: src/mpid/ch3/include/mpidpre.h */
+ sreq->dev.pending_pkt = *(MPIDI_CH3_Pkt_t *)hdr;
+ sreq->dev.iov[0].MPID_IOV_BUF =
+ (MPID_IOV_BUF_CAST) &sreq->dev.pending_pkt;
+ sreq->dev.iov[0].MPID_IOV_LEN = sizeof (MPIDI_CH3_Pkt_t);
+ sreq->dev.iov_count = 1;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int)sreq->dev.iov[0].MPID_IOV_LEN);
+ if (data_sz > 0) {
+ sreq->dev.iov[1].MPID_IOV_BUF = data;
+ sreq->dev.iov[1].MPID_IOV_LEN = data_sz;
+ sreq->dev.iov_count = 2;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "IOV_LEN = %d", (int)sreq->dev.iov[1].MPID_IOV_LEN);
+ }
+
+ vc_tofu = VC_TOFU(vc);
+ if ( ! MPIDI_CH3I_Sendq_empty(vc_tofu->send_queue) ) {
+ need_to_queue = 1;
+ goto queue_it;
+ }
+
+ {
+ int ret;
+
+ ret = llctofu_writev(vc_tofu->endpoint,
+ vc_tofu->remote_endpoint_addr,
+ sreq->dev.iov, sreq->dev.iov_count,
+ sreq, &REQ_TOFU(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "WRITEV() = %d", ret);
+ if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ need_to_queue = 2; /* YYY */
+ }
+ }
+
+queue_it:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "need_to_que %d", need_to_queue);
+ if (need_to_queue > 0) {
+ MPIDI_CH3I_Sendq_enqueue(&vc_tofu->send_queue, sreq);
+ }
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_ISENDCONTIGMSG);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_SendNoncontig
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
+{
+ int mpi_errno = MPI_SUCCESS;
+ /* MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG); */
+
+ /* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG); */
+ MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "tofu_SendNoncontig");
+
+ MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
+
+ fn_exit:
+ /* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SENDNONCONTIG); */
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_send_queued
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_send_queued(MPIDI_VC_t * vc, rque_t *send_queue)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_nem_tofu_vc_area *vc_tofu;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_SEND_QUEUED);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_SEND_QUEUED);
+
+ MPIU_Assert(vc != NULL);
+ vc_tofu = VC_TOFU(vc);
+ MPIU_Assert(vc_tofu != NULL);
+
+ while ( ! MPIDI_CH3I_Sendq_empty(*send_queue) ) {
+ ssize_t ret = 0;
+ MPID_Request *sreq;
+ void *endpt = vc_tofu->endpoint;
+ MPID_IOV *iovs;
+ int niov;
+
+ sreq = MPIDI_CH3I_Sendq_head(*send_queue);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "sreq %p", sreq);
+
+ if (mpi_errno == MPI_SUCCESS) {
+ iovs = &sreq->dev.iov[sreq->dev.iov_offset];
+ niov = sreq->dev.iov_count;
+
+ ret = llctofu_writev(endpt, vc_tofu->remote_endpoint_addr,
+ iovs, niov, sreq, &REQ_TOFU(sreq)->cmds);
+ if (ret < 0) {
+ mpi_errno = MPI_ERR_OTHER;
+ }
+ }
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
+ sreq->status.MPI_ERROR = mpi_errno;
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "OnDataAvail = %p", sreq->dev.OnDataAvail);
+ MPIDI_CH3U_Request_complete(sreq);
+ continue;
+ }
+ if ( ! MPIDI_nem_tofu_Rqst_iov_update(sreq, ret) ) {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "skip %p", sreq);
+ break;
+ }
+ MPIDI_CH3I_Sendq_dequeue(send_queue, &sreq);
+ }
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_SEND_QUEUED);
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_nem_tofu_Rqst_iov_update
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_nem_tofu_Rqst_iov_update(MPID_Request *mreq, MPIDI_msg_sz_t consume)
+{
+ int ret = TRUE;
+ /* MPIDI_msg_sz_t oconsume = consume; */
+ int iv, nv;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_NEM_TOFU_RQST_IOV_UPDATE);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_NEM_TOFU_RQST_IOV_UPDATE);
+
+ MPIU_Assert(consume >= 0);
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : consume %d", (int)consume);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : iov_count %d", mreq->dev.iov_count);
+
+ nv = mreq->dev.iov_count;
+ for (iv = mreq->dev.iov_offset; iv < nv; iv++) {
+ MPID_IOV *iov = &mreq->dev.iov[iv];
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : iov[iv] %d", iv);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : consume b %d", (int)consume);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : iov_len b %d", (int)iov->MPID_IOV_LEN);
+ if (iov->MPID_IOV_LEN > consume) {
+ iov->MPID_IOV_BUF = ((char *) iov->MPID_IOV_BUF) + consume;
+ iov->MPID_IOV_LEN -= consume;
+ consume = 0;
+ ret = FALSE;
+ break;
+ }
+ consume -= iov->MPID_IOV_LEN;
+ iov->MPID_IOV_LEN = 0;
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : consume %d", (int)consume);
+
+ mreq->dev.iov_count = nv - iv;
+ mreq->dev.iov_offset = iv;
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() : iov_offset %d", mreq->dev.iov_offset);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "iov_update() = %d", ret);
+
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_NEM_TOFU_RQST_IOV_UPDATE);
+ return ret;
+}
+
+struct llctofu_cmd_area {
+ void *cbarg;
+ uint32_t raddr;
+};
+
+ssize_t llctofu_writev(void *endpt, uint64_t raddr,
+ const struct iovec *iovs, int niov, void *cbarg, void **vpp_reqid)
+{
+ ssize_t nw = 0;
+ LLC_cmd_t *lcmd = 0;
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev(%d)", (int)raddr);
+ {
+ uint8_t *buff = 0;
+ uint32_t bsiz;
+
+ {
+ int iv, nv = niov;
+ bsiz = 0;
+ for (iv = 0; iv < nv; iv++) {
+ size_t len = iovs[iv].iov_len;
+
+ if (len <= 0) {
+ continue;
+ }
+ bsiz += len;
+ }
+ if (bsiz > 0) {
+ buff = MPIU_Malloc(bsiz + sizeof(MPID_nem_tofu_netmod_hdr_t));
+ if (buff == 0) {
+ nw = -1; /* ENOMEM */
+ goto bad;
+ }
+ }
+ }
+
+ lcmd = LLC_cmd_alloc(1);
+ if (lcmd == 0) {
+ if (buff != 0) { MPIU_Free(buff); buff = 0; }
+ nw = -1; /* ENOMEM */
+ goto bad;
+ }
+ lcmd->opcode = LLC_OPCODE_UNSOLICITED;
+ lcmd->rank = (uint32_t)raddr; /* XXX */
+ lcmd->req_id = lcmd;
+
+ lcmd->iov_local[0].addr = (uintptr_t)buff;
+ lcmd->iov_local[0].length = bsiz;
+ lcmd->niov_local = 1;
+
+ lcmd->iov_remote[0].addr = 0;
+ lcmd->iov_remote[0].length = bsiz;
+ lcmd->niov_remote = 1;
+
+ {
+ struct llctofu_cmd_area *usr = (void *)lcmd->usr_area;
+ usr->cbarg = cbarg;
+ usr->raddr = lcmd->rank;
+ }
+ buff = 0;
+ }
+
+ {
+ int iv, nv = niov;
+ char *bp;
+ size_t bz;
+
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev() : nv %d", nv);
+ bp = (void *)lcmd->iov_local[0].addr;
+ bz = lcmd->iov_local[0].length;
+
+ /* Prepare netmod header */
+ ((MPID_nem_tofu_netmod_hdr_t*)bp)->initiator_pg_rank = MPIDI_Process.my_pg_rank;
+ bp += sizeof(MPID_nem_tofu_netmod_hdr_t);
+
+ /* Pack iovs into buff */
+ for (iv = 0; iv < nv; iv++) {
+ size_t len = iovs[iv].iov_len;
+
+ if (len <= 0) {
+ continue;
+ }
+ if (len > bz) {
+ len = bz;
+ }
+ memcpy(bp, iovs[iv].iov_base, len);
+ if ((bz -= len) <= 0) {
+ break;
+ }
+ bp += len;
+ }
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev() : iv %d", iv);
+ {
+ void *bb = (void *)lcmd->iov_local[0].addr;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "wptr = %d", (int)(bp - (char *)bb));
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "blocklengt = %d", (int)lcmd->iov_local[0].length);
+ MPIU_DBG_PKT(endpt, bb, "writev");
+ }
+ }
+ {
+ int llc_errno;
+ llc_errno = LLC_post(lcmd, 1);
+ if (llc_errno != 0) {
+ if ((llc_errno == EAGAIN) || (llc_errno == ENOSPC)) {
+ nw = 0;
+ }
+ else {
+ if (lcmd->iov_local[0].addr != 0) {
+ MPIU_Free((void *)lcmd->iov_local[0].addr);
+ lcmd->iov_local[0].addr = 0;
+ }
+ (void) LLC_cmd_free(lcmd, 1);
+ nw = -1;
+ goto bad;
+ }
+ }
+ else {
+ nw = (ssize_t)lcmd->iov_local[0].length;
+ }
+ }
+ if (vpp_reqid != 0) {
+ vpp_reqid[0] = lcmd;
+ }
+
+ bad:
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "llctofu_writev() : nw %d", (int)nw);
+ return nw;
+}
+
+int llctofu_poll(int in_blocking_poll,
+ llctofu_send_f sfnc, llctofu_recv_f rfnc)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ int llc_errno;
+ int nevents;
+ LLC_event_t events[1];
+
+ while(1) {
+ llc_errno = LLC_poll(1, events, &nevents);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_poll");
+
+ LLC_cmd_t *lcmd;
+ void *vp_sreq;
+ uint64_t reqid = 0;
+
+ if(nevents == 0) {
+ break;
+ }
+ MPIU_Assert(nevents == 1);
+
+ switch(events[0].type) {
+ case LLC_EVENT_SEND_LEFT:
+ case LLC_EVENT_UNSOLICITED_LEFT: {
+
+ lcmd = events[0].side.initiator.req_id;
+ MPIU_Assert(lcmd != 0);
+ MPIU_Assert(lcmd->opcode == LLC_OPCODE_SEND);
+
+ struct llctofu_cmd_area *usr;
+ usr = (void *)lcmd->usr_area;
+ vp_sreq = usr->cbarg;
+
+ if(events[0].side.initiator.error_code != LLC_ERROR_SUCCESS) {
+ printf("llctofu_poll,error_code=%d\n", events[0].side.initiator.error_code);
+ MPID_nem_tofu_segv;
+ }
+ (*sfnc)(vp_sreq, &reqid);
+
+ if (lcmd->iov_local[0].addr != 0) {
+ MPIU_Free((void *)lcmd->iov_local[0].addr);
+ lcmd->iov_local[0].addr = 0;
+ }
+ llc_errno = LLC_cmd_free(lcmd, 1);
+ MPIU_ERR_CHKANDJUMP(llc_errno, mpi_errno, MPI_ERR_OTHER, "**LLC_cmd_free");
+
+ break; }
+ case LLC_EVENT_UNSOLICITED_ARRIVED: {
+ void *vp_vc = 0;
+ uint64_t addr;
+ void *buff;
+ size_t bsiz;
+
+ buff = events[0].side.responder.addr;
+ bsiz = events[0].side.responder.length;
+ {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "LLC_leng = %d", (int)bsiz);
+ MPIU_DBG_PKT(vp_vc, buff, "poll");
+ }
+ (*rfnc)(vp_vc,
+ ((MPID_nem_tofu_netmod_hdr_t*)buff)->initiator_pg_rank,
+ (uint8_t*)buff + sizeof(MPID_nem_tofu_netmod_hdr_t),
+ bsiz);
+
+ break; }
+ case LLC_EVENT_RECV_MATCHED: {
+ lcmd = events[0].side.initiator.req_id;
+ MPID_Request *req = ((struct llctofu_cmd_area*)lcmd->usr_area)->cbarg;
+
+ /* unpack non-contiguous dt */
+ int is_contig;
+ MPID_Datatype_is_contig(req->dev.datatype, &is_contig);
+ if (!is_contig) {
+ dprintf("llctofu_poll,unpack noncontiguous data to user buffer\n");
+
+ /* see MPIDI_CH3U_Request_unpack_uebuf (in /src/mpid/ch3/src/ch3u_request.c) */
+ /* or MPIDI_CH3U_Receive_data_found (in src/mpid/ch3/src/ch3u_handle_recv_pkt.c) */
+ MPIDI_msg_sz_t unpack_sz = req->ch.lmt_data_sz;
+ MPID_Segment seg;
+ MPI_Aint last;
+
+ MPID_Segment_init(req->dev.user_buf, req->dev.user_count, req->dev.datatype, &seg,
+ 0);
+ last = unpack_sz;
+ MPID_Segment_unpack(&seg, 0, &last, REQ_FIELD(req, pack_buf));
+ if (last != unpack_sz) {
+ /* --BEGIN ERROR HANDLING-- */
+ /* received data was not entirely consumed by unpack()
+ * because too few bytes remained to fill the next basic
+ * datatype */
+ MPIR_STATUS_SET_COUNT(req->status, last);
+ req->status.MPI_ERROR =
+ MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
+ MPI_ERR_TYPE, "**llctofu_poll", 0);
+ /* --END ERROR HANDLING-- */
+ }
+ dprintf("llctofu_poll,ref_count=%d,pack_buf=%p\n", req->ref_count,
+ REQ_FIELD(req, pack_buf));
+ MPIU_Free(REQ_FIELD(req, pack_buf), (size_t) req->ch.lmt_data_sz);
+ }
+
+ /* Dequeue request from posted queue.
+ A request is posted to the queue, for example, in the following path.
+ MPID_Irecv --> MPIDI_CH3U_Recvq_FDU_or_AEP */
+ int found = MPIDI_CH3U_Recvq_DP(req);
+ MPIU_Assert(found);
+
+ /* Mark completion on rreq */
+ MPIDI_CH3U_Request_complete(req);
+
+ break; }
+ default:
+ printf("llctofu_poll,unknown event type=%d\n", events[0].type);
+ MPID_nem_tofu_segv;
+ }
+ }
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
new file mode 100644
index 0000000..2ca0eab
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/tofu/tofu_vc.c
@@ -0,0 +1,205 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/* vim: set ts=8 sts=4 sw=4 noexpandtab : */
+/*
+ *
+ */
+
+
+
+#include "mpid_nem_impl.h"
+#include "tofu_impl.h"
+#ifdef NOTDEF
+#include <llc/llc-tofu.h>
+#endif /* NOTDEF */
+
+/* function prototypes */
+
+static int tofu_vc_init (MPIDI_VC_t *vc);
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_vc_init
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int
+MPID_nem_tofu_vc_init (MPIDI_VC_t *vc)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_INIT);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_INIT);
+
+ mpi_errno = tofu_vc_init (vc);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_INIT);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_vc_destroy
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_vc_destroy(MPIDI_VC_t *vc)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
+ /* free any resources associated with this VC here */
+
+ {
+#ifdef NOTDEF
+ int rc;
+#endif /* NOTDEF */
+ MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
+
+#ifdef NOTDEF
+ rc = llctofu_unbind(vc_tofu->endpoint);
+ if (rc != 0 /* LLC_SUCCESS */) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+#endif /* NOTDEF */
+ vc_tofu->endpoint = 0;
+ }
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_DESTROY);
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_vc_terminate
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPID_nem_tofu_vc_terminate (MPIDI_VC_t *vc)
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+
+ mpi_errno = MPIDI_CH3U_Handle_connection (vc, MPIDI_VC_EVENT_TERMINATED);
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TOFU_VC_TERMINATE);
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+/* ============================================== */
+
+#undef FUNCNAME
+#define FUNCNAME tofu_vc_init
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+static int tofu_vc_init (MPIDI_VC_t *vc)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ {
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_NEM_VC_NETMOD_AREA_LEN = %d\n",
+ MPID_NEM_VC_NETMOD_AREA_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_NEM_REQ_NETMOD_AREA_LEN = %d",
+ MPID_NEM_REQ_NETMOD_AREA_LEN);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE,
+ "MPID_nem_tofu_vc_area = %d\n",
+ (int) sizeof (MPID_nem_tofu_vc_area));
+ }
+
+ /* MPIDI_CH3I_VC: src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h */
+ {
+ MPIDI_CH3I_VC *vc_ch = &vc->ch;
+ MPID_nem_tofu_vc_area *vc_tofu = VC_TOFU(vc);
+
+#ifdef NOTDEF
+ vc_tofu->endpoint = 0;
+#else /* NOTDEF */
+ vc_tofu->endpoint = vc;
+#endif /* NOTDEF */
+ vc_tofu->remote_endpoint_addr = vc->pg_rank;
+ vc_tofu->send_queue.head = 0; /* GENERIC_Q_DECL */
+ vc_tofu->send_queue.tail = 0; /* GENERIC_Q_DECL */
+#ifdef NOTDEF
+
+ {
+ int rc;
+ rc = llctofu_bind(&vc_tofu->endpoint,
+ vc_tofu->remote_endpoint_addr, vc /* cba */);
+ if (rc != 0 /* LLC_SUCCESS */) {
+ mpi_errno = MPI_ERR_OTHER;
+ MPIU_ERR_POP(mpi_errno);
+ }
+ }
+#endif /* NOTDEF */
+
+ vc->eager_max_msg_sz = (12 * 1024);
+ vc->ready_eager_max_msg_sz = (12 * 1024);
+ /* vc->rndvSend_fn = 0*/
+ /* vc->rndvRecv_fn = 0*/
+ vc->sendNoncontig_fn = MPID_nem_tofu_SendNoncontig;
+#ifdef ENABLE_COMM_OVERRIDES
+ vc->comm_ops = 0 /* &comm_ops */;
+#endif
+
+ vc_ch->iStartContigMsg = MPID_nem_tofu_iStartContigMsg;
+ vc_ch->iSendContig = MPID_nem_tofu_iSendContig;
+
+#ifdef ENABLE_CHECKPOINTING
+ vc_ch->ckpt_pause_send_vc = 0 /* MPID_nem_tofu_ckpt_pause_send_vc */;
+ vc_ch->ckpt_continue_vc = 0 /* MPID_nem_tofu_ckpt_continue_vc */;
+ vc_ch->ckpt_restart_vc = 0 /* = MPID_nem_tofu_ckpt_restart_vc */;
+#endif
+
+ MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
+ }
+
+ fn_exit:
+ return mpi_errno;
+ //fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_tofu_vc_prnt
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+static int MPID_nem_tofu_vc_prnt(MPIDI_VC_t *vc)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ /* MPIU_OBJECT_HEADER; */
+ /* src/include/mpihandlemem.h */
+ /* int handle; */
+ /* MPIU_THREAD_OBJECT_HOOK */
+ /* MPIU_Handle_ref_count ref_count; */
+ /* MPIDI_VC_State_t state; */
+ /* struct MPIDI_PG *pg; */
+ /* int pg_rank; */
+ /* int lpid; */
+ /* MPID_Node_id_t node_id; */
+ /* int port_name_tag; */
+ /* MPID_Seqnum_t seqnum_send; */ /* MPID_USE_SEQUENCE_NUMBERS */
+ /* MPID_Seqnum_t seqnum_recv; */ /* MPID_CH3_MSGS_UNORDERED */
+ /* MPIDI_CH3_Pkt_send_container_t *msg_reorder_queue; */
+ /* int (*rndvSend_fn)(); */
+ /* int (*rndvRecv_fn)(); */
+ /* int eager_max_msg_sz; */
+ /* int ready_eager_max_msg_sz; */
+ /* int (*sendNonconfig_gn)(); */
+ /* MPIDI_Comm_ops_t *comm_ops; */ /* ENABLE_COMM_OVERRIDES */
+ /* MPIDI_CH3_VC_DECL */ /* MPIDI_CH3_VC_DECL */
+ /* src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h */
+
+ return mpi_errno;
+}
+
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/channels/nemesis/netmod/Makefile.mk | 1 +
.../ch3/channels/nemesis/netmod/llc/Makefile.mk | 27 +
.../ch3/channels/nemesis/netmod/llc/errnames.txt | 17 +
.../ch3/channels/nemesis/netmod/llc/llc_cancel.c | 39 +
.../ch3/channels/nemesis/netmod/llc/llc_fini.c | 33 +
.../ch3/channels/nemesis/netmod/llc/llc_impl.h | 138 +++
.../ch3/channels/nemesis/netmod/llc/llc_init.c | 223 ++++
.../ch3/channels/nemesis/netmod/llc/llc_poll.c | 377 +++++++
.../ch3/channels/nemesis/netmod/llc/llc_probe.c | 238 +++++
.../ch3/channels/nemesis/netmod/llc/llc_send.c | 1080 ++++++++++++++++++++
src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c | 220 ++++
.../channels/nemesis/netmod/llc/subconfigure.m4 | 57 +
12 files changed, 2450 insertions(+), 0 deletions(-)
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/Makefile.mk
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/errnames.txt
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_cancel.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_fini.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_impl.h
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_init.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_poll.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_probe.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_send.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/llc_vc.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/llc/subconfigure.m4
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list