commits
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
November 2014
- 1 participants
- 74 discussions
[mpich] MPICH primary repository branch, master, updated. v3.1.3-223-g8d26112
by noreply@mpich.org 14 Nov '14
by noreply@mpich.org 14 Nov '14
14 Nov '14
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 8d26112786e9314c21716ede6bdb6633e7da7620 (commit)
from 9f608cfefa435e1e17d3f00e2d17b39cb81c1bc2 (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/8d26112786e9314c21716ede6bdb6633e…
commit 8d26112786e9314c21716ede6bdb6633e7da7620
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Fri Nov 14 09:48:49 2014 -0600
fix typo in function argument
No reviewer
diff --git a/src/mpi/romio/mpi-io/iread_atall.c b/src/mpi/romio/mpi-io/iread_atall.c
index ec70b2d..1a9d718 100644
--- a/src/mpi/romio/mpi-io/iread_atall.c
+++ b/src/mpi/romio/mpi-io/iread_atall.c
@@ -17,7 +17,7 @@
/* end of weak pragmas */
#elif defined(HAVE_WEAK_ATTRIBUTE)
int MPIX_File_iread_at_all(MPI_File fh, MPI_Offset offset, void * buf, int count,
- MPI_Datatype datatype, MPI_Rquest *request)
+ MPI_Datatype datatype, MPI_Request *request)
__attribute__((weak,alias("PMPIX_File_iread_at_all")));
#endif
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/mpi-io/iread_atall.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-222-g9f608cf
by noreply@mpich.org 14 Nov '14
by noreply@mpich.org 14 Nov '14
14 Nov '14
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 9f608cfefa435e1e17d3f00e2d17b39cb81c1bc2 (commit)
via f4a578872e328dcd8bc42d46b8f6aed888da633a (commit)
via ac1fb3c720cdff545d48c2aec2832097b03fa36b (commit)
via 4bb35606318186a56d950dc9043f4b6bd3cd0a57 (commit)
from 88d34091a9e6cff45dbec9bdb80208fedb4d4231 (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/9f608cfefa435e1e17d3f00e2d17b39cb…
commit 9f608cfefa435e1e17d3f00e2d17b39cb81c1bc2
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Thu Nov 13 13:05:05 2014 -0600
Clean up event stashing.
Now, when we pop an event, we queue up the buddy event (e.g., ACK for
SEND) to return next. This way, we don't need to search for the event
everytime. Since we know that there'll be at most one such pending
event, we maintain a single event structure for this.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
index 08b858d..6e58e8f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
@@ -614,55 +614,8 @@ static int stash_event(struct rptl_op *op, ptl_event_t event)
}
-#undef FUNCNAME
-#define FUNCNAME retrieve_event
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static int retrieve_event(ptl_event_t * event)
-{
- struct rptl_target *target;
- struct rptl_op *op;
- int have_event = 0;
- MPIDI_STATE_DECL(MPID_STATE_RETRIEVE_EVENT);
-
- MPIDI_FUNC_ENTER(MPID_STATE_RETRIEVE_EVENT);
-
- /* FIXME: this is an expensive loop over all pending operations
- * everytime the user does an eqget */
- for (target = rptl_info.target_list; target; target = target->next) {
- for (op = target->data_op_list; op; op = op->next) {
- if (op->events_ready) {
- assert(op->op_type == RPTL_OP_PUT);
- assert(op->u.put.send || op->u.put.ack);
-
- if (op->u.put.send) {
- memcpy(event, op->u.put.send, sizeof(ptl_event_t));
- MPIU_Free(op->u.put.send);
- op->u.put.send = NULL;
- }
- else {
- memcpy(event, op->u.put.ack, sizeof(ptl_event_t));
- MPIU_Free(op->u.put.ack);
- op->u.put.ack = NULL;
- }
- event->user_ptr = op->u.put.user_ptr;
-
- MPL_DL_DELETE(target->data_op_list, op);
- rptli_op_free(op);
-
- have_event = 1;
- goto fn_exit;
- }
- }
- }
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_RETRIEVE_EVENT);
- return have_event;
-
- fn_fail:
- goto fn_exit;
-}
+static ptl_event_t pending_event;
+static int pending_event_valid = 0;
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptl_rptl_eqget
@@ -684,7 +637,9 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
/* before we poll the eq, we need to check if there are any
* completed operations that need to be returned */
- if (retrieve_event(event)) {
+ if (pending_event_valid) {
+ memcpy(event, &pending_event, sizeof(ptl_event_t));
+ pending_event_valid = 0;
ret = PTL_OK;
goto fn_exit;
}
@@ -865,6 +820,21 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
/* drop the send event */
ret = PTL_EQ_EMPTY;
}
+ else {
+ /* if the message is over the data portal, we'll
+ * return the send event. if the user asked for an
+ * ACK, we will enqueue the ack to be returned
+ * next. */
+ if (op->u.put.ack_req & PTL_ACK_REQ) {
+ /* only one event should be pending */
+ assert(pending_event_valid == 0);
+ memcpy(&pending_event, op->u.put.ack, sizeof(ptl_event_t));
+ pending_event_valid = 1;
+ }
+ MPIU_Free(op->u.put.ack);
+ MPL_DL_DELETE(op->target->data_op_list, op);
+ rptli_op_free(op);
+ }
}
else if (event->type == PTL_EVENT_ACK && op->u.put.send) {
@@ -876,25 +846,40 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
op->events_ready = 1;
event->user_ptr = op->u.put.user_ptr;
- /* if the message is over the control portal, ignore ACK
- * event */
+ /* if the message is over the control portal, ignore both
+ * events */
if (op->u.put.pt_type == RPTL_PT_CONTROL) {
+ /* drop the send event */
MPIU_Free(op->u.put.send);
MPL_DL_DELETE(op->target->control_op_list, op);
rptli_op_free(op);
+
+ /* drop the ack event */
ret = PTL_EQ_EMPTY;
}
+ else {
+ /* if the message is over the data portal, we'll
+ * return the send event. if the user asked for an
+ * ACK, we will enqueue the ack to be returned
+ * next. */
+ if (op->u.put.ack_req & PTL_ACK_REQ) {
+ /* user asked for an ACK, so return it to the user
+ * and queue up the SEND event for next time */
+ memcpy(&pending_event, op->u.put.send, sizeof(ptl_event_t));
+ MPIU_Free(op->u.put.send);
+ assert(pending_event_valid == 0);
+ pending_event_valid = 1;
+ }
+ else {
+ /* user didn't ask for an ACK, overwrite the ACK
+ * event with the pending send event */
+ memcpy(event, op->u.put.send, sizeof(ptl_event_t));
+ MPIU_Free(op->u.put.send);
- /* if the user did not ask for an ACK discard this event
- * and return the send event. */
- else if (!(op->u.put.ack_req & PTL_ACK_REQ)) {
- memcpy(event, op->u.put.send, sizeof(ptl_event_t));
- MPIU_Free(op->u.put.send);
-
- /* set the event user pointer again, since we copied
- * over the original event */
- event->user_ptr = op->u.put.user_ptr;
-
+ /* set the event user pointer again, since we
+ * copied over the original event */
+ event->user_ptr = op->u.put.user_ptr;
+ }
/* we should be in the data op list */
MPL_DL_DELETE(op->target->data_op_list, op);
rptli_op_free(op);
http://git.mpich.org/mpich.git/commitdiff/f4a578872e328dcd8bc42d46b8f6aed88…
commit f4a578872e328dcd8bc42d46b8f6aed888da633a
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Thu Nov 13 12:46:42 2014 -0600
On an error drop all existing events for that op.
We were stashing events when the origin receives a NACK. This is
unnecessary since we retransmit the op and never use those stashed
events.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
index 6bbe304..08b858d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
@@ -807,21 +807,16 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
assert(!(event->type == PTL_EVENT_SEND && op->u.put.send));
assert(!(event->type == PTL_EVENT_ACK && op->u.put.ack));
- /* if we have received both events, discard them.
- * otherwise, stash the one we received while waiting
- * for the other. */
- if (event->type == PTL_EVENT_SEND && op->u.put.ack) {
+ /* discard pending events, since we will retransmit
+ * this op anyway */
+ if (op->u.put.ack) {
MPIU_Free(op->u.put.ack);
op->u.put.ack = NULL;
}
- else if (event->type == PTL_EVENT_ACK && op->u.put.send) {
+ if (op->u.put.send) {
MPIU_Free(op->u.put.send);
op->u.put.send = NULL;
}
- else {
- ret = stash_event(op, *event);
- RPTLU_ERR_POP(ret, "error stashing event\n");
- }
}
if (op->op_type == RPTL_OP_PUT)
http://git.mpich.org/mpich.git/commitdiff/ac1fb3c720cdff545d48c2aec2832097b…
commit ac1fb3c720cdff545d48c2aec2832097b03fa36b
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Thu Nov 13 12:45:46 2014 -0600
Additional comments to explain what we are doing.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
index 3b603b7..6bbe304 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
@@ -859,12 +859,15 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
op->events_ready = 1;
event->user_ptr = op->u.put.user_ptr;
- /* if the message is over the control portal, ignore the
- * ACK event */
+ /* if the message is over the control portal, ignore both
+ * events */
if (op->u.put.pt_type == RPTL_PT_CONTROL) {
+ /* drop the ack event */
MPIU_Free(op->u.put.ack);
MPL_DL_DELETE(op->target->control_op_list, op);
rptli_op_free(op);
+
+ /* drop the send event */
ret = PTL_EQ_EMPTY;
}
}
http://git.mpich.org/mpich.git/commitdiff/4bb35606318186a56d950dc9043f4b6bd…
commit 4bb35606318186a56d950dc9043f4b6bd3cd0a57
Author: Pavan Balaji <balaji(a)anl.gov>
Date: Wed Nov 12 20:41:08 2014 -0600
rportals code refactoring.
1. Moved op management to a different file.
2. Move rptl_info to an extern, so it can be shared by multiple files.
3. Separate out rptl initialization routines.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
index 06c26d1..764e821 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
@@ -16,7 +16,9 @@ mpi_core_sources += \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_lmt.c \
- src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+ src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c \
+ src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c \
+ src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
noinst_HEADERS += \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
index cbcc81c..3b603b7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.c
@@ -60,15 +60,7 @@
#define IDS_ARE_EQUAL(t1, t2) \
(t1.phys.nid == t2.phys.nid && t1.phys.pid == t2.phys.pid)
-static struct {
- struct rptl *rptl_list;
- struct rptl_target *target_list;
-
- int world_size;
- uint64_t origin_events_left;
- int (*get_target_info) (int rank, ptl_process_t * id, ptl_pt_index_t local_data_pt,
- ptl_pt_index_t * target_data_pt, ptl_pt_index_t * target_control_pt);
-} rptl_info;
+struct rptl_info rptl_info;
#undef FUNCNAME
@@ -118,292 +110,6 @@ static int find_target(ptl_process_t id, struct rptl_target **target)
}
-#undef FUNCNAME
-#define FUNCNAME MPID_nem_ptl_rptl_init
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_ptl_rptl_init(int world_size, uint64_t max_origin_events,
- int (*get_target_info) (int rank, ptl_process_t * id,
- ptl_pt_index_t local_data_pt,
- ptl_pt_index_t * target_data_pt,
- ptl_pt_index_t * target_control_pt))
-{
- int ret = PTL_OK;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_INIT);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_INIT);
-
- rptl_info.rptl_list = NULL;
- rptl_info.target_list = NULL;
-
- rptl_info.world_size = world_size;
- rptl_info.origin_events_left = max_origin_events;
- rptl_info.get_target_info = get_target_info;
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_INIT);
- return ret;
-
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME MPID_nem_ptl_rptl_drain_eq
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_ptl_rptl_drain_eq(int eq_count, ptl_handle_eq_t *eq)
-{
- int ret = PTL_OK;
- ptl_event_t event;
- struct rptl_op_pool_segment *op_segment;
- int i;
- struct rptl_target *target, *t;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_FINALIZE);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_FINALIZE);
-
- for (target = rptl_info.target_list; target; target = target->next) {
- while (target->control_op_list || target->data_op_list) {
- for (i = 0; i < eq_count; i++) {
- /* read and ignore all events */
- ret = MPID_nem_ptl_rptl_eqget(eq[i], &event);
- if (ret == PTL_EQ_EMPTY)
- ret = PTL_OK;
- RPTLU_ERR_POP(ret, "Error calling MPID_nem_ptl_rptl_eqget\n");
- }
- }
- }
-
- for (target = rptl_info.target_list; target;) {
- assert(target->data_op_list == NULL);
- assert(target->control_op_list == NULL);
-
- while (target->op_segment_list) {
- op_segment = target->op_segment_list;
- MPL_DL_DELETE(target->op_segment_list, op_segment);
- MPIU_Free(op_segment);
- }
-
- t = target->next;
- MPIU_Free(target);
- target = t;
- }
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_FINALIZE);
- return ret;
-
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME post_empty_buffer
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int post_empty_buffer(ptl_handle_ni_t ni_handle, ptl_pt_index_t pt,
- ptl_handle_me_t * me_handle)
-{
- int ret;
- ptl_me_t me;
- ptl_process_t id;
- MPIDI_STATE_DECL(MPID_STATE_POST_EMPTY_BUFFER);
-
- MPIDI_FUNC_ENTER(MPID_STATE_POST_EMPTY_BUFFER);
-
- id.phys.nid = PTL_NID_ANY;
- id.phys.pid = PTL_PID_ANY;
-
- me.start = NULL;
- me.length = 0;
- me.ct_handle = PTL_CT_NONE;
- me.uid = PTL_UID_ANY;
- me.options = (PTL_ME_OP_PUT | PTL_ME_OP_GET | PTL_ME_USE_ONCE | PTL_ME_IS_ACCESSIBLE |
- PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE);
- me.match_id = id;
- me.match_bits = 0;
- me.ignore_bits = 0;
- me.min_free = 0;
-
- ret = PtlMEAppend(ni_handle, pt, &me, PTL_PRIORITY_LIST, NULL, me_handle);
- RPTLU_ERR_POP(ret, "Error appending empty buffer to priority list\n");
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_POST_EMPTY_BUFFER);
- return ret;
-
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME MPID_nem_ptl_rptl_ptinit
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_ptl_rptl_ptinit(ptl_handle_ni_t ni_handle, ptl_handle_eq_t eq_handle, ptl_pt_index_t data_pt,
- ptl_pt_index_t control_pt)
-{
- int ret = PTL_OK;
- struct rptl *rptl;
- int mpi_errno = MPI_SUCCESS;
- int i;
- ptl_md_t md;
- MPIU_CHKPMEM_DECL(2);
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_PTINIT);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_PTINIT);
-
-
- /* setup the parts of rptls that can be done before world size or
- * target information */
- MPIU_CHKPMEM_MALLOC(rptl, struct rptl *, sizeof(struct rptl), mpi_errno, "rptl");
- MPL_DL_APPEND(rptl_info.rptl_list, rptl);
-
- rptl->local_state = RPTL_LOCAL_STATE_ACTIVE;
- rptl->pause_ack_counter = 0;
-
- rptl->data.ob_max_count = 0;
- rptl->data.ob_curr_count = 0;
-
- rptl->data.pt = data_pt;
- rptl->control.pt = control_pt;
-
- rptl->ni = ni_handle;
- rptl->eq = eq_handle;
-
- md.start = 0;
- md.length = (ptl_size_t) (-1);
- md.options = 0x0;
- md.eq_handle = rptl->eq;
- md.ct_handle = PTL_CT_NONE;
- ret = PtlMDBind(rptl->ni, &md, &rptl->md);
- RPTLU_ERR_POP(ret, "Error binding new global MD\n");
-
- /* post world_size number of empty buffers on the control portal */
- if (rptl->control.pt != PTL_PT_ANY) {
- MPIU_CHKPMEM_MALLOC(rptl->control.me, ptl_handle_me_t *,
- 2 * rptl_info.world_size * sizeof(ptl_handle_me_t), mpi_errno,
- "rptl target info");
- for (i = 0; i < 2 * rptl_info.world_size; i++) {
- ret = post_empty_buffer(rptl->ni, rptl->control.pt, &rptl->control.me[i]);
- RPTLU_ERR_POP(ret, "Error in post_empty_buffer\n");
- }
- rptl->control.me_idx = 0;
- }
-
- fn_exit:
- MPIU_CHKPMEM_COMMIT();
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_PTINIT);
- return ret;
-
- fn_fail:
- if (mpi_errno)
- ret = PTL_FAIL;
- MPIU_CHKPMEM_REAP();
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME MPID_nem_ptl_rptl_ptfini
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_ptl_rptl_ptfini(ptl_pt_index_t pt_index)
-{
- int i;
- int ret = PTL_OK;
- struct rptl *rptl;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
-
- /* find the right rptl */
- for (rptl = rptl_info.rptl_list; rptl && rptl->data.pt != pt_index; rptl = rptl->next);
- assert(rptl);
-
- /* free control portals that were created */
- if (rptl->control.pt != PTL_PT_ANY) {
- for (i = 0; i < rptl_info.world_size * 2; i++) {
- ret = PtlMEUnlink(rptl->control.me[i]);
- RPTLU_ERR_POP(ret, "Error unlinking control buffers\n");
- }
- MPIU_Free(rptl->control.me);
- }
-
- MPL_DL_DELETE(rptl_info.rptl_list, rptl);
- MPIU_Free(rptl);
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
- return ret;
-
- fn_fail:
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME alloc_op
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static int alloc_op(struct rptl_op **op, struct rptl_target *target)
-{
- int ret = PTL_OK;
- struct rptl_op_pool_segment *op_segment;
- int mpi_errno = MPI_SUCCESS;
- int i;
- MPIU_CHKPMEM_DECL(1);
- MPIDI_STATE_DECL(MPID_STATE_ALLOC_OP);
-
- MPIDI_FUNC_ENTER(MPID_STATE_ALLOC_OP);
-
- assert(target);
-
- if (target->op_pool == NULL) {
- MPIU_CHKPMEM_MALLOC(op_segment, struct rptl_op_pool_segment *, sizeof(struct rptl_op_pool_segment),
- mpi_errno, "op pool segment");
- MPL_DL_APPEND(target->op_segment_list, op_segment);
-
- for (i = 0; i < RPTL_OP_POOL_SEGMENT_COUNT; i++)
- MPL_DL_APPEND(target->op_pool, &op_segment->op[i]);
- }
-
- *op = target->op_pool;
- MPL_DL_DELETE(target->op_pool, *op);
-
- fn_exit:
- MPIU_CHKPMEM_COMMIT();
- MPIDI_FUNC_EXIT(MPID_STATE_ALLOC_OP);
- return ret;
-
- fn_fail:
- if (mpi_errno)
- ret = PTL_FAIL;
- MPIU_CHKPMEM_REAP();
- goto fn_exit;
-}
-
-
-#undef FUNCNAME
-#define FUNCNAME free_op
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static void free_op(struct rptl_op *op)
-{
- MPIDI_STATE_DECL(MPID_STATE_FREE_OP);
-
- MPIDI_FUNC_ENTER(MPID_STATE_FREE_OP);
-
- MPL_DL_APPEND(op->target->op_pool, op);
-
- MPIDI_FUNC_EXIT(MPID_STATE_FREE_OP);
-}
-
-
static int rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size_t length,
ptl_ack_req_t ack_req, ptl_process_t target_id, ptl_pt_index_t pt_index,
ptl_match_bits_t match_bits, ptl_size_t remote_offset, void *user_ptr,
@@ -620,7 +326,7 @@ static int rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size
ret = find_target(target_id, &target);
RPTLU_ERR_POP(ret, "error finding target structure\n");
- ret = alloc_op(&op, target);
+ ret = rptli_op_alloc(&op, target);
RPTLU_ERR_POP(ret, "error allocating op\n");
op->op_type = RPTL_OP_PUT;
@@ -694,7 +400,7 @@ int MPID_nem_ptl_rptl_get(ptl_handle_md_t md_handle, ptl_size_t local_offset, pt
ret = find_target(target_id, &target);
RPTLU_ERR_POP(ret, "error finding target structure\n");
- ret = alloc_op(&op, target);
+ ret = rptli_op_alloc(&op, target);
RPTLU_ERR_POP(ret, "error allocating op\n");
op->op_type = RPTL_OP_GET;
@@ -942,7 +648,7 @@ static int retrieve_event(ptl_event_t * event)
event->user_ptr = op->u.put.user_ptr;
MPL_DL_DELETE(target->data_op_list, op);
- free_op(op);
+ rptli_op_free(op);
have_event = 1;
goto fn_exit;
@@ -1048,11 +754,11 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
ret = PTL_EQ_EMPTY;
/* the message came in on the control PT, repost it */
- tmp_ret = post_empty_buffer(rptl->ni, rptl->control.pt,
+ tmp_ret = rptli_post_control_buffer(rptl->ni, rptl->control.pt,
&rptl->control.me[rptl->control.me_idx]);
if (tmp_ret) {
ret = tmp_ret;
- RPTLU_ERR_POP(ret, "Error returned from post_empty_buffer\n");
+ RPTLU_ERR_POP(ret, "Error returned from rptli_post_control_buffer\n");
}
rptl->control.me_idx++;
if (rptl->control.me_idx >= 2 * rptl_info.world_size)
@@ -1141,7 +847,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
/* GET operations only go into the data op list */
MPL_DL_DELETE(op->target->data_op_list, op);
- free_op(op);
+ rptli_op_free(op);
}
else if (event->type == PTL_EVENT_SEND && op->u.put.ack) {
@@ -1158,7 +864,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
if (op->u.put.pt_type == RPTL_PT_CONTROL) {
MPIU_Free(op->u.put.ack);
MPL_DL_DELETE(op->target->control_op_list, op);
- free_op(op);
+ rptli_op_free(op);
ret = PTL_EQ_EMPTY;
}
}
@@ -1177,7 +883,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
if (op->u.put.pt_type == RPTL_PT_CONTROL) {
MPIU_Free(op->u.put.send);
MPL_DL_DELETE(op->target->control_op_list, op);
- free_op(op);
+ rptli_op_free(op);
ret = PTL_EQ_EMPTY;
}
@@ -1193,7 +899,7 @@ int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event)
/* we should be in the data op list */
MPL_DL_DELETE(op->target->data_op_list, op);
- free_op(op);
+ rptli_op_free(op);
}
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.h
index 7ce31d9..f99523c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl.h
@@ -160,28 +160,44 @@ struct rptl_target {
struct rptl_target *prev;
};
+struct rptl_info {
+ struct rptl *rptl_list;
+ struct rptl_target *target_list;
+
+ int world_size;
+ uint64_t origin_events_left;
+ int (*get_target_info) (int rank, ptl_process_t * id, ptl_pt_index_t local_data_pt,
+ ptl_pt_index_t * target_data_pt, ptl_pt_index_t * target_control_pt);
+};
+
+extern struct rptl_info rptl_info;
+
+
+/* initialization */
int MPID_nem_ptl_rptl_init(int world_size, uint64_t max_origin_events,
int (*get_target_info) (int rank, ptl_process_t * id,
ptl_pt_index_t local_data_pt,
ptl_pt_index_t * target_data_pt,
ptl_pt_index_t * target_control_pt));
-
int MPID_nem_ptl_rptl_drain_eq(int eq_count, ptl_handle_eq_t *eq);
-
int MPID_nem_ptl_rptl_ptinit(ptl_handle_ni_t ni_handle, ptl_handle_eq_t eq_handle, ptl_pt_index_t data_pt,
ptl_pt_index_t control_pt);
-
int MPID_nem_ptl_rptl_ptfini(ptl_pt_index_t pt_index);
+int rptli_post_control_buffer(ptl_handle_ni_t ni_handle, ptl_pt_index_t pt,
+ ptl_handle_me_t * me_handle);
+
+/* op management */
+int rptli_op_alloc(struct rptl_op **op, struct rptl_target *target);
+void rptli_op_free(struct rptl_op *op);
+/* communication */
int MPID_nem_ptl_rptl_put(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size_t length,
ptl_ack_req_t ack_req, ptl_process_t target_id, ptl_pt_index_t pt_index,
ptl_match_bits_t match_bits, ptl_size_t remote_offset, void *user_ptr,
ptl_hdr_data_t hdr_data);
-
int MPID_nem_ptl_rptl_get(ptl_handle_md_t md_handle, ptl_size_t local_offset, ptl_size_t length,
ptl_process_t target_id, ptl_pt_index_t pt_index,
ptl_match_bits_t match_bits, ptl_size_t remote_offset, void *user_ptr);
-
int MPID_nem_ptl_rptl_eqget(ptl_handle_eq_t eq_handle, ptl_event_t * event);
#endif /* RPTL_H_INCLUDED */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
new file mode 100644
index 0000000..9262c5e
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
@@ -0,0 +1,235 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "ptl_impl.h"
+#include "rptl.h"
+
+#undef FUNCNAME
+#define FUNCNAME rptli_post_control_buffer
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int rptli_post_control_buffer(ptl_handle_ni_t ni_handle, ptl_pt_index_t pt,
+ ptl_handle_me_t * me_handle)
+{
+ int ret;
+ ptl_me_t me;
+ ptl_process_t id;
+ MPIDI_STATE_DECL(MPID_STATE_RPTLI_POST_CONTROL_BUFFER);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_RPTLI_POST_CONTROL_BUFFER);
+
+ id.phys.nid = PTL_NID_ANY;
+ id.phys.pid = PTL_PID_ANY;
+
+ me.start = NULL;
+ me.length = 0;
+ me.ct_handle = PTL_CT_NONE;
+ me.uid = PTL_UID_ANY;
+ me.options = (PTL_ME_OP_PUT | PTL_ME_OP_GET | PTL_ME_USE_ONCE | PTL_ME_IS_ACCESSIBLE |
+ PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE);
+ me.match_id = id;
+ me.match_bits = 0;
+ me.ignore_bits = 0;
+ me.min_free = 0;
+
+ ret = PtlMEAppend(ni_handle, pt, &me, PTL_PRIORITY_LIST, NULL, me_handle);
+ RPTLU_ERR_POP(ret, "Error appending empty buffer to priority list\n");
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_RPTLI_POST_CONTROL_BUFFER);
+ return ret;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ptl_rptl_init
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_nem_ptl_rptl_init(int world_size, uint64_t max_origin_events,
+ int (*get_target_info) (int rank, ptl_process_t * id,
+ ptl_pt_index_t local_data_pt,
+ ptl_pt_index_t * target_data_pt,
+ ptl_pt_index_t * target_control_pt))
+{
+ int ret = PTL_OK;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_INIT);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_INIT);
+
+ rptl_info.rptl_list = NULL;
+ rptl_info.target_list = NULL;
+
+ rptl_info.world_size = world_size;
+ rptl_info.origin_events_left = max_origin_events;
+ rptl_info.get_target_info = get_target_info;
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_INIT);
+ return ret;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ptl_rptl_drain_eq
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_nem_ptl_rptl_drain_eq(int eq_count, ptl_handle_eq_t *eq)
+{
+ int ret = PTL_OK;
+ ptl_event_t event;
+ struct rptl_op_pool_segment *op_segment;
+ int i;
+ struct rptl_target *target, *t;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_FINALIZE);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_FINALIZE);
+
+ for (target = rptl_info.target_list; target; target = target->next) {
+ while (target->control_op_list || target->data_op_list) {
+ for (i = 0; i < eq_count; i++) {
+ /* read and ignore all events */
+ ret = MPID_nem_ptl_rptl_eqget(eq[i], &event);
+ if (ret == PTL_EQ_EMPTY)
+ ret = PTL_OK;
+ RPTLU_ERR_POP(ret, "Error calling MPID_nem_ptl_rptl_eqget\n");
+ }
+ }
+ }
+
+ for (target = rptl_info.target_list; target;) {
+ assert(target->data_op_list == NULL);
+ assert(target->control_op_list == NULL);
+
+ while (target->op_segment_list) {
+ op_segment = target->op_segment_list;
+ MPL_DL_DELETE(target->op_segment_list, op_segment);
+ MPIU_Free(op_segment);
+ }
+
+ t = target->next;
+ MPIU_Free(target);
+ target = t;
+ }
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_FINALIZE);
+ return ret;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ptl_rptl_ptinit
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_nem_ptl_rptl_ptinit(ptl_handle_ni_t ni_handle, ptl_handle_eq_t eq_handle, ptl_pt_index_t data_pt,
+ ptl_pt_index_t control_pt)
+{
+ int ret = PTL_OK;
+ struct rptl *rptl;
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ ptl_md_t md;
+ MPIU_CHKPMEM_DECL(2);
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_PTINIT);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_PTINIT);
+
+
+ /* setup the parts of rptls that can be done before world size or
+ * target information */
+ MPIU_CHKPMEM_MALLOC(rptl, struct rptl *, sizeof(struct rptl), mpi_errno, "rptl");
+ MPL_DL_APPEND(rptl_info.rptl_list, rptl);
+
+ rptl->local_state = RPTL_LOCAL_STATE_ACTIVE;
+ rptl->pause_ack_counter = 0;
+
+ rptl->data.ob_max_count = 0;
+ rptl->data.ob_curr_count = 0;
+
+ rptl->data.pt = data_pt;
+ rptl->control.pt = control_pt;
+
+ rptl->ni = ni_handle;
+ rptl->eq = eq_handle;
+
+ md.start = 0;
+ md.length = (ptl_size_t) (-1);
+ md.options = 0x0;
+ md.eq_handle = rptl->eq;
+ md.ct_handle = PTL_CT_NONE;
+ ret = PtlMDBind(rptl->ni, &md, &rptl->md);
+ RPTLU_ERR_POP(ret, "Error binding new global MD\n");
+
+ /* post world_size number of empty buffers on the control portal */
+ if (rptl->control.pt != PTL_PT_ANY) {
+ MPIU_CHKPMEM_MALLOC(rptl->control.me, ptl_handle_me_t *,
+ 2 * rptl_info.world_size * sizeof(ptl_handle_me_t), mpi_errno,
+ "rptl target info");
+ for (i = 0; i < 2 * rptl_info.world_size; i++) {
+ ret = rptli_post_control_buffer(rptl->ni, rptl->control.pt, &rptl->control.me[i]);
+ RPTLU_ERR_POP(ret, "Error in rptli_post_control_buffer\n");
+ }
+ rptl->control.me_idx = 0;
+ }
+
+ fn_exit:
+ MPIU_CHKPMEM_COMMIT();
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_PTINIT);
+ return ret;
+
+ fn_fail:
+ if (mpi_errno)
+ ret = PTL_FAIL;
+ MPIU_CHKPMEM_REAP();
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME MPID_nem_ptl_rptl_ptfini
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPID_nem_ptl_rptl_ptfini(ptl_pt_index_t pt_index)
+{
+ int i;
+ int ret = PTL_OK;
+ struct rptl *rptl;
+ MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
+
+ /* find the right rptl */
+ for (rptl = rptl_info.rptl_list; rptl && rptl->data.pt != pt_index; rptl = rptl->next);
+ assert(rptl);
+
+ /* free control portals that were created */
+ if (rptl->control.pt != PTL_PT_ANY) {
+ for (i = 0; i < rptl_info.world_size * 2; i++) {
+ ret = PtlMEUnlink(rptl->control.me[i]);
+ RPTLU_ERR_POP(ret, "Error unlinking control buffers\n");
+ }
+ MPIU_Free(rptl->control.me);
+ }
+
+ MPL_DL_DELETE(rptl_info.rptl_list, rptl);
+ MPIU_Free(rptl);
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_RPTL_PTFINI);
+ return ret;
+
+ fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
new file mode 100644
index 0000000..44a287c
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
@@ -0,0 +1,65 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "ptl_impl.h"
+#include "rptl.h"
+
+#undef FUNCNAME
+#define FUNCNAME rptli_op_alloc
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int rptli_op_alloc(struct rptl_op **op, struct rptl_target *target)
+{
+ int ret = PTL_OK;
+ struct rptl_op_pool_segment *op_segment;
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIU_CHKPMEM_DECL(1);
+ MPIDI_STATE_DECL(MPID_STATE_RPTLI_OP_ALLOC);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_RPTLI_OP_ALLOC);
+
+ assert(target);
+
+ if (target->op_pool == NULL) {
+ MPIU_CHKPMEM_MALLOC(op_segment, struct rptl_op_pool_segment *, sizeof(struct rptl_op_pool_segment),
+ mpi_errno, "op pool segment");
+ MPL_DL_APPEND(target->op_segment_list, op_segment);
+
+ for (i = 0; i < RPTL_OP_POOL_SEGMENT_COUNT; i++)
+ MPL_DL_APPEND(target->op_pool, &op_segment->op[i]);
+ }
+
+ *op = target->op_pool;
+ MPL_DL_DELETE(target->op_pool, *op);
+
+ fn_exit:
+ MPIU_CHKPMEM_COMMIT();
+ MPIDI_FUNC_EXIT(MPID_STATE_RPTLI_OP_ALLOC);
+ return ret;
+
+ fn_fail:
+ if (mpi_errno)
+ ret = PTL_FAIL;
+ MPIU_CHKPMEM_REAP();
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME rptli_op_free
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+void rptli_op_free(struct rptl_op *op)
+{
+ MPIDI_STATE_DECL(MPID_STATE_RPTLI_OP_FREE);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_RPTLI_OP_FREE);
+
+ MPL_DL_APPEND(op->target->op_pool, op);
+
+ MPIDI_FUNC_EXIT(MPID_STATE_RPTLI_OP_FREE);
+}
-----------------------------------------------------------------------
Summary of changes:
.../channels/nemesis/netmod/portals4/Makefile.mk | 4 +-
.../ch3/channels/nemesis/netmod/portals4/rptl.c | 441 +++-----------------
.../ch3/channels/nemesis/netmod/portals4/rptl.h | 26 +-
.../channels/nemesis/netmod/portals4/rptl_init.c | 235 +++++++++++
.../ch3/channels/nemesis/netmod/portals4/rptl_op.c | 65 +++
5 files changed, 389 insertions(+), 382 deletions(-)
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_init.c
create mode 100644 src/mpid/ch3/channels/nemesis/netmod/portals4/rptl_op.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-218-g88d3409
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 88d34091a9e6cff45dbec9bdb80208fedb4d4231 (commit)
via 8b1a69b92ab944c726ca1156b84c4ee9ff144b2b (commit)
via 8b277d9f5c029a661eb52adfe73443e7c74b2112 (commit)
via 9bc09a30a47fb411bf3f63f4c29a694fe779118e (commit)
via a9d968cc474bc369be2c514b7384944e6baefd18 (commit)
from c26861ba3ff025bb62351acf1d74945581f5c59c (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/88d34091a9e6cff45dbec9bdb80208fed…
commit 88d34091a9e6cff45dbec9bdb80208fedb4d4231
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Wed Nov 12 17:06:43 2014 -0600
Split shared request handler.
ReqHandler_GaccumLikeSendComplete is used for GACC-like operations,
including GACC, CAS and FOP. Here we split it into following three
functions:
ReqHandler_GaccumSendComplete
ReqHandler_CASSendComplete
ReqHandler_FOPSendComplete
It is convenient for us to add different actions in future for those
three kinds of operations.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index b5f47ed..a64d32f 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -1923,8 +1923,12 @@ int MPIDI_CH3_ReqHandler_SendReloadIOV( MPIDI_VC_t *vc, MPID_Request *sreq,
int *complete );
int MPIDI_CH3_ReqHandler_GetSendComplete( MPIDI_VC_t *, MPID_Request *,
int * );
-int MPIDI_CH3_ReqHandler_GaccumLikeSendComplete( MPIDI_VC_t *, MPID_Request *,
- int * );
+int MPIDI_CH3_ReqHandler_GaccumSendComplete( MPIDI_VC_t *, MPID_Request *,
+ int * );
+int MPIDI_CH3_ReqHandler_CASSendComplete( MPIDI_VC_t *, MPID_Request *,
+ int * );
+int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *, MPID_Request *,
+ int * );
/* Request-based operation handler */
int MPIDI_CH3_ReqHandler_ReqOpsComplete(MPIDI_VC_t *, MPID_Request *,
int *);
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 4f9e906..fffce27 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -214,8 +214,8 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete( MPIDI_VC_t *vc,
MPID_Segment_free(seg);
}
- resp_req->dev.OnFinal = MPIDI_CH3_ReqHandler_GaccumLikeSendComplete;
- resp_req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumLikeSendComplete;
+ resp_req->dev.OnFinal = MPIDI_CH3_ReqHandler_GaccumSendComplete;
+ resp_req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumSendComplete;
resp_req->dev.target_win_handle = rreq->dev.target_win_handle;
resp_req->dev.flags = rreq->dev.flags;
diff --git a/src/mpid/ch3/src/ch3u_handle_send_req.c b/src/mpid/ch3/src/ch3u_handle_send_req.c
index e50f2dc..ab7d728 100644
--- a/src/mpid/ch3/src/ch3u_handle_send_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_send_req.c
@@ -72,18 +72,18 @@ int MPIDI_CH3_ReqHandler_GetSendComplete( MPIDI_VC_t *vc ATTRIBUTE((unused)),
}
#undef FUNCNAME
-#define FUNCNAME MPIDI_CH3_ReqHandler_GaccumLikeSendComplete
+#define FUNCNAME MPIDI_CH3_ReqHandler_GaccumSendComplete
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_ReqHandler_GaccumLikeSendComplete( MPIDI_VC_t *vc,
+int MPIDI_CH3_ReqHandler_GaccumSendComplete( MPIDI_VC_t *vc,
MPID_Request *rreq,
int *complete )
{
int mpi_errno = MPI_SUCCESS;
MPID_Win *win_ptr;
- MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMLIKESENDCOMPLETE);
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMSENDCOMPLETE);
- MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMLIKESENDCOMPLETE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMSENDCOMPLETE);
/* This function is triggered when sending back process of GACC/FOP/CAS
is finished. Only GACC used user_buf. FOP and CAS can fit all data
in response packet. */
@@ -101,12 +101,90 @@ int MPIDI_CH3_ReqHandler_GaccumLikeSendComplete( MPIDI_VC_t *vc,
win_ptr->at_completion_counter--;
MPIU_Assert(win_ptr->at_completion_counter >= 0);
+ MPIDI_CH3U_Request_complete(rreq);
+ *complete = TRUE;
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMSENDCOMPLETE);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3_ReqHandler_CASSendComplete
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3_ReqHandler_CASSendComplete( MPIDI_VC_t *vc,
+ MPID_Request *rreq,
+ int *complete )
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Win *win_ptr;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_CASSENDCOMPLETE);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_CASSENDCOMPLETE);
+ /* This function is triggered when sending back process of GACC/FOP/CAS
+ is finished. Only GACC used user_buf. FOP and CAS can fit all data
+ in response packet. */
+ if (rreq->dev.user_buf != NULL)
+ MPIU_Free(rreq->dev.user_buf);
+
+ MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
+
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_CAS,
+ rreq->dev.flags, rreq->dev.source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* here we decrement the Active Target counter to guarantee the GET-like
+ operation are completed when counter reaches zero. */
+ win_ptr->at_completion_counter--;
+ MPIU_Assert(win_ptr->at_completion_counter >= 0);
+
+ MPIDI_CH3U_Request_complete(rreq);
+ *complete = TRUE;
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQHANDLER_CASSENDCOMPLETE);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3_ReqHandler_FOPSendComplete
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *vc,
+ MPID_Request *rreq,
+ int *complete )
+{
+ int mpi_errno = MPI_SUCCESS;
+ MPID_Win *win_ptr;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_FOPSENDCOMPLETE);
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_FOPSENDCOMPLETE);
+ /* This function is triggered when sending back process of GACC/FOP/CAS
+ is finished. Only GACC used user_buf. FOP and CAS can fit all data
+ in response packet. */
+ if (rreq->dev.user_buf != NULL)
+ MPIU_Free(rreq->dev.user_buf);
+
+ MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
+
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_FOP,
+ rreq->dev.flags, rreq->dev.source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ /* here we decrement the Active Target counter to guarantee the GET-like
+ operation are completed when counter reaches zero. */
+ win_ptr->at_completion_counter--;
+ MPIU_Assert(win_ptr->at_completion_counter >= 0);
MPIDI_CH3U_Request_complete(rreq);
*complete = TRUE;
fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMLIKESENDCOMPLETE);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_REQHANDLER_FOPSENDCOMPLETE);
return mpi_errno;
fn_fail:
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index 751f31d..b95eacd 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -923,7 +923,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
(it is initialized to NULL by lower layer) */
req->dev.target_win_handle = cas_pkt->target_win_handle;
req->dev.flags = cas_pkt->flags;
- req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumLikeSendComplete;
+ req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_CASSendComplete;
/* here we increment the Active Target counter to guarantee the GET-like
operation are completed when counter reaches zero. */
@@ -1081,7 +1081,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
(it is initialized to NULL by lower layer) */
resp_req->dev.target_win_handle = fop_pkt->target_win_handle;
resp_req->dev.flags = fop_pkt->flags;
- resp_req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GaccumLikeSendComplete;
+ resp_req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_FOPSendComplete;
/* here we increment the Active Target counter to guarantee the GET-like
operation are completed when counter reaches zero. */
http://git.mpich.org/mpich.git/commitdiff/8b1a69b92ab944c726ca1156b84c4ee9f…
commit 8b1a69b92ab944c726ca1156b84c4ee9ff144b2b
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Wed Nov 12 17:04:21 2014 -0600
Code-refactoring: wrapping up action of finishing op on target.
Here we wrap up common action when one RMA op is finished on target
into a function to make code structure cleaner.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 8f1354b..4481c0e 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -476,6 +476,67 @@ static inline int check_piggyback_lock(MPID_Win *win_ptr, MPIDI_CH3_Pkt_t *pkt,
goto fn_exit;
}
+static inline int finish_op_on_target(MPID_Win *win_ptr, MPIDI_VC_t *vc,
+ MPIDI_CH3_Pkt_type_t type,
+ MPIDI_CH3_Pkt_flags_t flags,
+ MPI_Win source_win_handle) {
+ int mpi_errno = MPI_SUCCESS;
+
+ if (type == MPIDI_CH3_PKT_PUT || type == MPIDI_CH3_PKT_ACCUMULATE) {
+ /* This is PUT or ACC */
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
+ if (!(flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) &&
+ !(flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK)) {
+ mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr, source_win_handle);
+ if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3_Progress_signal_completion();
+ }
+ }
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
+ mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, flags,
+ source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3_Progress_signal_completion();
+ }
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
+ win_ptr->at_completion_counter--;
+ MPIU_Assert(win_ptr->at_completion_counter >= 0);
+ /* Signal the local process when the op counter reaches 0. */
+ if (win_ptr->at_completion_counter == 0)
+ MPIDI_CH3_Progress_signal_completion();
+ }
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
+ mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, flags,
+ source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3_Progress_signal_completion();
+ }
+ }
+ else {
+ /* This is GACC / GET / CAS / FOP */
+
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
+ mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ MPIDI_CH3_Progress_signal_completion();
+ }
+
+ if (flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
+ win_ptr->at_completion_counter--;
+ MPIU_Assert(win_ptr->at_completion_counter >= 0);
+ /* Signal the local process when the op counter reaches 0. */
+ if (win_ptr->at_completion_counter == 0)
+ MPIDI_CH3_Progress_signal_completion();
+ }
+ }
+
+ fn_exit:
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
static inline int wait_progress_engine(void)
{
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 11c5c49..4f9e906 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -86,35 +86,9 @@ int MPIDI_CH3_ReqHandler_PutRecvComplete( MPIDI_VC_t *vc,
MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
- if (!(rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) &&
- !(rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK)) {
- mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr, rreq->dev.source_win_handle);
- if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
- mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, rreq->dev.flags,
- rreq->dev.source_win_handle);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
- win_ptr->at_completion_counter--;
- MPIU_Assert(win_ptr->at_completion_counter >= 0);
- /* Signal the local process when the op counter reaches 0. */
- if (win_ptr->at_completion_counter == 0)
- MPIDI_CH3_Progress_signal_completion();
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, rreq->dev.flags,
- rreq->dev.source_win_handle);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_PUT,
+ rreq->dev.flags, rreq->dev.source_win_handle);
+ if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
/* mark data transfer as complete and decrement CC */
MPIDI_CH3U_Request_complete(rreq);
@@ -164,34 +138,9 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete( MPIDI_VC_t *vc,
MPIR_Type_get_true_extent_impl(rreq->dev.datatype, &true_lb, &true_extent);
MPIU_Free((char *) rreq->dev.final_user_buf + true_lb);
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
- if (!(rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) &&
- !(rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK)) {
- mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr, rreq->dev.source_win_handle);
- if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
- mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, rreq->dev.flags,
- rreq->dev.source_win_handle);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
- win_ptr->at_completion_counter--;
- MPIU_Assert(win_ptr->at_completion_counter >= 0);
- /* Signal the local process when the op counter reaches 0. */
- if (win_ptr->at_completion_counter == 0)
- MPIDI_CH3_Progress_signal_completion();
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, rreq->dev.flags,
- rreq->dev.source_win_handle);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- }
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_ACCUMULATE,
+ rreq->dev.flags, rreq->dev.source_win_handle);
+ if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
/* mark data transfer as complete and decrement CC */
MPIDI_CH3U_Request_complete(rreq);
diff --git a/src/mpid/ch3/src/ch3u_handle_send_req.c b/src/mpid/ch3/src/ch3u_handle_send_req.c
index 07ecad2..e50f2dc 100644
--- a/src/mpid/ch3/src/ch3u_handle_send_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_send_req.c
@@ -52,18 +52,9 @@ int MPIDI_CH3_ReqHandler_GetSendComplete( MPIDI_VC_t *vc ATTRIBUTE((unused)),
MPID_Win_get_ptr(sreq->dev.target_win_handle, win_ptr);
- if (sreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- if (sreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
- win_ptr->at_completion_counter--;
- MPIU_Assert(win_ptr->at_completion_counter >= 0);
- /* Signal the local process when the op counter reaches 0. */
- if (win_ptr->at_completion_counter == 0)
- MPIDI_CH3_Progress_signal_completion();
- }
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_GET,
+ sreq->dev.flags, sreq->dev.source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* here we decrement the Active Target counter to guarantee the GET-like
operation are completed when counter reaches zero. */
@@ -101,24 +92,16 @@ int MPIDI_CH3_ReqHandler_GaccumLikeSendComplete( MPIDI_VC_t *vc,
MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr);
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_GET_ACCUM,
+ rreq->dev.flags, rreq->dev.source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
/* here we decrement the Active Target counter to guarantee the GET-like
operation are completed when counter reaches zero. */
win_ptr->at_completion_counter--;
MPIU_Assert(win_ptr->at_completion_counter >= 0);
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
- win_ptr->at_completion_counter--;
- MPIU_Assert(win_ptr->at_completion_counter >= 0);
- /* Signal the local process when the op counter reaches 0. */
- if (win_ptr->at_completion_counter == 0)
- MPIDI_CH3_Progress_signal_completion();
- }
MPIDI_CH3U_Request_complete(rreq);
*complete = TRUE;
@@ -130,6 +113,7 @@ int MPIDI_CH3_ReqHandler_GaccumLikeSendComplete( MPIDI_VC_t *vc,
goto fn_exit;
}
+
int MPIDI_CH3_ReqHandler_SendReloadIOV( MPIDI_VC_t *vc ATTRIBUTE((unused)), MPID_Request *sreq,
int *complete )
{
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index 757cee4..751f31d 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -936,18 +936,9 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPID_Request_release(req);
}
- if (cas_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
- if (cas_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
- win_ptr->at_completion_counter--;
- MPIU_Assert(win_ptr->at_completion_counter >= 0);
- /* Signal the local process when the op counter reaches 0. */
- if (win_ptr->at_completion_counter == 0)
- MPIDI_CH3_Progress_signal_completion();
- }
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_CAS,
+ cas_pkt->flags, cas_pkt->source_win_handle);
+ if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
fn_exit:
MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_cas);
@@ -1104,18 +1095,9 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
}
}
- if (fop_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
- mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- MPIDI_CH3_Progress_signal_completion();
- }
-
- if (fop_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_DECR_AT_COUNTER) {
- win_ptr->at_completion_counter--;
- MPIU_Assert(win_ptr->at_completion_counter >= 0);
- if (win_ptr->at_completion_counter == 0)
- MPIDI_CH3_Progress_signal_completion();
- }
+ mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_FOP,
+ fop_pkt->flags, fop_pkt->source_win_handle);
+ if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
fn_exit:
MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_fop);
http://git.mpich.org/mpich.git/commitdiff/8b277d9f5c029a661eb52adfe73443e7c…
commit 8b277d9f5c029a661eb52adfe73443e7c74b2112
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Wed Nov 12 16:25:56 2014 -0600
Modify do_accumulate_op() to accept better arguments.
Originally do_accumulate_op() only accepts request pointer as
argument which is too restrict to be reused. Here we modify
it to access buffer address, count, datatype and op, so that
it can be reused in more general cases.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 64e8aac..8f1354b 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -342,48 +342,42 @@ static inline int MPIDI_CH3I_RMA_Handle_flush_ack(MPID_Win * win_ptr, int target
#define FUNCNAME do_accumulate_op
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int do_accumulate_op(MPID_Request *rreq)
+static inline int do_accumulate_op(void *source_buf, void *target_buf,
+ int acc_count, MPI_Datatype acc_dtp, MPI_Op acc_op)
{
int mpi_errno = MPI_SUCCESS;
- MPI_Aint true_lb, true_extent;
MPI_User_function *uop;
MPIDI_STATE_DECL(MPID_STATE_DO_ACCUMULATE_OP);
MPIDI_FUNC_ENTER(MPID_STATE_DO_ACCUMULATE_OP);
- MPIU_Assert(rreq->dev.final_user_buf != NULL);
-
- if (rreq->dev.op == MPI_REPLACE)
+ if (acc_op == MPI_REPLACE)
{
/* simply copy the data */
- mpi_errno = MPIR_Localcopy(rreq->dev.final_user_buf, rreq->dev.user_count,
- rreq->dev.datatype,
- rreq->dev.real_user_buf,
- rreq->dev.user_count,
- rreq->dev.datatype);
+ mpi_errno = MPIR_Localcopy(source_buf, acc_count, acc_dtp,
+ target_buf, acc_count, acc_dtp);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
goto fn_exit;
}
- if (HANDLE_GET_KIND(rreq->dev.op) == HANDLE_KIND_BUILTIN)
+ if (HANDLE_GET_KIND(acc_op) == HANDLE_KIND_BUILTIN)
{
/* get the function by indexing into the op table */
- uop = MPIR_OP_HDL_TO_FN(rreq->dev.op);
+ uop = MPIR_OP_HDL_TO_FN(acc_op);
}
else
{
/* --BEGIN ERROR HANDLING-- */
- mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opnotpredefined", "**opnotpredefined %d", rreq->dev.op );
+ mpi_errno = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OP, "**opnotpredefined", "**opnotpredefined %d", acc_op );
return mpi_errno;
/* --END ERROR HANDLING-- */
}
- if (MPIR_DATATYPE_IS_PREDEFINED(rreq->dev.datatype))
+ if (MPIR_DATATYPE_IS_PREDEFINED(acc_dtp))
{
- (*uop)(rreq->dev.final_user_buf, rreq->dev.real_user_buf,
- &(rreq->dev.user_count), &(rreq->dev.datatype));
+ (*uop)(source_buf, target_buf, &acc_count, &acc_dtp);
}
else
{
@@ -405,13 +399,13 @@ static inline int do_accumulate_op(MPID_Request *rreq)
return mpi_errno;
}
/* --END ERROR HANDLING-- */
- MPID_Segment_init(NULL, rreq->dev.user_count,
- rreq->dev.datatype, segp, 0);
+ MPID_Segment_init(NULL, acc_count,
+ acc_dtp, segp, 0);
first = 0;
last = SEGMENT_IGNORE_LAST;
- MPID_Datatype_get_ptr(rreq->dev.datatype, dtp);
- vec_len = dtp->max_contig_blocks * rreq->dev.user_count + 1;
+ MPID_Datatype_get_ptr(acc_dtp, dtp);
+ vec_len = dtp->max_contig_blocks * acc_count + 1;
/* +1 needed because Rob says so */
dloop_vec = (DLOOP_VECTOR *)
MPIU_Malloc(vec_len * sizeof(DLOOP_VECTOR));
@@ -431,8 +425,8 @@ static inline int do_accumulate_op(MPID_Request *rreq)
for (i=0; i<vec_len; i++)
{
MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size, int);
- (*uop)((char *)rreq->dev.final_user_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
- (char *)rreq->dev.real_user_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
+ (*uop)((char *)source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
+ (char *)target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
&count, &type);
}
@@ -441,10 +435,6 @@ static inline int do_accumulate_op(MPID_Request *rreq)
}
fn_exit:
- /* free the temporary buffer */
- MPIR_Type_get_true_extent_impl(rreq->dev.datatype, &true_lb, &true_extent);
- MPIU_Free((char *) rreq->dev.final_user_buf + true_lb);
-
MPIDI_FUNC_EXIT(MPID_STATE_DO_ACCUMULATE_OP);
return mpi_errno;
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 44c8a71..11c5c49 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -139,6 +139,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete( MPIDI_VC_t *vc,
int *complete )
{
int mpi_errno = MPI_SUCCESS;
+ MPI_Aint true_lb, true_extent;
MPID_Win *win_ptr;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_ACCUMRECVCOMPLETE);
@@ -151,13 +152,18 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete( MPIDI_VC_t *vc,
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
/* accumulate data from tmp_buf into user_buf */
- mpi_errno = do_accumulate_op(rreq);
+ mpi_errno = do_accumulate_op(rreq->dev.final_user_buf, rreq->dev.real_user_buf,
+ rreq->dev.user_count, rreq->dev.datatype, rreq->dev.op);
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
+ /* free the temporary buffer */
+ MPIR_Type_get_true_extent_impl(rreq->dev.datatype, &true_lb, &true_extent);
+ MPIU_Free((char *) rreq->dev.final_user_buf + true_lb);
+
if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
if (!(rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) &&
!(rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK)) {
@@ -216,6 +222,7 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete( MPIDI_VC_t *vc,
MPIDI_CH3_Pkt_get_accum_resp_t *get_accum_resp_pkt = &upkt.get_accum_resp;
MPID_Request *resp_req;
MPID_IOV iov[MPID_IOV_LIMIT];
+ MPI_Aint true_lb, true_extent;
MPIU_CHKPMEM_DECL(1);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMRECVCOMPLETE);
@@ -287,12 +294,17 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete( MPIDI_VC_t *vc,
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
/* accumulate data from tmp_buf into user_buf */
- mpi_errno = do_accumulate_op(rreq);
+ mpi_errno = do_accumulate_op(rreq->dev.final_user_buf, rreq->dev.real_user_buf,
+ rreq->dev.user_count, rreq->dev.datatype, rreq->dev.op);
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
+
+ /* free the temporary buffer */
+ MPIR_Type_get_true_extent_impl(rreq->dev.datatype, &true_lb, &true_extent);
+ MPIU_Free((char *) rreq->dev.final_user_buf + true_lb);
/* mark data transfer as complete and decrement CC */
MPIDI_CH3U_Request_complete(rreq);
http://git.mpich.org/mpich.git/commitdiff/9bc09a30a47fb411bf3f63f4c29a694fe…
commit 9bc09a30a47fb411bf3f63f4c29a694fe779118e
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Tue Nov 4 22:10:57 2014 -0600
Initialize flag in pkt when creating RMA operation.
Here we initalize packet flag as FLAG_NONE when creating
this packet, and add flags later when needed.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_issue.h b/src/mpid/ch3/include/mpid_rma_issue.h
index c310329..08bad83 100644
--- a/src/mpid/ch3/include/mpid_rma_issue.h
+++ b/src/mpid/ch3/include/mpid_rma_issue.h
@@ -338,7 +338,7 @@ static int issue_put_op(MPIDI_RMA_Op_t * rma_op, MPID_Win *win_ptr,
rma_op->request = NULL;
- put_pkt->flags = flags;
+ put_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
put_pkt->lock_type = target_ptr->lock_type;
@@ -399,7 +399,7 @@ static int issue_acc_op(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
rma_op->request = NULL;
- accum_pkt->flags = flags;
+ accum_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
accum_pkt->lock_type = target_ptr->lock_type;
@@ -484,7 +484,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
/* Note: Get_accumulate uses the same packet type as accumulate */
get_accum_pkt->request_handle = resp_req->handle;
- get_accum_pkt->flags = flags;
+ get_accum_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
get_accum_pkt->lock_type = target_ptr->lock_type;
@@ -599,7 +599,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
}
get_pkt->request_handle = rma_op->request->handle;
- get_pkt->flags = flags;
+ get_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
get_pkt->lock_type = target_ptr->lock_type;
@@ -699,7 +699,7 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
rma_op->request->dev.source_win_handle = cas_pkt->source_win_handle;
cas_pkt->request_handle = rma_op->request->handle;
- cas_pkt->flags = flags;
+ cas_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
cas_pkt->lock_type = target_ptr->lock_type;
@@ -768,7 +768,7 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
fop_pkt->request_handle = resp_req->handle;
- fop_pkt->flags = flags;
+ fop_pkt->flags |= flags;
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK)
fop_pkt->lock_type = target_ptr->lock_type;
diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c
index 4a6db9f..8ec172d 100644
--- a/src/mpid/ch3/src/ch3u_rma_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_ops.c
@@ -120,6 +120,7 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype
put_pkt->source_win_handle = win_ptr->handle;
put_pkt->immed_len = 0;
put_pkt->origin_rank = rank;
+ put_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
/* FIXME: For contig and very short operations, use a streamlined op */
new_ptr->origin_addr = (void *) origin_addr;
@@ -303,6 +304,7 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->origin_rank = rank;
+ get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
/* FIXME: For contig and very short operations, use a streamlined op */
new_ptr->origin_addr = origin_addr;
@@ -468,6 +470,7 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp
accum_pkt->source_win_handle = win_ptr->handle;
accum_pkt->immed_len = 0;
accum_pkt->origin_rank = rank;
+ accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = origin_count;
@@ -658,6 +661,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->origin_rank = rank;
+ get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = result_addr;
new_ptr->origin_count = result_count;
@@ -693,6 +697,7 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
get_accum_pkt->source_win_handle = win_ptr->handle;
get_accum_pkt->immed_len = 0;
get_accum_pkt->origin_rank = rank;
+ get_accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = origin_count;
@@ -982,6 +987,7 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
cas_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
cas_pkt->source_win_handle = win_ptr->handle;
cas_pkt->origin_rank = rank;
+ cas_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = 1;
@@ -1110,6 +1116,7 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->origin_rank = rank;
+ get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = result_addr;
new_ptr->origin_count = 1;
@@ -1131,6 +1138,7 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
fop_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
fop_pkt->immed_len = 0;
fop_pkt->origin_rank = rank;
+ fop_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
new_ptr->origin_addr = (void *) origin_addr;
new_ptr->origin_count = 1;
http://git.mpich.org/mpich.git/commitdiff/a9d968cc474bc369be2c514b7384944e6…
commit a9d968cc474bc369be2c514b7384944e6baefd18
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Thu Nov 13 10:12:04 2014 -0600
Perf-tuning: issue FLUSH, FLUSH ACK, UNLOCK ACK messages only when needed.
When operation pending list and request lists are all empty, FLUSH message
needs to be sent by origin only when origin issued PUT/ACC operations since
the last synchronization calls, otherwise origin does not need to issue FLUSH
at all and does not need to wait for FLUSH ACK message.
Similiarly, origin waits for ACK of UNLOCK message only when origin issued
PUT/ACC operations since the last synchronization calls. However, UNLOCK
message always needs to be sent out because origin needs to unlock the
target process. This patch avoids issuing unnecessary
FLUSH / FLUSH ACK / UNLOCK ACK messages.
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index 85b672a..e4d4a2e 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -118,6 +118,7 @@ static inline MPIDI_RMA_Target_t *MPIDI_CH3I_Win_target_alloc(MPID_Win * win_ptr
e->outstanding_lock = 0;
e->disable_flush_local = 0;
e->win_complete_flag = 0;
+ e->put_acc_issued = 0;
e->sync.sync_flag = MPIDI_RMA_SYNC_NONE;
e->sync.outstanding_acks = 0;
diff --git a/src/mpid/ch3/include/mpid_rma_types.h b/src/mpid/ch3/include/mpid_rma_types.h
index bdcc9a0..d182799 100644
--- a/src/mpid/ch3/include/mpid_rma_types.h
+++ b/src/mpid/ch3/include/mpid_rma_types.h
@@ -88,6 +88,8 @@ typedef struct MPIDI_RMA_Target {
int outstanding_lock;
int disable_flush_local;
int win_complete_flag;
+ int put_acc_issued; /* indicate if PUT/ACC is issued in this epoch
+ after the previous synchronization calls. */
/* The target structure is free to be cleaned up when all of the
* following conditions hold true:
diff --git a/src/mpid/ch3/include/mpidpkt.h b/src/mpid/ch3/include/mpidpkt.h
index 25b890f..243c296 100644
--- a/src/mpid/ch3/include/mpidpkt.h
+++ b/src/mpid/ch3/include/mpidpkt.h
@@ -118,7 +118,8 @@ typedef enum {
MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE = 128,
MPIDI_CH3_PKT_FLAG_RMA_FLUSH_ACK = 256,
MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_ACK = 512,
- MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED = 1024
+ MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED = 1024,
+ MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK = 2048
} MPIDI_CH3_Pkt_flags_t;
typedef struct MPIDI_CH3_Pkt_send {
@@ -551,6 +552,7 @@ typedef struct MPIDI_CH3_Pkt_unlock {
int target_rank; /* Used in unluck/flush response to look up the
* target state at the origin. */
int origin_rank;
+ MPIDI_CH3_Pkt_flags_t flags;
} MPIDI_CH3_Pkt_unlock_t;
typedef struct MPIDI_CH3_Pkt_flush {
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 7efc641..9e8b9f1 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -351,7 +351,6 @@ extern MPIDI_RMA_Pkt_orderings_t *MPIDI_RMA_Pkt_orderings;
int outstanding_locks; /* when issuing multiple lock requests in \
MPI_WIN_LOCK_ALL, this counter keeps track \
of number of locks not being granted yet. */ \
- int outstanding_unlocks; \
#ifdef MPIDI_CH3_WIN_DECL
#define MPID_DEV_WIN_DECL \
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index a939ed5..64e8aac 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -60,7 +60,8 @@ static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
#define FUNCNAME send_unlock_msg
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int send_unlock_msg(int dest, MPID_Win * win_ptr)
+static inline int send_unlock_msg(int dest, MPID_Win * win_ptr,
+ MPIDI_CH3_Pkt_flags_t flags)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_CH3_Pkt_t upkt;
@@ -78,6 +79,7 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr)
MPIDI_Pkt_init(unlock_pkt, MPIDI_CH3_PKT_UNLOCK);
unlock_pkt->target_win_handle = win_ptr->all_win_handles[dest];
unlock_pkt->source_win_handle = win_ptr->handle;
+ unlock_pkt->flags = flags;
MPIU_THREAD_CS_ENTER(CH3COMM, vc);
mpi_errno = MPIDI_CH3_iStartMsg(vc, unlock_pkt, sizeof(*unlock_pkt), &req);
@@ -324,14 +326,10 @@ static inline int MPIDI_CH3I_RMA_Handle_flush_ack(MPID_Win * win_ptr, int target
mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &t);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
- if (t == NULL) {
- win_ptr->outstanding_unlocks--;
- MPIU_Assert(win_ptr->outstanding_unlocks >= 0);
- }
- else {
- t->sync.outstanding_acks--;
- MPIU_Assert(t->sync.outstanding_acks >= 0);
- }
+ t->sync.outstanding_acks--;
+ MPIU_Assert(t->sync.outstanding_acks >= 0);
+
+ t->put_acc_issued = 0; /* reset PUT_ACC_FLAG after FLUSH is completed */
fn_exit:
return mpi_errno;
diff --git a/src/mpid/ch3/src/ch3u_rma_oplist.c b/src/mpid/ch3/src/ch3u_rma_oplist.c
index 5c06650..69e98d5 100644
--- a/src/mpid/ch3/src/ch3u_rma_oplist.c
+++ b/src/mpid/ch3/src/ch3u_rma_oplist.c
@@ -233,10 +233,21 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t *targe
target->sync.outstanding_acks--;
MPIU_Assert(target->sync.outstanding_acks == 0);
}
+ else if (target->read_op_list == NULL &&
+ target->write_op_list == NULL &&
+ target->dt_op_list == NULL &&
+ target->put_acc_issued == 0) {
+ /* both pending list and all waiting lists for
+ this target are empty, we do not need to send
+ FLUSH message then. */
+ target->sync.outstanding_acks--;
+ MPIU_Assert(target->sync.outstanding_acks >= 0);
+ }
else {
mpi_errno = send_flush_msg(target->target_rank, win_ptr);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
+
(*made_progress) = 1;
goto finish_issue;
}
@@ -247,10 +258,22 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t *targe
target->sync.outstanding_acks--;
MPIU_Assert(target->sync.outstanding_acks == 0);
}
+ else if (target->read_op_list == NULL &&
+ target->write_op_list == NULL &&
+ target->dt_op_list == NULL &&
+ target->put_acc_issued == 0) {
+ /* send message to unlock target, but don't need ACK */
+ mpi_errno = send_unlock_msg(target->target_rank, win_ptr, MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK);
+ if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+
+ target->sync.outstanding_acks--;
+ MPIU_Assert(target->sync.outstanding_acks >= 0);
+ }
else {
- mpi_errno = send_unlock_msg(target->target_rank, win_ptr);
+ mpi_errno = send_unlock_msg(target->target_rank, win_ptr, MPIDI_CH3_PKT_FLAG_NONE);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
+
(*made_progress) = 1;
goto finish_issue;
}
@@ -327,6 +350,8 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t *targe
curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE) {
MPIDI_CH3I_RMA_Ops_append(&(target->write_op_list),
&(target->write_op_list_tail), curr_op);
+ target->put_acc_issued = 1; /* set PUT_ACC_FLAG when sending
+ PUT/ACC operation. */
}
else {
MPIDI_CH3I_RMA_Ops_append(&(target->read_op_list),
diff --git a/src/mpid/ch3/src/ch3u_rma_pkthandler.c b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
index 6a0bbab..757cee4 100644
--- a/src/mpid/ch3/src/ch3u_rma_pkthandler.c
+++ b/src/mpid/ch3/src/ch3u_rma_pkthandler.c
@@ -1519,9 +1519,11 @@ int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
- mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, MPIDI_CH3_PKT_FLAG_NONE,
- unlock_pkt->source_win_handle);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (!(unlock_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK)) {
+ mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, MPIDI_CH3_PKT_FLAG_NONE,
+ unlock_pkt->source_win_handle);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
MPIDI_CH3_Progress_signal_completion();
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index c1a2c01..5ecf2cd 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -1488,8 +1488,6 @@ int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
OPA_read_write_barrier();
}
- MPIU_Assert(win_ptr->outstanding_unlocks == 0);
-
/* Unlock MYSELF and processes on SHM. */
if (!(win_ptr->lock_all_assert & MPI_MODE_NOCHECK)) {
mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
@@ -1503,8 +1501,7 @@ int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
if (i == rank) continue;
MPIDI_Comm_get_vc(win_ptr->comm_ptr, i, &target_vc);
if (orig_vc->node_id == target_vc->node_id) {
- win_ptr->outstanding_unlocks++;
- mpi_errno = send_unlock_msg(i, win_ptr);
+ mpi_errno = send_unlock_msg(i, win_ptr, MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
}
@@ -1561,8 +1558,7 @@ int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
continue;
}
- win_ptr->outstanding_unlocks++;
- mpi_errno = send_unlock_msg(i, win_ptr);
+ mpi_errno = send_unlock_msg(i, win_ptr, MPIDI_CH3_PKT_FLAG_RMA_UNLOCK_NO_ACK);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
}
@@ -1579,12 +1575,12 @@ int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_win(win_ptr, &local_completed,
&remote_completed);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
- if (!remote_completed || win_ptr->outstanding_unlocks) {
+ if (!remote_completed) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
}
- } while (!remote_completed || win_ptr->outstanding_unlocks);
+ } while (!remote_completed);
/* Cleanup all targets on this window. */
mpi_errno = MPIDI_CH3I_RMA_Cleanup_targets_win(win_ptr);
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index 83a5b35..42b4521 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -336,7 +336,6 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
(*win_ptr)->lock_all_assert = 0;
(*win_ptr)->lock_epoch_count = 0;
(*win_ptr)->outstanding_locks = 0;
- (*win_ptr)->outstanding_unlocks = 0;
/* Initialize the info flags */
(*win_ptr)->info_args.no_locks = 0;
diff --git a/src/mpid/ch3/src/mpidi_rma.c b/src/mpid/ch3/src/mpidi_rma.c
index 616f5ed..88ca0f8 100644
--- a/src/mpid/ch3/src/mpidi_rma.c
+++ b/src/mpid/ch3/src/mpidi_rma.c
@@ -169,6 +169,24 @@ int MPIDI_Win_free(MPID_Win ** win_ptr)
(*win_ptr)->states.exposure_state != MPIDI_RMA_NONE,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
+ /* 1. Here we must wait until all passive locks are released on this target,
+ because for some UNLOCK messages, we do not send ACK back to origin,
+ we must wait until lock is released so that we can free window.
+ 2. We also need to wait until AT completion counter being zero, because
+ this counter is increment everytime we meet a GET-like operation, it is
+ possible that when target entering Win_free, passive epoch is not finished
+ yet and there are still GETs doing on this target.
+ 3. We also need to wait until lock queue becomes empty. It is possible
+ that some lock requests is still waiting in the queue when target is
+ entering Win_free. */
+ while ((*win_ptr)->current_lock_type != MPID_LOCK_NONE ||
+ (*win_ptr)->at_completion_counter != 0 ||
+ (*win_ptr)->lock_queue != NULL) {
+ mpi_errno = wait_progress_engine();
+ if (mpi_errno != MPI_SUCCESS)
+ MPIU_ERR_POP(mpi_errno);
+ }
+
if (!(*win_ptr)->shm_allocated) {
/* when SHM is allocated, we already did a global barrier in
MPIDI_CH3_SHM_Win_free, so we do not need to do it again here. */
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/include/mpid_rma_issue.h | 12 ++--
src/mpid/ch3/include/mpid_rma_oplist.h | 1 +
src/mpid/ch3/include/mpid_rma_types.h | 2 +
src/mpid/ch3/include/mpidimpl.h | 8 ++-
src/mpid/ch3/include/mpidpkt.h | 4 +-
src/mpid/ch3/include/mpidpre.h | 1 -
src/mpid/ch3/include/mpidrma.h | 119 +++++++++++++++++++++---------
src/mpid/ch3/src/ch3u_handle_recv_req.c | 83 ++++++----------------
src/mpid/ch3/src/ch3u_handle_send_req.c | 120 +++++++++++++++++++++++--------
src/mpid/ch3/src/ch3u_rma_oplist.c | 27 +++++++-
src/mpid/ch3/src/ch3u_rma_ops.c | 8 ++
src/mpid/ch3/src/ch3u_rma_pkthandler.c | 42 ++++--------
src/mpid/ch3/src/ch3u_rma_sync.c | 12 +--
src/mpid/ch3/src/mpid_rma.c | 1 -
src/mpid/ch3/src/mpidi_rma.c | 18 +++++
15 files changed, 284 insertions(+), 174 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-213-gc26861b
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 c26861ba3ff025bb62351acf1d74945581f5c59c (commit)
via 66fa21c77151c7a68a5525d8d6311e7bfea4ddb7 (commit)
via 30da9161a6c21f8dfb4a115e45fd52081ddf6a5d (commit)
via 48c38c08fa002e2cd042b141ebacdec1786fbfe7 (commit)
via 56fee8ce9b43db1668d5d9dad3acfab1c42e9a33 (commit)
from 3f060b9f7da8a534fdd258a9b1dd490af4fcf3c4 (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/c26861ba3ff025bb62351acf1d7494558…
commit c26861ba3ff025bb62351acf1d74945581f5c59c
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Wed Nov 12 12:50:17 2014 -0600
Support spaces after @whatever@ in testlist
It makes testlist.in files more flexible and easier to read
Signed-off-by: Sangmin Seo <sseo(a)anl.gov>
diff --git a/maint/f77tof90.in b/maint/f77tof90.in
index 3be22ed..b6ecccc 100644
--- a/maint/f77tof90.in
+++ b/maint/f77tof90.in
@@ -472,7 +472,7 @@ sub ConvertTestlist {
# Cray-style pointers for MPI_Alloc_mem).
$_ = "\@ALLOCMEMFC\@\n";
}
- elsif (/^(\@\w+\@)(\w+f)\s+(.*)/) {
+ elsif (/^(\@\w+\@)(\s*\w+f)\s+(.*)/) {
# This handles the case where an autoconf variable in the
# testlist.in file is used to optionally comment out a test
$_ = $1 . $2 . "90 " . $3 . "\n";
http://git.mpich.org/mpich.git/commitdiff/66fa21c77151c7a68a5525d8d6311e7bf…
commit 66fa21c77151c7a68a5525d8d6311e7bfea4ddb7
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Mon Nov 10 17:22:28 2014 -0600
Add Fortran tests for nonblocking collective I/O
No review since F08 binding is experimental now.
diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 60e69d4..5459964 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -38,6 +38,7 @@
/f77/init/checksizes.c
/f90/datatype/allctypesf90.f90
/io/test.ord
+/io/i_setviewcur
/threads/pt2pt/greq_test
/threads/pt2pt/greq_wait
/threads/pt2pt/multisend
@@ -246,6 +247,7 @@
/f77/io/writeordbef.f
/f77/io/writeshf.f
/f77/io/writeatallf.f
+/f77/io/iwriteatallf.f
/f77/io/writeatallbef.f
/f77/io/writeallbef.f
/f77/io/iwritef
@@ -259,6 +261,7 @@
/f77/io/writeatall
/f77/io/writeatallbef
/f77/io/writeallbef
+/f77/io/i_setviewcurf
/f77/io/iooffset.h
/f77/io/iodisp.h
/f77/io/ioaint.h
@@ -343,6 +346,7 @@
/f90/io/writeordbef90.f90
/f90/io/writeshf90.f90
/f90/io/writeatallf90.f90
+/f90/io/iwriteatallf90.f90
/f90/io/writeatallbef90.f90
/f90/io/writeallbef90.f90
/f90/io/c2f2ciof90.f90
@@ -350,8 +354,10 @@
/f90/io/c2f90multio.c
/f90/io/Makefile.sm
/f90/io/testlist
+/f90/io/testlist.in
/f90/io/ioharness.defn
/f90/io/ioharness.tlt
+/f90/io/i_setviewcurf90.f90
/f90/misc/sizeof
/f90/misc/f77tof90
/f90/pt2pt/Makefile.sm
@@ -442,6 +448,9 @@
/f08/datatype/get_elem_d
/f08/datatype/get_elem_u
/f08/rma/testlist
+/f08/io/iwriteatallf90.f90
+/f08/io/iwriteatallf90
+/f08/io/i_fcoll_test
/group/errstring
/group/grouptest
/group/groupcreate
@@ -798,6 +807,8 @@
/f77/io/setviewcurf
/f77/io/shpositionf
/f77/io/writeatallf
+/f77/io/iwriteatallf
+/f77/io/testlist
/f77/pt2pt/allpairf
/f77/pt2pt/greqf
/f77/pt2pt/mprobef
@@ -866,6 +877,7 @@
/f90/io/writeallf90
/f90/io/writeatallbef90
/f90/io/writeatallf90
+/f90/io/iwriteatallf90
/f90/io/writeatf90
/f90/io/writef90
/f90/io/writeordbef90
diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac
index 2ce7df8..26a9d95 100644
--- a/test/mpi/configure.ac
+++ b/test/mpi/configure.ac
@@ -1547,6 +1547,7 @@ AC_OUTPUT(maint/testmerge \
f77/io/iooffset.h \
f77/io/iodisp.h \
f77/io/ioaint.h \
+ f77/io/testlist \
f77/profile/Makefile \
f90/Makefile \
f90/attr/Makefile \
@@ -1566,6 +1567,7 @@ AC_OUTPUT(maint/testmerge \
f90/ext/Makefile \
f90/ext/testlist \
f90/io/Makefile \
+ f90/io/testlist \
f90/misc/Makefile \
f90/profile/Makefile \
f08/Makefile \
@@ -1579,6 +1581,7 @@ AC_OUTPUT(maint/testmerge \
f08/subarray/Makefile \
f08/topo/Makefile \
f08/io/Makefile \
+ f08/io/testlist \
f08/init/Makefile \
f08/info/Makefile \
f08/spawn/Makefile \
diff --git a/test/mpi/f08/io/Makefile.am b/test/mpi/f08/io/Makefile.am
index e69d4de..a81572d 100644
--- a/test/mpi/f08/io/Makefile.am
+++ b/test/mpi/f08/io/Makefile.am
@@ -7,7 +7,7 @@
include $(top_srcdir)/Makefile_f08.mtest
-EXTRA_DIST = testlist
+EXTRA_DIST = testlist.in
# avoid having to write many "foo_SOURCES = foo.f90" lines
AM_DEFAULT_SOURCE_EXT = .f90
@@ -34,6 +34,11 @@ noinst_PROGRAMS = \
c2f90multio \
c2f2ciof90
+if BUILD_MPIX_TESTS
+noinst_PROGRAMS += \
+ i_fcoll_test \
+ iwriteatallf90
+endif
# We don't want to distribute these source files because they are created by
# "testmerge", hence "nodist_foo_SOURCES"
@@ -49,6 +54,7 @@ nodist_writef90_SOURCES = writef90.f90
nodist_writeordbef90_SOURCES = writeordbef90.f90
nodist_writeordf90_SOURCES = writeordf90.f90
nodist_writeshf90_SOURCES = writeshf90.f90
+nodist_iwriteatallf90_SOURCES = iwriteatallf90.f90
c2f90multio_SOURCES = c2f90multio.c
# this is a C only program, so we must either:
@@ -68,6 +74,7 @@ c2f2ciof90_SOURCES = c2f2ciof90.f90 c2f902cio.c
# these files are genereated using testmerge (see below)
generated_io_sources = \
iwriteatf90.f90 \
+ iwriteatallf90.f90 \
iwritef90.f90 \
iwriteshf90.f90 \
writeallbef90.f90 \
diff --git a/test/mpi/f08/io/i_fcoll_test.f90 b/test/mpi/f08/io/i_fcoll_test.f90
new file mode 100644
index 0000000..29bc82a
--- /dev/null
+++ b/test/mpi/f08/io/i_fcoll_test.f90
@@ -0,0 +1,155 @@
+! -*- Mode: Fortran; -*-
+!
+! (C) 2014 by Argonne National Laboratory.
+! See COPYRIGHT in top-level directory.
+!
+program main
+use mpi_f08
+
+implicit none
+!include 'mpif.h'
+
+! Fortran 2008 equivalent of src/mpi/romio/test/coll_test.c
+
+integer FILESIZE
+parameter (FILESIZE=32*32*32*4)
+
+! A 32^3 array. For other array sizes, change FILESIZE above and
+! array_of_gsizes below.
+
+! Uses collective I/O. Writes a 3D block-distributed array to a file
+! corresponding to the global array in row-major (C) order, reads it
+! back, and checks that the data read is correct.
+
+! Note that the file access pattern is noncontiguous.
+
+integer i, ndims, array_of_gsizes(3)
+integer order, intsize, nprocs, j, array_of_distribs(3)
+integer array_of_dargs(3), array_of_psizes(3)
+integer readbuf(FILESIZE), writebuf(FILESIZE), bufcount
+integer mynod, tmpbuf(FILESIZE), array_size, argc
+integer ierr
+character*256 str ! used to store the filename
+integer errs, toterrs
+integer(MPI_OFFSET_KIND) :: disp
+
+type(MPI_Datatype) :: newtype
+type(MPI_Status) :: status
+type(MPI_Request) :: request
+type(MPI_File) :: fh
+
+errs = 0
+str = "iotest.txt"
+
+call MPI_INIT(ierr)
+call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, ierr)
+call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr)
+
+! create the distributed array filetype
+
+ndims = 3
+order = MPI_ORDER_FORTRAN
+
+array_of_gsizes(1) = 32
+array_of_gsizes(2) = 32
+array_of_gsizes(3) = 32
+
+array_of_distribs(1) = MPI_DISTRIBUTE_BLOCK
+array_of_distribs(2) = MPI_DISTRIBUTE_BLOCK
+array_of_distribs(3) = MPI_DISTRIBUTE_BLOCK
+
+array_of_dargs(1) = MPI_DISTRIBUTE_DFLT_DARG
+array_of_dargs(2) = MPI_DISTRIBUTE_DFLT_DARG
+array_of_dargs(3) = MPI_DISTRIBUTE_DFLT_DARG
+
+do i=1, ndims
+ array_of_psizes(i) = 0
+end do
+
+call MPI_DIMS_CREATE(nprocs, ndims, array_of_psizes, ierr)
+
+call MPI_TYPE_CREATE_DARRAY(nprocs, mynod, ndims, &
+ array_of_gsizes, array_of_distribs, array_of_dargs, &
+ array_of_psizes, order, MPI_INTEGER, newtype, ierr)
+
+call MPI_TYPE_COMMIT(newtype, ierr)
+
+! initialize writebuf
+
+call MPI_TYPE_SIZE(newtype, bufcount, ierr)
+call MPI_TYPE_SIZE(MPI_INTEGER, intsize, ierr)
+bufcount = bufcount/intsize
+do i=1, bufcount
+ writebuf(i) = 1
+end do
+
+do i=1, FILESIZE
+ tmpbuf(i) = 0
+end do
+
+call MPI_IRECV(tmpbuf, 1, newtype, mynod, 10, MPI_COMM_WORLD, request, ierr)
+call MPI_SEND(writebuf, bufcount, MPI_INTEGER, mynod, 10, MPI_COMM_WORLD, ierr)
+call MPI_WAIT(request, status, ierr)
+
+j = 1
+array_size = array_of_gsizes(1) * array_of_gsizes(2) * array_of_gsizes(3)
+do i=1, array_size
+ if (tmpbuf(i) .ne. 0) then
+ writebuf(j) = i
+ j = j + 1
+ end if
+end do
+
+! end of initialization
+
+! write the array to the file
+
+call MPI_FILE_OPEN(MPI_COMM_WORLD, str, MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr)
+
+disp = 0
+call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, "native", MPI_INFO_NULL, ierr)
+call MPIX_FILE_IWRITE_ALL(fh, writebuf, bufcount, MPI_INTEGER, request, ierr)
+call MPI_WAIT(request, status, ierr)
+call MPI_FILE_CLOSE(fh, ierr)
+
+!now read it back
+
+call MPI_FILE_OPEN(MPI_COMM_WORLD, str, MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr)
+
+call MPI_FILE_SET_VIEW(fh, disp, MPI_INTEGER, newtype, "native", MPI_INFO_NULL, ierr)
+call MPIX_FILE_IREAD_ALL(fh, readbuf, bufcount, MPI_INTEGER, request, ierr)
+call MPI_WAIT(request, status, ierr)
+call MPI_FILE_CLOSE(fh, ierr)
+
+! check the data read
+do i=1, bufcount
+ if (readbuf(i) .ne. writebuf(i)) then
+ errs = errs + 1
+ print *, 'Node ', mynod, ' readbuf ', readbuf(i), &
+ ' writebuf ', writebuf(i), ' i', i
+ end if
+end do
+
+call MPI_TYPE_FREE(newtype, ierr)
+
+if (mynod .eq. 0) then
+ call MPI_FILE_DELETE(str, MPI_INFO_NULL, ierr)
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ endif
+endif
+
+call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, MPI_COMM_WORLD, ierr )
+
+if (mynod .eq. 0) then
+ if( toterrs .gt. 0 ) then
+ print *, 'Found ', toterrs, ' errors'
+ else
+ print *, ' No Errors'
+ endif
+endif
+
+call MPI_FINALIZE(ierr)
+
+stop
+end
diff --git a/test/mpi/f08/io/ioharness.defn b/test/mpi/f08/io/ioharness.defn
index ca261e5..5a7d756 100644
--- a/test/mpi/f08/io/ioharness.defn
+++ b/test/mpi/f08/io/ioharness.defn
@@ -246,6 +246,38 @@ enddo
</readfile>
</TESTDEFN>
+# This test uses nonblocking collective I/O with thread-safe, individual file pointers
+<TESTDEFN filename="iwriteatallf90.f90">
+<writefiledecl>
+type(MPI_Status) status
+type(MPI_Request) request
+integer buf(MAX_BUFFER), ans
+integer (kind=MPI_OFFSET_KIND)offset
+</writefiledecl>
+<writefile>
+do k=1, b
+ <setContigBuffer/>
+ <findOffset/>
+ call MPIX_File_iwrite_at_all( fh, offset, buf, n, MPI_INTEGER, request, ierr )
+ call MPI_Wait(request, status, ierr)
+ <checkErr/>
+enddo
+</writefile>
+# No extra declarations are needed for the read step
+<readfiledecl>
+</readfiledecl>
+<readfile>
+do k=1, b
+ <clearContigBuffer/>
+ <findOffset/>
+ call MPIX_File_iread_at_all( fh, offset, buf, n, MPI_INTEGER, request, ierr )
+ call MPI_Wait(request, status, ierr)
+ <checkErr/>
+ <checkContigBuffer/>
+enddo
+</readfile>
+</TESTDEFN>
+
# This test uses collective I/O with thread-safe, individual file pointers
<TESTDEFN filename="writeatallbef90.f90">
<writefiledecl>
diff --git a/test/mpi/f08/io/testlist b/test/mpi/f08/io/testlist.in
similarity index 86%
rename from test/mpi/f08/io/testlist
rename to test/mpi/f08/io/testlist.in
index 46c2ef8..d2dd57d 100644
--- a/test/mpi/f08/io/testlist
+++ b/test/mpi/f08/io/testlist.in
@@ -18,3 +18,5 @@ miscfilef90 4
setviewcurf90 4
c2f2ciof90 1
c2f90multio 1
+@mpix@ i_fcoll_test 4
+@mpix@ iwriteatallf90 4
diff --git a/test/mpi/f77/io/Makefile.am b/test/mpi/f77/io/Makefile.am
index d7f5d06..2cd966c 100644
--- a/test/mpi/f77/io/Makefile.am
+++ b/test/mpi/f77/io/Makefile.am
@@ -7,7 +7,7 @@
include $(top_srcdir)/Makefile_f77.mtest
-EXTRA_DIST = testlist
+EXTRA_DIST = testlist.in
# avoid having to write many "foo_SOURCES = foo.f" lines
AM_DEFAULT_SOURCE_EXT = .f
@@ -34,10 +34,17 @@ noinst_PROGRAMS = \
c2fmultio \
c2f2ciof
+if BUILD_MPIX_TESTS
+noinst_PROGRAMS += \
+ i_setviewcurf \
+ iwriteatallf
+endif
+
# We don't want to distribute these source files because they are created by
# "testmerge", hence "nodist_foo_SOURCES"
nodist_iwriteatf_SOURCES = iwriteatf.f
+nodist_iwriteatallf_SOURCES = iwriteatallf.f
nodist_iwritef_SOURCES = iwritef.f
nodist_iwriteshf_SOURCES = iwriteshf.f
nodist_writeallbef_SOURCES = writeallbef.f
@@ -82,6 +89,7 @@ writeordf.$(OBJEXT): iooffset.h
# these files are genereated using testmerge (see below)
generated_io_sources = \
iwriteatf.f \
+ iwriteatallf.f \
iwritef.f \
iwriteshf.f \
writeallbef.f \
diff --git a/test/mpi/f77/io/i_setviewcurf.f b/test/mpi/f77/io/i_setviewcurf.f
new file mode 100644
index 0000000..15b222e
--- /dev/null
+++ b/test/mpi/f77/io/i_setviewcurf.f
@@ -0,0 +1,122 @@
+C -*- Mode: Fortran; -*-
+C
+C (C) 2003 by Argonne National Laboratory.
+C See COPYRIGHT in top-level directory.
+C
+ program main
+ implicit none
+ include 'mpif.h'
+ include 'iooffset.h'
+ integer errs, ierr, size, rank
+ integer fh, comm, status(MPI_STATUS_SIZE)
+ integer buf(1024)
+ integer request
+
+ errs = 0
+ call MTest_Init( ierr )
+
+C This test reads a header then sets the view to every "size" int,
+C using set view and current displacement. The file is first written
+C using a combination of collective and ordered writes
+
+ comm = MPI_COMM_WORLD
+ call MPI_File_open( comm, "test.ord", MPI_MODE_WRONLY +
+ $ MPI_MODE_CREATE, MPI_INFO_NULL, fh, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Open(1)", ierr )
+ endif
+ call MPI_Comm_size( comm, size, ierr )
+ call MPI_Comm_rank( comm, rank, ierr )
+ if (size .gt. 1024) then
+ if (rank .eq. 0) then
+ print *,
+ $"This program must be run with no more than 1024 processes"
+ call MPI_Abort( MPI_COMM_WORLD, 1, ierr )
+ endif
+ endif
+
+ buf(1) = size
+ call MPIX_File_iwrite_all( fh, buf, 1, MPI_INTEGER, request, ierr)
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "iwrite_all", ierr )
+ endif
+
+ call MPI_Wait(request, status, ierr)
+
+ call MPI_File_get_position( fh, offset, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Get_position", ierr )
+ endif
+ call MPI_File_seek_shared( fh, offset, MPI_SEEK_SET, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Seek_shared", ierr )
+ endif
+ buf(1) = rank
+ call MPI_File_write_ordered( fh, buf, 1, MPI_INTEGER, status,ierr)
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Write_ordered", ierr )
+ endif
+ call MPI_File_close( fh, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Close(1)", ierr )
+ endif
+
+C Reopen the file as sequential
+ call MPI_File_open( comm, "test.ord", MPI_MODE_RDONLY +
+ $ MPI_MODE_SEQUENTIAL + MPI_MODE_DELETE_ON_CLOSE,
+ $ MPI_INFO_NULL, fh, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Open(Read)", ierr )
+ endif
+
+ if (rank .eq. 0) then
+ call MPI_File_read_shared( fh, buf, 1, MPI_INTEGER, status,
+ $ ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Read_all", ierr )
+ endif
+ if (buf(1) .ne. size) then
+ errs = errs + 1
+ print *, "Unexpected value for the header = ", buf(1),
+ $ ", should be ", size
+ endif
+ endif
+ call MPI_Barrier( comm, ierr )
+C All processes must provide the same file view for MODE_SEQUENTIAL
+ call MPI_File_set_view( fh, MPI_DISPLACEMENT_CURRENT, MPI_INTEGER
+ $ ,MPI_INTEGER, "native", MPI_INFO_NULL, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Set_view", ierr )
+ endif
+ buf(1) = -1
+ call MPI_File_read_ordered( fh, buf, 1, MPI_INTEGER, status, ierr
+ $ )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Read_all", ierr )
+ endif
+ if (buf(1) .ne. rank) then
+ errs = errs + 1
+ print *, rank, ": buf(1) = ", buf(1)
+ endif
+
+ call MPI_File_close( fh, ierr )
+ if (ierr .ne. MPI_SUCCESS) then
+ errs = errs + 1
+ call MTestPrintErrorMsg( "Close(2)", ierr )
+ endif
+
+ call MTest_Finalize( errs )
+
+ call MPI_Finalize( ierr )
+ end
+
diff --git a/test/mpi/f77/io/ioharness.defn b/test/mpi/f77/io/ioharness.defn
index 55760ca..22d143c 100644
--- a/test/mpi/f77/io/ioharness.defn
+++ b/test/mpi/f77/io/ioharness.defn
@@ -246,6 +246,38 @@ enddo
</readfile>
</TESTDEFN>
+# This test uses nonblocking collective I/O with thread-safe, individual file pointers
+<TESTDEFN filename="iwriteatallf.f">
+<writefiledecl>
+integer status(MPI_STATUS_SIZE)
+integer request
+integer buf(MAX_BUFFER), ans
+include 'iooffset.h'
+</writefiledecl>
+<writefile>
+do k=1, b
+ <setContigBuffer/>
+ <findOffset/>
+ call mpix_file_iwrite_at_all( fh, offset, buf, n, MPI_INTEGER, request, ierr )
+ call mpi_wait(request, status, ierr)
+ <checkErr/>
+enddo
+</writefile>
+# No extra declarations are needed for the read step
+<readfiledecl>
+</readfiledecl>
+<readfile>
+do k=1, b
+ <clearContigBuffer/>
+ <findOffset/>
+ call mpix_file_iread_at_all( fh, offset, buf, n, MPI_INTEGER, request, ierr )
+ call mpi_wait(request, status, ierr)
+ <checkErr/>
+ <checkContigBuffer/>
+enddo
+</readfile>
+</TESTDEFN>
+
# This test uses collective I/O with thread-safe, individual file pointers
<TESTDEFN filename="writeatallbef.f">
<writefiledecl>
diff --git a/test/mpi/f77/io/testlist b/test/mpi/f77/io/testlist.in
similarity index 84%
rename from test/mpi/f77/io/testlist
rename to test/mpi/f77/io/testlist.in
index 297353a..51646b1 100644
--- a/test/mpi/f77/io/testlist
+++ b/test/mpi/f77/io/testlist.in
@@ -18,3 +18,5 @@ miscfilef 4
setviewcurf 4
c2f2ciof 1
c2fmultio 1
+@mpix@ i_setviewcurf 4
+@mpix@ iwriteatallf 4
http://git.mpich.org/mpich.git/commitdiff/30da9161a6c21f8dfb4a115e45fd52081…
commit 30da9161a6c21f8dfb4a115e45fd52081ddf6a5d
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Thu Nov 6 20:26:07 2014 -0600
Add F08 bindings for nonblocking collective I/O
No review since F08 binding is experimental now.
diff --git a/src/binding/fortran/use_mpi_f08/mpi_c_interface_cdesc.F90 b/src/binding/fortran/use_mpi_f08/mpi_c_interface_cdesc.F90
index af7b15d..ba27a93 100644
--- a/src/binding/fortran/use_mpi_f08/mpi_c_interface_cdesc.F90
+++ b/src/binding/fortran/use_mpi_f08/mpi_c_interface_cdesc.F90
@@ -1565,6 +1565,62 @@ function MPIR_Ineighbor_alltoallw_cdesc(sendbuf, sendcounts, sdispls, sendtypes,
integer(c_int) :: ierror
end function MPIR_Ineighbor_alltoallw_cdesc
+function MPIR_File_iread_all_cdesc(fh, buf, count, datatype, request) &
+ bind(C, name="MPIR_File_iread_all_cdesc") result(ierror)
+ use, intrinsic :: iso_c_binding, only : c_int
+ use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
+ implicit none
+ integer(c_File), value, intent(in) :: fh
+ type(*), dimension(..) :: buf
+ integer(c_int), value, intent(in) :: count
+ integer(c_Datatype), value, intent(in) :: datatype
+ integer(c_Request), intent(out) :: request
+ integer(c_int) :: ierror
+end function MPIR_File_iread_all_cdesc
+
+function MPIR_File_iwrite_all_cdesc(fh, buf, count, datatype, request) &
+ bind(C, name="MPIR_File_iwrite_all_cdesc") result(ierror)
+ use, intrinsic :: iso_c_binding, only : c_int, c_ptr
+ use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
+ implicit none
+ integer(c_File), value, intent(in) :: fh
+ type(*), dimension(..), intent(in) :: buf
+ integer(c_int), value, intent(in) :: count
+ integer(c_Datatype), value, intent(in) :: datatype
+ integer(c_Request), intent(out) :: request
+ integer(c_int) :: ierror
+end function MPIR_File_iwrite_all_cdesc
+
+function MPIR_File_iread_at_all_cdesc(fh, offset, buf, count, datatype, request) &
+ bind(C, name="MPIR_File_iread_at_all_cdesc") result(ierror)
+ use, intrinsic :: iso_c_binding, only : c_int
+ use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
+ use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
+ implicit none
+ integer(c_File), value, intent(in) :: fh
+ integer(MPI_OFFSET_KIND), value, intent(in) :: offset
+ type(*), dimension(..) :: buf
+ integer(c_int), value, intent(in) :: count
+ integer(c_Datatype), value, intent(in) :: datatype
+ integer(c_Request), intent(out) :: request
+ integer(c_int) :: ierror
+end function MPIR_File_iread_at_all_cdesc
+
+function MPIR_File_iwrite_at_all_cdesc(fh, offset, buf, count, datatype, request) &
+ bind(C, name="MPIR_File_iwrite_at_all_cdesc") result(ierror)
+ use, intrinsic :: iso_c_binding, only : c_int
+ use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
+ use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
+ implicit none
+ integer(c_File), value, intent(in) :: fh
+ integer(MPI_OFFSET_KIND), value, intent(in) :: offset
+ type(*), dimension(..) :: buf
+ integer(c_int), value, intent(in) :: count
+ integer(c_Datatype), value, intent(in) :: datatype
+ integer(c_Request), intent(out) :: request
+ integer(c_int) :: ierror
+end function MPIR_File_iwrite_at_all_cdesc
+
end interface
end module mpi_c_interface_cdesc
diff --git a/src/binding/fortran/use_mpi_f08/mpi_f08.F90 b/src/binding/fortran/use_mpi_f08/mpi_f08.F90
index 7a36ff3..d1ba398 100644
--- a/src/binding/fortran/use_mpi_f08/mpi_f08.F90
+++ b/src/binding/fortran/use_mpi_f08/mpi_f08.F90
@@ -4121,4 +4121,60 @@ interface MPIX_Aint_diff
end function MPIX_Aint_diff_f08
end interface MPIX_Aint_diff
+interface MPIX_File_iread_all
+ subroutine MPIX_File_iread_all_f08ts(fh, buf, count, datatype, request, ierror)
+ use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
+ implicit none
+ type(MPI_File), intent(in) :: fh
+ type(*), dimension(..) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+ end subroutine MPIX_File_iread_all_f08ts
+end interface MPIX_File_iread_all
+
+interface MPIX_File_iwrite_all
+ subroutine MPIX_File_iwrite_all_f08ts(fh, buf, count, datatype, request, ierror)
+ use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
+ implicit none
+ type(MPI_File), intent(in) :: fh
+ type(*), dimension(..), intent(in) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+ end subroutine MPIX_File_iwrite_all_f08ts
+end interface MPIX_File_iwrite_all
+
+interface MPIX_File_iread_at_all
+ subroutine MPIX_File_iread_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
+ use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
+ use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
+ implicit none
+ type(MPI_File), intent(in) :: fh
+ integer(MPI_OFFSET_KIND), intent(in) :: offset
+ type(*), dimension(..) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+ end subroutine MPIX_File_iread_at_all_f08ts
+end interface MPIX_File_iread_at_all
+
+interface MPIX_File_iwrite_at_all
+ subroutine MPIX_File_iwrite_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
+ use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
+ use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
+ implicit none
+ type(MPI_File), intent(in) :: fh
+ integer(MPI_OFFSET_KIND), intent(in) :: offset
+ type(*), dimension(..) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+ end subroutine MPIX_File_iwrite_at_all_f08ts
+end interface MPIX_File_iwrite_at_all
+
end module mpi_f08
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_f/file_iread_all_f08ts.F90 b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iread_all_f08ts.F90
new file mode 100644
index 0000000..72c86b6
--- /dev/null
+++ b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iread_all_f08ts.F90
@@ -0,0 +1,42 @@
+! -*- Mode: Fortran; -*-
+!
+! (C) 2014 by Argonne National Laboratory.
+! See COPYRIGHT in top-level directory.
+!
+subroutine MPIX_File_iread_all_f08ts(fh, buf, count, datatype, request, ierror)
+ use, intrinsic :: iso_c_binding, only : c_loc, c_associated
+ use, intrinsic :: iso_c_binding, only : c_int, c_ptr
+ use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
+ use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
+ use :: mpi_c_interface, only : c_File, c_Datatype
+ use :: mpi_c_interface, only : c_Request
+ use :: mpi_c_interface, only : MPIR_File_iread_all_cdesc
+
+ implicit none
+
+ type(MPI_File), intent(in) :: fh
+ type(*), dimension(..) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+
+ integer(c_File) :: fh_c
+ integer(c_int) :: count_c
+ integer(c_Datatype) :: datatype_c
+ integer(c_Request) :: request_c
+ integer(c_int) :: ierror_c
+
+ fh_c = MPI_File_f2c(fh%MPI_VAL)
+ if (c_int == kind(0)) then
+ ierror_c = MPIR_File_iread_all_cdesc(fh_c, buf, count, datatype%MPI_VAL, request%MPI_VAL)
+ else
+ count_c = count
+ datatype_c = datatype%MPI_VAL
+ ierror_c = MPIR_File_iread_all_cdesc(fh_c, buf, count_c, datatype_c, request_c)
+ request%MPI_VAL = request_c
+ end if
+
+ if (present(ierror)) ierror = ierror_c
+
+end subroutine MPIX_File_iread_all_f08ts
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_f/file_iread_at_all_f08ts.F90 b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iread_at_all_f08ts.F90
new file mode 100644
index 0000000..fe68cfc
--- /dev/null
+++ b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iread_at_all_f08ts.F90
@@ -0,0 +1,46 @@
+! -*- Mode: Fortran; -*-
+!
+! (C) 2014 by Argonne National Laboratory.
+! See COPYRIGHT in top-level directory.
+!
+subroutine MPIX_File_iread_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
+ use, intrinsic :: iso_c_binding, only : c_loc, c_associated
+ use, intrinsic :: iso_c_binding, only : c_int, c_ptr
+ use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
+ use :: mpi_f08, only : MPI_OFFSET_KIND
+ use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
+ use :: mpi_c_interface, only : c_File, c_Datatype
+ use :: mpi_c_interface, only : c_Request
+ use :: mpi_c_interface, only : MPIR_File_iread_at_all_cdesc
+
+ implicit none
+
+ type(MPI_File), intent(in) :: fh
+ integer(MPI_OFFSET_KIND), intent(in) :: offset
+ type(*), dimension(..) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+
+ integer(c_File) :: fh_c
+ integer(MPI_OFFSET_KIND) :: offset_c
+ integer(c_int) :: count_c
+ integer(c_Datatype) :: datatype_c
+ integer(c_Request) :: request_c
+ integer(c_int) :: ierror_c
+
+ fh_c = MPI_File_f2c(fh%MPI_VAL)
+ if (c_int == kind(0)) then
+ ierror_c = MPIR_File_iread_at_all_cdesc(fh_c, offset, buf, count, datatype%MPI_VAL, request%MPI_VAL)
+ else
+ offset_c = offset
+ count_c = count
+ datatype_c = datatype%MPI_VAL
+ ierror_c = MPIR_File_iread_at_all_cdesc(fh_c, offset_c, buf, count_c, datatype_c, request_c)
+ request%MPI_VAL = request_c
+ end if
+
+ if (present(ierror)) ierror = ierror_c
+
+end subroutine MPIX_File_iread_at_all_f08ts
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_f/file_iwrite_all_f08ts.F90 b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iwrite_all_f08ts.F90
new file mode 100644
index 0000000..469555a
--- /dev/null
+++ b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iwrite_all_f08ts.F90
@@ -0,0 +1,42 @@
+! -*- Mode: Fortran; -*-
+!
+! (C) 2014 by Argonne National Laboratory.
+! See COPYRIGHT in top-level directory.
+!
+subroutine MPIX_File_iwrite_all_f08ts(fh, buf, count, datatype, request, ierror)
+ use, intrinsic :: iso_c_binding, only : c_loc, c_associated
+ use, intrinsic :: iso_c_binding, only : c_int, c_ptr
+ use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
+ use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
+ use :: mpi_c_interface, only : c_File, c_Datatype
+ use :: mpi_c_interface, only : c_Request
+ use :: mpi_c_interface, only : MPIR_File_iwrite_all_cdesc
+
+ implicit none
+
+ type(MPI_File), intent(in) :: fh
+ type(*), dimension(..), intent(in) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+
+ integer(c_File) :: fh_c
+ integer(c_int) :: count_c
+ integer(c_Datatype) :: datatype_c
+ integer(c_Request) :: request_c
+ integer(c_int) :: ierror_c
+
+ fh_c = MPI_File_f2c(fh%MPI_VAL)
+ if (c_int == kind(0)) then
+ ierror_c = MPIR_File_iwrite_all_cdesc(fh_c, buf, count, datatype%MPI_VAL, request%MPI_VAL)
+ else
+ count_c = count
+ datatype_c = datatype%MPI_VAL
+ ierror_c = MPIR_File_iwrite_all_cdesc(fh_c, buf, count_c, datatype_c, request_c)
+ request%MPI_VAL = request_c
+ end if
+
+ if (present(ierror)) ierror = ierror_c
+
+end subroutine MPIX_File_iwrite_all_f08ts
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_f/file_iwrite_at_all_f08ts.F90 b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iwrite_at_all_f08ts.F90
new file mode 100644
index 0000000..b5ed93f
--- /dev/null
+++ b/src/binding/fortran/use_mpi_f08/wrappers_f/file_iwrite_at_all_f08ts.F90
@@ -0,0 +1,46 @@
+! -*- Mode: Fortran; -*-
+!
+! (C) 2014 by Argonne National Laboratory.
+! See COPYRIGHT in top-level directory.
+!
+subroutine MPIX_File_iwrite_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
+ use, intrinsic :: iso_c_binding, only : c_loc, c_associated
+ use, intrinsic :: iso_c_binding, only : c_int, c_ptr
+ use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
+ use :: mpi_f08, only : MPI_OFFSET_KIND
+ use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
+ use :: mpi_c_interface, only : c_File, c_Datatype
+ use :: mpi_c_interface, only : c_Request
+ use :: mpi_c_interface, only : MPIR_File_iwrite_at_all_cdesc
+
+ implicit none
+
+ type(MPI_File), intent(in) :: fh
+ integer(MPI_OFFSET_KIND), intent(in) :: offset
+ type(*), dimension(..) :: buf
+ integer, intent(in) :: count
+ type(MPI_Datatype), intent(in) :: datatype
+ type(MPI_Request), intent(out) :: request
+ integer, optional, intent(out) :: ierror
+
+ integer(c_File) :: fh_c
+ integer(MPI_OFFSET_KIND) :: offset_c
+ integer(c_int) :: count_c
+ integer(c_Datatype) :: datatype_c
+ integer(c_Request) :: request_c
+ integer(c_int) :: ierror_c
+
+ fh_c = MPI_File_f2c(fh%MPI_VAL)
+ if (c_int == kind(0)) then
+ ierror_c = MPIR_File_iwrite_at_all_cdesc(fh_c, offset, buf, count, datatype%MPI_VAL, request%MPI_VAL)
+ else
+ offset_c = offset
+ count_c = count
+ datatype_c = datatype%MPI_VAL
+ ierror_c = MPIR_File_iwrite_at_all_cdesc(fh_c, offset_c, buf, count_c, datatype_c, request_c)
+ request%MPI_VAL = request_c
+ end if
+
+ if (present(ierror)) ierror = ierror_c
+
+end subroutine MPIX_File_iwrite_at_all_f08ts
http://git.mpich.org/mpich.git/commitdiff/48c38c08fa002e2cd042b141ebacdec17…
commit 48c38c08fa002e2cd042b141ebacdec1786fbfe7
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Thu Nov 6 20:21:48 2014 -0600
Fix: skip #ifdef/#endif lines in input headers
Without doing so, the script wrongly thinks #ifdef etc. are part of
a subroutine's prototype line.
No review since F08 binding is experimental now.
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface b/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface
index 4b3d1e8..f70e101 100755
--- a/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface
+++ b/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface
@@ -411,6 +411,9 @@ while (<FD>) {
}
}
+ # Skip lines starting with # such as #ifdef or #endif
+ if (/^\s*#/) { next; }
+
# If we found a semi-colon at the end, that's the end of the line.
# This is not perfect (e.g., does not work when a single line has
# multiple semi-colon separated statements), but should be good
http://git.mpich.org/mpich.git/commitdiff/56fee8ce9b43db1668d5d9dad3acfab1c…
commit 56fee8ce9b43db1668d5d9dad3acfab1c42e9a33
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Tue Nov 11 09:45:14 2014 -0600
Add support for MPIX_ subroutines in cdesc buildiface
No review since F08 binding is experimental now.
diff --git a/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface b/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface
index 214f35b..4b3d1e8 100755
--- a/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface
+++ b/src/binding/fortran/use_mpi_f08/wrappers_c/buildiface
@@ -456,15 +456,17 @@ while (<FD>) {
if (grep/void\s*\*/, @arglist) {
$fname = "$routine";
$fname =~ s/MPI_//g;
+ $fname =~ s/MPIX_//g;
$fname =~ tr/A-Z/a-z/;
$fname .= "_cdesc.c";
print MAKEFD "\tsrc/binding/fortran/use_mpi_f08/wrappers_c/$fname \\\n";
open(CFILE, ">$fname") || die "Could not open $fname\n";
- # replace MPI_Foo with MPIR_Foo_cdesc
+ # replace MPI(X)_Foo with MPIR_Foo_cdesc
$cdesc_routine = $routine;
$cdesc_routine =~ s/MPI_/MPIR_/g;
+ $cdesc_routine =~ s/MPIX_/MPIR_/g;
$cdesc_routine .= "_cdesc";
print CFILE <<EOT;
-----------------------------------------------------------------------
Summary of changes:
maint/f77tof90.in | 2 +-
.../fortran/use_mpi_f08/mpi_c_interface_cdesc.F90 | 56 +++++++
src/binding/fortran/use_mpi_f08/mpi_f08.F90 | 56 +++++++
.../fortran/use_mpi_f08/wrappers_c/buildiface | 7 +-
...d_shared_f08ts.F90 => file_iread_all_f08ts.F90} | 18 ++-
...te_at_f08ts.F90 => file_iread_at_all_f08ts.F90} | 18 ++-
...e_iread_f08ts.F90 => file_iwrite_all_f08ts.F90} | 18 ++-
...e_at_f08ts.F90 => file_iwrite_at_all_f08ts.F90} | 18 ++-
test/mpi/.gitignore | 12 ++
test/mpi/configure.ac | 3 +
test/mpi/f08/io/Makefile.am | 9 +-
test/mpi/f08/io/i_fcoll_test.f90 | 155 ++++++++++++++++++++
test/mpi/f08/io/ioharness.defn | 32 ++++
test/mpi/f08/io/{testlist => testlist.in} | 2 +
test/mpi/f77/io/Makefile.am | 10 +-
test/mpi/f77/io/{setviewcurf.f => i_setviewcurf.f} | 50 ++++---
test/mpi/f77/io/ioharness.defn | 32 ++++
test/mpi/f77/io/{testlist => testlist.in} | 2 +
18 files changed, 441 insertions(+), 59 deletions(-)
copy src/binding/fortran/use_mpi_f08/wrappers_f/{file_iread_shared_f08ts.F90 => file_iread_all_f08ts.F90} (57%)
copy src/binding/fortran/use_mpi_f08/wrappers_f/{file_iwrite_at_f08ts.F90 => file_iread_at_all_f08ts.F90} (60%)
copy src/binding/fortran/use_mpi_f08/wrappers_f/{file_iread_f08ts.F90 => file_iwrite_all_f08ts.F90} (57%)
copy src/binding/fortran/use_mpi_f08/wrappers_f/{file_iwrite_at_f08ts.F90 => file_iwrite_at_all_f08ts.F90} (60%)
create mode 100644 test/mpi/f08/io/i_fcoll_test.f90
rename test/mpi/f08/io/{testlist => testlist.in} (86%)
copy test/mpi/f77/io/{setviewcurf.f => i_setviewcurf.f} (78%)
rename test/mpi/f77/io/{testlist => testlist.in} (84%)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-208-g3f060b9
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 3f060b9f7da8a534fdd258a9b1dd490af4fcf3c4 (commit)
from b2c8d888caf4e3b45ec29fbff34b469ceceba549 (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/3f060b9f7da8a534fdd258a9b1dd490af…
commit 3f060b9f7da8a534fdd258a9b1dd490af4fcf3c4
Author: Sangmin Seo <sseo(a)anl.gov>
Date: Thu Nov 13 15:00:00 2014 -0600
Fix incorrect sendbufs used in MPI_Iallgather.
Stack variables should not have been used as sendbuf for MPI_Iallgather
because we do not wait the completion of MPI_Iallgather in caller
functions. This fix moved them to the struct used for keeping track
of operation state and uses variables in the struct for MPI_Iallgather.
Signed-off-by: Rob Latham <robl(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/ad_iread_coll.c b/src/mpi/romio/adio/common/ad_iread_coll.c
index 8a0b7a1..023a142 100644
--- a/src/mpi/romio/adio/common/ad_iread_coll.c
+++ b/src/mpi/romio/adio/common/ad_iread_coll.c
@@ -47,6 +47,8 @@ struct ADIOI_GEN_IreadStridedColl_vars {
int *count_my_req_per_proc;
int count_my_req_procs;
int count_others_req_procs;
+ ADIO_Offset start_offset;
+ ADIO_Offset end_offset;
ADIO_Offset orig_fp;
ADIO_Offset fd_size;
ADIO_Offset min_st_offset;
@@ -210,7 +212,6 @@ void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count,
#ifdef RDCOLL_DEBUG
int i;
#endif
- ADIO_Offset start_offset, end_offset;
/* FIXME: need an implementation of ADIOI_IOIstridedColl
if (fd->hints->cb_pfr != ADIOI_HINT_DISABLE) {
@@ -266,7 +267,7 @@ void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count,
ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset,
&vars->offset_list, &vars->len_list,
- &start_offset, &end_offset,
+ &vars->start_offset, &vars->end_offset,
&vars->contig_access_count);
#ifdef RDCOLL_DEBUG
@@ -283,11 +284,11 @@ void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count,
vars->st_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset));
vars->end_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset));
- *error_code = MPI_Iallgather(&start_offset, 1, ADIO_OFFSET,
+ *error_code = MPI_Iallgather(&vars->start_offset, 1, ADIO_OFFSET,
vars->st_offsets, 1, ADIO_OFFSET,
fd->comm, &vars->req_offset[0]);
if (*error_code != MPI_SUCCESS) return;
- *error_code = MPI_Iallgather(&end_offset, 1, ADIO_OFFSET,
+ *error_code = MPI_Iallgather(&vars->end_offset, 1, ADIO_OFFSET,
vars->end_offsets, 1, ADIO_OFFSET,
fd->comm, &vars->req_offset[1]);
diff --git a/src/mpi/romio/adio/common/ad_iwrite_coll.c b/src/mpi/romio/adio/common/ad_iwrite_coll.c
index 71dd93a..7fa423f 100644
--- a/src/mpi/romio/adio/common/ad_iwrite_coll.c
+++ b/src/mpi/romio/adio/common/ad_iwrite_coll.c
@@ -45,6 +45,8 @@ struct ADIOI_GEN_IwriteStridedColl_vars {
int *count_my_req_per_proc;
int count_my_req_procs;
int count_others_req_procs;
+ ADIO_Offset start_offset;
+ ADIO_Offset end_offset;
ADIO_Offset orig_fp;
ADIO_Offset fd_size;
ADIO_Offset min_st_offset;
@@ -230,7 +232,6 @@ void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count,
ADIOI_NBC_Request *nbc_req = NULL;
ADIOI_GEN_IwriteStridedColl_vars *vars = NULL;
int nprocs, myrank;
- ADIO_Offset start_offset, end_offset;
#if 0
/* FIXME: need an implementation of ADIOI_IOIstridedColl */
@@ -291,7 +292,7 @@ void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count,
ADIOI_Calc_my_off_len(fd, count, datatype, file_ptr_type, offset,
&vars->offset_list, &vars->len_list,
- &start_offset, &end_offset,
+ &vars->start_offset, &vars->end_offset,
&vars->contig_access_count);
/* each process communicates its start and end offsets to other
@@ -301,11 +302,11 @@ void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count,
vars->st_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset));
vars->end_offsets = (ADIO_Offset *)ADIOI_Malloc(nprocs*sizeof(ADIO_Offset));
- *error_code = MPI_Iallgather(&start_offset, 1, ADIO_OFFSET,
+ *error_code = MPI_Iallgather(&vars->start_offset, 1, ADIO_OFFSET,
vars->st_offsets, 1, ADIO_OFFSET,
fd->comm, &vars->req_offset[0]);
if (*error_code != MPI_SUCCESS) return;
- *error_code = MPI_Iallgather(&end_offset, 1, ADIO_OFFSET,
+ *error_code = MPI_Iallgather(&vars->end_offset, 1, ADIO_OFFSET,
vars->end_offsets, 1, ADIO_OFFSET,
fd->comm, &vars->req_offset[1]);
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/common/ad_iread_coll.c | 9 +++++----
src/mpi/romio/adio/common/ad_iwrite_coll.c | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-207-gb2c8d88
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 b2c8d888caf4e3b45ec29fbff34b469ceceba549 (commit)
via f3fb46ae69b4e58ac4a2fdc8e2b13df9660d53ad (commit)
from 8705110a70e91f9cfcccb24086c7a5e9232e1ec1 (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/b2c8d888caf4e3b45ec29fbff34b469ce…
commit b2c8d888caf4e3b45ec29fbff34b469ceceba549
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Thu Nov 13 18:20:41 2014 -0600
portals4: change variable name put_acked -> put_done
Helps clarity since we no longer use ACKs in the netmod code.
Signed-off-by: Antonio Pena Monferrer <apenya(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index e5e1aea..5ab1eef 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -49,7 +49,7 @@ typedef struct {
ptl_handle_me_t put_me;
ptl_handle_me_t *get_me_p;
int num_gets;
- int put_acked;
+ int put_done;
ptl_size_t chunk_offset;
void *chunk_buffer[MPID_NEM_PTL_NUM_CHUNK_BUFFERS];
MPIDI_msg_sz_t bytes_put;
@@ -72,7 +72,7 @@ typedef struct {
REQ_PTL(req_)->put_me = PTL_INVALID_HANDLE; \
REQ_PTL(req_)->get_me_p = NULL; \
REQ_PTL(req_)->num_gets = 0; \
- REQ_PTL(req_)->put_acked = 0; \
+ REQ_PTL(req_)->put_done = 0; \
REQ_PTL(req_)->event_handler = NULL; \
REQ_PTL(req_)->chunk_offset = 0; \
} while (0)
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index f506987..9a1000e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -177,7 +177,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
NEW_TAG(sendbuf->tag);
TMPBUF(sreq) = NULL;
REQ_PTL(sreq)->num_gets = 0;
- REQ_PTL(sreq)->put_acked = 0;
+ REQ_PTL(sreq)->put_done = 0;
if (data_sz) {
MPIU_Memcpy(sendbuf->packet + sizeof(MPIDI_CH3_Pkt_t), data_p, sent_sz);
@@ -230,7 +230,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
NEW_TAG(sendbuf->tag);
TMPBUF(sreq) = NULL;
REQ_PTL(sreq)->num_gets = 0;
- REQ_PTL(sreq)->put_acked = 0;
+ REQ_PTL(sreq)->put_done = 0;
if (sreq->dev.segment_size) {
MPIDI_msg_sz_t last = sent_sz;
@@ -456,7 +456,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
if (--REQ_PTL(req)->num_gets == 0) {
MPIU_Free(TMPBUF(req));
- if (REQ_PTL(req)->put_acked)
+ if (REQ_PTL(req)->put_done)
on_data_avail(req); /* Otherwise we'll do it on the SEND */
}
}
@@ -467,7 +467,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
MPID_Request *const req = e->user_ptr;
MPIU_Free(SENDBUF(req));
- REQ_PTL(req)->put_acked = 1;
+ REQ_PTL(req)->put_done = 1;
if (REQ_PTL(req)->num_gets == 0) /* Otherwise GET will do it */
on_data_avail(req);
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index fb6d5f3..34a1b4f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -104,13 +104,13 @@ static int handler_large(const ptl_event_t *e)
MPIU_Assert(e->type == PTL_EVENT_SEND || e->type == PTL_EVENT_GET);
if (e->type == PTL_EVENT_SEND) {
- REQ_PTL(sreq)->put_acked = 1;
+ REQ_PTL(sreq)->put_done = 1;
} else if (e->type == PTL_EVENT_GET) {
/* decrement the remaining get operations */
REQ_PTL(sreq)->num_gets--;
}
- if (REQ_PTL(sreq)->num_gets == 0 && REQ_PTL(sreq)->put_acked)
+ if (REQ_PTL(sreq)->num_gets == 0 && REQ_PTL(sreq)->put_done)
mpi_errno = handler_send_complete(e);
fn_exit:
http://git.mpich.org/mpich.git/commitdiff/f3fb46ae69b4e58ac4a2fdc8e2b13df96…
commit f3fb46ae69b4e58ac4a2fdc8e2b13df9660d53ad
Author: Antonio Pena Monferrer <apenya(a)mcs.anl.gov>
Date: Thu Nov 13 11:52:28 2014 -0600
Use SEND instead of ACK events in Portals4
The rportals layer is taking care of retransmissions, so we should only
be interested in delivery events in the netmod layer.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
index a6d4697..c016952 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -170,7 +170,6 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
}
case PTL_EVENT_PUT_OVERFLOW:
case PTL_EVENT_GET:
- case PTL_EVENT_ACK:
case PTL_EVENT_SEND:
case PTL_EVENT_REPLY:
case PTL_EVENT_SEARCH: {
@@ -193,6 +192,7 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
case PTL_EVENT_LINK:
/* ignore */
break;
+ case PTL_EVENT_ACK:
default:
MPIU_Error_printf("Received unexpected event type: %d %s", event.type, MPID_nem_ptl_strevent(&event));
MPIU_ERR_INTERNALANDJUMP(mpi_errno, "Unexpected event type");
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index 022b541..fb6d5f3 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -66,10 +66,7 @@ static int handler_send_complete(const ptl_event_t *e)
MPIDI_FUNC_ENTER(MPID_STATE_HANDLER_SEND_COMPLETE);
- if (e->type == PTL_EVENT_SEND) /* Ignore */
- goto fn_exit;
-
- MPIU_Assert(e->type == PTL_EVENT_ACK || e->type == PTL_EVENT_GET);
+ MPIU_Assert(e->type == PTL_EVENT_SEND || e->type == PTL_EVENT_GET);
if (REQ_PTL(sreq)->md != PTL_INVALID_HANDLE) {
ret = PtlMDRelease(REQ_PTL(sreq)->md);
@@ -104,20 +101,9 @@ static int handler_large(const ptl_event_t *e)
MPIDI_FUNC_ENTER(MPID_STATE_HANDLER_LARGE);
- if (e->type == PTL_EVENT_SEND) /* Ignore */
- goto fn_exit;
+ MPIU_Assert(e->type == PTL_EVENT_SEND || e->type == PTL_EVENT_GET);
- if (e->type != PTL_EVENT_ACK && e->type != PTL_EVENT_GET)
- MPIU_Error_printf("ACK event expected, received %s ni_fail=%s list=%s user_ptr=%p hdr_data=%#lx\n",
- MPID_nem_ptl_strevent(e), MPID_nem_ptl_strnifail(e->ni_fail_type),
- MPID_nem_ptl_strlist(e->ptl_list), e->user_ptr, e->hdr_data);
- MPIU_Assert(e->type == PTL_EVENT_ACK || e->type == PTL_EVENT_GET);
-
- if (e->type == PTL_EVENT_ACK && e->mlength < PTL_LARGE_THRESHOLD) {
- /* truncated message */
- mpi_errno = handler_send_complete(e);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- } else if (e->type == PTL_EVENT_ACK) {
+ if (e->type == PTL_EVENT_SEND) {
REQ_PTL(sreq)->put_acked = 1;
} else if (e->type == PTL_EVENT_GET) {
/* decrement the remaining get operations */
@@ -271,7 +257,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Small contig message");
REQ_PTL(sreq)->event_handler = handler_send_complete;
MPIU_DBG_MSG_P(CH3_CHANNEL, VERBOSE, "&REQ_PTL(sreq)->event_handler = %p", &(REQ_PTL(sreq)->event_handler));
- ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)((char *)buf + dt_true_lb), data_sz, PTL_ACK_REQ, vc_ptl->id, vc_ptl->pt,
+ ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)((char *)buf + dt_true_lb), data_sz, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
NPTL_HEADER(ssend_flag, data_sz));
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
@@ -308,7 +294,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmdbind", "**ptlmdbind %s", MPID_nem_ptl_strerror(ret));
REQ_PTL(sreq)->event_handler = handler_send_complete;
- ret = MPID_nem_ptl_rptl_put(REQ_PTL(sreq)->md, 0, data_sz, PTL_ACK_REQ, vc_ptl->id, vc_ptl->pt,
+ ret = MPID_nem_ptl_rptl_put(REQ_PTL(sreq)->md, 0, data_sz, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
NPTL_HEADER(ssend_flag, data_sz));
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
@@ -325,7 +311,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, REQ_PTL(sreq)->chunk_buffer[0]);
MPIU_Assert(last == sreq->dev.segment_size);
REQ_PTL(sreq)->event_handler = handler_send_complete;
- ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)REQ_PTL(sreq)->chunk_buffer[0], data_sz, PTL_ACK_REQ,
+ ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)REQ_PTL(sreq)->chunk_buffer[0], data_sz, PTL_NO_ACK_REQ,
vc_ptl->id, vc_ptl->pt, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
NPTL_HEADER(ssend_flag, data_sz));
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
@@ -342,7 +328,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
REQ_PTL(sreq)->large = TRUE;
REQ_PTL(sreq)->event_handler = handler_large;
- ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)((char *)buf + dt_true_lb), PTL_LARGE_THRESHOLD, PTL_ACK_REQ, vc_ptl->id, vc_ptl->pt,
+ ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)((char *)buf + dt_true_lb), PTL_LARGE_THRESHOLD, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
@@ -412,7 +398,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
REQ_PTL(sreq)->large = TRUE;
REQ_PTL(sreq)->event_handler = handler_large;
- ret = MPID_nem_ptl_rptl_put(REQ_PTL(sreq)->md, 0, PTL_LARGE_THRESHOLD, PTL_ACK_REQ, vc_ptl->id, vc_ptl->pt,
+ ret = MPID_nem_ptl_rptl_put(REQ_PTL(sreq)->md, 0, PTL_LARGE_THRESHOLD, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt,
NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), 0, sreq,
NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
@@ -437,7 +423,7 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
REQ_PTL(sreq)->event_handler = handler_large;
ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)REQ_PTL(sreq)->chunk_buffer[0], PTL_LARGE_THRESHOLD,
- PTL_ACK_REQ, vc_ptl->id, vc_ptl->pt, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank),
+ PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->pt, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank),
0, sreq, NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s", MPID_nem_ptl_strerror(ret));
DBG_MSG_PUT("global", PTL_LARGE_THRESHOLD, vc->pg_rank, NPTL_MATCH(tag, comm->context_id + context_offset, comm->rank), NPTL_HEADER(ssend_flag | NPTL_LARGE, data_sz));
-----------------------------------------------------------------------
Summary of changes:
.../channels/nemesis/netmod/portals4/ptl_impl.h | 4 +-
.../ch3/channels/nemesis/netmod/portals4/ptl_nm.c | 8 ++--
.../channels/nemesis/netmod/portals4/ptl_poll.c | 2 +-
.../channels/nemesis/netmod/portals4/ptl_send.c | 36 ++++++--------------
4 files changed, 18 insertions(+), 32 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-205-g8705110
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 8705110a70e91f9cfcccb24086c7a5e9232e1ec1 (commit)
from 22524a6e83464617bd7786ac8f221fa3b791e1e6 (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/8705110a70e91f9cfcccb24086c7a5e92…
commit 8705110a70e91f9cfcccb24086c7a5e9232e1ec1
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Thu Nov 13 18:12:51 2014 -0600
update .gitignore in testsuite
No reviewer
diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 6a193c7..60e69d4 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -886,6 +886,7 @@
/init/finalized
/init/library_version
/io/resized
+/io/testlist
/manual/mpi_t/mpit_test
/manual/mpi_t/mpit_test2
/manual/mpi_t/nem_fbox_fallback_to_queue_count
-----------------------------------------------------------------------
Summary of changes:
test/mpi/.gitignore | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-204-g22524a6
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 22524a6e83464617bd7786ac8f221fa3b791e1e6 (commit)
from a81ec2ac2bf2efcb02cbbd28aaf4b75174382f44 (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/22524a6e83464617bd7786ac8f221fa3b…
commit 22524a6e83464617bd7786ac8f221fa3b791e1e6
Author: Min Si <msi(a)il.is.s.u-tokyo.ac.jp>
Date: Thu Nov 13 17:56:08 2014 -0600
Increase bcast2,bcast3 timelimit to 13 mins.
Nightly testing reported timeout on octopus with 12 timelimit. Each of
them took 12:05 ~ 12:10 mins.
diff --git a/test/mpi/coll/testlist b/test/mpi/coll/testlist
index 280365e..36686e7 100644
--- a/test/mpi/coll/testlist
+++ b/test/mpi/coll/testlist
@@ -35,8 +35,8 @@ bcasttest 10
bcast2 4
# More that 8 processes are required to get bcast to switch to the long
# msg algorithm (see coll definitions in mpiimpl.h)
-bcast2 10 timeLimit=720
-bcast3 10 timeLimit=720
+bcast2 10 timeLimit=780
+bcast3 10 timeLimit=780
bcastzerotype 1
bcastzerotype 4
bcastzerotype 5
-----------------------------------------------------------------------
Summary of changes:
test/mpi/coll/testlist | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-203-ga81ec2a
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 a81ec2ac2bf2efcb02cbbd28aaf4b75174382f44 (commit)
from f759813f15708bebcb29e0942ed9af0fbc1154e0 (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/a81ec2ac2bf2efcb02cbbd28aaf4b7517…
commit a81ec2ac2bf2efcb02cbbd28aaf4b75174382f44
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Nov 13 15:09:36 2014 -0600
Add test for revoke+shrink
This tests the behavior after a failure when using revoke+shrink. Right
now this test still fails so it is marked as xfail.
See #2198
No reviewer
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index 080e7dc..6440f30 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -13,4 +13,4 @@ include $(top_srcdir)/Makefile.mtest
noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead \
irecvdead barrier gather reduce bcast scatter failure_ack \
anysource revoke_nofail shrink agree multi_isendalive \
- agree_shrink
+ agree_shrink revoke_shrink
diff --git a/test/mpi/ft/revoke_shrink.c b/test/mpi/ft/revoke_shrink.c
new file mode 100644
index 0000000..cba2e05
--- /dev/null
+++ b/test/mpi/ft/revoke_shrink.c
@@ -0,0 +1,67 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+#include "mpi.h"
+
+MPI_Comm comm_all;
+
+void error_handler(MPI_Comm *communicator, int *error_code, ...) {
+ MPI_Comm *new_comm = malloc(sizeof(MPI_Comm));
+
+ MPIX_Comm_revoke(comm_all);
+ MPIX_Comm_shrink(comm_all, new_comm);
+
+ MPI_Comm_free(&comm_all);
+
+ comm_all = *new_comm;
+}
+
+int main(int argc, char *argv[]) {
+ int rank, size;
+ int sum = 0, val = 1;
+ int errs = 0;
+ MPI_Errhandler errhandler;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+ if (size < 4) {
+ fprintf(stderr, "Must run with at least 4 processes.\n");
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_dup(MPI_COMM_WORLD, &comm_all);
+
+ MPI_Comm_create_errhandler(&error_handler, &errhandler);
+ MPI_Comm_set_errhandler(comm_all, errhandler);
+
+ for (int i = 0; i < 10; ++i) {
+ MPI_Comm_size(comm_all, &size);
+ sum = 0;
+ if (i == 5 && rank == 1) {
+ exit(1);
+ } else if (i != 5) {
+ MPI_Allreduce(&val, &sum, 1, MPI_INT, MPI_SUM, comm_all);
+ if (sum != size && rank == 0) {
+ errs++;
+ fprintf(stderr, "Incorrect answer: %d != %d\n", sum, size);
+ }
+ }
+ }
+
+ if (0 == rank && errs) {
+ fprintf(stdout, " Found %d errors\n", errs);
+ } else if (0 == rank) {
+ fprintf(stdout, " No errors\n");
+ }
+
+ MPI_Comm_free(&comm_all);
+ MPI_Errhandler_free(&errhandler);
+
+ MPI_Finalize();
+
+ return 0;
+}
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index 604211a..582f06d 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -16,3 +16,4 @@ anysource 3 env=MPIR_CVAR_ENABLE_FT=1 mpiexecarg=-disable-auto-cleanup resultTes
revoke_nofail 2 env=MPIR_CVAR_ENABLE_FT=1 strict=false timeLimit=10
shrink 8 env=MPIR_CVAR_ENABLE_FT=1 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
agree 4 env=MPIR_CVAR_ENABLE_FT=1 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
+revoke_shrink 4 env=MPIR_CVAR_ENABLE=1 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=2198
-----------------------------------------------------------------------
Summary of changes:
test/mpi/ft/Makefile.am | 2 +-
test/mpi/ft/revoke_shrink.c | 67 +++++++++++++++++++++++++++++++++++++++++++
test/mpi/ft/testlist | 1 +
3 files changed, 69 insertions(+), 1 deletions(-)
create mode 100644 test/mpi/ft/revoke_shrink.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1.3-202-gf759813
by noreply@mpich.org 13 Nov '14
by noreply@mpich.org 13 Nov '14
13 Nov '14
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 f759813f15708bebcb29e0942ed9af0fbc1154e0 (commit)
from a07efda56188170545cdcc33c41ff3548ab0ceb0 (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/f759813f15708bebcb29e0942ed9af0fb…
commit f759813f15708bebcb29e0942ed9af0fbc1154e0
Author: Antonio Pena Monferrer <apenya(a)mcs.anl.gov>
Date: Thu Nov 13 01:35:10 2014 -0600
Remove unnecessary soft ACKs from portals RMA code
Those were introduced for a robust protocol during development.
No longer needed.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index 481b88b..f506987 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -15,14 +15,11 @@
#define SENDBUF_SIZE(sent_sz_) (offsetof(buf_t, packet) + sizeof(MPIDI_CH3_Pkt_t) + (sent_sz_))
#define SENDBUF(req_) REQ_PTL(req_)->chunk_buffer[0]
#define TMPBUF(req_) REQ_PTL(req_)->chunk_buffer[1]
-#define NEW_TAG(tag_) do { \
- global_tag += 2; \
- if (global_tag == CTL_TAG) \
- global_tag += 2; \
- (tag_) = global_tag; \
+#define NEW_TAG(tag_) do { \
+ if (++global_tag == CTL_TAG) \
+ ++global_tag; \
+ (tag_) = global_tag; \
} while(0)
-#define GET_TAG(tag_) (((tag_) >> 1) << 1)
-#define DONE_TAG(tag_) ((tag_) | 0x1)
typedef struct {
size_t remaining;
@@ -34,7 +31,6 @@ static buf_t recvbufs[NUM_RECV_BUFS];
static ptl_me_t mes[NUM_RECV_BUFS];
static ptl_handle_me_t me_handles[NUM_RECV_BUFS];
static unsigned long long put_cnt = 0; /* required to not finalizing too early */
-static MPID_Request *done_req;
static ptl_match_bits_t global_tag = 0;
@@ -73,12 +69,6 @@ int MPID_nem_ptl_nm_init(void)
MPID_nem_ptl_strerror(ret));
}
- done_req = MPID_Request_create();
- MPIU_Assert(done_req != NULL);
- done_req->dev.OnDataAvail = NULL;
- SENDBUF(done_req) = NULL;
- REQ_PTL(done_req)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
-
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_NM_INIT);
return mpi_errno;
@@ -107,8 +97,6 @@ int MPID_nem_ptl_nm_finalize(void)
MPID_nem_ptl_strerror(ret));
}
- MPIDI_CH3_Request_destroy(done_req);
-
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_NM_FINALIZE);
return mpi_errno;
@@ -117,44 +105,6 @@ int MPID_nem_ptl_nm_finalize(void)
}
#undef FUNCNAME
-#define FUNCNAME meappend_done
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int meappend_done(ptl_process_t id, MPID_Request *req, ptl_match_bits_t tag)
-{
- int mpi_errno = MPI_SUCCESS;
- int ret;
- ptl_me_t me;
- ptl_handle_me_t me_handle;
- MPIDI_STATE_DECL(MPID_STATE_MEAPPEND_DONE);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MEAPPEND_DONE);
-
- me.start = NULL;
- me.length = 0;
- me.ct_handle = PTL_CT_NONE;
- me.uid = PTL_UID_ANY;
- me.options = ( PTL_ME_OP_PUT | PTL_ME_USE_ONCE | PTL_ME_IS_ACCESSIBLE |
- PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
- me.match_id = id;
- me.match_bits = DONE_TAG(tag);
- me.ignore_bits = 0;
- me.min_free = 0;
- ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &me, PTL_PRIORITY_LIST, req,
- &me_handle);
- MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, DONE_TAG(tag)));
- MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
- MPID_nem_ptl_strerror(ret));
- ++put_cnt;
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MEAPPEND_DONE);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
-#undef FUNCNAME
#define FUNCNAME meappend_large
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
@@ -175,21 +125,20 @@ static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_
me.options = ( PTL_ME_OP_GET | PTL_ME_USE_ONCE | PTL_ME_IS_ACCESSIBLE |
PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
me.match_id = id;
- me.match_bits = GET_TAG(tag);
+ me.match_bits = tag;
me.ignore_bits = 0;
me.min_free = 0;
while (remaining) {
- int incomplete;
ptl_handle_me_t foo_me_handle;
- MPIDI_CH3U_Request_increment_cc(req, &incomplete); /* Cannot avoid GET events from poll infrastructure */
+ ++REQ_PTL(req)->num_gets;
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &me, PTL_PRIORITY_LIST, req,
&foo_me_handle);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
MPID_nem_ptl_strerror(ret));
- MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, GET_TAG(tag)));
+ MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, tag));
me.start = (char *)me.start + me.length;
remaining -= me.length;
@@ -227,6 +176,8 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
sendbuf->remaining = data_sz - sent_sz;
NEW_TAG(sendbuf->tag);
TMPBUF(sreq) = NULL;
+ REQ_PTL(sreq)->num_gets = 0;
+ REQ_PTL(sreq)->put_acked = 0;
if (data_sz) {
MPIU_Memcpy(sendbuf->packet + sizeof(MPIDI_CH3_Pkt_t), data_p, sent_sz);
@@ -239,11 +190,6 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
SENDBUF(sreq) = sendbuf;
REQ_PTL(sreq)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
- /* Post ME for the DONE message */
- mpi_errno = meappend_done(vc_ptl->id, sreq, sendbuf->tag);
- if (mpi_errno)
- goto fn_fail;
-
ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
vc_ptl->id, vc_ptl->ptc, CTL_TAG, 0, sreq, MPIDI_Process.my_pg_rank);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
@@ -251,6 +197,8 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
sendbuf_sz, vc_ptl->id.phys.nid,
vc_ptl->id.phys.pid, vc_ptl->ptc));
+ ++put_cnt;
+
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_SEND_PKT);
return mpi_errno;
@@ -281,6 +229,8 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
sendbuf->remaining = sreq->dev.segment_size - sent_sz;
NEW_TAG(sendbuf->tag);
TMPBUF(sreq) = NULL;
+ REQ_PTL(sreq)->num_gets = 0;
+ REQ_PTL(sreq)->put_acked = 0;
if (sreq->dev.segment_size) {
MPIDI_msg_sz_t last = sent_sz;
@@ -302,11 +252,6 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
SENDBUF(sreq) = sendbuf;
REQ_PTL(sreq)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
- /* Post ME for the DONE message */
- mpi_errno = meappend_done(vc_ptl->id, sreq, sendbuf->tag);
- if (mpi_errno)
- goto fn_fail;
-
ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
vc_ptl->id, vc_ptl->ptc, CTL_TAG, 0, sreq, MPIDI_Process.my_pg_rank);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
@@ -314,6 +259,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
sendbuf_sz, vc_ptl->id.phys.nid,
vc_ptl->id.phys.pid, vc_ptl->ptc));
+ ++put_cnt;
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_SEND_NONCONTIG_PKT);
@@ -405,10 +351,11 @@ int MPID_nem_ptl_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
#define FCNAME MPIU_QUOTE(FUNCNAME)
static inline void on_data_avail(MPID_Request * req)
{
+ int (*reqFn) (MPIDI_VC_t *, MPID_Request *, int *);
MPIDI_STATE_DECL(MPID_STATE_ON_DATA_AVAIL);
+
MPIDI_FUNC_ENTER(MPID_STATE_ON_DATA_AVAIL);
- int (*reqFn) (MPIDI_VC_t *, MPID_Request *, int *);
reqFn = req->dev.OnDataAvail;
if (!reqFn) {
MPIDI_CH3U_Request_complete(req);
@@ -420,6 +367,9 @@ static inline void on_data_avail(MPID_Request * req)
reqFn(vc, req, &complete);
MPIU_Assert(complete == TRUE);
}
+
+ --put_cnt;
+
MPIDI_FUNC_EXIT(MPID_STATE_ON_DATA_AVAIL);
}
@@ -437,13 +387,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
switch(e->type) {
case PTL_EVENT_PUT:
- if (e->match_bits != CTL_TAG) {
- MPIU_Free(SENDBUF((MPID_Request *)e->user_ptr));
- MPIU_Free(TMPBUF((MPID_Request *)e->user_ptr));
- on_data_avail((MPID_Request *)e->user_ptr);
- --put_cnt;
- }
- else {
+ {
int ret;
const uint64_t buf_idx = (uint64_t) e->user_ptr;
const size_t packet_sz = e->mlength - offsetof(buf_t, packet);
@@ -459,15 +403,6 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
mpi_errno = MPID_nem_handle_pkt(vc, recvbufs[buf_idx].packet, packet_sz);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
- /* Notify we're done */
- ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, 0, 0, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->ptc,
- DONE_TAG(recvbufs[buf_idx].tag), 0, done_req, MPIDI_Process.my_pg_rank);
- MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
- MPID_nem_ptl_strerror(ret));
- MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
- "PtlPut(size=0 id=(%#x,%#x) pt=%#x tag=%#lx)",
- vc_ptl->id.phys.nid, vc_ptl->id.phys.pid,
- vc_ptl->ptc, DONE_TAG(recvbufs[buf_idx].tag)));
}
else {
int incomplete;
@@ -493,13 +428,13 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
while (recvbufs[buf_idx].remaining) {
MPIDI_CH3U_Request_increment_cc(req, &incomplete); /* Will be decremented - and eventually freed in REPLY */
ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
- size, vc_ptl->id, vc_ptl->ptc, GET_TAG(recvbufs[buf_idx].tag), 0, req);
+ size, vc_ptl->id, vc_ptl->ptc, recvbufs[buf_idx].tag, 0, req);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
MPID_nem_ptl_strerror(ret));
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
"PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%#lx)", size,
vc_ptl->id.phys.nid,
- vc_ptl->id.phys.pid, vc_ptl->ptc, GET_TAG(recvbufs[buf_idx].tag)));
+ vc_ptl->id.phys.pid, vc_ptl->ptc, recvbufs[buf_idx].tag));
buf_ptr += size;
recvbufs[buf_idx].remaining -= size;
if (recvbufs[buf_idx].remaining < MPIDI_nem_ptl_ni_limits.max_msg_size)
@@ -515,41 +450,47 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
}
break;
+ case PTL_EVENT_GET:
+ {
+ MPID_Request *const req = e->user_ptr;
+
+ if (--REQ_PTL(req)->num_gets == 0) {
+ MPIU_Free(TMPBUF(req));
+ if (REQ_PTL(req)->put_acked)
+ on_data_avail(req); /* Otherwise we'll do it on the SEND */
+ }
+ }
+ break;
+
+ case PTL_EVENT_SEND:
+ {
+ MPID_Request *const req = e->user_ptr;
+
+ MPIU_Free(SENDBUF(req));
+ REQ_PTL(req)->put_acked = 1;
+ if (REQ_PTL(req)->num_gets == 0) /* Otherwise GET will do it */
+ on_data_avail(req);
+ }
+ break;
+
case PTL_EVENT_REPLY:
{
int incomplete;
- MPID_Request *const rreq = e->user_ptr;
+ MPID_Request *const req = e->user_ptr;
- MPIDI_CH3U_Request_decrement_cc(rreq, &incomplete);
+ MPIDI_CH3U_Request_decrement_cc(req, &incomplete);
if (!incomplete) {
- int ret;
- MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(rreq->ch.vc);
-
- mpi_errno = MPID_nem_handle_pkt(rreq->ch.vc, TMPBUF(rreq), REQ_PTL(rreq)->bytes_put);
+ mpi_errno = MPID_nem_handle_pkt(req->ch.vc, TMPBUF(req), REQ_PTL(req)->bytes_put);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
- /* Notify we're done */
- ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, 0, 0, PTL_NO_ACK_REQ, vc_ptl->id, vc_ptl->ptc,
- DONE_TAG(rreq->dev.match.parts.tag), 0, done_req, MPIDI_Process.my_pg_rank);
- MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
- MPID_nem_ptl_strerror(ret));
- MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
- "PtlPut(size=0 id=(%#x,%#x) pt=%#x tag=%#lx)",
- vc_ptl->id.phys.nid, vc_ptl->id.phys.pid,
- vc_ptl->ptc, DONE_TAG((ptl_match_bits_t)SENDBUF(rreq))));
-
/* Free resources */
- MPIU_Free(TMPBUF(rreq));
- MPID_Request_release(rreq);
+ MPIU_Free(TMPBUF(req));
+ MPID_Request_release(req);
}
}
break;
- case PTL_EVENT_GET:
- MPIDI_CH3U_Request_complete((MPID_Request *)e->user_ptr);
- break;
-
default:
MPIU_Error_printf("Received unexpected event type: %d %s", e->type, MPID_nem_ptl_strevent(e));
MPIU_ERR_INTERNALANDJUMP(mpi_errno, "Unexpected event type");
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
index 85ef2f8..a6d4697 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -171,6 +171,7 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
case PTL_EVENT_PUT_OVERFLOW:
case PTL_EVENT_GET:
case PTL_EVENT_ACK:
+ case PTL_EVENT_SEND:
case PTL_EVENT_REPLY:
case PTL_EVENT_SEARCH: {
MPID_Request * const req = event.user_ptr;
@@ -189,7 +190,6 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
case PTL_EVENT_AUTO_UNLINK:
overflow_me_handle[(size_t)event.user_ptr] = PTL_INVALID_HANDLE;
break;
- case PTL_EVENT_SEND:
case PTL_EVENT_LINK:
/* ignore */
break;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index 51c0016..022b541 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -66,6 +66,9 @@ static int handler_send_complete(const ptl_event_t *e)
MPIDI_FUNC_ENTER(MPID_STATE_HANDLER_SEND_COMPLETE);
+ if (e->type == PTL_EVENT_SEND) /* Ignore */
+ goto fn_exit;
+
MPIU_Assert(e->type == PTL_EVENT_ACK || e->type == PTL_EVENT_GET);
if (REQ_PTL(sreq)->md != PTL_INVALID_HANDLE) {
@@ -101,6 +104,9 @@ static int handler_large(const ptl_event_t *e)
MPIDI_FUNC_ENTER(MPID_STATE_HANDLER_LARGE);
+ if (e->type == PTL_EVENT_SEND) /* Ignore */
+ goto fn_exit;
+
if (e->type != PTL_EVENT_ACK && e->type != PTL_EVENT_GET)
MPIU_Error_printf("ACK event expected, received %s ni_fail=%s list=%s user_ptr=%p hdr_data=%#lx\n",
MPID_nem_ptl_strevent(e), MPID_nem_ptl_strnifail(e->ni_fail_type),
-----------------------------------------------------------------------
Summary of changes:
.../ch3/channels/nemesis/netmod/portals4/ptl_nm.c | 159 ++++++-------------
.../channels/nemesis/netmod/portals4/ptl_poll.c | 2 +-
.../channels/nemesis/netmod/portals4/ptl_send.c | 6 +
3 files changed, 57 insertions(+), 110 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0