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
January 2015
- 1 participants
- 22 discussions
[mpich] MPICH primary repository branch, master, updated. v3.2a2-129-g9a1ae5a
by noreply@mpich.org 31 Jan '15
by noreply@mpich.org 31 Jan '15
31 Jan '15
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 9a1ae5a841cd9cc5b2d258aa52fe1cb7ade4f498 (commit)
from 15262441d4010de06a50c4aba877e26154187665 (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/9a1ae5a841cd9cc5b2d258aa52fe1cb7a…
commit 9a1ae5a841cd9cc5b2d258aa52fe1cb7ade4f498
Author: Wesley Bland <wbland(a)anl.gov>
Date: Sat Jan 31 09:26:24 2015 -0600
Fix a bunch of bugs in the scheduler
The previous commits didn't take into account empty requests when
extracting the status. It also introduced a dumb bug that didn't get
tested first about a null pointer check.
Signed-off-by: Junchao Zhang <jczhang(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 3906e52..90c28e3 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -4559,7 +4559,8 @@ static inline int MPIR_Request_complete_fastpath(MPI_Request *request, MPID_Requ
#define FCNAME MPIU_QUOTE(FUNCNAME)
static inline void MPIR_Process_status(MPI_Status *status, mpir_errflag_t *errflag)
{
- if ((MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
+ if (MPI_PROC_NULL != status->MPI_SOURCE &&
+ (MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) && !*errflag) {
/* If the receive was completed within the MPID_Recv, handle the
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 97ebd0b..1746430 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -228,10 +228,6 @@ int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag)
MPID_Progress_end(&progress_state);
}
- if (request_ptr->kind == MPID_REQUEST_RECV &&
- request_ptr->status.MPI_SOURCE == MPI_PROC_NULL)
- goto fn_exit;
-
MPIR_Process_status(&request_ptr->status, errflag);
fn_exit:
diff --git a/src/mpid/common/sched/mpid_sched.c b/src/mpid/common/sched/mpid_sched.c
index 9e2a09d..86027cd 100644
--- a/src/mpid/common/sched/mpid_sched.c
+++ b/src/mpid/common/sched/mpid_sched.c
@@ -841,37 +841,29 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
case MPIDU_SCHED_ENTRY_SEND:
if (e->u.send.sreq != NULL && MPID_Request_is_complete(e->u.send.sreq)) {
MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completed SEND entry %d, sreq=%p\n", (int) i, e->u.send.sreq));
- e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
- /* This wait call won't enter the progress engine.
- * It's just a convinient way to pull out the error
- * information from the tag. */
- MPIR_Process_status(&e->u.send.sreq->status, &s->req->dev.errflag);
+ if (s->req->dev.errflag != MPIR_ERR_NONE)
+ e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
+ else
+ e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
MPID_Request_release(e->u.send.sreq);
e->u.send.sreq = NULL;
MPIR_Comm_release(e->u.send.comm, /*isDisconnect=*/FALSE);
dtype_release_if_not_builtin(e->u.send.datatype);
- if (e->u.send.sreq->status.MPI_ERROR)
- e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
- else
- e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
}
break;
case MPIDU_SCHED_ENTRY_RECV:
if (e->u.recv.rreq != NULL && MPID_Request_is_complete(e->u.recv.rreq)) {
MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completed RECV entry %d, rreq=%p\n", (int) i, e->u.recv.rreq));
- /* This wait call won't enter the progress engine.
- * It's just a convinient way to pull out the error
- * information from the tag. */
MPIR_Process_status(&e->u.recv.rreq->status, &s->req->dev.errflag);
MPIR_Request_extract_status(e->u.recv.rreq, e->u.recv.status);
+ if (s->req->dev.errflag != MPIR_ERR_NONE)
+ e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
+ else
+ e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
MPID_Request_release(e->u.recv.rreq);
e->u.recv.rreq = NULL;
MPIR_Comm_release(e->u.recv.comm, /*isDisconnect=*/FALSE);
dtype_release_if_not_builtin(e->u.recv.datatype);
- if (e->u.recv.rreq->status.MPI_ERROR)
- e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
- else
- e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
}
break;
default:
-----------------------------------------------------------------------
Summary of changes:
src/include/mpiimpl.h | 3 ++-
src/mpi/coll/helper_fns.c | 4 ----
src/mpid/common/sched/mpid_sched.c | 24 ++++++++----------------
3 files changed, 10 insertions(+), 21 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-128-g1526244
by noreply@mpich.org 30 Jan '15
by noreply@mpich.org 30 Jan '15
30 Jan '15
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 15262441d4010de06a50c4aba877e26154187665 (commit)
via 18b18311514deadcfc66dc357d58e837c4ed2545 (commit)
via 48d797a9bdb58adcaaad4361743756f5e0f7dd61 (commit)
via 67ec0ab1c7606ef5749797c93192a4b02d879c57 (commit)
via 3dae695980abe2580f98e82a08121756cceaf06f (commit)
via 6556f351cc454a2c858280d7a94ce83b124f6480 (commit)
via 54362c008ee413b40d5e4f654b72ee45091f1c33 (commit)
via c04f08514fddfd16996e913e3d18d32aaed460f2 (commit)
from 85727524ca0fc264a455627e293f758f5c2a7708 (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/15262441d4010de06a50c4aba877e2615…
commit 15262441d4010de06a50c4aba877e26154187665
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Jan 29 15:11:18 2015 -0600
Correctly return errcode for NBC
The error code set in the status was being ignored for NBC and one-sided
requests (which wasn't right anyway so it didn't matter). This grabs the
error code from the status now.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/mpi/pt2pt/mpir_request.c b/src/mpi/pt2pt/mpir_request.c
index 5cf6b97..1a34ef0 100644
--- a/src/mpi/pt2pt/mpir_request.c
+++ b/src/mpi/pt2pt/mpir_request.c
@@ -218,6 +218,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
case MPID_COLL_REQUEST:
case MPID_WIN_REQUEST:
{
+ mpi_errno = request_ptr->status.MPI_ERROR;
MPIR_Request_extract_status(request_ptr, status);
MPID_Request_release(request_ptr);
if (NULL != request) *request = MPI_REQUEST_NULL;
http://git.mpich.org/mpich.git/commitdiff/18b18311514deadcfc66dc357d58e837c…
commit 18b18311514deadcfc66dc357d58e837c4ed2545
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Jan 29 11:11:46 2015 -0600
Add test for non-blocking collective failures
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index 3aa31ed..7c094b5 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -15,4 +15,4 @@ EXTRA_DIST = testlist
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 revoke_shrink
+ agree_shrink revoke_shrink nbccoll
diff --git a/test/mpi/ft/nbccoll.c b/test/mpi/ft/nbccoll.c
new file mode 100644
index 0000000..f5b6cf4
--- /dev/null
+++ b/test/mpi/ft/nbccoll.c
@@ -0,0 +1,76 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2003 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * This test checks if a non-blocking collective failing impacts the result
+ * of another operation going on at the same time.
+ */
+int main(int argc, char **argv)
+{
+ int rank, size;
+ int err;
+ int excl;
+ MPI_Comm small_comm;
+ MPI_Group orig_grp, small_grp;
+ MPI_Request req;
+ MPI_Status status;
+
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+ MPI_Comm_group(MPI_COMM_WORLD, &orig_grp);
+ MPI_Group_size(orig_grp, &excl);
+ excl--;
+ MPI_Group_excl(orig_grp, 1, &excl, &small_grp);
+ MPI_Comm_create_group(MPI_COMM_WORLD, small_grp, 0, &small_comm);
+ MPI_Group_free(&orig_grp);
+ MPI_Group_free(&small_grp);
+
+ if (size < 4) {
+ fprintf( stderr, "Must run with at least 2 processes\n" );
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ }
+
+ if (rank == excl) {
+ exit(EXIT_FAILURE);
+ }
+
+ MPI_Ibarrier(MPI_COMM_WORLD, &req);
+
+ err = MPI_Barrier(small_comm);
+ if (err != MPI_SUCCESS) {
+ int ec;
+ MPI_Error_class(err, &ec);
+ fprintf(stderr, "Result != MPI_SUCCESS: %d\n", ec);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ err = MPI_Wait(&req, &status);
+ if (err == MPI_SUCCESS) {
+ int ec, ec2;
+ MPI_Error_class(err, &ec);
+ MPI_Error_class(status.MPI_ERROR, &ec2);
+ fprintf(stderr, "Result != MPIX_ERR_PROC_FAILED: %d Status: %d\n", ec, ec2);
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ MPI_Comm_free(&small_comm);
+
+ if (rank == 0) {
+ printf(" No Errors\n");
+ fflush(stdout);
+ }
+
+ MPI_Finalize();
+
+ return 0;
+}
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index 52dde9a..03868d4 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -17,4 +17,5 @@ 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
agree_shrink 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
+revoke_shrink 4 env=MPIR_CVAR_ENABLE_FT=1 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=2198
+nbccoll 4 env=MPIR_CVAR_ENABLE_FT=1 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10
http://git.mpich.org/mpich.git/commitdiff/48d797a9bdb58adcaaad4361743756f5e…
commit 48d797a9bdb58adcaaad4361743756f5e0f7dd61
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Jan 29 12:33:45 2015 -0600
Convert scheduler functions to use MPIC
The scheduler functions now use MPIC_* functions to handle their
communication instead of directly calling the MPID_* functions. This
helps to simplify code related to error handling and allows the
collectives to complete even if a failure is detected because the error
will be tracked via the errflag inside the request object.
Fixes #2222
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/mpid/common/sched/mpid_sched.c b/src/mpid/common/sched/mpid_sched.c
index 21082d1..9e2a09d 100644
--- a/src/mpid/common/sched/mpid_sched.c
+++ b/src/mpid/common/sched/mpid_sched.c
@@ -124,8 +124,7 @@ fn_fail:
* performing reductions, calling callbacks, etc. */
static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPIDU_Sched_entry *e)
{
- int mpi_errno = MPI_SUCCESS;
- int context_offset;
+ int mpi_errno = MPI_SUCCESS, ret_errno = MPI_SUCCESS;
MPID_Request *r = s->req;
MPID_Comm *comm;
@@ -134,43 +133,62 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
switch (e->type) {
case MPIDU_SCHED_ENTRY_SEND:
comm = e->u.send.comm;
- context_offset = (comm->comm_kind == MPID_INTRACOMM) ?
- MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "starting SEND entry %d\n", (int) idx);
if (e->u.send.count_p) {
/* deferred send */
/* originally there was no branch and send.count_p was set to
* &send.count, but this requires patching up the pointers
* during realloc of entries, so this is easier */
- mpi_errno = MPID_Isend(e->u.send.buf, *e->u.send.count_p, e->u.send.datatype,
- e->u.send.dest, s->tag, comm, context_offset,
- &e->u.send.sreq);
+ ret_errno = MPIC_Isend(e->u.send.buf, *e->u.send.count_p, e->u.send.datatype,
+ e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->dev.errflag);
}
else {
if (e->u.send.is_sync) {
- mpi_errno = MPID_Issend(e->u.send.buf, e->u.send.count, e->u.send.datatype,
- e->u.send.dest, s->tag, comm, context_offset,
- &e->u.send.sreq);
+ ret_errno = MPIC_Issend(e->u.send.buf, e->u.send.count, e->u.send.datatype,
+ e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->dev.errflag);
}
else {
- mpi_errno = MPID_Isend(e->u.send.buf, e->u.send.count, e->u.send.datatype,
- e->u.send.dest, s->tag, comm, context_offset,
- &e->u.send.sreq);
+ ret_errno = MPIC_Isend(e->u.send.buf, e->u.send.count, e->u.send.datatype,
+ e->u.send.dest, s->tag, comm, &e->u.send.sreq, &r->dev.errflag);
}
}
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
+ /* Check if the error is actually fatal to the NBC or we can continue. */
+ if (unlikely(ret_errno)) {
+ if (MPIR_ERR_NONE == r->dev.errflag) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
+ r->dev.errflag = MPIR_ERR_PROC_FAILED;
+ } else {
+ r->dev.errflag = MPIR_ERR_OTHER;
+ }
+ }
+ e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->dev.errflag);
+ } else {
+ e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
+ }
break;
case MPIDU_SCHED_ENTRY_RECV:
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "starting RECV entry %d\n", (int) idx);
comm = e->u.recv.comm;
- context_offset = (comm->comm_kind == MPID_INTRACOMM) ?
- MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
- mpi_errno = MPID_Irecv(e->u.recv.buf, e->u.recv.count, e->u.recv.datatype,
- e->u.recv.src, s->tag, comm, context_offset,
- &e->u.recv.rreq);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
+ ret_errno = MPIC_Irecv(e->u.recv.buf, e->u.recv.count, e->u.recv.datatype,
+ e->u.recv.src, s->tag, comm, &e->u.recv.rreq);
+ /* Check if the error is actually fatal to the NBC or we can continue. */
+ if (unlikely(ret_errno)) {
+ if (MPIR_ERR_NONE == r->dev.errflag) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
+ r->dev.errflag = MPIR_ERR_PROC_FAILED;
+ } else {
+ r->dev.errflag = MPIR_ERR_OTHER;
+ }
+ }
+ e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "Sched SEND failed. Errflag: %d\n", (int) r->dev.errflag);
+ } else {
+ e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
+ }
break;
case MPIDU_SCHED_ENTRY_REDUCE:
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "starting REDUCE entry %d\n", (int) idx);
mpi_errno = MPIR_Reduce_local_impl(e->u.reduce.inbuf, e->u.reduce.inoutbuf, e->u.reduce.count,
e->u.reduce.datatype, e->u.reduce.op);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -183,6 +201,7 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
break;
case MPIDU_SCHED_ENTRY_COPY:
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "starting COPY entry %d\n", (int) idx);
mpi_errno = MPIR_Localcopy(e->u.copy.inbuf, e->u.copy.incount, e->u.copy.intype,
e->u.copy.outbuf, e->u.copy.outcount, e->u.copy.outtype);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -191,30 +210,48 @@ static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPI
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
break;
case MPIDU_SCHED_ENTRY_NOP:
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "starting NOOP entry %d\n", (int) idx);
/* nothing to be done */
break;
case MPIDU_SCHED_ENTRY_CB:
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "starting CB entry %d\n", (int) idx);
if (e->u.cb.cb_type == MPIDU_SCHED_CB_TYPE_1) {
- mpi_errno = e->u.cb.u.cb_p(r->comm, s->tag, e->u.cb.cb_state);
- if (mpi_errno) {
+ ret_errno = e->u.cb.u.cb_p(r->comm, s->tag, e->u.cb.cb_state);
+ if (unlikely(ret_errno)) {
+ if (MPIR_ERR_NONE == r->dev.errflag) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
+ r->dev.errflag = MPIR_ERR_PROC_FAILED;
+ } else {
+ r->dev.errflag = MPIR_ERR_OTHER;
+ }
+ }
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
- MPIU_ERR_POP(mpi_errno);
+ } else {
+ e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
}
}
else if (e->u.cb.cb_type == MPIDU_SCHED_CB_TYPE_2) {
- mpi_errno = e->u.cb.u.cb2_p(r->comm, s->tag, e->u.cb.cb_state, e->u.cb.cb_state2);
- if (mpi_errno) {
+ ret_errno = e->u.cb.u.cb2_p(r->comm, s->tag, e->u.cb.cb_state, e->u.cb.cb_state2);
+ if (unlikely(ret_errno)) {
+ if (MPIR_ERR_NONE == r->dev.errflag) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(ret_errno)) {
+ r->dev.errflag = MPIR_ERR_PROC_FAILED;
+ } else {
+ r->dev.errflag = MPIR_ERR_OTHER;
+ }
+ }
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
- MPIU_ERR_POP(mpi_errno);
+ } else {
+ e->status = MPIDU_SCHED_ENTRY_STATUS_STARTED;
}
}
else {
- MPIU_Assert_fmt_msg(FALSE, ("unknown callback type, e->u.cb.cb_type=%d", e->u.cb.cb_type));
+ MPIU_DBG_MSG_D(COMM, TYPICAL, "unknown callback type, e->u.cb.cb_type=%d", e->u.cb.cb_type);
}
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
break;
default:
- MPIU_Assert_fmt_msg(FALSE, ("unknown entry type, e->type=%d", e->type));
+ MPIU_DBG_MSG_D(COMM, TYPICAL, "unknown entry type, e->type=%d", e->type);
break;
}
@@ -248,13 +285,13 @@ static int MPIDU_Sched_continue(struct MPIDU_Sched *s)
}
/* _start_entry may have completed the operation, but won't update s->idx */
- if (i == s->idx && e->status == MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
+ if (i == s->idx && e->status >= MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
++s->idx; /* this is valid even for barrier entries */
}
/* watch the indexing, s->idx might have been incremented above, so
* ||-short-circuit matters here */
- if (e->is_barrier && (e->status != MPIDU_SCHED_ENTRY_STATUS_COMPLETE || (s->idx != i+1))) {
+ if (e->is_barrier && (e->status < MPIDU_SCHED_ENTRY_STATUS_COMPLETE || (s->idx != i+1))) {
/* we've hit a barrier but outstanding operations before this
* barrier remain, so we cannot proceed past the barrier */
break;
@@ -368,7 +405,7 @@ int MPID_Sched_start(MPID_Sched_t *sp, MPID_Comm *comm, int tag, MPID_Request **
* progress engine can make progress on it */
MPL_DL_APPEND(all_schedules.head, s);
- dprintf(stderr, "started schedule s=%p\n", s);
+ MPIU_DBG_MSG_P(COMM, TYPICAL, "started schedule s=%p\n", s);
MPIDU_Sched_dump(s);
fn_exit:
@@ -795,7 +832,6 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
*made_progress = FALSE;
MPL_DL_FOREACH_SAFE(state->head, s, tmp) {
- dprintf(stderr, "making progress on s=%p\n", s);
/*MPIDU_Sched_dump(s);*/
for (i = s->idx; i < s->num_entries; ++i) {
@@ -804,38 +840,38 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
switch (e->type) {
case MPIDU_SCHED_ENTRY_SEND:
if (e->u.send.sreq != NULL && MPID_Request_is_complete(e->u.send.sreq)) {
- dprintf(stderr, "completed SEND entry %d, sreq=%p\n", i, e->u.send.sreq);
+ MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completed SEND entry %d, sreq=%p\n", (int) i, e->u.send.sreq));
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
- mpi_errno = e->u.send.sreq->status.MPI_ERROR;
+ /* This wait call won't enter the progress engine.
+ * It's just a convinient way to pull out the error
+ * information from the tag. */
+ MPIR_Process_status(&e->u.send.sreq->status, &s->req->dev.errflag);
MPID_Request_release(e->u.send.sreq);
e->u.send.sreq = NULL;
MPIR_Comm_release(e->u.send.comm, /*isDisconnect=*/FALSE);
dtype_release_if_not_builtin(e->u.send.datatype);
- if (mpi_errno) {
+ if (e->u.send.sreq->status.MPI_ERROR)
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
- MPIU_ERR_POP(mpi_errno);
- }
- else {
+ else
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
- }
}
break;
case MPIDU_SCHED_ENTRY_RECV:
if (e->u.recv.rreq != NULL && MPID_Request_is_complete(e->u.recv.rreq)) {
- dprintf(stderr, "completed RECV entry %d, rreq=%p\n", i, e->u.recv.rreq);
- mpi_errno = e->u.recv.rreq->status.MPI_ERROR;
+ MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completed RECV entry %d, rreq=%p\n", (int) i, e->u.recv.rreq));
+ /* This wait call won't enter the progress engine.
+ * It's just a convinient way to pull out the error
+ * information from the tag. */
+ MPIR_Process_status(&e->u.recv.rreq->status, &s->req->dev.errflag);
MPIR_Request_extract_status(e->u.recv.rreq, e->u.recv.status);
MPID_Request_release(e->u.recv.rreq);
e->u.recv.rreq = NULL;
MPIR_Comm_release(e->u.recv.comm, /*isDisconnect=*/FALSE);
dtype_release_if_not_builtin(e->u.recv.datatype);
- if (mpi_errno) {
+ if (e->u.recv.rreq->status.MPI_ERROR)
e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED;
- MPIU_ERR_POP(mpi_errno);
- }
- else {
+ else
e->status = MPIDU_SCHED_ENTRY_STATUS_COMPLETE;
- }
}
break;
default:
@@ -844,28 +880,40 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made
break;
}
- if (i == s->idx && e->status == MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
+ if (i == s->idx && e->status >= MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
++s->idx;
+ MPIU_DBG_MSG_D(COMM, VERBOSE, "completed OTHER entry %d\n", (int) i);
if (e->is_barrier) {
- dprintf(stderr, "completed barrier in entry %d\n", i);
/* post/perform the next round of operations */
mpi_errno = MPIDU_Sched_continue(s);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
}
- else if (e->is_barrier && e->status != MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
+ else if (e->is_barrier && e->status < MPIDU_SCHED_ENTRY_STATUS_COMPLETE) {
/* don't process anything after this barrier entry */
break;
}
}
if (s->idx == s->num_entries) {
- dprintf(stderr, "completing and dequeuing s=%p r=%p\n", s, s->req);
+ MPIU_DBG_MSG_FMT(COMM, VERBOSE, (MPIU_DBG_FDEST, "completing and dequeuing s=%p r=%p\n", s, s->req));
/* dequeue this schedule from the state, it's complete */
MPL_DL_DELETE(state->head, s);
/* TODO refactor into a sched_complete routine? */
+ switch (s->req->dev.errflag) {
+ case MPIR_ERR_PROC_FAILED:
+ MPIU_ERR_SET(s->req->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**comm");
+ break;
+ case MPIR_ERR_OTHER:
+ MPIU_ERR_SET(s->req->status.MPI_ERROR, MPI_ERR_OTHER, "**comm");
+ break;
+ case MPIR_ERR_NONE:
+ default:
+ break;
+ }
+
MPID_REQUEST_SET_COMPLETED(s->req);
MPID_Request_release(s->req);
s->req = NULL;
http://git.mpich.org/mpich.git/commitdiff/67ec0ab1c7606ef5749797c93192a4b02…
commit 67ec0ab1c7606ef5749797c93192a4b02d879c57
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jan 28 13:13:59 2015 -0600
Add mpir_errflag_t to MPIDI_Request
Non-blocking communication requests need a way to track whether an error
has occurred in a previous part of the NBC schedule. This adds an
errflag to the request object itself so the tracking is possible.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 2bb62b2..6b379cb 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -446,6 +446,9 @@ typedef struct MPIDI_Request {
struct MPIDI_RMA_Lock_entry *lock_queue_entry;
MPI_Request resp_request_handle; /* Handle for get_accumulate response */
+ /* Errflag for NBC requests. Not used by other requests. */
+ mpir_errflag_t errflag;
+
MPIDI_REQUEST_SEQNUM
/* Occasionally, when a message cannot be sent, we need to cache the
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 7e795b2..19c0747 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -94,6 +94,7 @@ MPID_Request * MPID_Request_create(void)
req->dev.user_buf = NULL;
req->dev.final_user_buf = NULL;
req->dev.drop_data = FALSE;
+ req->dev.errflag = MPIR_ERR_NONE;
#ifdef MPIDI_CH3_REQUEST_INIT
MPIDI_CH3_REQUEST_INIT(req);
#endif
http://git.mpich.org/mpich.git/commitdiff/3dae695980abe2580f98e82a08121756c…
commit 3dae695980abe2580f98e82a08121756cceaf06f
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jan 28 13:12:18 2015 -0600
Move mpir_errflag_t to mpitypedefs.h
Having mpir_errflag_t defined in mpiimpl.h causes a problem if it needs
to be used in some other headers. This moves the definition to
mpitypedefs.h so it can be used elsewhere.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 1e007f3..3906e52 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -720,14 +720,6 @@ extern MPID_Errhandler MPID_Errhandler_direct[];
} while (0)
/* ------------------------------------------------------------------------- */
-/* Define a typedef for the errflag value used by many internal functions.
- * If an error needs to be returned, these values can be used to signal such.
- * More details can be found further down in the code with the bitmasking logic */
-typedef enum {MPIR_ERR_NONE = MPI_SUCCESS,
- MPIR_ERR_PROC_FAILED = MPIX_ERR_PROC_FAILED,
- MPIR_ERR_OTHER = MPI_ERR_OTHER}
-mpir_errflag_t;
-
/* ------------------------------------------------------------------------- */
/* Keyvals and attributes */
/*TKyOverview.tex
diff --git a/src/include/mpitypedefs.h b/src/include/mpitypedefs.h
index 95fe3aa..91e6207 100644
--- a/src/include/mpitypedefs.h
+++ b/src/include/mpitypedefs.h
@@ -68,6 +68,14 @@ typedef uint16_t MPIR_Context_id_t;
typedef MPIU_SIZE_T MPIU_Size_t;
+/* Define a typedef for the errflag value used by many internal functions.
+ * If an error needs to be returned, these values can be used to signal such.
+ * More details can be found further down in the code with the bitmasking logic */
+typedef enum {MPIR_ERR_NONE = MPI_SUCCESS,
+ MPIR_ERR_PROC_FAILED = MPIX_ERR_PROC_FAILED,
+ MPIR_ERR_OTHER = MPI_ERR_OTHER}
+mpir_errflag_t;
+
/* Use the MPIU_PtrToXXX macros to convert pointers to and from integer types */
/* The Microsoft compiler will not allow casting of different sized types
http://git.mpich.org/mpich.git/commitdiff/6556f351cc454a2c858280d7a94ce83b1…
commit 6556f351cc454a2c858280d7a94ce83b124f6480
Author: Wesley Bland <wbland(a)anl.gov>
Date: Wed Jan 28 12:27:05 2015 -0600
Add MPIC_Issend
Part of converting the NBC code to use the MPIC_* functions requires
an MPIC_Issend function to exist. This adds it.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 4724314..1e007f3 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -3964,6 +3964,8 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, MPID_Request **request, mpir_errflag_t *errflag);
+int MPIC_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
+ MPID_Comm *comm_ptr, MPID_Request **request, mpir_errflag_t *errflag);
int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
int tag, MPID_Comm *comm_ptr, MPID_Request **request);
int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], mpir_errflag_t *errflag);
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index e5e8d06..97ebd0b 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -655,6 +655,47 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
}
#undef FUNCNAME
+#define FUNCNAME MPIC_Issend
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPIC_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
+ MPID_Comm *comm_ptr, MPID_Request **request_ptr, mpir_errflag_t *errflag)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int context_id;
+ MPIDI_STATE_DECL(MPID_STATE_MPIC_ISSEND);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIC_ISSEND);
+
+ MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
+
+ MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
+ "**countneg", "**countneg %d", count);
+
+ switch(*errflag) {
+ case MPIR_ERR_NONE:
+ break;
+ case MPIR_ERR_PROC_FAILED:
+ MPIR_TAG_SET_PROC_FAILURE_BIT(tag);
+ default:
+ MPIR_TAG_SET_ERROR_BIT(tag);
+ }
+
+ context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
+ MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
+
+ mpi_errno = MPID_Issend(buf, count, datatype, dest, tag, comm_ptr,
+ context_id, request_ptr);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+
+ fn_exit:
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIC_ISSEND);
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
#define FUNCNAME MPIC_Irecv
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
http://git.mpich.org/mpich.git/commitdiff/54362c008ee413b40d5e4f654b72ee450…
commit 54362c008ee413b40d5e4f654b72ee45091f1c33
Author: Wesley Bland <wbland(a)anl.gov>
Date: Tue Jan 27 16:11:58 2015 -0600
Refactor MPIC functions to use the MPID objects
The MPIC helper functions have been using MPI_Comm and MPI_Request
objects instead of their MPID_* counterparts. This leads to a bunch of
unnecessary conversions back and forth between the two types of objects
and makes the work incompatible with other parts of the codebase
(non-blocking collectives for instance).
This patch converts all of the MPIC_* functions to use MPID_Comm and
MPID_Request and changes all of the collective calls to use them now
too.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index c1439d3..4724314 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -3949,24 +3949,24 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
/* FT versions of te MPIC_ functions */
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
- MPI_Comm comm, mpir_errflag_t *errflag);
+ MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
- MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag);
+ MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
- MPI_Comm comm, mpir_errflag_t *errflag);
+ MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
- MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag);
+ MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
- MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag);
+ MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
- MPI_Comm comm, MPI_Request *request, mpir_errflag_t *errflag);
+ MPID_Comm *comm_ptr, MPID_Request **request, mpir_errflag_t *errflag);
int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
- int tag, MPI_Comm comm, MPI_Request *request);
-int MPIC_Waitall(int numreq, MPI_Request requests[], MPI_Status statuses[], mpir_errflag_t *errflag);
+ int tag, MPID_Comm *comm_ptr, MPID_Request **request);
+int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], mpir_errflag_t *errflag);
void MPIR_MAXF ( void *, void *, int *, MPI_Datatype * ) ;
diff --git a/src/mpi/coll/allgather.c b/src/mpi/coll/allgather.c
index 7d6799e..24f0817 100644
--- a/src/mpi/coll/allgather.c
+++ b/src/mpi/coll/allgather.c
@@ -127,7 +127,6 @@ int MPIR_Allgather_intra (
int j, i, pof2, src, rem;
void *tmp_buf = NULL;
int curr_cnt, dst, type_size, left, right, jnext;
- MPI_Comm comm;
MPI_Status status;
int mask, dst_tree_root, my_tree_root, is_homogeneous,
send_offset, recv_offset, last_recv_cnt = 0, nprocs_completed, k,
@@ -140,8 +139,7 @@ int MPIR_Allgather_intra (
if (((sendcount == 0) && (sendbuf != MPI_IN_PLACE)) || (recvcount == 0))
return MPI_SUCCESS;
-
- comm = comm_ptr->handle;
+
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -209,7 +207,7 @@ int MPIR_Allgather_intra (
((char *)recvbuf + recv_offset),
(comm_size-dst_tree_root)*recvcount,
recvtype, dst,
- MPIR_ALLGATHER_TAG, comm, &status, errflag);
+ MPIR_ALLGATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -271,7 +269,7 @@ int MPIR_Allgather_intra (
mpi_errno = MPIC_Send(((char *)recvbuf + offset),
last_recv_cnt,
recvtype, dst,
- MPIR_ALLGATHER_TAG, comm, errflag);
+ MPIR_ALLGATHER_TAG, comm_ptr, errflag);
/* last_recv_cnt was set in the previous
receive. that's the amount of data to be
sent now. */
@@ -291,7 +289,7 @@ int MPIR_Allgather_intra (
(comm_size - (my_tree_root + mask))*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
/* nprocs_completed is also equal to the
no. of processes whose data we don't have */
if (mpi_errno) {
@@ -377,7 +375,7 @@ int MPIR_Allgather_intra (
((char *)tmp_buf + recv_offset),
tmp_buf_size - recv_offset,
MPI_BYTE, dst,
- MPIR_ALLGATHER_TAG, comm, &status, errflag);
+ MPIR_ALLGATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -432,7 +430,7 @@ int MPIR_Allgather_intra (
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt, MPI_BYTE,
dst, MPIR_ALLGATHER_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -452,7 +450,7 @@ int MPIR_Allgather_intra (
tmp_buf_size - offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
/* nprocs_completed is also equal to the
no. of processes whose data we don't have */
if (mpi_errno) {
@@ -528,7 +526,7 @@ int MPIR_Allgather_intra (
MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
curr_cnt, recvtype,
- src, MPIR_ALLGATHER_TAG, comm,
+ src, MPIR_ALLGATHER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -551,7 +549,7 @@ int MPIR_Allgather_intra (
dst, MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
rem * recvcount, recvtype,
- src, MPIR_ALLGATHER_TAG, comm,
+ src, MPIR_ALLGATHER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -613,7 +611,7 @@ int MPIR_Allgather_intra (
((char *)recvbuf +
jnext*recvcount*recvtype_extent),
recvcount, recvtype, left,
- MPIR_ALLGATHER_TAG, comm,
+ MPIR_ALLGATHER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
diff --git a/src/mpi/coll/allgatherv.c b/src/mpi/coll/allgatherv.c
index 8064713..b3fcfbf 100644
--- a/src/mpi/coll/allgatherv.c
+++ b/src/mpi/coll/allgatherv.c
@@ -100,7 +100,6 @@ int MPIR_Allgatherv_intra (
MPID_Comm *comm_ptr,
mpir_errflag_t *errflag )
{
- MPI_Comm comm;
int comm_size, rank, j, i, left, right;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
@@ -121,7 +120,6 @@ int MPIR_Allgatherv_intra (
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -214,7 +212,7 @@ int MPIR_Allgatherv_intra (
((char *)tmp_buf + recv_offset * recvtype_extent),
total_count - recv_offset, recvtype, dst,
MPIR_ALLGATHERV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -282,7 +280,7 @@ int MPIR_Allgatherv_intra (
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt,
recvtype, dst,
- MPIR_ALLGATHERV_TAG, comm, errflag);
+ MPIR_ALLGATHERV_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -306,7 +304,7 @@ int MPIR_Allgatherv_intra (
mpi_errno = MPIC_Recv(((char *)tmp_buf + offset * recvtype_extent),
total_count - offset, recvtype,
dst, MPIR_ALLGATHERV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -415,7 +413,7 @@ int MPIR_Allgatherv_intra (
MPIR_ALLGATHERV_TAG,
((char *)tmp_buf + recv_offset),
tmp_buf_size-recv_offset, MPI_BYTE, dst,
- MPIR_ALLGATHERV_TAG, comm, &status, errflag);
+ MPIR_ALLGATHERV_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -475,7 +473,7 @@ int MPIR_Allgatherv_intra (
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt, MPI_BYTE,
dst, MPIR_ALLGATHERV_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -495,7 +493,7 @@ int MPIR_Allgatherv_intra (
tmp_buf_size-offset, MPI_BYTE,
dst,
MPIR_ALLGATHERV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -577,7 +575,7 @@ int MPIR_Allgatherv_intra (
MPIR_ALLGATHERV_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
total_count - curr_cnt, recvtype,
- src, MPIR_ALLGATHERV_TAG, comm, &status, errflag);
+ src, MPIR_ALLGATHERV_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -606,7 +604,7 @@ int MPIR_Allgatherv_intra (
dst, MPIR_ALLGATHERV_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
total_count - curr_cnt, recvtype,
- src, MPIR_ALLGATHERV_TAG, comm,
+ src, MPIR_ALLGATHERV_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -695,7 +693,7 @@ int MPIR_Allgatherv_intra (
* consecutive processes contribute 0 bytes each. */
}
else if (!sendnow) { /* If there's no data to send, just do a recv call */
- mpi_errno = MPIC_Recv(rbuf, recvnow, recvtype, left, MPIR_ALLGATHERV_TAG, comm, &status, errflag);
+ mpi_errno = MPIC_Recv(rbuf, recvnow, recvtype, left, MPIR_ALLGATHERV_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -705,7 +703,7 @@ int MPIR_Allgatherv_intra (
torecv -= recvnow;
}
else if (!recvnow) { /* If there's no data to receive, just do a send call */
- mpi_errno = MPIC_Send(sbuf, sendnow, recvtype, right, MPIR_ALLGATHERV_TAG, comm, errflag);
+ mpi_errno = MPIC_Send(sbuf, sendnow, recvtype, right, MPIR_ALLGATHERV_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -717,7 +715,7 @@ int MPIR_Allgatherv_intra (
else { /* There's data to be sent and received */
mpi_errno = MPIC_Sendrecv(sbuf, sendnow, recvtype, right, MPIR_ALLGATHERV_TAG,
rbuf, recvnow, recvtype, left, MPIR_ALLGATHERV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/allred_group.c b/src/mpi/coll/allred_group.c
index 6c66347..ecc9a17 100644
--- a/src/mpi/coll/allred_group.c
+++ b/src/mpi/coll/allred_group.c
@@ -37,7 +37,6 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf;
- MPI_Comm comm = comm_ptr->handle;
int group_rank, group_size;
int cdst, csrc;
MPIU_CHKLMEM_DECL(3);
@@ -92,7 +91,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
to_comm_rank(cdst, group_rank+1);
mpi_errno = MPIC_Send(recvbuf, count,
datatype, cdst,
- tag, comm, errflag);
+ tag, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -109,7 +108,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
to_comm_rank(csrc, group_rank-1);
mpi_errno = MPIC_Recv(tmp_buf, count,
datatype, csrc,
- tag, comm,
+ tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -158,7 +157,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
mpi_errno = MPIC_Sendrecv(recvbuf, count, datatype,
cdst, tag, tmp_buf,
count, datatype, cdst,
- tag, comm,
+ tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -242,7 +241,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
(char *) tmp_buf +
disps[recv_idx]*extent,
recv_cnt, datatype, cdst,
- tag, comm,
+ tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -308,7 +307,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
(char *) recvbuf +
disps[recv_idx]*extent,
recv_cnt, datatype, cdst,
- tag, comm,
+ tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -332,13 +331,13 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
to_comm_rank(cdst, group_rank-1);
mpi_errno = MPIC_Send(recvbuf, count,
datatype, cdst,
- tag, comm, errflag);
+ tag, comm_ptr, errflag);
}
else { /* even */
to_comm_rank(csrc, group_rank+1);
mpi_errno = MPIC_Recv(recvbuf, count,
datatype, csrc,
- tag, comm,
+ tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
}
if (mpi_errno) {
diff --git a/src/mpi/coll/allreduce.c b/src/mpi/coll/allreduce.c
index c7dc13f..5da27b3 100644
--- a/src/mpi/coll/allreduce.c
+++ b/src/mpi/coll/allreduce.c
@@ -198,14 +198,12 @@ int MPIR_Allreduce_intra (
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(3);
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
if (count == 0) goto fn_exit;
- comm = comm_ptr->handle;
is_commutative = MPIR_Op_is_commutative(op);
@@ -349,7 +347,7 @@ int MPIR_Allreduce_intra (
if (rank % 2 == 0) { /* even */
mpi_errno = MPIC_Send(recvbuf, count,
datatype, rank+1,
- MPIR_ALLREDUCE_TAG, comm, errflag);
+ MPIR_ALLREDUCE_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -365,7 +363,7 @@ int MPIR_Allreduce_intra (
else { /* odd */
mpi_errno = MPIC_Recv(tmp_buf, count,
datatype, rank-1,
- MPIR_ALLREDUCE_TAG, comm,
+ MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -411,7 +409,7 @@ int MPIR_Allreduce_intra (
mpi_errno = MPIC_Sendrecv(recvbuf, count, datatype,
dst, MPIR_ALLREDUCE_TAG, tmp_buf,
count, datatype, dst,
- MPIR_ALLREDUCE_TAG, comm,
+ MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -496,7 +494,7 @@ int MPIR_Allreduce_intra (
(char *) tmp_buf +
disps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_ALLREDUCE_TAG, comm,
+ MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -561,7 +559,7 @@ int MPIR_Allreduce_intra (
(char *) recvbuf +
disps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_ALLREDUCE_TAG, comm,
+ MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -584,11 +582,11 @@ int MPIR_Allreduce_intra (
if (rank % 2) /* odd */
mpi_errno = MPIC_Send(recvbuf, count,
datatype, rank-1,
- MPIR_ALLREDUCE_TAG, comm, errflag);
+ MPIR_ALLREDUCE_TAG, comm_ptr, errflag);
else /* even */
mpi_errno = MPIC_Recv(recvbuf, count,
datatype, rank+1,
- MPIR_ALLREDUCE_TAG, comm,
+ MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -638,7 +636,6 @@ int MPIR_Allreduce_inter (
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf=NULL;
MPID_Comm *newcomm_ptr = NULL;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(1);
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
@@ -655,8 +652,6 @@ int MPIR_Allreduce_inter (
tmp_buf = (void *)((char*)tmp_buf - true_lb);
}
- comm = comm_ptr->handle;
-
/* Get the local intracommunicator */
if (!comm_ptr->local_comm)
MPIR_Setup_intercomm_localcomm( comm_ptr );
@@ -677,7 +672,7 @@ int MPIR_Allreduce_inter (
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv(tmp_buf, count, datatype, 0, MPIR_REDUCE_TAG,
recvbuf, count, datatype, 0, MPIR_REDUCE_TAG,
- comm, MPI_STATUS_IGNORE, errflag);
+ comm_ptr, MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index 576931d..f3e3c35 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -147,8 +147,7 @@ int MPIR_Alltoall_intra(
MPI_Aint pack_size, position;
MPI_Datatype newtype = MPI_DATATYPE_NULL;
void *tmp_buf;
- MPI_Comm comm;
- MPI_Request *reqarray;
+ MPID_Request **reqarray;
MPI_Status *starray;
MPIU_CHKLMEM_DECL(6);
#ifdef MPIR_OLD_SHORT_ALLTOALL_ALG
@@ -159,7 +158,6 @@ int MPIR_Alltoall_intra(
if (recvcount == 0) return MPI_SUCCESS;
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -192,7 +190,7 @@ int MPIR_Alltoall_intra(
recvcount, recvtype,
j, MPIR_ALLTOALL_TAG,
j, MPIR_ALLTOALL_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -206,7 +204,7 @@ int MPIR_Alltoall_intra(
recvcount, recvtype,
i, MPIR_ALLTOALL_TAG,
i, MPIR_ALLTOALL_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -279,7 +277,7 @@ int MPIR_Alltoall_intra(
mpi_errno = MPIC_Sendrecv(tmp_buf, position, MPI_PACKED, dst,
MPIR_ALLTOALL_TAG, recvbuf, 1, newtype,
- src, MPIR_ALLTOALL_TAG, comm,
+ src, MPIR_ALLTOALL_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -371,7 +369,7 @@ int MPIR_Alltoall_intra(
dst_tree_root*sendbuf_extent),
sendbuf_extent*(comm_size-dst_tree_root),
sendtype, dst, MPIR_ALLTOALL_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -425,7 +423,7 @@ int MPIR_Alltoall_intra(
dst_tree_root*sendbuf_extent),
last_recv_cnt, sendtype,
dst, MPIR_ALLTOALL_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -443,7 +441,7 @@ int MPIR_Alltoall_intra(
sendbuf_extent*(comm_size-dst_tree_root),
sendtype,
dst, MPIR_ALLTOALL_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -498,7 +496,7 @@ int MPIR_Alltoall_intra(
bblock = MPIR_CVAR_ALLTOALL_THROTTLE;
if (bblock == 0) bblock = comm_size;
- MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request *, 2*bblock*sizeof(MPI_Request), mpi_errno, "reqarray");
+ MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request **, 2*bblock*sizeof(MPID_Request*), mpi_errno, "reqarray");
MPIU_CHKLMEM_MALLOC(starray, MPI_Status *, 2*bblock*sizeof(MPI_Status), mpi_errno, "starray");
@@ -510,7 +508,7 @@ int MPIR_Alltoall_intra(
mpi_errno = MPIC_Irecv((char *)recvbuf +
dst*recvcount*recvtype_extent,
recvcount, recvtype, dst,
- MPIR_ALLTOALL_TAG, comm,
+ MPIR_ALLTOALL_TAG, comm_ptr,
&reqarray[i]);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
@@ -520,7 +518,7 @@ int MPIR_Alltoall_intra(
mpi_errno = MPIC_Isend((char *)sendbuf +
dst*sendcount*sendtype_extent,
sendcount, sendtype, dst,
- MPIR_ALLTOALL_TAG, comm,
+ MPIR_ALLTOALL_TAG, comm_ptr,
&reqarray[i+ss], errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
@@ -588,7 +586,7 @@ int MPIR_Alltoall_intra(
((char *)recvbuf +
src*recvcount*recvtype_extent),
recvcount, recvtype, src,
- MPIR_ALLTOALL_TAG, comm, &status, errflag);
+ MPIR_ALLTOALL_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -647,12 +645,10 @@ int MPIR_Alltoall_inter(
MPI_Status status;
int src, dst, rank;
char *sendaddr, *recvaddr;
- MPI_Comm comm;
-
+
local_size = comm_ptr->local_size;
remote_size = comm_ptr->remote_size;
rank = comm_ptr->rank;
- comm = comm_ptr->handle;
/* Get extent of send and recv types */
MPID_Datatype_get_extent_macro(sendtype, sendtype_extent);
@@ -688,7 +684,7 @@ int MPIR_Alltoall_inter(
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype, dst,
MPIR_ALLTOALL_TAG, recvaddr,
recvcount, recvtype, src,
- MPIR_ALLTOALL_TAG, comm, &status, errflag);
+ MPIR_ALLTOALL_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/alltoallv.c b/src/mpi/coll/alltoallv.c
index 7db2166..fa53196 100644
--- a/src/mpi/coll/alltoallv.c
+++ b/src/mpi/coll/alltoallv.c
@@ -71,15 +71,13 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
int mpi_errno_ret = MPI_SUCCESS;
MPI_Status *starray;
MPI_Status status;
- MPI_Request *reqarray;
+ MPID_Request **reqarray;
int dst, rank, req_cnt;
- MPI_Comm comm;
int ii, ss, bblock;
int type_size;
MPIU_CHKLMEM_DECL(2);
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -108,7 +106,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
recvcounts[j], recvtype,
j, MPIR_ALLTOALLV_TAG,
j, MPIR_ALLTOALLV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -123,7 +121,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
recvcounts[i], recvtype,
i, MPIR_ALLTOALLV_TAG,
i, MPIR_ALLTOALLV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -141,7 +139,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
MPID_Datatype_get_extent_macro(sendtype, send_extent);
MPIU_CHKLMEM_MALLOC(starray, MPI_Status*, 2*bblock*sizeof(MPI_Status), mpi_errno, "starray");
- MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request*, 2*bblock*sizeof(MPI_Request), mpi_errno, "reqarray");
+ MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request**, 2*bblock*sizeof(MPID_Request *), mpi_errno, "reqarray");
/* post only bblock isends/irecvs at a time as suggested by Tony Ladd */
for (ii=0; ii<comm_size; ii+=bblock) {
@@ -158,7 +156,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
rdispls[dst]*recv_extent);
mpi_errno = MPIC_Irecv((char *)recvbuf+rdispls[dst]*recv_extent,
recvcounts[dst], recvtype, dst,
- MPIR_ALLTOALLV_TAG, comm,
+ MPIR_ALLTOALLV_TAG, comm_ptr,
&reqarray[req_cnt]);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -180,7 +178,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
sdispls[dst]*send_extent);
mpi_errno = MPIC_Isend((char *)sendbuf+sdispls[dst]*send_extent,
sendcounts[dst], sendtype, dst,
- MPIR_ALLTOALLV_TAG, comm,
+ MPIR_ALLTOALLV_TAG, comm_ptr,
&reqarray[req_cnt], errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -261,11 +259,9 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
MPI_Status status;
int src, dst, rank, sendcount, recvcount;
char *sendaddr, *recvaddr;
- MPI_Comm comm;
-
+
local_size = comm_ptr->local_size;
remote_size = comm_ptr->remote_size;
- comm = comm_ptr->handle;
rank = comm_ptr->rank;
/* Get extent of send and recv types */
@@ -306,7 +302,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype, dst,
MPIR_ALLTOALLV_TAG, recvaddr, recvcount,
recvtype, src, MPIR_ALLTOALLV_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/alltoallw.c b/src/mpi/coll/alltoallw.c
index ecd8852..e55d55a 100644
--- a/src/mpi/coll/alltoallw.c
+++ b/src/mpi/coll/alltoallw.c
@@ -64,15 +64,13 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
int mpi_errno_ret = MPI_SUCCESS;
MPI_Status status;
MPI_Status *starray;
- MPI_Request *reqarray;
+ MPID_Request **reqarray;
int dst, rank;
- MPI_Comm comm;
int outstanding_requests;
int ii, ss, bblock;
int type_size;
MPIU_CHKLMEM_DECL(2);
-
- comm = comm_ptr->handle;
+
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -98,7 +96,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
recvcounts[j], recvtypes[j],
j, MPIR_ALLTOALLW_TAG,
j, MPIR_ALLTOALLW_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -112,7 +110,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
recvcounts[i], recvtypes[i],
i, MPIR_ALLTOALLW_TAG,
i, MPIR_ALLTOALLW_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -128,7 +126,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
if (bblock == 0) bblock = comm_size;
MPIU_CHKLMEM_MALLOC(starray, MPI_Status*, 2*bblock*sizeof(MPI_Status), mpi_errno, "starray");
- MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request*, 2*bblock*sizeof(MPI_Request), mpi_errno, "reqarray");
+ MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request**, 2*bblock*sizeof(MPID_Request *), mpi_errno, "reqarray");
/* post only bblock isends/irecvs at a time as suggested by Tony Ladd */
for (ii=0; ii<comm_size; ii+=bblock) {
@@ -143,7 +141,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
if (type_size) {
mpi_errno = MPIC_Irecv((char *)recvbuf+rdispls[dst],
recvcounts[dst], recvtypes[dst], dst,
- MPIR_ALLTOALLW_TAG, comm,
+ MPIR_ALLTOALLW_TAG, comm_ptr,
&reqarray[outstanding_requests]);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
@@ -159,7 +157,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
if (type_size) {
mpi_errno = MPIC_Isend((char *)sendbuf+sdispls[dst],
sendcounts[dst], sendtypes[dst], dst,
- MPIR_ALLTOALLW_TAG, comm,
+ MPIR_ALLTOALLW_TAG, comm_ptr,
&reqarray[outstanding_requests], errflag);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
@@ -206,7 +204,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
MPIR_ALLTOALLW_TAG,
((char *)recvbuf+rdispls[src]),
recvcounts[src], recvtypes[dst], src,
- MPIR_ALLTOALLW_TAG, comm, &status, errflag);
+ MPIR_ALLTOALLW_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -301,7 +299,7 @@ int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype,
dst, MPIR_ALLTOALLW_TAG, recvaddr,
recvcount, recvtype, src,
- MPIR_ALLTOALLW_TAG, comm, &status, errflag);
+ MPIR_ALLTOALLW_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/barrier.c b/src/mpi/coll/barrier.c
index 38a311f..821d77a 100644
--- a/src/mpi/coll/barrier.c
+++ b/src/mpi/coll/barrier.c
@@ -132,7 +132,6 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, mpir_errflag_t *errflag )
{
int size, rank, src, dst, mask, mpi_errno=MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- MPI_Comm comm;
/* Only one collective operation per communicator can be active at any
time */
@@ -155,7 +154,6 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, mpir_errflag_t *errflag )
}
rank = comm_ptr->rank;
- comm = comm_ptr->handle;
mask = 0x1;
while (mask < size) {
@@ -163,7 +161,7 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, mpir_errflag_t *errflag )
src = (rank - mask + size) % size;
mpi_errno = MPIC_Sendrecv(NULL, 0, MPI_BYTE, dst,
MPIR_BARRIER_TAG, NULL, 0, MPI_BYTE,
- src, MPIR_BARRIER_TAG, comm,
+ src, MPIR_BARRIER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index e1abbda..f50b941 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -140,11 +140,9 @@ static int MPIR_Bcast_binomial(
MPI_Aint type_size;
MPI_Aint position;
void *tmp_buf=NULL;
- MPI_Comm comm;
MPID_Datatype *dtp;
MPIU_CHKLMEM_DECL(1);
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -231,10 +229,10 @@ static int MPIR_Bcast_binomial(
if (src < 0) src += comm_size;
if (!is_contig || !is_homogeneous)
mpi_errno = MPIC_Recv(tmp_buf,nbytes,MPI_BYTE,src,
- MPIR_BCAST_TAG,comm, &status, errflag);
+ MPIR_BCAST_TAG,comm_ptr, &status, errflag);
else
mpi_errno = MPIC_Recv(buffer,count,datatype,src,
- MPIR_BCAST_TAG,comm, &status, errflag);
+ MPIR_BCAST_TAG,comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -277,10 +275,10 @@ static int MPIR_Bcast_binomial(
if (dst >= comm_size) dst -= comm_size;
if (!is_contig || !is_homogeneous)
mpi_errno = MPIC_Send(tmp_buf,nbytes,MPI_BYTE,dst,
- MPIR_BCAST_TAG,comm, errflag);
+ MPIR_BCAST_TAG,comm_ptr, errflag);
else
mpi_errno = MPIC_Send(buffer,count,datatype,dst,
- MPIR_BCAST_TAG,comm, errflag);
+ MPIR_BCAST_TAG,comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -348,9 +346,7 @@ static int scatter_for_bcast(
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int scatter_size, curr_size, recv_size = 0, send_size;
- MPI_Comm comm;
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
relative_rank = (rank >= root) ? rank - root : rank - root + comm_size;
@@ -392,7 +388,7 @@ static int scatter_for_bcast(
mpi_errno = MPIC_Recv(((char *)tmp_buf +
relative_rank*scatter_size),
recv_size, MPI_BYTE, src,
- MPIR_BCAST_TAG, comm, &status, errflag);
+ MPIR_BCAST_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -428,7 +424,7 @@ static int scatter_for_bcast(
mpi_errno = MPIC_Send(((char *)tmp_buf +
scatter_size*(relative_rank+mask)),
send_size, MPI_BYTE, dst,
- MPIR_BCAST_TAG, comm, errflag);
+ MPIR_BCAST_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -498,12 +494,10 @@ static int MPIR_Bcast_scatter_doubling_allgather(
int recv_offset, tree_root, nprocs_completed, offset;
MPI_Aint position;
MPIU_CHKLMEM_DECL(1);
- MPI_Comm comm;
MPID_Datatype *dtp;
MPI_Aint true_extent, true_lb;
void *tmp_buf;
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
relative_rank = (rank >= root) ? rank - root : rank - root + comm_size;
@@ -611,7 +605,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
curr_size, MPI_BYTE, dst, MPIR_BCAST_TAG,
((char *)tmp_buf + recv_offset),
(nbytes-recv_offset < 0 ? 0 : nbytes-recv_offset),
- MPI_BYTE, dst, MPIR_BCAST_TAG, comm, &status, errflag);
+ MPI_BYTE, dst, MPIR_BCAST_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* --BEGIN ERROR HANDLING-- */
/* for communication errors, just record the error but continue */
@@ -685,7 +679,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
fflush(stdout); */
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
recv_size, MPI_BYTE, dst,
- MPIR_BCAST_TAG, comm, errflag);
+ MPIR_BCAST_TAG, comm_ptr, errflag);
/* recv_size was set in the previous
receive. that's the amount of data to be
sent now. */
@@ -707,7 +701,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
mpi_errno = MPIC_Recv(((char *)tmp_buf + offset),
nbytes - offset,
MPI_BYTE, dst, MPIR_BCAST_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
/* nprocs_completed is also equal to the no. of processes
whose data we don't have */
if (mpi_errno) {
@@ -807,12 +801,10 @@ static int MPIR_Bcast_scatter_ring_allgather(
void *tmp_buf;
int recvd_size;
MPI_Status status;
- MPI_Comm comm;
MPID_Datatype *dtp;
MPI_Aint true_extent, true_lb;
MPIU_CHKLMEM_DECL(1);
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -912,7 +904,7 @@ static int MPIR_Bcast_scatter_ring_allgather(
MPI_BYTE, right, MPIR_BCAST_TAG,
(char *)tmp_buf + left_disp, left_count,
MPI_BYTE, left, MPIR_BCAST_TAG,
- comm, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -1048,7 +1040,7 @@ static int MPIR_SMP_Bcast(
{ /* and is on our node (!-1) */
if (root == comm_ptr->rank) {
mpi_errno = MPIC_Send(buffer,count,datatype,0,
- MPIR_BCAST_TAG,comm_ptr->node_comm->handle, errflag);
+ MPIR_BCAST_TAG,comm_ptr->node_comm, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -1058,7 +1050,7 @@ static int MPIR_SMP_Bcast(
}
else if (0 == comm_ptr->node_comm->rank) {
mpi_errno = MPIC_Recv(buffer,count,datatype,MPIU_Get_intranode_rank(comm_ptr, root),
- MPIR_BCAST_TAG,comm_ptr->node_comm->handle, &status, errflag);
+ MPIR_BCAST_TAG,comm_ptr->node_comm, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -1363,12 +1355,10 @@ int MPIR_Bcast_inter (
int mpi_errno_ret = MPI_SUCCESS;
MPI_Status status;
MPID_Comm *newcomm_ptr = NULL;
- MPI_Comm comm;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_BCAST_INTER);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_BCAST_INTER);
- comm = comm_ptr->handle;
if (root == MPI_PROC_NULL)
{
@@ -1380,7 +1370,7 @@ int MPIR_Bcast_inter (
/* root sends to rank 0 on remote group and returns */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
mpi_errno = MPIC_Send(buffer, count, datatype, 0,
- MPIR_BCAST_TAG, comm, errflag);
+ MPIR_BCAST_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -1398,7 +1388,7 @@ int MPIR_Bcast_inter (
if (rank == 0)
{
mpi_errno = MPIC_Recv(buffer, count, datatype, root,
- MPIR_BCAST_TAG, comm, &status, errflag);
+ MPIR_BCAST_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/exscan.c b/src/mpi/coll/exscan.c
index f14444a..856dddd 100644
--- a/src/mpi/coll/exscan.c
+++ b/src/mpi/coll/exscan.c
@@ -101,15 +101,13 @@ int MPIR_Exscan (
MPI_Aint true_extent, true_lb, extent;
void *partial_scan, *tmp_buf;
MPID_Op *op_ptr;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(2);
MPIU_THREADPRIV_DECL;
if (count == 0) return MPI_SUCCESS;
MPIU_THREADPRIV_GET;
-
- comm = comm_ptr->handle;
+
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -157,7 +155,7 @@ int MPIR_Exscan (
mpi_errno = MPIC_Sendrecv(partial_scan, count, datatype,
dst, MPIR_EXSCAN_TAG, tmp_buf,
count, datatype, dst,
- MPIR_EXSCAN_TAG, comm,
+ MPIR_EXSCAN_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index fa8a983..ee6384f 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -99,7 +99,6 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *tmp_buf=NULL;
MPI_Status status;
MPI_Aint extent=0; /* Datatype extent */
- MPI_Comm comm;
int blocks[2];
int displs[2];
MPI_Aint struct_displs[2];
@@ -110,8 +109,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#ifdef MPID_HAS_HETERO
int position, recv_size;
#endif
-
- comm = comm_ptr->handle;
+
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -222,7 +220,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
mpi_errno = MPIC_Recv(((char *)recvbuf +
(((rank + mask) % comm_size)*recvcount*extent)),
recvblks * recvcount, recvtype, src,
- MPIR_GATHER_TAG, comm,
+ MPIR_GATHER_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -233,7 +231,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
mpi_errno = MPIC_Recv(tmp_buf, recvblks * nbytes, MPI_BYTE,
- src, MPIR_GATHER_TAG, comm, &status, errflag);
+ src, MPIR_GATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -256,7 +254,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPIC_Recv(recvbuf, 1, tmp_type, src,
- MPIR_GATHER_TAG, comm, &status, errflag);
+ MPIR_GATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -283,7 +281,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
offset = (mask - 1) * nbytes;
mpi_errno = MPIC_Recv(((char *)tmp_buf + offset),
recvblks * nbytes, MPI_BYTE, src,
- MPIR_GATHER_TAG, comm,
+ MPIR_GATHER_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -304,7 +302,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
/* leaf nodes send directly from sendbuf */
mpi_errno = MPIC_Send(sendbuf, sendcount, sendtype, dst,
- MPIR_GATHER_TAG, comm, errflag);
+ MPIR_GATHER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -314,7 +312,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
else if (nbytes < MPIR_CVAR_GATHER_VSMALL_MSG_SIZE) {
mpi_errno = MPIC_Send(tmp_buf, curr_cnt, MPI_BYTE, dst,
- MPIR_GATHER_TAG, comm, errflag);
+ MPIR_GATHER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -337,7 +335,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPIC_Send(MPI_BOTTOM, 1, tmp_type, dst,
- MPIR_GATHER_TAG, comm, errflag);
+ MPIR_GATHER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -409,7 +407,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
src = (src + root) % comm_size;
mpi_errno = MPIC_Recv(((char *)tmp_buf + curr_cnt),
tmp_buf_size-curr_cnt, MPI_BYTE, src,
- MPIR_GATHER_TAG, comm,
+ MPIR_GATHER_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -429,7 +427,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
dst = relative_rank ^ mask;
dst = (dst + root) % comm_size;
mpi_errno = MPIC_Send(tmp_buf, curr_cnt, MPI_BYTE, dst,
- MPIR_GATHER_TAG, comm, errflag);
+ MPIR_GATHER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -512,7 +510,6 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPI_Aint extent, true_extent, true_lb = 0;
void *tmp_buf=NULL;
MPID_Comm *newcomm_ptr = NULL;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(1);
if (root == MPI_PROC_NULL)
@@ -523,7 +520,6 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
- comm = comm_ptr->handle;
remote_size = comm_ptr->remote_size;
local_size = comm_ptr->local_size;
@@ -545,7 +541,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
/* root receives data from rank 0 on remote group */
mpi_errno = MPIC_Recv(recvbuf, recvcount*remote_size,
- recvtype, 0, MPIR_GATHER_TAG, comm,
+ recvtype, 0, MPIR_GATHER_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -597,7 +593,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
mpi_errno = MPIC_Send(tmp_buf, sendcount*local_size,
sendtype, root,
- MPIR_GATHER_TAG, comm, errflag);
+ MPIR_GATHER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -620,7 +616,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
mpi_errno = MPIC_Recv(((char *)recvbuf+recvcount*i*extent),
recvcount, recvtype, i,
- MPIR_GATHER_TAG, comm, &status, errflag);
+ MPIR_GATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -632,7 +628,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
else
{
mpi_errno = MPIC_Send(sendbuf,sendcount,sendtype,root,
- MPIR_GATHER_TAG,comm, errflag);
+ MPIR_GATHER_TAG,comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/gatherv.c b/src/mpi/coll/gatherv.c
index d1b6f94..0f8d81a 100644
--- a/src/mpi/coll/gatherv.c
+++ b/src/mpi/coll/gatherv.c
@@ -88,15 +88,13 @@ int MPIR_Gatherv (
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- MPI_Comm comm;
MPI_Aint extent;
int i, reqs;
int min_procs;
- MPI_Request *reqarray;
+ MPID_Request **reqarray;
MPI_Status *starray;
MPIU_CHKLMEM_DECL(2);
-
- comm = comm_ptr->handle;
+
rank = comm_ptr->rank;
/* check if multiple threads are calling this collective function */
@@ -115,7 +113,7 @@ int MPIR_Gatherv (
MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT recvbuf +
displs[rank] * extent);
- MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request *, comm_size * sizeof(MPI_Request), mpi_errno, "reqarray");
+ MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request **, comm_size * sizeof(MPID_Request *), mpi_errno, "reqarray");
MPIU_CHKLMEM_MALLOC(starray, MPI_Status *, comm_size * sizeof(MPI_Status), mpi_errno, "starray");
reqs = 0;
@@ -132,7 +130,7 @@ int MPIR_Gatherv (
else {
mpi_errno = MPIC_Irecv(((char *)recvbuf+displs[i]*extent),
recvcounts[i], recvtype, i,
- MPIR_GATHERV_TAG, comm,
+ MPIR_GATHERV_TAG, comm_ptr,
&reqarray[reqs++]);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
@@ -174,7 +172,7 @@ int MPIR_Gatherv (
if (comm_size >= min_procs) {
mpi_errno = MPIC_Ssend(sendbuf, sendcount, sendtype, root,
- MPIR_GATHERV_TAG, comm, errflag);
+ MPIR_GATHERV_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -184,7 +182,7 @@ int MPIR_Gatherv (
}
else {
mpi_errno = MPIC_Send(sendbuf, sendcount, sendtype, root,
- MPIR_GATHERV_TAG, comm, errflag);
+ MPIR_GATHERV_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 3244496..e5e8d06 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -9,6 +9,9 @@
#include "datatype.h"
#define COPY_BUFFER_SZ 16384
+#if !defined(MPIC_REQUEST_PTR_ARRAY_SIZE)
+#define MPIC_REQUEST_PTR_ARRAY_SIZE 64
+#endif
/* These functions are used in the implementation of collective
operations. They are wrappers around MPID send/recv functions. They do
@@ -267,12 +270,11 @@ int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag)
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
- MPI_Comm comm, mpir_errflag_t *errflag)
+ MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
MPID_Request *request_ptr = NULL;
- MPID_Comm *comm_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIC_SEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SEND);
@@ -291,7 +293,6 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
MPIR_TAG_SET_ERROR_BIT(tag);
}
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
@@ -327,13 +328,12 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
- MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag)
+ MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
MPI_Status mystatus;
MPID_Request *request_ptr = NULL;
- MPID_Comm *comm_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIC_RECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_RECV);
@@ -343,7 +343,6 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", count);
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
@@ -385,12 +384,11 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
- MPI_Comm comm, mpir_errflag_t *errflag)
+ MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
MPID_Request *request_ptr = NULL;
- MPID_Comm *comm_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIC_SSEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SSEND);
@@ -400,7 +398,6 @@ int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int
MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", count);
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
@@ -447,13 +444,12 @@ int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int
int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
- MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag)
+ MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
MPI_Status mystatus;
MPID_Request *recv_req_ptr = NULL, *send_req_ptr = NULL;
- MPID_Comm *comm_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIC_SENDRECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SENDRECV);
@@ -465,7 +461,6 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPIU_ERR_CHKANDJUMP1((recvcount < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", recvcount);
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
@@ -527,7 +522,7 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
- MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag)
+ MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
MPI_Status mystatus;
@@ -537,7 +532,6 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
void *tmpbuf = NULL;
MPI_Aint tmpbuf_size = 0;
MPI_Aint tmpbuf_count = 0;
- MPID_Comm *comm_ptr;
MPIU_CHKLMEM_DECL(1);
MPIDI_STATE_DECL(MPID_STATE_MPIC_SENDRECV_REPLACE);
#ifdef MPID_LOG_ARROWS
@@ -562,7 +556,6 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
MPIR_TAG_SET_ERROR_BIT(sendtag);
}
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id_offset = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
@@ -625,12 +618,10 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
- MPI_Comm comm, MPI_Request *request, mpir_errflag_t *errflag)
+ MPID_Comm *comm_ptr, MPID_Request **request_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
- MPID_Request *request_ptr = NULL;
- MPID_Comm *comm_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIC_ISEND);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_ISEND);
@@ -649,16 +640,13 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
MPIR_TAG_SET_ERROR_BIT(tag);
}
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
mpi_errno = MPID_Isend(buf, count, datatype, dest, tag, comm_ptr,
- context_id, &request_ptr);
+ context_id, request_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- *request = request_ptr->handle;
-
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_ISEND);
return mpi_errno;
@@ -671,12 +659,10 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
- int tag, MPI_Comm comm, MPI_Request *request)
+ int tag, MPID_Comm *comm_ptr, MPID_Request **request_ptr)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
- MPID_Request *request_ptr = NULL;
- MPID_Comm *comm_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIC_IRECV);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_IRECV);
@@ -684,16 +670,13 @@ int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", count);
- MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
mpi_errno = MPID_Irecv(buf, count, datatype, source, tag, comm_ptr,
- context_id, &request_ptr);
+ context_id, request_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- *request = request_ptr->handle;
-
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_IRECV);
return mpi_errno;
@@ -706,34 +689,53 @@ int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
#define FUNCNAME MPIC_Waitall
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIC_Waitall(int numreq, MPI_Request requests[], MPI_Status statuses[], mpir_errflag_t *errflag)
+int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int i;
+ MPI_Request request_ptr_array[MPIC_REQUEST_PTR_ARRAY_SIZE];
+ MPI_Request *request_ptrs = request_ptr_array;
+ MPI_Status status_static_array[MPIC_REQUEST_PTR_ARRAY_SIZE];
+ MPI_Status *status_array = statuses;
MPIDI_STATE_DECL(MPID_STATE_MPIC_WAITALL);
+ MPIU_CHKLMEM_DECL(2);
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_WAITALL);
- MPIU_Assert(statuses != MPI_STATUSES_IGNORE);
-
MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
- /* The MPI_TAG field is not set for send operations, so if we want
- to check for the error bit in the tag below, we should initialize all
- tag fields here. */
- for (i = 0; i < numreq; ++i)
- statuses[i].MPI_TAG = 0;
+ if (statuses == MPI_STATUSES_IGNORE) {
+ status_array = status_static_array;
+ }
- mpi_errno = MPIR_Waitall_impl(numreq, requests, statuses);
+ if (numreq > MPIC_REQUEST_PTR_ARRAY_SIZE) {
+ MPIU_CHKLMEM_MALLOC(request_ptrs, MPI_Request *, numreq * sizeof(MPI_Request), mpi_errno, "request pointers");
+ MPIU_CHKLMEM_MALLOC(status_array, MPI_Status *, numreq * sizeof(MPI_Status), mpi_errno, "status objects");
+ }
+
+ for (i = 0; i < numreq; ++i) {
+ /* The MPI_TAG field is not set for send operations, so if we want
+ to check for the error bit in the tag below, we should initialize all
+ tag fields here. */
+ status_array[i].MPI_TAG = 0;
+
+ /* Convert the MPID_Request objects to MPI_Request objects */
+ request_ptrs[i] = requests[i]->handle;
+ }
+
+ mpi_errno = MPIR_Waitall_impl(numreq, request_ptrs, status_array);
/* The errflag value here is for all requests, not just a single one. If
* in the future, this function is used for multiple collectives at a
* single time, we may have to change that. */
for (i = 0; i < numreq; ++i) {
- MPIR_Process_status(&statuses[i], errflag);
+ MPIR_Process_status(&status_array[i], errflag);
}
fn_exit:
+ if (numreq > MPIC_REQUEST_PTR_ARRAY_SIZE)
+ MPIU_CHKLMEM_FREEALL();
+
MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_WAITALL);
return mpi_errno;
diff --git a/src/mpi/coll/igather.c b/src/mpi/coll/igather.c
index 5fa603a..7e126fc 100644
--- a/src/mpi/coll/igather.c
+++ b/src/mpi/coll/igather.c
@@ -319,7 +319,7 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
src = (src + root) % comm_size;
mpi_errno = MPIC_Recv(((char *)tmp_buf + curr_cnt),
tmp_buf_size-curr_cnt, MPI_BYTE, src,
- MPIR_GATHER_TAG, comm,
+ MPIR_GATHER_TAG, comm_ptr,
&status, errflag);
/* the recv size is larger than what may be sent in
some cases. query amount of data actually received */
@@ -333,7 +333,7 @@ int MPIR_Igather_binomial(const void *sendbuf, int sendcount, MPI_Datatype sendt
dst = relative_rank ^ mask;
dst = (dst + root) % comm_size;
mpi_errno = MPIC_Send(tmp_buf, curr_cnt, MPI_BYTE, dst,
- MPIR_GATHER_TAG, comm, errflag);
+ MPIR_GATHER_TAG, comm_ptr, errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
break;
}
diff --git a/src/mpi/coll/iscatter.c b/src/mpi/coll/iscatter.c
index 3d842bc..9710a9f 100644
--- a/src/mpi/coll/iscatter.c
+++ b/src/mpi/coll/iscatter.c
@@ -364,7 +364,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
if (src < 0) src += comm_size;
mpi_errno = MPIC_Recv(tmp_buf, tmp_buf_size, MPI_BYTE, src,
- MPIR_SCATTER_TAG, comm, &status, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -395,7 +395,7 @@ int MPIR_Iscatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtyp
/* mask is also the size of this process's subtree */
mpi_errno = MPIC_Send(((char *)tmp_buf + nbytes*mask),
send_subtree_cnt, MPI_BYTE, dst,
- MPIR_SCATTER_TAG, comm, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/red_scat.c b/src/mpi/coll/red_scat.c
index fa7105b..40d9ad6 100644
--- a/src/mpi/coll/red_scat.c
+++ b/src/mpi/coll/red_scat.c
@@ -73,7 +73,6 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
void *tmp_buf0;
void *tmp_buf1;
void *result_ptr;
- MPI_Comm comm = comm_ptr->handle;
MPIU_CHKLMEM_DECL(3);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
@@ -136,7 +135,7 @@ static int MPIR_Reduce_scatter_noncomm(const void *sendbuf, void *recvbuf, const
size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
incoming_data + recv_offset*true_extent,
size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
- comm, MPI_STATUS_IGNORE, errflag);
+ comm_ptr, MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -257,11 +256,9 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
MPI_Datatype sendtype, recvtype;
int nprocs_completed, tmp_mask, tree_root, is_commutative;
MPID_Op *op_ptr;
- MPI_Comm comm;
MPIU_THREADPRIV_DECL;
MPIU_CHKLMEM_DECL(5);
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -345,7 +342,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
if (rank % 2 == 0) { /* even */
mpi_errno = MPIC_Send(tmp_results, total_count,
datatype, rank+1,
- MPIR_REDUCE_SCATTER_TAG, comm, errflag);
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -361,7 +358,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
else { /* odd */
mpi_errno = MPIC_Recv(tmp_recvbuf, total_count,
datatype, rank-1,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -444,20 +441,20 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
(char *) tmp_recvbuf +
newdisps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
else if ((send_cnt == 0) && (recv_cnt != 0))
mpi_errno = MPIC_Recv((char *) tmp_recvbuf +
newdisps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
else if ((recv_cnt == 0) && (send_cnt != 0))
mpi_errno = MPIC_Send((char *) tmp_results +
newdisps[send_idx]*extent,
send_cnt, datatype,
dst, MPIR_REDUCE_SCATTER_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -502,7 +499,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
mpi_errno = MPIC_Send((char *) tmp_results +
disps[rank-1]*extent, recvcounts[rank-1],
datatype, rank-1,
- MPIR_REDUCE_SCATTER_TAG, comm, errflag);
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -515,7 +512,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
if (recvcounts[rank]) {
mpi_errno = MPIC_Recv(recvbuf, recvcounts[rank],
datatype, rank+1,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -557,14 +554,14 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
recvcounts[dst], datatype, dst,
MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
recvcounts[rank], datatype, src,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
else
mpi_errno = MPIC_Sendrecv(((char *)recvbuf+disps[dst]*extent),
recvcounts[dst], datatype, dst,
MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
recvcounts[rank], datatype, src,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
@@ -740,7 +737,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
mpi_errno = MPIC_Sendrecv(tmp_results, 1, sendtype, dst,
MPIR_REDUCE_SCATTER_TAG,
tmp_recvbuf, 1, recvtype, dst,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ MPIR_REDUCE_SCATTER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
received = 1;
if (mpi_errno) {
@@ -789,7 +786,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
/* send the current result */
mpi_errno = MPIC_Send(tmp_recvbuf, 1, recvtype,
dst, MPIR_REDUCE_SCATTER_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -804,7 +801,7 @@ int MPIR_Reduce_scatter_intra(const void *sendbuf, void *recvbuf, const int recv
(rank >= tree_root + nprocs_completed)) {
mpi_errno = MPIC_Recv(tmp_recvbuf, 1, recvtype, dst,
MPIR_REDUCE_SCATTER_TAG,
- comm, MPI_STATUS_IGNORE, errflag);
+ comm_ptr, MPI_STATUS_IGNORE, errflag);
received = 1;
if (mpi_errno) {
/* for communication errors, just record the error but continue */
diff --git a/src/mpi/coll/red_scat_block.c b/src/mpi/coll/red_scat_block.c
index fdab92e..3f28151 100644
--- a/src/mpi/coll/red_scat_block.c
+++ b/src/mpi/coll/red_scat_block.c
@@ -69,7 +69,6 @@ static int MPIR_Reduce_scatter_block_noncomm (
void *tmp_buf0;
void *tmp_buf1;
void *result_ptr;
- MPI_Comm comm = comm_ptr->handle;
MPIU_CHKLMEM_DECL(3);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
@@ -128,7 +127,7 @@ static int MPIR_Reduce_scatter_block_noncomm (
size, datatype, peer, MPIR_REDUCE_SCATTER_BLOCK_TAG,
incoming_data + recv_offset*true_extent,
size, datatype, peer, MPIR_REDUCE_SCATTER_BLOCK_TAG,
- comm, MPI_STATUS_IGNORE, errflag);
+ comm_ptr, MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -257,11 +256,9 @@ int MPIR_Reduce_scatter_block_intra (
MPI_Datatype sendtype, recvtype;
int nprocs_completed, tmp_mask, tree_root, is_commutative;
MPID_Op *op_ptr;
- MPI_Comm comm;
MPIU_THREADPRIV_DECL;
MPIU_CHKLMEM_DECL(5);
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -344,7 +341,7 @@ int MPIR_Reduce_scatter_block_intra (
if (rank % 2 == 0) { /* even */
mpi_errno = MPIC_Send(tmp_results, total_count,
datatype, rank+1,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm, errflag);
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -360,7 +357,7 @@ int MPIR_Reduce_scatter_block_intra (
else { /* odd */
mpi_errno = MPIC_Recv(tmp_recvbuf, total_count,
datatype, rank-1,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -443,20 +440,20 @@ int MPIR_Reduce_scatter_block_intra (
(char *) tmp_recvbuf +
newdisps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
else if ((send_cnt == 0) && (recv_cnt != 0))
mpi_errno = MPIC_Recv((char *) tmp_recvbuf +
newdisps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
else if ((recv_cnt == 0) && (send_cnt != 0))
mpi_errno = MPIC_Send((char *) tmp_results +
newdisps[send_idx]*extent,
send_cnt, datatype,
dst, MPIR_REDUCE_SCATTER_BLOCK_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -497,12 +494,12 @@ int MPIR_Reduce_scatter_block_intra (
mpi_errno = MPIC_Send((char *) tmp_results +
disps[rank-1]*extent, recvcount,
datatype, rank-1,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm, errflag);
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr, errflag);
}
else { /* even */
mpi_errno = MPIC_Recv(recvbuf, recvcount,
datatype, rank+1,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
}
if (mpi_errno) {
@@ -543,14 +540,14 @@ int MPIR_Reduce_scatter_block_intra (
recvcount, datatype, dst,
MPIR_REDUCE_SCATTER_BLOCK_TAG, tmp_recvbuf,
recvcount, datatype, src,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
else
mpi_errno = MPIC_Sendrecv(((char *)recvbuf+disps[dst]*extent),
recvcount, datatype, dst,
MPIR_REDUCE_SCATTER_BLOCK_TAG, tmp_recvbuf,
recvcount, datatype, src,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
@@ -715,7 +712,7 @@ int MPIR_Reduce_scatter_block_intra (
mpi_errno = MPIC_Sendrecv(tmp_results, 1, sendtype, dst,
MPIR_REDUCE_SCATTER_BLOCK_TAG,
tmp_recvbuf, 1, recvtype, dst,
- MPIR_REDUCE_SCATTER_BLOCK_TAG, comm,
+ MPIR_REDUCE_SCATTER_BLOCK_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
received = 1;
if (mpi_errno) {
@@ -764,7 +761,7 @@ int MPIR_Reduce_scatter_block_intra (
/* send the current result */
mpi_errno = MPIC_Send(tmp_recvbuf, 1, recvtype,
dst, MPIR_REDUCE_SCATTER_BLOCK_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -779,7 +776,7 @@ int MPIR_Reduce_scatter_block_intra (
(rank >= tree_root + nprocs_completed)) {
mpi_errno = MPIC_Recv(tmp_recvbuf, 1, recvtype, dst,
MPIR_REDUCE_SCATTER_BLOCK_TAG,
- comm, MPI_STATUS_IGNORE, errflag);
+ comm_ptr, MPI_STATUS_IGNORE, errflag);
received = 1;
if (mpi_errno) {
/* for communication errors, just record the error but continue */
diff --git a/src/mpi/coll/reduce.c b/src/mpi/coll/reduce.c
index b5cdaa9..1be40f9 100644
--- a/src/mpi/coll/reduce.c
+++ b/src/mpi/coll/reduce.c
@@ -93,12 +93,10 @@ static int MPIR_Reduce_binomial (
int mask, relrank, source, lroot;
MPI_Aint true_lb, true_extent, extent;
void *tmp_buf;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(2);
if (count == 0) return MPI_SUCCESS;
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -181,7 +179,7 @@ static int MPIR_Reduce_binomial (
if (source < comm_size) {
source = (source + lroot) % comm_size;
mpi_errno = MPIC_Recv(tmp_buf, count, datatype, source,
- MPIR_REDUCE_TAG, comm, &status, errflag);
+ MPIR_REDUCE_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -210,7 +208,7 @@ static int MPIR_Reduce_binomial (
my parent */
source = ((relrank & (~ mask)) + lroot) % comm_size;
mpi_errno = MPIC_Send(recvbuf, count, datatype,
- source, MPIR_REDUCE_TAG, comm, errflag);
+ source, MPIR_REDUCE_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -227,12 +225,12 @@ static int MPIR_Reduce_binomial (
if (rank == 0)
{
mpi_errno = MPIC_Send(recvbuf, count, datatype, root,
- MPIR_REDUCE_TAG, comm, errflag);
+ MPIR_REDUCE_TAG, comm_ptr, errflag);
}
else if (rank == root)
{
mpi_errno = MPIC_Recv(recvbuf, count, datatype, 0,
- MPIR_REDUCE_TAG, comm, &status, errflag);
+ MPIR_REDUCE_TAG, comm_ptr, &status, errflag);
}
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -302,11 +300,10 @@ static int MPIR_Reduce_redscat_gather (
int dst, send_cnt, recv_cnt, newroot, newdst_tree_root, newroot_tree_root;
MPI_Aint true_lb, true_extent, extent;
void *tmp_buf;
- MPI_Comm comm;
+
MPIU_CHKLMEM_DECL(4);
MPIU_THREADPRIV_DECL;
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -373,7 +370,7 @@ static int MPIR_Reduce_redscat_gather (
if (rank % 2 != 0) { /* odd */
mpi_errno = MPIC_Send(recvbuf, count,
datatype, rank-1,
- MPIR_REDUCE_TAG, comm, errflag);
+ MPIR_REDUCE_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -389,7 +386,7 @@ static int MPIR_Reduce_redscat_gather (
else { /* even */
mpi_errno = MPIC_Recv(tmp_buf, count,
datatype, rank+1,
- MPIR_REDUCE_TAG, comm,
+ MPIR_REDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -464,7 +461,7 @@ static int MPIR_Reduce_redscat_gather (
(char *) tmp_buf +
disps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_REDUCE_TAG, comm,
+ MPIR_REDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -513,7 +510,7 @@ static int MPIR_Reduce_redscat_gather (
disps[i] = disps[i-1] + cnts[i-1];
mpi_errno = MPIC_Recv(recvbuf, cnts[0], datatype,
- 0, MPIR_REDUCE_TAG, comm,
+ 0, MPIR_REDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -527,7 +524,7 @@ static int MPIR_Reduce_redscat_gather (
}
else if (newrank == 0) { /* send */
mpi_errno = MPIC_Send(recvbuf, cnts[0], datatype,
- root, MPIR_REDUCE_TAG, comm, errflag);
+ root, MPIR_REDUCE_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -601,7 +598,7 @@ static int MPIR_Reduce_redscat_gather (
disps[send_idx]*extent,
send_cnt, datatype,
dst, MPIR_REDUCE_TAG,
- comm, errflag);
+ comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -617,7 +614,7 @@ static int MPIR_Reduce_redscat_gather (
mpi_errno = MPIC_Recv((char *) recvbuf +
disps[recv_idx]*extent,
recv_cnt, datatype, dst,
- MPIR_REDUCE_TAG, comm,
+ MPIR_REDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -929,7 +926,6 @@ int MPIR_Reduce_inter (
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf=NULL;
MPID_Comm *newcomm_ptr = NULL;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(1);
if (root == MPI_PROC_NULL) {
@@ -938,13 +934,12 @@ int MPIR_Reduce_inter (
}
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
-
- comm = comm_ptr->handle;
+
if (root == MPI_ROOT) {
/* root receives data from rank 0 on remote group */
mpi_errno = MPIC_Recv(recvbuf, count, datatype, 0,
- MPIR_REDUCE_TAG, comm, &status, errflag);
+ MPIR_REDUCE_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -993,7 +988,7 @@ int MPIR_Reduce_inter (
if (rank == 0)
{
mpi_errno = MPIC_Send(tmp_buf, count, datatype, root,
- MPIR_REDUCE_TAG, comm, errflag);
+ MPIR_REDUCE_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/scan.c b/src/mpi/coll/scan.c
index 05df09b..ee3bf89 100644
--- a/src/mpi/coll/scan.c
+++ b/src/mpi/coll/scan.c
@@ -86,7 +86,6 @@ static int MPIR_Scan_generic (
MPI_Aint true_extent, true_lb, extent;
void *partial_scan, *tmp_buf;
MPID_Op *op_ptr;
- MPI_Comm comm;
MPIU_THREADPRIV_DECL;
MPIU_CHKLMEM_DECL(2);
@@ -95,7 +94,6 @@ static int MPIR_Scan_generic (
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
- comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -157,7 +155,7 @@ static int MPIR_Scan_generic (
mpi_errno = MPIC_Sendrecv(partial_scan, count, datatype,
dst, MPIR_SCAN_TAG, tmp_buf,
count, datatype, dst,
- MPIR_SCAN_TAG, comm,
+ MPIR_SCAN_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -305,7 +303,7 @@ int MPIR_Scan(
{
mpi_errno = MPIC_Recv(localfulldata, count, datatype,
comm_ptr->node_comm->local_size - 1, MPIR_SCAN_TAG,
- comm_ptr->node_comm->handle, &status, errflag);
+ comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -318,7 +316,7 @@ int MPIR_Scan(
MPIU_Get_intranode_rank(comm_ptr, rank) == comm_ptr->node_comm->local_size - 1)
{
mpi_errno = MPIC_Send(recvbuf, count, datatype,
- 0, MPIR_SCAN_TAG, comm_ptr->node_comm->handle, errflag);
+ 0, MPIR_SCAN_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -351,7 +349,7 @@ int MPIR_Scan(
{
mpi_errno = MPIC_Send(prefulldata, count, datatype,
MPIU_Get_internode_rank(comm_ptr, rank) + 1,
- MPIR_SCAN_TAG, comm_ptr->node_roots_comm->handle, errflag);
+ MPIR_SCAN_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -362,9 +360,8 @@ int MPIR_Scan(
if (MPIU_Get_internode_rank(comm_ptr, rank) != 0)
{
mpi_errno = MPIC_Recv(tempbuf, count, datatype,
- MPIU_Get_internode_rank(comm_ptr, rank) - 1,
- MPIR_SCAN_TAG, comm_ptr->node_roots_comm->handle,
- &status, errflag);
+ MPIU_Get_internode_rank(comm_ptr, rank) - 1,
+ MPIR_SCAN_TAG, comm_ptr, &status, errflag);
noneed = 0;
if (mpi_errno) {
/* for communication errors, just record the error but continue */
diff --git a/src/mpi/coll/scatter.c b/src/mpi/coll/scatter.c
index 94d9587..ee5f0b7 100644
--- a/src/mpi/coll/scatter.c
+++ b/src/mpi/coll/scatter.c
@@ -85,10 +85,8 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
void *tmp_buf=NULL;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(4);
-
- comm = comm_ptr->handle;
+
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
@@ -184,7 +182,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
receive data into a temporary buffer. */
if (relative_rank % 2) {
mpi_errno = MPIC_Recv(recvbuf, recvcount, recvtype,
- src, MPIR_SCATTER_TAG, comm,
+ src, MPIR_SCATTER_TAG, comm_ptr,
&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -195,7 +193,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
}
else {
mpi_errno = MPIC_Recv(tmp_buf, tmp_buf_size, MPI_BYTE, src,
- MPIR_SCATTER_TAG, comm, &status, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -231,7 +229,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
extent * sendcount * mask),
send_subtree_cnt,
sendtype, dst,
- MPIR_SCATTER_TAG, comm, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, errflag);
}
else
{
@@ -241,7 +239,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
mpi_errno = MPIC_Send(((char *)tmp_buf + nbytes*mask),
send_subtree_cnt,
MPI_BYTE, dst,
- MPIR_SCATTER_TAG, comm, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, errflag);
}
if (mpi_errno) {
/* for communication errors, just record the error but continue */
@@ -349,7 +347,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
if (src < 0) src += comm_size;
mpi_errno = MPIC_Recv(tmp_buf, tmp_buf_size, MPI_BYTE, src,
- MPIR_SCATTER_TAG, comm, &status, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -380,7 +378,7 @@ int MPIR_Scatter_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype
/* mask is also the size of this process's subtree */
mpi_errno = MPIC_Send(((char *)tmp_buf + nbytes*mask),
send_subtree_cnt, MPI_BYTE, dst,
- MPIR_SCATTER_TAG, comm, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -442,7 +440,6 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
MPI_Aint extent, true_extent, true_lb = 0;
void *tmp_buf=NULL;
MPID_Comm *newcomm_ptr = NULL;
- MPI_Comm comm;
MPIU_CHKLMEM_DECL(1);
if (root == MPI_PROC_NULL) {
@@ -450,8 +447,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
return MPI_SUCCESS;
}
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
-
- comm = comm_ptr->handle;
+
remote_size = comm_ptr->remote_size;
local_size = comm_ptr->local_size;
@@ -469,7 +465,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
if (root == MPI_ROOT) {
/* root sends all data to rank 0 on remote group and returns */
mpi_errno = MPIC_Send(sendbuf, sendcount*remote_size,
- sendtype, 0, MPIR_SCATTER_TAG, comm, errflag);
+ sendtype, 0, MPIR_SCATTER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -499,7 +495,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
mpi_errno = MPIC_Recv(tmp_buf, recvcount*local_size,
recvtype, root,
- MPIR_SCATTER_TAG, comm, &status, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -533,7 +529,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
for (i=0; i<remote_size; i++) {
mpi_errno = MPIC_Send(((char *)sendbuf+sendcount*i*extent),
sendcount, sendtype, i,
- MPIR_SCATTER_TAG, comm, errflag);
+ MPIR_SCATTER_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
@@ -544,7 +540,7 @@ int MPIR_Scatter_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype
}
else {
mpi_errno = MPIC_Recv(recvbuf,recvcount,recvtype,root,
- MPIR_SCATTER_TAG,comm,&status, errflag);
+ MPIR_SCATTER_TAG,comm_ptr,&status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/coll/scatterv.c b/src/mpi/coll/scatterv.c
index 4aaacc3..16fc7cb 100644
--- a/src/mpi/coll/scatterv.c
+++ b/src/mpi/coll/scatterv.c
@@ -59,14 +59,12 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
{
int rank, comm_size, mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- MPI_Comm comm;
MPI_Aint extent;
int i, reqs;
- MPI_Request *reqarray;
+ MPID_Request **reqarray;
MPI_Status *starray;
MPIU_CHKLMEM_DECL(2);
- comm = comm_ptr->handle;
rank = comm_ptr->rank;
/* check if multiple threads are calling this collective function */
@@ -89,7 +87,7 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
* this? */
MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf + extent);
- MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request *, comm_size * sizeof(MPI_Request), mpi_errno, "reqarray");
+ MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request **, comm_size * sizeof(MPID_Request *), mpi_errno, "reqarray");
MPIU_CHKLMEM_MALLOC(starray, MPI_Status *, comm_size * sizeof(MPI_Status), mpi_errno, "starray");
reqs = 0;
@@ -106,7 +104,7 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
else {
mpi_errno = MPIC_Isend(((char *)sendbuf+displs[i]*extent),
sendcounts[i], sendtype, i,
- MPIR_SCATTERV_TAG, comm, &reqarray[reqs++], errflag);
+ MPIR_SCATTERV_TAG, comm_ptr, &reqarray[reqs++], errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
}
@@ -134,7 +132,7 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
else if (root != MPI_PROC_NULL) { /* non-root nodes, and in the intercomm. case, non-root nodes on remote side */
if (recvcount) {
mpi_errno = MPIC_Recv(recvbuf,recvcount,recvtype,root,
- MPIR_SCATTERV_TAG,comm,MPI_STATUS_IGNORE, errflag);
+ MPIR_SCATTERV_TAG,comm_ptr,MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
diff --git a/src/mpi/comm/comm_create.c b/src/mpi/comm/comm_create.c
index abcddde..9d9f100 100644
--- a/src/mpi/comm/comm_create.c
+++ b/src/mpi/comm/comm_create.c
@@ -313,7 +313,6 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
{
int mpi_errno = MPI_SUCCESS;
MPIR_Context_id_t new_context_id;
- MPI_Comm comm = comm_ptr->handle;
int *mapping = NULL;
int *remote_mapping = NULL;
int remote_size = -1;
@@ -387,7 +386,7 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
mpi_errno = MPIC_Sendrecv(info, 2, MPI_INT, 0, 0,
rinfo, 2, MPI_INT, 0, 0,
- comm, MPI_STATUS_IGNORE, &errflag );
+ comm_ptr, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
if (*newcomm_ptr != NULL) {
(*newcomm_ptr)->context_id = rinfo[0];
@@ -401,7 +400,7 @@ PMPI_LOCAL int MPIR_Comm_create_inter(MPID_Comm *comm_ptr, MPID_Group *group_ptr
/* Populate and exchange the ranks */
mpi_errno = MPIC_Sendrecv( mapping, group_ptr->size, MPI_INT, 0, 0,
remote_mapping, remote_size, MPI_INT, 0, 0,
- comm, MPI_STATUS_IGNORE, &errflag );
+ comm_ptr, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
/* Broadcast to the other members of the local group */
diff --git a/src/mpi/comm/comm_split.c b/src/mpi/comm/comm_split.c
index 31db2da..effa047 100644
--- a/src/mpi/comm/comm_split.c
+++ b/src/mpi/comm/comm_split.c
@@ -256,7 +256,7 @@ int MPIR_Comm_split_impl(MPID_Comm *comm_ptr, int color, int key, MPID_Comm **ne
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv( &new_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, 0,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE,
- 0, 0, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
+ 0, 0, comm_ptr, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) { MPIU_ERR_POP( mpi_errno ); }
mpi_errno = MPIR_Bcast_impl( &remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, local_comm_ptr, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpi/comm/commutil.c b/src/mpi/comm/commutil.c
index 171b9d2..cbe659e 100644
--- a/src/mpi/comm/commutil.c
+++ b/src/mpi/comm/commutil.c
@@ -1632,7 +1632,7 @@ int MPIR_Get_intercomm_contextid( MPID_Comm *comm_ptr, MPIR_Context_id_t *contex
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv( &mycontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, 0, tag,
- comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
+ comm_ptr, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
diff --git a/src/mpi/comm/intercomm_create.c b/src/mpi/comm/intercomm_create.c
index 41d1a34..69ba0c4 100644
--- a/src/mpi/comm/intercomm_create.c
+++ b/src/mpi/comm/intercomm_create.c
@@ -230,7 +230,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
remote_leader, cts_tag,
&remote_size, 1, MPI_INT,
remote_leader, cts_tag,
- peer_comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
+ peer_comm_ptr, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIU_DBG_MSG_FMT(COMM,VERBOSE,(MPIU_DBG_FDEST, "local size = %d, remote size = %d", local_size,
@@ -249,7 +249,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
mpi_errno = MPIC_Sendrecv( local_gpids, 2*local_size, MPI_INT,
remote_leader, cts_tag,
remote_gpids, 2*remote_size, MPI_INT,
- remote_leader, cts_tag, peer_comm_ptr->handle,
+ remote_leader, cts_tag, peer_comm_ptr,
MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -307,7 +307,7 @@ int MPIR_Intercomm_create_impl(MPID_Comm *local_comm_ptr, int local_leader,
mpi_errno = MPIC_Sendrecv( &recvcontext_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
&remote_context_id, 1, MPIR_CONTEXT_ID_T_DATATYPE, remote_leader, cts_tag,
- peer_comm_ptr->handle, MPI_STATUS_IGNORE, &errflag );
+ peer_comm_ptr, MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
final_context_id = remote_context_id;
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index 0b7b4a5..0b0a941 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -107,7 +107,7 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
/* This routine allows use to use the collective communication
context rather than the point-to-point context. */
mpi_errno = MPIC_Sendrecv( &local_high, 1, MPI_INT, 0, 0,
- &remote_high, 1, MPI_INT, 0, 0, comm_ptr->handle,
+ &remote_high, 1, MPI_INT, 0, 0, comm_ptr,
MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -121,7 +121,7 @@ int MPIR_Intercomm_merge_impl(MPID_Comm *comm_ptr, int high, MPID_Comm **new_int
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPIC_Sendrecv( ingpid, 2, MPI_INT, 0, 1,
- outgpid, 2, MPI_INT, 0, 1, comm_ptr->handle,
+ outgpid, 2, MPI_INT, 0, 1, comm_ptr,
MPI_STATUS_IGNORE, &errflag );
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpi/topo/dist_gr_create.c b/src/mpi/topo/dist_gr_create.c
index 5913b01..495d00a 100644
--- a/src/mpi/topo/dist_gr_create.c
+++ b/src/mpi/topo/dist_gr_create.c
@@ -75,7 +75,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Comm *comm_dist_graph_ptr = NULL;
- MPI_Request *reqs = NULL;
+ MPID_Request **reqs = NULL;
MPIR_Topology *topo_ptr = NULL;
MPIR_Dist_graph_topology *dist_graph_ptr = NULL;
int i;
@@ -271,16 +271,16 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
idx = 0;
/* must be 2*comm_size requests because we will possibly send inbound and
* outbound edges to everyone in our communicator */
- MPIU_CHKLMEM_MALLOC(reqs, MPI_Request *, 2*comm_size*sizeof(MPI_Request), mpi_errno, "temp request array");
+ MPIU_CHKLMEM_MALLOC(reqs, MPID_Request **, 2*comm_size*sizeof(MPID_Request *), mpi_errno, "temp request array");
for (i = 0; i < comm_size; ++i) {
if (rin_sizes[i]) {
/* send edges where i is a destination to process i */
- mpi_errno = MPIC_Isend(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_old, &reqs[idx++], &errflag);
+ mpi_errno = MPIC_Isend(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_ptr, &reqs[idx++], &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
if (rout_sizes[i]) {
/* send edges where i is a source to process i */
- mpi_errno = MPIC_Isend(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_old, &reqs[idx++], &errflag);
+ mpi_errno = MPIC_Isend(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_ptr, &reqs[idx++], &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
}
@@ -322,7 +322,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
buf = MPIU_Malloc(count*sizeof(int));
MPIU_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
- mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_A_TAG, comm_old, MPI_STATUS_IGNORE, &errflag);
+ mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_A_TAG, comm_ptr, MPI_STATUS_IGNORE, &errflag);
/* FIXME: buf is never freed on error! */
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -356,7 +356,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
buf = MPIU_Malloc(count*sizeof(int));
MPIU_ERR_CHKANDJUMP(!buf, mpi_errno, MPI_ERR_OTHER, "**nomem");
- mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_B_TAG, comm_old, MPI_STATUS_IGNORE, &errflag);
+ mpi_errno = MPIC_Recv(buf, count, MPI_INT, MPI_ANY_SOURCE, MPIR_TOPO_B_TAG, comm_ptr, MPI_STATUS_IGNORE, &errflag);
/* FIXME: buf is never freed on error! */
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -377,7 +377,7 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
MPIU_Free(buf);
}
- mpi_errno = MPIR_Waitall_impl(idx, reqs, MPI_STATUSES_IGNORE);
+ mpi_errno = MPIC_Waitall(idx, reqs, MPI_STATUSES_IGNORE, &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* remove any excess memory allocation */
diff --git a/src/mpid/ch3/src/ch3u_port.c b/src/mpid/ch3/src/ch3u_port.c
index cb6a1dc..6870f51 100644
--- a/src/mpid/ch3/src/ch3u_port.c
+++ b/src/mpid/ch3/src/ch3u_port.c
@@ -399,7 +399,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
send_ints[0], send_ints[1], send_ints[2]));
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
@@ -443,7 +443,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 2,
- MPI_INT, 0, recvtag++, tmp_comm->handle,
+ MPI_INT, 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
@@ -499,7 +499,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer");
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
@@ -705,7 +705,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
if (rank == root) {
/* First, receive the pg description from the partner */
mpi_errno = MPIC_Recv(&j, 1, MPI_INT, 0, recvtag++,
- tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
+ tmp_comm, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
@@ -715,7 +715,7 @@ static int ReceivePGAndDistribute( MPID_Comm *tmp_comm, MPID_Comm *comm_ptr,
MPIU_ERR_POP(mpi_errno);
}
mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++,
- tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
+ tmp_comm, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
@@ -884,7 +884,7 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
pg_iter = pg_list;
i = pg_iter->lenStr;
/*printf("connect:sending 1 int: %d\n", i);fflush(stdout);*/
- mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle, &errflag);
+ mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
@@ -892,7 +892,7 @@ static int SendPGtoPeerAndFree( MPID_Comm *tmp_comm, int *sendtag_p,
/* printf("connect:sending string length %d\n", i);fflush(stdout); */
mpi_errno = MPIC_Send(pg_iter->str, i, MPI_CHAR, 0, sendtag++,
- tmp_comm->handle, &errflag);
+ tmp_comm, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
@@ -997,7 +997,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
/*printf("accept:sending 3 ints, %d, %d, %d, and receiving 2 ints\n", send_ints[0], send_ints[1], send_ints[2]);fflush(stdout);*/
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
@@ -1037,7 +1037,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 2,
- MPI_INT, 0, recvtag++, tmp_comm->handle,
+ MPI_INT, 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
#ifdef MPICH_DBG_OUTPUT
MPIU_DBG_PRINTF(("[%d]accept:Received remote_translation:\n", rank));
@@ -1088,7 +1088,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer");
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpid/ch3/src/mpid_comm_agree.c b/src/mpid/ch3/src/mpid_comm_agree.c
index 5e77d52..ca0273e 100644
--- a/src/mpid/ch3/src/mpid_comm_agree.c
+++ b/src/mpid/ch3/src/mpid_comm_agree.c
@@ -77,7 +77,7 @@ int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, mpir_err
for (i = 0; i < nchildren; i++) {
if (children[i] == -1) continue;
mpi_errno = MPIC_Recv(&tmp_flag, 1, MPI_INT, children[i], MPIR_AGREE_TAG,
- comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ comm_ptr, MPI_STATUS_IGNORE, &errflag);
if (mpi_errno) return mpi_errno;
if (errflag) new_fail = 1;
@@ -88,12 +88,12 @@ int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, mpir_err
if (-1 != parent) {
/* Send my message to my parent */
mpi_errno = MPIC_Send(flag, 1, MPI_INT, parent, MPIR_AGREE_TAG,
- comm_ptr->handle, &errflag);
+ comm_ptr, &errflag);
if (mpi_errno) return mpi_errno;
/* Receive the result from my parent */
mpi_errno = MPIC_Recv(flag, 1, MPI_INT, parent, MPIR_AGREE_TAG,
- comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ comm_ptr, MPI_STATUS_IGNORE, &errflag);
if (mpi_errno) return mpi_errno;
if (errflag) new_fail = 1;
}
@@ -102,7 +102,7 @@ int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, mpir_err
for (i = 0; i < nchildren; i++) {
if (children[i] == -1) continue;
mpi_errno = MPIC_Send(flag, 1, MPI_INT, children[i], MPIR_AGREE_TAG,
- comm_ptr->handle, &errflag);
+ comm_ptr, &errflag);
if (mpi_errno) return mpi_errno;
}
diff --git a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
index 465d24f..015ddd9 100644
--- a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
+++ b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
@@ -116,7 +116,7 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
for (i = 1; i < comm_ptr->local_size; i++) {
/* Get everyone's list of failed processes to aggregate */
ret_errno = MPIC_Recv(remote_bitarray, bitarray_size, MPI_UINT32_T,
- i, tag, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ i, tag, comm_ptr, MPI_STATUS_IGNORE, &errflag);
if (ret_errno) continue;
/* Combine the received bitarray with my own */
@@ -130,7 +130,7 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
for (i = 1; i < comm_ptr->local_size; i++) {
/* Send the list to each rank to be processed locally */
ret_errno = MPIC_Send(bitarray, bitarray_size, MPI_UINT32_T, i,
- tag, comm_ptr->handle, &errflag);
+ tag, comm_ptr, &errflag);
if (ret_errno) continue;
}
@@ -139,11 +139,11 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
} else {
/* Send my bitarray to rank 0 */
mpi_errno = MPIC_Send(bitarray, bitarray_size, MPI_UINT32_T, 0,
- tag, comm_ptr->handle, &errflag);
+ tag, comm_ptr, &errflag);
/* Get the resulting bitarray back from rank 0 */
mpi_errno = MPIC_Recv(remote_bitarray, bitarray_size, MPI_UINT32_T, 0,
- tag, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ tag, comm_ptr, MPI_STATUS_IGNORE, &errflag);
/* Convert the bitarray into a group */
*failed_group = bitarray_to_group(comm_ptr, remote_bitarray);
diff --git a/src/mpid/pamid/src/dyntask/mpidi_port.c b/src/mpid/pamid/src/dyntask/mpidi_port.c
index 092d2dd..cab1c20 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_port.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_port.c
@@ -562,7 +562,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
TRACE_ERR("connect:sending 3 ints, %d, %d, %d, and receiving 2 ints with sendtag=%d recvtag=%d\n", send_ints[0], send_ints[1], send_ints[2], sendtag, recvtag);
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
@@ -571,7 +571,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
}
mpi_errno = MPIC_Sendrecv_replace(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
- sendtag++, 0, recvtag++, tmp_comm->handle,
+ sendtag++, 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
@@ -611,7 +611,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 3,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 3,
- MPI_INT, 0, recvtag++, tmp_comm->handle,
+ MPI_INT, 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
@@ -676,7 +676,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
{
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
@@ -823,14 +823,14 @@ static int MPIDI_ReceivePGAndDistribute( struct MPID_Comm *tmp_comm, struct MPID
if (rank == root) {
/* First, receive the pg description from the partner */
mpi_errno = MPIC_Recv(&j, 1, MPI_INT, 0, recvtag++,
- tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
+ tmp_comm, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Recv returned with mpi_errno=%d\n", mpi_errno);
}
pg_str = (char*)MPIU_Malloc(j);
mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++,
- tmp_comm->handle, MPI_STATUS_IGNORE, &errflag);
+ tmp_comm, MPI_STATUS_IGNORE, &errflag);
*recvtag_p = recvtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Recv returned with mpi_errno=%d\n", mpi_errno);
@@ -1094,7 +1094,7 @@ static int MPIDI_SendPGtoPeerAndFree( struct MPID_Comm *tmp_comm, int *sendtag_p
pg_iter = pg_list;
i = pg_iter->lenStr;
TRACE_ERR("connect:sending 1 int: %d\n", i);
- mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle, &errflag);
+ mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Send returned with mpi_errno=%d\n", mpi_errno);
@@ -1102,7 +1102,7 @@ static int MPIDI_SendPGtoPeerAndFree( struct MPID_Comm *tmp_comm, int *sendtag_p
TRACE_ERR("connect:sending string length %d\n", i);
mpi_errno = MPIC_Send(pg_iter->str, i, MPI_CHAR, 0, sendtag++,
- tmp_comm->handle, &errflag);
+ tmp_comm, &errflag);
*sendtag_p = sendtag;
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Send returned with mpi_errno=%d\n", mpi_errno);
@@ -1208,7 +1208,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
TRACE_ERR("accept:sending 3 ints, %d, %d, %d, and receiving 2 ints with sendtag=%d recvtag=%d\n", send_ints[0], send_ints[1], send_ints[2], sendtag, recvtag);
mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0,
sendtag++, recv_ints, 3, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
@@ -1218,14 +1218,14 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
TRACE_ERR("accept:sending 1 string and receiving 1 string\n", send_char, recv_char);
mpi_errno = MPIC_Sendrecv(send_char, 1, MPI_CHAR, 0,
sendtag++, recv_char, 3, MPI_CHAR,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
}
#endif
mpi_errno = MPIC_Sendrecv_replace(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
- sendtag++, 0, recvtag++, tmp_comm->handle,
+ sendtag++, 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
/* this is a no_port error because we may fail to connect
@@ -1266,7 +1266,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 3,
MPI_INT, 0, sendtag++,
remote_translation, remote_comm_size * 3,
- MPI_INT, 0, recvtag++, tmp_comm->handle,
+ MPI_INT, 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
for (i=0; i<remote_comm_size; i++)
{
@@ -1331,7 +1331,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
{
mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0,
sendtag++, &j, 0, MPI_INT,
- 0, recvtag++, tmp_comm->handle,
+ 0, recvtag++, tmp_comm,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
diff --git a/src/pmi/pmi2/poe/poe2pmi.c b/src/pmi/pmi2/poe/poe2pmi.c
index 7132716..e56ce1c 100644
--- a/src/pmi/pmi2/poe/poe2pmi.c
+++ b/src/pmi/pmi2/poe/poe2pmi.c
@@ -389,7 +389,7 @@ int _mpi_reduce_for_dyntask(int *sendbuf, int *recvbuf)
int numchildren, parent=0, i, result=0,tag, remaining_child_count;
MPID_Comm *comm_ptr;
int mpi_errno;
- int errflag = FALSE;
+ mpir_errflag_t errflag = MPIR_ERR_NONE;
int TASKS= world_size;
children = MPIU_Malloc(TASKS*sizeof(int));
@@ -413,7 +413,7 @@ int _mpi_reduce_for_dyntask(int *sendbuf, int *recvbuf)
remaining_child_count = i;
child_rank = (children[i])% TASKS;
TRACE_ERR("_mpi_reduce_for_dyntask - recv from child_rank%d child_taskid=%d\n", child_rank, pg_world->vct[child_rank].taskid);
- mpi_errno = MPIC_Recv(recvbuf, sizeof(int),MPI_BYTE, child_rank, tag, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
+ mpi_errno = MPIC_Recv(recvbuf, sizeof(int),MPI_BYTE, child_rank, tag, comm_ptr, MPI_STATUS_IGNORE, &errflag);
TRACE_ERR("_mpi_reduce_for_dyntask - recv DONE from child_rank%d child_taskid=%d\n", child_rank, pg_world->vct[child_rank].taskid);
if(world_rank != parent)
@@ -422,7 +422,7 @@ int _mpi_reduce_for_dyntask(int *sendbuf, int *recvbuf)
parent_rank = (parent) % TASKS;
result += *recvbuf;
TRACE_ERR("_mpi_reduce_for_dyntask - send to parent_rank=%d parent taskid=%d \n", parent_rank, pg_world->vct[parent_rank].taskid);
- MPIC_Send(&result, sizeof(int), MPI_BYTE, parent_rank, tag, comm_ptr->handle, &errflag);
+ MPIC_Send(&result, sizeof(int), MPI_BYTE, parent_rank, tag, comm_ptr, &errflag);
}
else
{
@@ -438,7 +438,7 @@ int _mpi_reduce_for_dyntask(int *sendbuf, int *recvbuf)
if(world_rank != parent && numchildren == 0) {
parent_rank = (parent) % TASKS;
TRACE_ERR("_mpi_reduce_for_dyntask - send to parent_rank=%d parent_task_id=%d\n", parent_rank, pg_world->vct[parent_rank].taskid);
- MPIC_Send(sendbuf, sizeof(int), MPI_BYTE, parent_rank, tag, comm_ptr->handle, &errflag);
+ MPIC_Send(sendbuf, sizeof(int), MPI_BYTE, parent_rank, tag, comm_ptr, &errflag);
}
if(world_rank == 0) {
http://git.mpich.org/mpich.git/commitdiff/c04f08514fddfd16996e913e3d18d32aa…
commit c04f08514fddfd16996e913e3d18d32aaed460f2
Author: Wesley Bland <wbland(a)anl.gov>
Date: Fri Jan 23 15:13:57 2015 -0600
Refactor MPIC_Wait to return an errflag
The collective helper functions generally have an errflag that is used
when a failure is detected to allow the collective to continue while
also communicating that a failure occurred. That flag is now included
as a parameter for MPIC_Wait.
The rest of this commit is the refactoring necessary in the rest of the
helper functions to support the change.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index e178615..c1439d3 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -3944,7 +3944,7 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
MPID_CONTEXT_INTRA(INTER)_COLL. */
int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype);
-int MPIC_Wait(MPID_Request * request_ptr);
+int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag);
int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
/* FT versions of te MPIC_ functions */
@@ -4558,6 +4558,29 @@ static inline int MPIR_Request_complete_fastpath(MPI_Request *request, MPID_Requ
return mpi_errno;
}
+/* Pull the error status out of the tag space and put it into an errflag. */
+#undef FUNCNAME
+#define FUNCNAME MPIR_process_status
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline void MPIR_Process_status(MPI_Status *status, mpir_errflag_t *errflag)
+{
+ if ((MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
+ MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
+ MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) && !*errflag) {
+ /* If the receive was completed within the MPID_Recv, handle the
+ * errflag here. */
+ if (MPIR_TAG_CHECK_PROC_FAILURE_BIT(status->MPI_TAG) ||
+ MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
+ *errflag = MPIR_ERR_PROC_FAILED;
+ MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
+ } else {
+ *errflag = MPIR_ERR_OTHER;
+ MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
+ }
+ }
+}
+
extern const char MPIR_Version_string[];
extern const char MPIR_Version_date[];
extern const char MPIR_Version_configure[];
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 4ea6202..3244496 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -200,12 +200,18 @@ int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FUNCNAME MPIC_Wait
#undef FCNAME
#define FCNAME "MPIC_Wait"
-int MPIC_Wait(MPID_Request * request_ptr)
+int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIC_WAIT);
MPIDI_PT2PT_FUNC_ENTER(MPID_STATE_MPIC_WAIT);
+
+ MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
+
+ if (request_ptr->kind == MPID_REQUEST_SEND)
+ request_ptr->status.MPI_TAG = 0;
+
if (!MPID_Request_is_complete(request_ptr))
{
MPID_Progress_state progress_state;
@@ -219,10 +225,19 @@ int MPIC_Wait(MPID_Request * request_ptr)
MPID_Progress_end(&progress_state);
}
- fn_fail:
- /* --BEGIN ERROR HANDLING-- */
+ if (request_ptr->kind == MPID_REQUEST_RECV &&
+ request_ptr->status.MPI_SOURCE == MPI_PROC_NULL)
+ goto fn_exit;
+
+ MPIR_Process_status(&request_ptr->status, errflag);
+
+ fn_exit:
+ MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
MPIDI_PT2PT_FUNC_EXIT(MPID_STATE_MPIC_WAIT);
return mpi_errno;
+ fn_fail:
+ /* --BEGIN ERROR HANDLING-- */
+ goto fn_exit;
/* --END ERROR HANDLING-- */
}
@@ -284,17 +299,25 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
context_id, &request_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
if (request_ptr) {
- mpi_errno = MPIC_Wait(request_ptr);
+ mpi_errno = MPIC_Wait(request_ptr, errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPID_Request_release(request_ptr);
}
fn_exit:
+ MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SEND);
return mpi_errno;
fn_fail:
/* --BEGIN ERROR HANDLING-- */
if (request_ptr) MPID_Request_release(request_ptr);
+ if (mpi_errno && !*errflag) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(mpi_errno)) {
+ *errflag = MPIR_ERR_PROC_FAILED;
+ } else {
+ *errflag = MPIR_ERR_OTHER;
+ }
+ }
goto fn_exit;
/* --END ERROR HANDLING-- */
}
@@ -331,29 +354,19 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
context_id, status, &request_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
if (request_ptr) {
- mpi_errno = MPIC_Wait(request_ptr);
+ mpi_errno = MPIC_Wait(request_ptr, errflag);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
*status = request_ptr->status;
mpi_errno = status->MPI_ERROR;
MPID_Request_release(request_ptr);
+ } else {
+ MPIR_Process_status(status, errflag);
}
- if (source != MPI_PROC_NULL) {
- if (MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
- MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
- MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
- if (MPIR_TAG_CHECK_PROC_FAILURE_BIT(status->MPI_TAG)) {
- *errflag = MPIR_ERR_PROC_FAILED;
- MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
- } else if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
- *errflag = MPIR_ERR_OTHER;
- MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
- }
- } else if (MPI_SUCCESS == MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
- MPIU_Assert(status->MPI_TAG == tag);
- }
+ if (MPI_SUCCESS == MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
+ MPIU_Assert(status->MPI_TAG == tag);
}
fn_exit:
@@ -404,17 +417,25 @@ int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int
context_id, &request_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
if (request_ptr) {
- mpi_errno = MPIC_Wait(request_ptr);
+ mpi_errno = MPIC_Wait(request_ptr, errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPID_Request_release(request_ptr);
}
fn_exit:
+ MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SSEND);
return mpi_errno;
fn_fail:
/* --BEGIN ERROR HANDLING-- */
if (request_ptr) MPID_Request_release(request_ptr);
+ if (mpi_errno && !*errflag) {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(mpi_errno)) {
+ *errflag = MPIR_ERR_PROC_FAILED;
+ } else {
+ *errflag = MPIR_ERR_OTHER;
+ }
+ }
goto fn_exit;
/* --END ERROR HANDLING-- */
}
@@ -465,33 +486,23 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
comm_ptr, context_id, &send_req_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPIC_Wait(send_req_ptr);
+ mpi_errno = MPIC_Wait(send_req_ptr, errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPIC_Wait(recv_req_ptr);
+ mpi_errno = MPIC_Wait(recv_req_ptr, errflag);
if (mpi_errno) MPIU_ERR_POPFATAL(mpi_errno);
*status = recv_req_ptr->status;
- mpi_errno = recv_req_ptr->status.MPI_ERROR;
- MPID_Request_release(send_req_ptr);
- MPID_Request_release(recv_req_ptr);
+ if (mpi_errno == MPI_SUCCESS) {
+ mpi_errno = recv_req_ptr->status.MPI_ERROR;
- if (source != MPI_PROC_NULL) {
- if (MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
- MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
- MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
- if (MPIR_TAG_CHECK_PROC_FAILURE_BIT(status->MPI_TAG)) {
- *errflag = MPIR_ERR_PROC_FAILED;
- MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
- } else if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
- *errflag = MPIR_ERR_OTHER;
- MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
- }
- } else if (MPI_SUCCESS == MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
- MPIU_Assert(status->MPI_TAG == recvtag);
+ if (mpi_errno == MPI_SUCCESS) {
+ mpi_errno = send_req_ptr->status.MPI_ERROR;
}
}
+ MPID_Request_release(send_req_ptr);
+ MPID_Request_release(recv_req_ptr);
fn_exit:
MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
@@ -521,8 +532,8 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int mpi_errno = MPI_SUCCESS;
MPI_Status mystatus;
MPIR_Context_id_t context_id_offset;
- MPID_Request *sreq;
- MPID_Request *rreq;
+ MPID_Request *sreq = NULL;
+ MPID_Request *rreq = NULL;
void *tmpbuf = NULL;
MPI_Aint tmpbuf_size = 0;
MPI_Aint tmpbuf_count = 0;
@@ -578,21 +589,10 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
/* --END ERROR HANDLING-- */
}
- if (!MPID_Request_is_complete(sreq) || !MPID_Request_is_complete(rreq)) {
- MPID_Progress_state progress_state;
-
- MPID_Progress_start(&progress_state);
- while (!MPID_Request_is_complete(sreq) || !MPID_Request_is_complete(rreq)) {
- mpi_errno = MPID_Progress_wait(&progress_state);
- if (mpi_errno != MPI_SUCCESS) {
- /* --BEGIN ERROR HANDLING-- */
- MPID_Progress_end(&progress_state);
- MPIU_ERR_POP(mpi_errno);
- /* --END ERROR HANDLING-- */
- }
- }
- MPID_Progress_end(&progress_state);
- }
+ mpi_errno = MPIC_Wait(sreq, errflag);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ mpi_errno = MPIC_Wait(rreq, errflag);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
*status = rreq->status;
@@ -607,31 +607,16 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
MPID_Request_release(sreq);
MPID_Request_release(rreq);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- if (source != MPI_PROC_NULL) {
- if (MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
- MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
- MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
- if (MPIR_TAG_CHECK_PROC_FAILURE_BIT(status->MPI_TAG)) {
- *errflag = MPIR_ERR_PROC_FAILED;
- MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
- } else if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
- *errflag = MPIR_ERR_OTHER;
- MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
- }
- } else if (MPI_SUCCESS == MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
- MPIU_Assert(status->MPI_TAG == recvtag);
- }
- }
-
-
fn_exit:
MPIU_CHKLMEM_FREEALL();
MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SENDRECV_REPLACE);
return mpi_errno;
fn_fail:
+ if (sreq)
+ MPID_Request_release(sreq);
+ if (rreq)
+ MPID_Request_release(rreq);
goto fn_exit;
}
@@ -738,22 +723,14 @@ int MPIC_Waitall(int numreq, MPI_Request requests[], MPI_Status statuses[], mpir
tag fields here. */
for (i = 0; i < numreq; ++i)
statuses[i].MPI_TAG = 0;
-
- mpi_errno = MPIR_Waitall_impl(numreq, requests, statuses);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- if (*errflag) goto fn_exit;
+ mpi_errno = MPIR_Waitall_impl(numreq, requests, statuses);
+ /* The errflag value here is for all requests, not just a single one. If
+ * in the future, this function is used for multiple collectives at a
+ * single time, we may have to change that. */
for (i = 0; i < numreq; ++i) {
- if (MPIR_TAG_CHECK_PROC_FAILURE_BIT(statuses[i].MPI_TAG)) {
- *errflag = MPIR_ERR_PROC_FAILED;
- MPIR_TAG_CLEAR_ERROR_BITS(statuses[i].MPI_TAG);
- break;
- } else if (MPIR_TAG_CHECK_ERROR_BIT(statuses[i].MPI_TAG)) {
- *errflag = MPIR_ERR_OTHER;
- MPIR_TAG_CLEAR_ERROR_BITS(statuses[i].MPI_TAG);
- break;
- }
+ MPIR_Process_status(&statuses[i], errflag);
}
fn_exit:
-----------------------------------------------------------------------
Summary of changes:
src/include/mpiimpl.h | 51 +++--
src/include/mpitypedefs.h | 8 +
src/mpi/coll/allgather.c | 22 +-
src/mpi/coll/allgatherv.c | 24 +-
src/mpi/coll/allred_group.c | 15 +-
src/mpi/coll/allreduce.c | 21 +-
src/mpi/coll/alltoall.c | 30 +--
src/mpi/coll/alltoallv.c | 20 +-
src/mpi/coll/alltoallw.c | 20 +-
src/mpi/coll/barrier.c | 4 +-
src/mpi/coll/bcast.c | 38 +--
src/mpi/coll/exscan.c | 6 +-
src/mpi/coll/gather.c | 32 +--
src/mpi/coll/gatherv.c | 14 +-
src/mpi/coll/helper_fns.c | 268 +++++++++++----------
src/mpi/coll/igather.c | 4 +-
src/mpi/coll/iscatter.c | 4 +-
src/mpi/coll/red_scat.c | 29 +--
src/mpi/coll/red_scat_block.c | 29 +--
src/mpi/coll/reduce.c | 35 ++--
src/mpi/coll/scan.c | 15 +-
src/mpi/coll/scatter.c | 28 +--
src/mpi/coll/scatterv.c | 10 +-
src/mpi/comm/comm_create.c | 5 +-
src/mpi/comm/comm_split.c | 2 +-
src/mpi/comm/commutil.c | 2 +-
src/mpi/comm/intercomm_create.c | 6 +-
src/mpi/comm/intercomm_merge.c | 4 +-
src/mpi/pt2pt/mpir_request.c | 1 +
src/mpi/topo/dist_gr_create.c | 14 +-
src/mpid/ch3/include/mpidpre.h | 3 +
src/mpid/ch3/src/ch3u_port.c | 20 +-
src/mpid/ch3/src/ch3u_request.c | 1 +
src/mpid/ch3/src/mpid_comm_agree.c | 8 +-
src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c | 8 +-
src/mpid/common/sched/mpid_sched.c | 152 ++++++++----
src/mpid/pamid/src/dyntask/mpidi_port.c | 26 +-
src/pmi/pmi2/poe/poe2pmi.c | 8 +-
test/mpi/ft/Makefile.am | 2 +-
test/mpi/ft/nbccoll.c | 76 ++++++
test/mpi/ft/testlist | 3 +-
41 files changed, 591 insertions(+), 477 deletions(-)
create mode 100644 test/mpi/ft/nbccoll.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-120-g8572752
by noreply@mpich.org 27 Jan '15
by noreply@mpich.org 27 Jan '15
27 Jan '15
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 85727524ca0fc264a455627e293f758f5c2a7708 (commit)
from 31628e6d2ac43f3dded92df936788eafc5cda3bf (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/85727524ca0fc264a455627e293f758f5…
commit 85727524ca0fc264a455627e293f758f5c2a7708
Author: Jithin Jose <jithin.jose(a)intel.com>
Date: Tue Jan 27 13:22:53 2015 -0800
Updates for latest OFI-libfabric API
Signed-off-by: Charles J Archer <charles.j.archer(a)intel.com>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
index 31b38fc..c38968c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c
@@ -105,7 +105,7 @@ static inline int MPID_nem_ofi_conn_req_callback(cq_tagged_entry_t * wc, MPID_Re
gl_data.conn_req->dev.user_buf,
OFI_KVSAPPSTRLEN,
gl_data.mr,
- 0,
+ FI_ADDR_UNSPEC,
MPID_CONN_REQ,
~MPID_PROTOCOL_MASK,
(void *) &(REQ_OFI(gl_data.conn_req)->ofi_context)), trecv);
@@ -246,7 +246,7 @@ static inline int MPID_nem_ofi_preposted_callback(cq_tagged_entry_t * wc, MPID_R
&rreq->dev.user_count,
sizeof rreq->dev.user_count,
gl_data.mr,
- 0,
+ FI_ADDR_UNSPEC,
MPID_MSG_RTS,
~MPID_PROTOCOL_MASK, &(REQ_OFI(rreq)->ofi_context)), trecv);
END_FUNC_RC(FCNAME);
@@ -307,7 +307,7 @@ int MPID_nem_ofi_cm_init(MPIDI_PG_t * pg_p, int pg_rank ATTRIBUTE((unused)))
&persistent_req->dev.user_count,
sizeof persistent_req->dev.user_count,
gl_data.mr,
- 0,
+ FI_ADDR_UNSPEC,
MPID_MSG_RTS,
~MPID_PROTOCOL_MASK,
(void *) &(REQ_OFI(persistent_req)->ofi_context)), trecv);
@@ -326,7 +326,7 @@ int MPID_nem_ofi_cm_init(MPIDI_PG_t * pg_p, int pg_rank ATTRIBUTE((unused)))
conn_req->dev.user_buf,
OFI_KVSAPPSTRLEN,
gl_data.mr,
- 0,
+ FI_ADDR_UNSPEC,
MPID_CONN_REQ,
~MPID_PROTOCOL_MASK, (void *) &(REQ_OFI(conn_req)->ofi_context)), trecv);
gl_data.conn_req = conn_req;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h
index 9e5f048..07b119c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_impl.h
@@ -40,7 +40,7 @@ typedef int (*req_fn) (MPIDI_VC_t *, MPID_Request *, int *);
/* Global Object for state tracking */
/* ******************************** */
typedef struct {
- fi_addr_t bound_addr; /* This ranks bound address */
+ char bound_addr[128]; /* This ranks bound address */
fi_addr_t any_addr; /* Specifies any source */
size_t bound_addrlen; /* length of the bound address */
struct fid_fabric *fabric; /* fabric object */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
index cefa87d..2fd7c87 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_init.c
@@ -56,7 +56,6 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
hints.ep_type = FI_EP_RDM; /* Reliable datagram */
hints.caps = FI_TAGGED; /* Tag matching interface */
hints.caps |= FI_BUFFERED_RECV; /* Buffered receives */
- hints.caps |= FI_REMOTE_COMPLETE; /* Remote completion */
hints.caps |= FI_CANCEL; /* Support cancel */
hints.caps |= FI_DYNAMIC_MR; /* Global dynamic mem region */
@@ -80,7 +79,7 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
domain_attr.threading = FI_THREAD_ENDPOINT;
domain_attr.control_progress = FI_PROGRESS_AUTO;
- tx_attr.op_flags = FI_REMOTE_COMPLETE;
+ domain_attr.data_progress = FI_PROGRESS_AUTO;
hints.domain_attr = &domain_attr;
hints.tx_attr = &tx_attr;
@@ -250,10 +249,8 @@ int MPID_nem_ofi_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_
/* ---------------------------------------------------- */
/* Insert the ANY_SRC address */
/* ---------------------------------------------------- */
- MPIU_CHKLMEM_MALLOC(null_addr, char *, 1 * gl_data.bound_addrlen, mpi_errno, "null_addr");
- memset(null_addr, 0, gl_data.bound_addrlen);
- FI_RC(fi_av_insert(gl_data.av, null_addr, 1, &gl_data.any_addr, 0ULL, NULL), avmap);
+ gl_data.any_addr = FI_ADDR_UNSPEC;
/* --------------------------------- */
/* Store the direct addresses in */
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/channels/nemesis/netmod/ofi/ofi_cm.c | 8 ++++----
.../ch3/channels/nemesis/netmod/ofi/ofi_impl.h | 2 +-
.../ch3/channels/nemesis/netmod/ofi/ofi_init.c | 7 ++-----
3 files changed, 7 insertions(+), 10 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-119-g31628e6
by noreply@mpich.org 27 Jan '15
by noreply@mpich.org 27 Jan '15
27 Jan '15
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 31628e6d2ac43f3dded92df936788eafc5cda3bf (commit)
from afb720d01390fe76299f9a9a90a949316af70ec1 (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/31628e6d2ac43f3dded92df936788eafc…
commit 31628e6d2ac43f3dded92df936788eafc5cda3bf
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Mon Jan 26 17:06:52 2015 -0600
correct tag usage in MPIC_Sendrecv
The tag for send was ignored and recvtag incorrectly used in its place.
Signed-off-by: Wesley Bland <wbland(a)anl.gov>
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index d0c2e95..4ea6202 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -461,7 +461,7 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
mpi_errno = MPID_Irecv(recvbuf, recvcount, recvtype, source, recvtag,
comm_ptr, context_id, &recv_req_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- mpi_errno = MPID_Isend(sendbuf, sendcount, sendtype, dest, recvtag,
+ mpi_errno = MPID_Isend(sendbuf, sendcount, sendtype, dest, sendtag,
comm_ptr, context_id, &send_req_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-----------------------------------------------------------------------
Summary of changes:
src/mpi/coll/helper_fns.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.2a2-118-gafb720d
by noreply@mpich.org 23 Jan '15
by noreply@mpich.org 23 Jan '15
23 Jan '15
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 afb720d01390fe76299f9a9a90a949316af70ec1 (commit)
via 4513e539639620d35614a3277474deba1314ebd1 (commit)
via 67b0e1e8ac5443cb8edd3622ef8f99503a0c3ac6 (commit)
from 93e816cc1fbd88109c55f9acf9b5ed6efc2a12d2 (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/afb720d01390fe76299f9a9a90a949316…
commit afb720d01390fe76299f9a9a90a949316af70ec1
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Jan 20 10:53:55 2015 -0600
fix issue with small i/o and big datatypes
HDF5 folks reported a bug with ROMIO and one of their slightly-strange (but
100% legal) datatypes. git-bisect points to the "promote size of length"
change. Seems that MPICH does not like struct datatypes with zero-count
elements? Further investigation requred. This change (construct a simpler
datatype in more cases) is sufficient to help HDF5 move forward.
See #2221
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/utils.c b/src/mpi/romio/adio/common/utils.c
index b539187..eef48cb 100644
--- a/src/mpi/romio/adio/common/utils.c
+++ b/src/mpi/romio/adio/common/utils.c
@@ -63,17 +63,40 @@ int ADIOI_Type_create_hindexed_x(int count,
int i, ret;
MPI_Datatype *types;
int *blocklens;
+ int is_big=0;
types = ADIOI_Malloc(count*sizeof(MPI_Datatype));
blocklens = ADIOI_Malloc(count*sizeof(int));
+ /* squashing two loops into one.
+ * - Look in the array_of_blocklengths for any large values
+ * - convert MPI_Count items (if they are not too big) into int-sized items
+ * after this loop we will know if we can use MPI_type_hindexed or if we
+ * need a more complicated BigMPI-style struct-of-chunks.
+ *
+ * Why not use the struct-of-chunks in all cases? HDF5 reported a bug,
+ * which I have not yet precicesly nailed down, but appears to have
+ * something to do with struct-of-chunks when the chunks are small */
+
for(i=0; i<count; i++) {
- blocklens[i] = 1;
- type_create_contiguous_x(array_of_blocklengths[i], oldtype, &(types[i]));
+ if (array_of_blocklengths[i] > INT_MAX) {
+ blocklens[i] = 1;
+ is_big=1;
+ type_create_contiguous_x(array_of_blocklengths[i], oldtype, &(types[i]));
+ } else {
+ /* OK to cast: checked for "bigness" above */
+ blocklens[i] = (int)array_of_blocklengths[i];
+ MPI_Type_contiguous(blocklens[i], oldtype, &(types[i]));
+ }
}
- ret = MPI_Type_create_struct(count, blocklens, array_of_displacements,
- types, newtype);
+ if (is_big) {
+ ret = MPI_Type_create_struct(count, blocklens, array_of_displacements,
+ types, newtype);
+ } else {
+ ret = MPI_Type_hindexed(count, blocklens,
+ array_of_displacements, oldtype, newtype);
+ }
for (i=0; i< count; i++)
MPI_Type_free(&(types[i]));
ADIOI_Free(types);
http://git.mpich.org/mpich.git/commitdiff/4513e539639620d35614a3277474deba1…
commit 4513e539639620d35614a3277474deba1314ebd1
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Jan 19 15:36:08 2015 -0600
clean up 64-to-32 bit casts
many many places where a 64 bit value is stored in a 32 bit value
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/ad_seek.c b/src/mpi/romio/adio/common/ad_seek.c
index d8bbe85..ceaf6f2 100644
--- a/src/mpi/romio/adio/common/ad_seek.c
+++ b/src/mpi/romio/adio/common/ad_seek.c
@@ -26,8 +26,8 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
ADIO_Offset n_etypes_in_filetype, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0;
ADIO_Offset size_in_filetype, sum;
- MPI_Count filetype_size;
- int etype_size, filetype_is_contig;
+ MPI_Count filetype_size, etype_size;
+ int filetype_is_contig;
MPI_Aint filetype_extent;
ADIOI_UNREFERENCED_ARG(whence);
@@ -35,7 +35,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
etype_size = fd->etype_size;
- if (filetype_is_contig) off = fd->disp + (ADIO_Offset)etype_size * offset;
+ if (filetype_is_contig) off = fd->disp + etype_size * offset;
else {
flat_file = ADIOI_Flatlist;
while (flat_file->type != fd->filetype) flat_file = flat_file->next;
diff --git a/src/mpi/romio/adio/common/utils.c b/src/mpi/romio/adio/common/utils.c
index 9814220..b539187 100644
--- a/src/mpi/romio/adio/common/utils.c
+++ b/src/mpi/romio/adio/common/utils.c
@@ -25,8 +25,12 @@ static int type_create_contiguous_x(MPI_Count count,
int blocklens[2];
MPI_Datatype types[2];
- MPI_Count c = count/INT_MAX;
- MPI_Count r = count%INT_MAX;
+ /* truly stupendously large counts will overflow an integer with this math,
+ * but that is a problem for a few decades from now. Sorry, few decades
+ * from now! */
+ ADIOI_Assert(count/INT_MAX == (int)(count/INT_MAX));
+ int c = (int)(count/INT_MAX); /* OK to cast until 'count' is 256 bits */
+ int r = count%INT_MAX;
MPI_Type_vector(c, INT_MAX, INT_MAX, oldtype, &chunks);
MPI_Type_contiguous(r, oldtype, &remainder);
http://git.mpich.org/mpich.git/commitdiff/67b0e1e8ac5443cb8edd3622ef8f99503…
commit 67b0e1e8ac5443cb8edd3622ef8f99503a0c3ac6
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Jan 19 14:12:03 2015 -0600
Tweak MPIDU_Datatype_debug output
- bump up subtypes from 3 to 6. The limit is arbitrary. I am trying to
figure out a type with 4 sub-types.
- split up indexed/hindexed lists onto separate lines. MPICH debug
output format adds its own newlines, but we have to clean out MPICH's
extra debug output anyway: joining a few lines isn't that much more
work.
- output a name of the digraph that graphviz can actually parse.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/common/datatype/mpid_type_debug.c b/src/mpid/common/datatype/mpid_type_debug.c
index 2489dbd..25a81ed 100644
--- a/src/mpid/common/datatype/mpid_type_debug.c
+++ b/src/mpid/common/datatype/mpid_type_debug.c
@@ -26,6 +26,9 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p, int depth, int header);
void MPIDI_Datatype_contents_printf(MPI_Datatype type, int depth, int acount);
static char *MPIDI_Datatype_depth_spacing(int depth) ATTRIBUTE((unused));
+#define NR_TYPE_CUTOFF 6 /* Number of types to display before truncating
+ output. 6 picked as arbitrary cutoff */
+
/* note: this isn't really "error handling" per se, but leave these comments
* because Bill uses them for coverage analysis.
*/
@@ -65,7 +68,8 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
if (header) {
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- "digraph %p { {", loop_p));
+ /* graphviz does not like the 0xNNN format */
+ "digraph %lld { {", (long long int)loop_p));
}
switch (loop_p->kind & DLOOP_KIND_MASK) {
@@ -94,28 +98,27 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
(int) loop_p->loop_params.i_t.count,
(int) loop_p->loop_params.i_t.total_blocks));
- /* 3 picked as arbitrary cutoff */
- for (i=0; i < 3 && i < loop_p->loop_params.i_t.count; i++) {
+ for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.i_t.count; i++) {
if (i + 1 < loop_p->loop_params.i_t.count) {
/* more regions after this one */
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- "(" MPI_AINT_FMT_DEC_SPEC ", %d), ",
+ "\\n(" MPI_AINT_FMT_DEC_SPEC ", %d), ",
(MPI_Aint) loop_p->loop_params.i_t.offset_array[i],
(int) loop_p->loop_params.i_t.blocksize_array[i]));
}
else {
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- "(" MPI_AINT_FMT_DEC_SPEC ", %d); ",
+ "\\n(" MPI_AINT_FMT_DEC_SPEC ", %d); ",
(MPI_Aint) loop_p->loop_params.i_t.offset_array[i],
(int) loop_p->loop_params.i_t.blocksize_array[i]));
}
}
if (i < loop_p->loop_params.i_t.count) {
- MPIU_DBG_OUT(DATATYPE,"...; ");
+ MPIU_DBG_OUT(DATATYPE,"\\n...; ");
}
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- "el_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];\n",
+ "\\nel_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];\n",
(MPI_Aint) loop_p->el_size,
(MPI_Aint) loop_p->el_extent));
break;
@@ -126,12 +129,11 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
(int) loop_p->loop_params.bi_t.count,
(int) loop_p->loop_params.bi_t.blocksize));
- /* 3 picked as arbitrary cutoff */
- for (i=0; i < 3 && i < loop_p->loop_params.bi_t.count; i++) {
+ for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.bi_t.count; i++) {
if (i + 1 < loop_p->loop_params.bi_t.count) {
/* more regions after this one */
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- MPI_AINT_FMT_DEC_SPEC ", ",
+ MPI_AINT_FMT_DEC_SPEC ",\\n ",
(MPI_Aint) loop_p->loop_params.bi_t.offset_array[i]));
}
else {
@@ -145,7 +147,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
}
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- "el_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];",
+ "\\nel_sz = " MPI_AINT_FMT_DEC_SPEC "; el_ext = " MPI_AINT_FMT_DEC_SPEC " }\"];",
(MPI_Aint) loop_p->el_size,
(MPI_Aint) loop_p->el_extent));
break;
@@ -154,7 +156,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
" dl%d [shape = record, label = \"struct | {ct = %d; blks = ",
depth,
(int) loop_p->loop_params.s_t.count));
- for (i=0; i < 3 && i < loop_p->loop_params.s_t.count; i++) {
+ for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.s_t.count; i++) {
if (i + 1 < loop_p->loop_params.s_t.count) {
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"%d, ",
(int) loop_p->loop_params.s_t.blocksize_array[i]));
@@ -171,7 +173,7 @@ void MPIDI_Dataloop_dot_printf(MPID_Dataloop *loop_p,
MPIU_DBG_OUT(DATATYPE,"disps = ");
}
- for (i=0; i < 3 && i < loop_p->loop_params.s_t.count; i++) {
+ for (i=0; i < NR_TYPE_CUTOFF && i < loop_p->loop_params.s_t.count; i++) {
if (i + 1 < loop_p->loop_params.s_t.count) {
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,MPI_AINT_FMT_DEC_SPEC ", ",
(MPI_Aint) loop_p->loop_params.s_t.offset_array[i]));
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/common/ad_seek.c | 6 ++--
src/mpi/romio/adio/common/utils.c | 39 +++++++++++++++++++++++----
src/mpid/common/datatype/mpid_type_debug.c | 28 ++++++++++---------
3 files changed, 51 insertions(+), 22 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-115-g93e816c
by noreply@mpich.org 22 Jan '15
by noreply@mpich.org 22 Jan '15
22 Jan '15
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 93e816cc1fbd88109c55f9acf9b5ed6efc2a12d2 (commit)
from a3dd5f401f3d038fd26eb6c93a7497566228213f (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/93e816cc1fbd88109c55f9acf9b5ed6ef…
commit 93e816cc1fbd88109c55f9acf9b5ed6efc2a12d2
Author: Huiwei Lu <huiweilu(a)mcs.anl.gov>
Date: Thu Jan 22 10:02:15 2015 -0600
FT: Fixes ref counts in shrink and agree
When process fails, fault tolerance scheme takes a different path to
deal with MPI object reference counts than the existing one. Some
reference counts were not properly set in FT path so when configured
with --enable-g=all, some ft tests will show leaked context id, dirty
COMM, GROUP and REQUEST objects and so on when exit.
This patch fixes ft/shrink and ft/agree with "--enable-g=all". Stack
allocated objects of requests, communicators and groups will be freed by
FT.
Signed-off-by: Wesley Bland <wbland(a)anl.gov>
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 588092f..d0c2e95 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -499,6 +499,10 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_SENDRECV);
return mpi_errno;
fn_fail:
+ if (send_req_ptr)
+ MPID_Request_release(send_req_ptr);
+ if (recv_req_ptr)
+ MPID_Request_release(recv_req_ptr);
goto fn_exit;
}
diff --git a/src/mpi/comm/comm_shrink.c b/src/mpi/comm/comm_shrink.c
index 631edb5..0466db5 100644
--- a/src/mpi/comm/comm_shrink.c
+++ b/src/mpi/comm/comm_shrink.c
@@ -81,7 +81,16 @@ int MPIR_Comm_shrink(MPID_Comm *comm_ptr, MPID_Comm **newcomm_ptr)
new_group_ptr, MPIR_SHRINK_TAG, &errflag);
MPIR_Group_release(new_group_ptr);
- if (errflag) MPIU_Object_set_ref(new_group_ptr, 0);
+ if (errflag) {
+ if (*newcomm_ptr != NULL && MPIU_Object_get_ref(*newcomm_ptr) > 0) {
+ MPIU_Object_set_ref(*newcomm_ptr, 1);
+ MPIR_Comm_release(*newcomm_ptr, 0);
+ }
+ if (MPIU_Object_get_ref(new_group_ptr) > 0) {
+ MPIU_Object_set_ref(new_group_ptr, 1);
+ MPIR_Group_release(new_group_ptr);
+ }
+ }
} while (errflag && ++attempts < 5);
if (errflag && attempts >= 5) goto fn_fail;
diff --git a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
index a991435..465d24f 100644
--- a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
+++ b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
@@ -107,6 +107,8 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
bitarray = group_to_bitarray(local_fail, comm_ptr);
bitarray_size = (comm_ptr->local_size / 8) + (comm_ptr->local_size % 8 ? 1 : 0);
remote_bitarray = MPIU_Malloc(sizeof(uint32_t) * bitarray_size);
+ if (local_fail != MPID_Group_empty)
+ MPIR_Group_release(local_fail);
/* For now, this will be implemented as a star with rank 0 serving as
* the source */
-----------------------------------------------------------------------
Summary of changes:
src/mpi/coll/helper_fns.c | 4 ++++
src/mpi/comm/comm_shrink.c | 11 ++++++++++-
src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c | 2 ++
3 files changed, 16 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-114-ga3dd5f4
by noreply@mpich.org 22 Jan '15
by noreply@mpich.org 22 Jan '15
22 Jan '15
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 a3dd5f401f3d038fd26eb6c93a7497566228213f (commit)
from 7d59d14dd74072037b0daaa67612836974c0ff2b (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/a3dd5f401f3d038fd26eb6c93a7497566…
commit a3dd5f401f3d038fd26eb6c93a7497566228213f
Author: Wesley Bland <wbland(a)anl.gov>
Date: Tue Jan 20 18:55:08 2015 -0600
Fix for MPIX_COMM_AGREE to not return incorrect errors
MPIX_Comm_agree should not return errors if the failed processes have
all been acknowledged. Previously, it was returning errors
unnecessarily, but this makes sure that the errcode is MPI_SUCCESS when
appropriate.
Signed-off-by: Huiwei Lu <huiweilu(a)mcs.anl.gov>
diff --git a/src/mpi/comm/comm_agree.c b/src/mpi/comm/comm_agree.c
index 9c5f669..e0b47d7 100644
--- a/src/mpi/comm/comm_agree.c
+++ b/src/mpi/comm/comm_agree.c
@@ -48,7 +48,7 @@ int MPIR_Comm_agree(MPID_Comm *comm_ptr, int *flag)
/* First decide on the group of failed procs. */
mpi_errno = MPID_Comm_get_all_failed_procs(comm_ptr, &global_failed, MPIR_AGREE_TAG);
- if (mpi_errno) errflag = 1;
+ if (mpi_errno) errflag = MPIR_ERR_PROC_FAILED;
mpi_errno = MPIR_Group_compare_impl(failed_grp, global_failed, &result);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
index 43a2faf..a991435 100644
--- a/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
+++ b/src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c
@@ -84,7 +84,7 @@ static MPID_Group *bitarray_to_group(MPID_Comm *comm_ptr, uint32_t *bitarray)
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_group, int tag)
{
- int mpi_errno = MPI_SUCCESS;
+ int mpi_errno = MPI_SUCCESS, ret_errno;
mpir_errflag_t errflag = MPIR_ERR_NONE;
int i, j, bitarray_size;
uint32_t *bitarray, *remote_bitarray;
@@ -113,9 +113,9 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
if (comm_ptr->rank == 0) {
for (i = 1; i < comm_ptr->local_size; i++) {
/* Get everyone's list of failed processes to aggregate */
- mpi_errno = MPIC_Recv(remote_bitarray, bitarray_size, MPI_UINT32_T,
+ ret_errno = MPIC_Recv(remote_bitarray, bitarray_size, MPI_UINT32_T,
i, tag, comm_ptr->handle, MPI_STATUS_IGNORE, &errflag);
- if (mpi_errno) continue;
+ if (ret_errno) continue;
/* Combine the received bitarray with my own */
for (j = 0; j < bitarray_size; j++) {
@@ -127,9 +127,9 @@ int MPID_Comm_get_all_failed_procs(MPID_Comm *comm_ptr, MPID_Group **failed_grou
for (i = 1; i < comm_ptr->local_size; i++) {
/* Send the list to each rank to be processed locally */
- mpi_errno = MPIC_Send(bitarray, bitarray_size, MPI_UINT32_T, i,
+ ret_errno = MPIC_Send(bitarray, bitarray_size, MPI_UINT32_T, i,
tag, comm_ptr->handle, &errflag);
- if (mpi_errno) errflag = MPIR_ERR_PROC_FAILED;
+ if (ret_errno) continue;
}
/* Convert the bitarray into a group */
-----------------------------------------------------------------------
Summary of changes:
src/mpi/comm/comm_agree.c | 2 +-
src/mpid/ch3/src/mpid_comm_get_all_failed_procs.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-113-g7d59d14
by noreply@mpich.org 16 Jan '15
by noreply@mpich.org 16 Jan '15
16 Jan '15
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 7d59d14dd74072037b0daaa67612836974c0ff2b (commit)
from 4be54219b7cb132bc2de3b0c1323211fe1718fb1 (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/7d59d14dd74072037b0daaa6761283697…
commit 7d59d14dd74072037b0daaa67612836974c0ff2b
Author: Su Huang <suhuang(a)us.ibm.com>
Date: Fri Jan 16 14:55:16 2015 -0500
PAMID:MP_STATISTICS=print will cause mpi hw case coredump
The segfault was caused by the library trying to free an already freed mpid_statp
structure. The structure is freed right after the status information is printed.
To fix the problem, the mpid_statp is set to NULL after the free is done.
(ibm) D202018
Signed-off-by: Sameh Sharkawi <sssharka(a)us.ibm.com>
diff --git a/src/mpid/pamid/src/mpidi_util.c b/src/mpid/pamid/src/mpidi_util.c
index 8217ade..774e786 100644
--- a/src/mpid/pamid/src/mpidi_util.c
+++ b/src/mpid/pamid/src/mpidi_util.c
@@ -800,10 +800,16 @@ void MPIDI_print_statistics() {
(MPIDI_Process.mp_printenv)) {
if (MPIDI_Process.mp_statistics) {
MPIDI_Statistics_write(stdout);
- if (mpid_statp) MPIU_Free(mpid_statp);
+ if (mpid_statp) {
+ MPIU_Free(mpid_statp);
+ mpid_statp=NULL;
+ }
}
if (MPIDI_Process.mp_printenv) {
- if (mpich_env) MPIU_Free(mpich_env);
+ if (mpich_env) {
+ MPIU_Free(mpich_env);
+ mpich_env=NULL;
+ }
}
}
}
-----------------------------------------------------------------------
Summary of changes:
src/mpid/pamid/src/mpidi_util.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-112-g4be5421
by noreply@mpich.org 15 Jan '15
by noreply@mpich.org 15 Jan '15
15 Jan '15
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 4be54219b7cb132bc2de3b0c1323211fe1718fb1 (commit)
from a30a4721a2d6d8e35b0f33069689d3f0b527c745 (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/4be54219b7cb132bc2de3b0c1323211fe…
commit 4be54219b7cb132bc2de3b0c1323211fe1718fb1
Author: Wesley Bland <wbland(a)anl.gov>
Date: Thu Jan 15 14:27:42 2015 -0600
Refactor MPI_Testall to have an MPIR version
For some reason, there was no MPIR_Testall_impl as there is with many of
the other MPI_* functions. This causes a linking problem when weak
symbols are disabled and another MPI function needs to call MPI_*.
This patch moves most of the MPI_Testall code into MPIR_Testall_impl and
has MPI_Waitall call that function instead of MPI_Testall.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index c26ca52..e178615 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -4517,6 +4517,8 @@ void MPIR_Type_lb_impl(MPI_Datatype datatype, MPI_Aint *displacement);
int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, MPI_Request *request);
int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status);
+int MPIR_Testall_impl(int count, MPI_Request array_of_requests[], int *flag,
+ MPI_Status array_of_statuses[]);
int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status);
int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
MPI_Status array_of_statuses[]);
diff --git a/src/mpi/pt2pt/testall.c b/src/mpi/pt2pt/testall.c
index 50107d4..dccc138 100644
--- a/src/mpi/pt2pt/testall.c
+++ b/src/mpi/pt2pt/testall.c
@@ -30,11 +30,164 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
#undef MPI_Testall
#define MPI_Testall PMPI_Testall
+
+#undef FUNCNAME
+#define FUNCNAME MPIR_Testall_impl
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPIR_Testall_impl(int count, MPI_Request array_of_requests[], int *flag,
+ MPI_Status array_of_statuses[])
+{
+ MPID_Request * request_ptr_array[MPID_REQUEST_PTR_ARRAY_SIZE];
+ MPID_Request ** request_ptrs = request_ptr_array;
+ MPI_Status * status_ptr;
+ int i;
+ int n_completed;
+ int active_flag;
+ int rc;
+ int proc_failure = FALSE;
+ int mpi_errno = MPI_SUCCESS;
+ MPIU_CHKLMEM_DECL(1);
+
+ /* Convert MPI request handles to a request object pointers */
+ if (count > MPID_REQUEST_PTR_ARRAY_SIZE)
+ {
+ MPIU_CHKLMEM_MALLOC_ORJUMP(request_ptrs, MPID_Request **,
+ count * sizeof(MPID_Request *), mpi_errno, "request pointers");
+ }
+
+ n_completed = 0;
+ for (i = 0; i < count; i++)
+ {
+ if (array_of_requests[i] != MPI_REQUEST_NULL)
+ {
+ MPID_Request_get_ptr(array_of_requests[i], request_ptrs[i]);
+ /* Validate object pointers if error checking is enabled */
+# ifdef HAVE_ERROR_CHECKING
+ {
+ MPID_BEGIN_ERROR_CHECKS;
+ {
+ MPID_Request_valid_ptr( request_ptrs[i], mpi_errno );
+ if (mpi_errno) goto fn_fail;
+ }
+ MPID_END_ERROR_CHECKS;
+ }
+# endif
+ }
+ else
+ {
+ request_ptrs[i] = NULL;
+ n_completed += 1;
+ }
+ }
+
+ mpi_errno = MPID_Progress_test();
+ if (mpi_errno != MPI_SUCCESS) goto fn_fail;
+
+ for (i = 0; i < count; i++)
+ {
+ if (request_ptrs[i] != NULL &&
+ request_ptrs[i]->kind == MPID_UREQUEST &&
+ request_ptrs[i]->greq_fns->poll_fn != NULL)
+ {
+ mpi_errno = (request_ptrs[i]->greq_fns->poll_fn)(request_ptrs[i]->greq_fns->grequest_extra_state,
+ &(array_of_statuses[i]));
+ if (mpi_errno != MPI_SUCCESS) goto fn_fail;
+ }
+ if (request_ptrs[i] != NULL)
+ {
+ if (MPID_Request_is_complete(request_ptrs[i]))
+ {
+ n_completed++;
+ rc = MPIR_Request_get_error(request_ptrs[i]);
+ if (rc != MPI_SUCCESS)
+ {
+ if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc) || MPIX_ERR_PROC_FAILED_PENDING == MPIR_ERR_GET_CLASS(rc))
+ proc_failure = TRUE;
+ mpi_errno = MPI_ERR_IN_STATUS;
+ }
+ } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
+ MPID_Request_is_anysource(request_ptrs[i]) &&
+ !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
+ {
+ mpi_errno = MPI_ERR_IN_STATUS;
+ MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
+ status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[i] : MPI_STATUS_IGNORE;
+ if (status_ptr != MPI_STATUS_IGNORE) status_ptr->MPI_ERROR = rc;
+ proc_failure = TRUE;
+ }
+ }
+ }
+
+ if (n_completed == count || mpi_errno == MPI_ERR_IN_STATUS)
+ {
+ n_completed = 0;
+ for (i = 0; i < count; i++)
+ {
+ if (request_ptrs[i] != NULL)
+ {
+ if (MPID_Request_is_complete(request_ptrs[i]))
+ {
+ n_completed ++;
+ status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[i] : MPI_STATUS_IGNORE;
+ rc = MPIR_Request_complete(&array_of_requests[i], request_ptrs[i], status_ptr, &active_flag);
+ if (mpi_errno == MPI_ERR_IN_STATUS && status_ptr != MPI_STATUS_IGNORE)
+ {
+ if (active_flag)
+ {
+ status_ptr->MPI_ERROR = rc;
+ }
+ else
+ {
+ status_ptr->MPI_ERROR = MPI_SUCCESS;
+ }
+ }
+ }
+ else
+ {
+ if (mpi_errno == MPI_ERR_IN_STATUS && array_of_statuses != MPI_STATUSES_IGNORE)
+ {
+ if (!proc_failure)
+ array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
+ else
+ array_of_statuses[i].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
+ }
+ }
+ }
+ else
+ {
+ n_completed ++;
+ if (array_of_statuses != MPI_STATUSES_IGNORE)
+ {
+ MPIR_Status_set_empty(&array_of_statuses[i]);
+ if (mpi_errno == MPI_ERR_IN_STATUS)
+ {
+ array_of_statuses[i].MPI_ERROR = MPI_SUCCESS;
+ }
+ }
+ }
+ }
+ }
+
+ *flag = (n_completed == count) ? TRUE : FALSE;
+
+ fn_exit:
+ if (count > MPID_REQUEST_PTR_ARRAY_SIZE)
+ {
+ MPIU_CHKLMEM_FREEALL();
+ }
+
+ return mpi_errno;
+ fn_fail:
+ goto fn_exit;
+}
+
#endif
#undef FUNCNAME
#define FUNCNAME MPI_Testall
-
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
/*@
MPI_Testall - Tests for the completion of all previously initiated
requests
@@ -79,17 +232,8 @@ program to unexecpectedly terminate or produce incorrect results.
int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
MPI_Status array_of_statuses[])
{
- static const char FCNAME[] = "MPI_Testall";
- MPID_Request * request_ptr_array[MPID_REQUEST_PTR_ARRAY_SIZE];
- MPID_Request ** request_ptrs = request_ptr_array;
- MPI_Status * status_ptr;
- int i;
- int n_completed;
- int active_flag;
- int rc;
- int proc_failure = FALSE;
int mpi_errno = MPI_SUCCESS;
- MPIU_CHKLMEM_DECL(1);
+ int i;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TESTALL);
MPIR_ERRTEST_INITIALIZED_ORDIE();
@@ -120,138 +264,13 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
# endif /* HAVE_ERROR_CHECKING */
/* ... body of routine ... */
-
- /* Convert MPI request handles to a request object pointers */
- if (count > MPID_REQUEST_PTR_ARRAY_SIZE)
- {
- MPIU_CHKLMEM_MALLOC_ORJUMP(request_ptrs, MPID_Request **,
- count * sizeof(MPID_Request *), mpi_errno, "request pointers");
- }
-
- n_completed = 0;
- for (i = 0; i < count; i++)
- {
- if (array_of_requests[i] != MPI_REQUEST_NULL)
- {
- MPID_Request_get_ptr(array_of_requests[i], request_ptrs[i]);
- /* Validate object pointers if error checking is enabled */
-# ifdef HAVE_ERROR_CHECKING
- {
- MPID_BEGIN_ERROR_CHECKS;
- {
- MPID_Request_valid_ptr( request_ptrs[i], mpi_errno );
- if (mpi_errno) goto fn_fail;
- }
- MPID_END_ERROR_CHECKS;
- }
-# endif
- }
- else
- {
- request_ptrs[i] = NULL;
- n_completed += 1;
- }
- }
-
- mpi_errno = MPID_Progress_test();
- if (mpi_errno != MPI_SUCCESS) goto fn_fail;
-
- for (i = 0; i < count; i++)
- {
- if (request_ptrs[i] != NULL &&
- request_ptrs[i]->kind == MPID_UREQUEST &&
- request_ptrs[i]->greq_fns->poll_fn != NULL)
- {
- mpi_errno = (request_ptrs[i]->greq_fns->poll_fn)(request_ptrs[i]->greq_fns->grequest_extra_state,
- &(array_of_statuses[i]));
- if (mpi_errno != MPI_SUCCESS) goto fn_fail;
- }
- if (request_ptrs[i] != NULL)
- {
- if (MPID_Request_is_complete(request_ptrs[i]))
- {
- n_completed++;
- rc = MPIR_Request_get_error(request_ptrs[i]);
- if (rc != MPI_SUCCESS)
- {
- if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc) || MPIX_ERR_PROC_FAILED_PENDING == MPIR_ERR_GET_CLASS(rc))
- proc_failure = TRUE;
- mpi_errno = MPI_ERR_IN_STATUS;
- }
- } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
- MPID_Request_is_anysource(request_ptrs[i]) &&
- !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
- {
- mpi_errno = MPI_ERR_IN_STATUS;
- MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
- status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[i] : MPI_STATUS_IGNORE;
- if (status_ptr != MPI_STATUS_IGNORE) status_ptr->MPI_ERROR = rc;
- proc_failure = TRUE;
- }
- }
- }
-
- if (n_completed == count || mpi_errno == MPI_ERR_IN_STATUS)
- {
- n_completed = 0;
- for (i = 0; i < count; i++)
- {
- if (request_ptrs[i] != NULL)
- {
- if (MPID_Request_is_complete(request_ptrs[i]))
- {
- n_completed ++;
- status_ptr = (array_of_statuses != MPI_STATUSES_IGNORE) ? &array_of_statuses[i] : MPI_STATUS_IGNORE;
- rc = MPIR_Request_complete(&array_of_requests[i], request_ptrs[i], status_ptr, &active_flag);
- if (mpi_errno == MPI_ERR_IN_STATUS && status_ptr != MPI_STATUS_IGNORE)
- {
- if (active_flag)
- {
- status_ptr->MPI_ERROR = rc;
- }
- else
- {
- status_ptr->MPI_ERROR = MPI_SUCCESS;
- }
- }
- }
- else
- {
- if (mpi_errno == MPI_ERR_IN_STATUS && array_of_statuses != MPI_STATUSES_IGNORE)
- {
- if (!proc_failure)
- array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
- else
- array_of_statuses[i].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
- }
- }
- }
- else
- {
- n_completed ++;
- if (array_of_statuses != MPI_STATUSES_IGNORE)
- {
- MPIR_Status_set_empty(&array_of_statuses[i]);
- if (mpi_errno == MPI_ERR_IN_STATUS)
- {
- array_of_statuses[i].MPI_ERROR = MPI_SUCCESS;
- }
- }
- }
- }
- }
-
- *flag = (n_completed == count) ? TRUE : FALSE;
+ mpi_errno = MPIR_Testall_impl(count, array_of_requests, flag, array_of_statuses);
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
fn_exit:
- if (count > MPID_REQUEST_PTR_ARRAY_SIZE)
- {
- MPIU_CHKLMEM_FREEALL();
- }
MPID_MPI_PT2PT_FUNC_EXIT(MPID_STATE_MPI_TESTALL);
MPIU_THREAD_CS_EXIT(ALLFUNC,);
diff --git a/src/mpi/pt2pt/waitall.c b/src/mpi/pt2pt/waitall.c
index eda6eaf..98cc267 100644
--- a/src/mpi/pt2pt/waitall.c
+++ b/src/mpi/pt2pt/waitall.c
@@ -114,7 +114,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
}
if (unlikely(disabled_anysource)) {
- mpi_errno = MPI_Testall(count, array_of_requests, &disabled_anysource, array_of_statuses);
+ mpi_errno = MPIR_Testall_impl(count, array_of_requests, &disabled_anysource, array_of_statuses);
goto fn_exit;
}
-----------------------------------------------------------------------
Summary of changes:
src/include/mpiimpl.h | 2 +
src/mpi/pt2pt/testall.c | 293 +++++++++++++++++++++++++----------------------
src/mpi/pt2pt/waitall.c | 2 +-
3 files changed, 159 insertions(+), 138 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2a2-111-ga30a472
by noreply@mpich.org 14 Jan '15
by noreply@mpich.org 14 Jan '15
14 Jan '15
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 a30a4721a2d6d8e35b0f33069689d3f0b527c745 (commit)
via ed39c90123dbe32a574ce4106874587369d778ce (commit)
from bb1c9db61ffb2e8c7a92e4d5d0d965a066480cdf (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/a30a4721a2d6d8e35b0f33069689d3f0b…
commit a30a4721a2d6d8e35b0f33069689d3f0b527c745
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Jan 12 16:23:14 2015 -0600
use PATH_MAX instead of magic number
User on OpenMPI list wanted to create a 259 character file. shared file
pointer name construction used the magic '256' value to construct a full
path to the hidden shared file pointer file. PATH_MAX already exists
for this purpose, so use it.
While there, found a few spots checking/setting PATH_MAX, so do that in
one place
Closes #2212
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index e2c41ea..c89b560 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -137,10 +137,6 @@ Output Parameters:
*/
#ifdef ROMIO_NEEDS_ADIOPARENTDIR
-#ifndef PATH_MAX
-#define PATH_MAX 65535
-#endif
-
/* In a strict ANSI environment, S_ISLNK may not be defined. Fix that
here. We assume that S_ISLNK is *always* defined as a macro. If
that is not universally true, then add a test to the romio
diff --git a/src/mpi/romio/adio/common/shfp_fname.c b/src/mpi/romio/adio/common/shfp_fname.c
index f1e5eee..dfa5baf 100644
--- a/src/mpi/romio/adio/common/shfp_fname.c
+++ b/src/mpi/romio/adio/common/shfp_fname.c
@@ -21,8 +21,11 @@
store the shared file pointer. The shared-file-pointer file is a
hidden file in the same directory as the real file being accessed.
If the real file is /tmp/thakur/testfile, the shared-file-pointer
- file will be /tmp/thakur/.testfile.shfp.xxxx, where xxxx is
- a random number. This file is created only if the shared
+ file will be /tmp/thakur/.testfile.shfp.yyy.xxxx, where yyy
+ is rank 0's process id and xxxx is a random number. If the
+ underlying file system supports shared file pointers
+ (PVFS does not, for example), the file name is always
+ constructed. This file is created only if the shared
file pointer functions are used and is deleted when the real
file is closed. */
@@ -33,14 +36,14 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code)
char *slash, *ptr, tmp[128];
int pid = 0;
- fd->shared_fp_fname = (char *) ADIOI_Malloc(256);
+ fd->shared_fp_fname = (char *) ADIOI_Malloc(PATH_MAX);
if (!rank) {
srand(time(NULL));
i = rand();
pid = (int)getpid();
- if (ADIOI_Strncpy(fd->shared_fp_fname, fd->filename, 256)) {
+ if (ADIOI_Strncpy(fd->shared_fp_fname, fd->filename, PATH_MAX)) {
*error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
fd->filename, ENAMETOOLONG);
return;
@@ -57,7 +60,7 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code)
fd->filename, ENAMETOOLONG);
return;
}
- if (ADIOI_Strncpy(fd->shared_fp_fname + 1, fd->filename, 255)) {
+ if (ADIOI_Strncpy(fd->shared_fp_fname + 1, fd->filename, PATH_MAX-1)) {
*error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
fd->filename, ENAMETOOLONG);
return;
@@ -76,7 +79,7 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code)
return;
}
/* ok to cast: file names bounded by PATH_MAX and NAME_MAX */
- len = (int) (256 - (slash+2 - fd->shared_fp_fname));
+ len = (int) (PATH_MAX - (slash+2 - fd->shared_fp_fname));
if (ADIOI_Strncpy(slash + 2, ptr + 1, len)) {
*error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
ptr + 1, ENAMETOOLONG);
@@ -86,7 +89,7 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code)
ADIOI_Snprintf(tmp, 128, ".shfp.%d.%d", pid, i);
/* ADIOI_Strnapp will return non-zero if truncated. That's ok */
- ADIOI_Strnapp(fd->shared_fp_fname, tmp, 256);
+ ADIOI_Strnapp(fd->shared_fp_fname, tmp, PATH_MAX);
len = (int)strlen(fd->shared_fp_fname);
MPI_Bcast(&len, 1, MPI_INT, 0, fd->comm);
diff --git a/src/mpi/romio/adio/common/system_hints.c b/src/mpi/romio/adio/common/system_hints.c
index 5d0e24b..fd6cba5 100644
--- a/src/mpi/romio/adio/common/system_hints.c
+++ b/src/mpi/romio/adio/common/system_hints.c
@@ -28,10 +28,6 @@
#include <io.h>
#endif
-#ifndef PATH_MAX
-#define PATH_MAX 65535
-#endif
-
/*#define SYSHINT_DEBUG 1 */
#define ROMIO_HINT_DEFAULT_CFG "/etc/romio-hints"
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index 67dd91e..eab98e5 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -1034,7 +1034,13 @@ typedef struct wcThreadFuncData {
void *ADIOI_IO_Thread_Func(void *vptr_args);
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX 65535
+#endif
#endif
http://git.mpich.org/mpich.git/commitdiff/ed39c90123dbe32a574ce410687458736…
commit ed39c90123dbe32a574ce4106874587369d778ce
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Jan 12 15:50:32 2015 -0600
make ADIOI_Shfp_fname report errors
Right now there's only one error condition: file name too long. This
change checks return codes of ADIOI_Strncpy and informs caller.
Otherwise, really long names result in buffer overruns.
See #2212
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/shfp_fname.c b/src/mpi/romio/adio/common/shfp_fname.c
index 3761cf8..f1e5eee 100644
--- a/src/mpi/romio/adio/common/shfp_fname.c
+++ b/src/mpi/romio/adio/common/shfp_fname.c
@@ -26,7 +26,7 @@
file pointer functions are used and is deleted when the real
file is closed. */
-void ADIOI_Shfp_fname(ADIO_File fd, int rank)
+void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code)
{
int i;
int len;
@@ -40,7 +40,11 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank)
i = rand();
pid = (int)getpid();
- ADIOI_Strncpy(fd->shared_fp_fname, fd->filename, 256);
+ if (ADIOI_Strncpy(fd->shared_fp_fname, fd->filename, 256)) {
+ *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
+ fd->filename, ENAMETOOLONG);
+ return;
+ }
#ifdef ROMIO_NTFS
slash = strrchr(fd->filename, '\\');
@@ -48,8 +52,16 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank)
slash = strrchr(fd->filename, '/');
#endif
if (!slash) {
- ADIOI_Strncpy(fd->shared_fp_fname, ".", 2);
- ADIOI_Strncpy(fd->shared_fp_fname + 1, fd->filename, 255);
+ if (ADIOI_Strncpy(fd->shared_fp_fname, ".", 2)) {
+ *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
+ fd->filename, ENAMETOOLONG);
+ return;
+ }
+ if (ADIOI_Strncpy(fd->shared_fp_fname + 1, fd->filename, 255)) {
+ *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
+ fd->filename, ENAMETOOLONG);
+ return;
+ }
}
else {
ptr = slash;
@@ -58,13 +70,22 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank)
#else
slash = strrchr(fd->shared_fp_fname, '/');
#endif
- ADIOI_Strncpy(slash + 1, ".", 2);
+ if (ADIOI_Strncpy(slash + 1, ".", 2)) {
+ *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
+ fd->filename, ENAMETOOLONG);
+ return;
+ }
/* ok to cast: file names bounded by PATH_MAX and NAME_MAX */
len = (int) (256 - (slash+2 - fd->shared_fp_fname));
- ADIOI_Strncpy(slash + 2, ptr + 1, len);
+ if (ADIOI_Strncpy(slash + 2, ptr + 1, len)) {
+ *error_code = ADIOI_Err_create_code("ADIOI_Shfp_fname",
+ ptr + 1, ENAMETOOLONG);
+ return;
+ }
}
ADIOI_Snprintf(tmp, 128, ".shfp.%d.%d", pid, i);
+ /* ADIOI_Strnapp will return non-zero if truncated. That's ok */
ADIOI_Strnapp(fd->shared_fp_fname, tmp, 256);
len = (int)strlen(fd->shared_fp_fname);
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index 02cea30..67dd91e 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -691,7 +691,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
void ADIOI_GEN_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
void ADIOI_GEN_Close(ADIO_File fd, int *error_code);
-void ADIOI_Shfp_fname(ADIO_File fd, int rank);
+void ADIOI_Shfp_fname(ADIO_File fd, int rank, int *error_code);
void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset size, int *error_code);
int ADIOI_Error(ADIO_File fd, int error_code, char *string);
int MPIR_Err_setmsg( int, int, const char *, const char *, const char *, ... );
diff --git a/src/mpi/romio/mpi-io/open.c b/src/mpi/romio/mpi-io/open.c
index 27a3e84..a2a68c9 100644
--- a/src/mpi/romio/mpi-io/open.c
+++ b/src/mpi/romio/mpi-io/open.c
@@ -179,7 +179,9 @@ int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode,
if ((error_code == MPI_SUCCESS) &&
ADIO_Feature((*fh), ADIO_SHARED_FP)) {
MPI_Comm_rank(dupcomm, &rank);
- ADIOI_Shfp_fname(*fh, rank);
+ ADIOI_Shfp_fname(*fh, rank, &error_code);
+ if (error_code != MPI_SUCCESS)
+ goto fn_fail;
/* if MPI_MODE_APPEND, set the shared file pointer to end of file.
indiv. file pointer already set to end of file in ADIO_Open.
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/common/ad_fstype.c | 4 --
src/mpi/romio/adio/common/shfp_fname.c | 46 ++++++++++++++++++++++-------
src/mpi/romio/adio/common/system_hints.c | 4 --
src/mpi/romio/adio/include/adioi.h | 8 ++++-
src/mpi/romio/mpi-io/open.c | 4 ++-
5 files changed, 45 insertions(+), 21 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0