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
June 2015
- 1 participants
- 58 discussions
[mpich] MPICH primary repository branch, master, updated. v3.2b3-120-gbac2513
by noreply@mpich.org 23 Jun '15
by noreply@mpich.org 23 Jun '15
23 Jun '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 bac25133c02822ef28e5011a71ad713966c5f0c5 (commit)
from 3efedf179d0cd885d32f8b47eccc52f9f851ef17 (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/bac25133c02822ef28e5011a71ad71396…
commit bac25133c02822ef28e5011a71ad713966c5f0c5
Author: Halim Amer <aamer(a)anl.gov>
Date: Mon Jun 22 22:32:01 2015 -0500
Added tests to stream ACC-like RMA ops
Signed-off-by: Min Si <msi(a)il.is.s.u-tokyo.ac.jp>
Signed-off-by: Rob Latham <robl(a)mcs.anl.gov>
diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index d5fcfe6..16f9ad8 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -537,6 +537,15 @@
/rma/putpscw1
/rma/wintest
/rma/manyget
+/rma/lock_dt
+/rma/lock_dt_flush
+/rma/lock_dt_flushlocal
+/rma/lockall_dt
+/rma/lockall_dt_flush
+/rma/lockall_dt_flushall
+/rma/lockall_dt_flushlocal
+/rma/lockall_dt_flushlocalall
+/rma/lock_contention_dt
/spawn/namepub
/spawn/disconnect3
/spawn/spaiccreate
diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 656afc6..8b3b9d5 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -25,6 +25,15 @@ noinst_PROGRAMS = \
lockcontention2 \
lockcontention3 \
lockopts \
+ lock_dt \
+ lock_dt_flush \
+ lock_dt_flushlocal \
+ lockall_dt \
+ lockall_dt_flush \
+ lockall_dt_flushall \
+ lockall_dt_flushlocal \
+ lockall_dt_flushlocalall\
+ lock_contention_dt \
contention_put \
contention_putget \
put_base \
diff --git a/test/mpi/rma/lock_contention_dt.c b/test/mpi/rma/lock_contention_dt.c
new file mode 100644
index 0000000..394f799
--- /dev/null
+++ b/test/mpi/rma/lock_contention_dt.c
@@ -0,0 +1,99 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test lock contention while streaming ACC-like operations";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int target = 1;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank != target) {
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, target, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, target, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_unlock(target, win);
+ MPI_Barrier(comm);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, target, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ target, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_unlock(target, win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else { /* Target checks the result */
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lock_dt.c b/test/mpi/rma/lock_dt.c
new file mode 100644
index 0000000..f98d4f4
--- /dev/null
+++ b/test/mpi/rma/lock_dt.c
@@ -0,0 +1,101 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size, source, dest;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ source = 0;
+ dest = size - 1;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ /* Make sure that everyone has a recv buffer */
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ dest, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else if (rank == dest) {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(dest, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(dest, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lock_dt_flush.c b/test/mpi/rma/lock_dt_flush.c
new file mode 100644
index 0000000..9613c92
--- /dev/null
+++ b/test/mpi/rma/lock_dt_flush.c
@@ -0,0 +1,109 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock+flush";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size, source, dest;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ source = 0;
+ dest = size - 1;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush(dest, win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ dest, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_flush(dest, win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+ free(resbuf);
+ }
+ else if (rank == dest) {
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ int err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lock_dt_flushlocal.c b/test/mpi/rma/lock_dt_flushlocal.c
new file mode 100644
index 0000000..ffd24e1
--- /dev/null
+++ b/test/mpi/rma/lock_dt_flushlocal.c
@@ -0,0 +1,110 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock+flush_local";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size, source, dest;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+ /* Determine the sender and receiver */
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ source = 0;
+ dest = size - 1;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ MPI_Aint slb, sextent;
+ MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush_local(dest, win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+
+ sendtype.InitBuf(&sendtype);
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ dest, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_flush_local(dest, win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else if (rank == dest) {
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ int err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(dest, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(dest, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt.c b/test/mpi/rma/lockall_dt.c
new file mode 100644
index 0000000..bdb7e97
--- /dev/null
+++ b/test/mpi/rma/lockall_dt.c
@@ -0,0 +1,107 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ }
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destinations to finish checking and reinitializing the buffers */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+
+ }
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flush.c b/test/mpi/rma/lockall_dt_flush.c
new file mode 100644
index 0000000..f6ddde3
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flush.c
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush(dest, win);
+ }
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destinations to finish checking and reinitializing the buffers */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush(dest, win);
+ }
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flushall.c b/test/mpi/rma/lockall_dt_flushall.c
new file mode 100644
index 0000000..9fdf416
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flushall.c
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush_all";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ }
+
+ MPI_Win_flush_all(win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+
+ }
+ MPI_Win_flush_all(win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flushlocal.c b/test/mpi/rma/lockall_dt_flushlocal.c
new file mode 100644
index 0000000..a3726b6
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flushlocal.c
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush_local";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ MPI_Aint slb, sextent;
+ MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush_local(dest, win);
+ }
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+
+ sendtype.InitBuf(&sendtype);
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destinations to finish checking and reinitializing the buffers */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush_local(dest, win);
+ }
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flushlocalall.c b/test/mpi/rma/lockall_dt_flushlocalall.c
new file mode 100644
index 0000000..9d662fa
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flushlocalall.c
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush_local_all";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ MPI_Aint slb, sextent;
+ MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ }
+
+ MPI_Win_flush_local_all(win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+
+ sendtype.InitBuf(&sendtype);
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+
+ }
+ MPI_Win_flush_local_all(win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/testlist.in b/test/mpi/rma/testlist.in
index fbf65cc..5f59ccd 100644
--- a/test/mpi/rma/testlist.in
+++ b/test/mpi/rma/testlist.in
@@ -28,6 +28,15 @@ lockcontention2 4
lockcontention2 8
lockcontention3 8
lockopts 2
+lock_dt 2
+lock_dt_flush 2
+lock_dt_flushlocal 2
+lockall_dt 4
+lockall_dt_flush 4
+lockall_dt_flushall 4
+lockall_dt_flushlocal 4
+lockall_dt_flushlocalall 4
+lock_contention_dt 4
transpose4 2
fetchandadd 7
fetchandadd_tree 7
-----------------------------------------------------------------------
Summary of changes:
test/mpi/.gitignore | 9 +++
test/mpi/rma/Makefile.am | 9 +++
test/mpi/rma/lock_contention_dt.c | 99 ++++++++++++++++++++++++++
test/mpi/rma/lock_dt.c | 101 ++++++++++++++++++++++++++
test/mpi/rma/lock_dt_flush.c | 109 ++++++++++++++++++++++++++++
test/mpi/rma/lock_dt_flushlocal.c | 110 ++++++++++++++++++++++++++++
test/mpi/rma/lockall_dt.c | 107 ++++++++++++++++++++++++++++
test/mpi/rma/lockall_dt_flush.c | 117 ++++++++++++++++++++++++++++++
test/mpi/rma/lockall_dt_flushall.c | 118 +++++++++++++++++++++++++++++++
test/mpi/rma/lockall_dt_flushlocal.c | 117 ++++++++++++++++++++++++++++++
test/mpi/rma/lockall_dt_flushlocalall.c | 118 +++++++++++++++++++++++++++++++
test/mpi/rma/testlist.in | 9 +++
12 files changed, 1023 insertions(+), 0 deletions(-)
create mode 100644 test/mpi/rma/lock_contention_dt.c
create mode 100644 test/mpi/rma/lock_dt.c
create mode 100644 test/mpi/rma/lock_dt_flush.c
create mode 100644 test/mpi/rma/lock_dt_flushlocal.c
create mode 100644 test/mpi/rma/lockall_dt.c
create mode 100644 test/mpi/rma/lockall_dt_flush.c
create mode 100644 test/mpi/rma/lockall_dt_flushall.c
create mode 100644 test/mpi/rma/lockall_dt_flushlocal.c
create mode 100644 test/mpi/rma/lockall_dt_flushlocalall.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, signed/rma-test-so, created. v3.2b3-114-g14099b3
by noreply@mpich.org 23 Jun '15
by noreply@mpich.org 23 Jun '15
23 Jun '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, signed/rma-test-so has been created
at 14099b3e7981be79fc920b54ed0a8f2d60cc9a7b (commit)
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/14099b3e7981be79fc920b54ed0a8f2d6…
commit 14099b3e7981be79fc920b54ed0a8f2d60cc9a7b
Author: Halim Amer <aamer(a)anl.gov>
Date: Mon Jun 22 22:32:01 2015 -0500
Added tests to stream ACC-like RMA ops
Signed-off-by: Min Si <msi(a)il.is.s.u-tokyo.ac.jp>
Signed-off-by: Rob Latham <robl(a)mcs.anl.gov>
diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index d5fcfe6..16f9ad8 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -537,6 +537,15 @@
/rma/putpscw1
/rma/wintest
/rma/manyget
+/rma/lock_dt
+/rma/lock_dt_flush
+/rma/lock_dt_flushlocal
+/rma/lockall_dt
+/rma/lockall_dt_flush
+/rma/lockall_dt_flushall
+/rma/lockall_dt_flushlocal
+/rma/lockall_dt_flushlocalall
+/rma/lock_contention_dt
/spawn/namepub
/spawn/disconnect3
/spawn/spaiccreate
diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 656afc6..8b3b9d5 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -25,6 +25,15 @@ noinst_PROGRAMS = \
lockcontention2 \
lockcontention3 \
lockopts \
+ lock_dt \
+ lock_dt_flush \
+ lock_dt_flushlocal \
+ lockall_dt \
+ lockall_dt_flush \
+ lockall_dt_flushall \
+ lockall_dt_flushlocal \
+ lockall_dt_flushlocalall\
+ lock_contention_dt \
contention_put \
contention_putget \
put_base \
diff --git a/test/mpi/rma/lock_contention_dt.c b/test/mpi/rma/lock_contention_dt.c
new file mode 100644
index 0000000..394f799
--- /dev/null
+++ b/test/mpi/rma/lock_contention_dt.c
@@ -0,0 +1,99 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test lock contention while streaming ACC-like operations";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int target = 1;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank != target) {
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, target, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, target, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_unlock(target, win);
+ MPI_Barrier(comm);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, target, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ target, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_unlock(target, win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else { /* Target checks the result */
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lock_dt.c b/test/mpi/rma/lock_dt.c
new file mode 100644
index 0000000..f98d4f4
--- /dev/null
+++ b/test/mpi/rma/lock_dt.c
@@ -0,0 +1,101 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size, source, dest;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ source = 0;
+ dest = size - 1;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ /* Make sure that everyone has a recv buffer */
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ dest, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else if (rank == dest) {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(dest, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(dest, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lock_dt_flush.c b/test/mpi/rma/lock_dt_flush.c
new file mode 100644
index 0000000..9613c92
--- /dev/null
+++ b/test/mpi/rma/lock_dt_flush.c
@@ -0,0 +1,109 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock+flush";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size, source, dest;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ source = 0;
+ dest = size - 1;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush(dest, win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ dest, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_flush(dest, win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+ free(resbuf);
+ }
+ else if (rank == dest) {
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ int err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Barrier(comm);
+ MPI_Win_unlock(dest, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lock_dt_flushlocal.c b/test/mpi/rma/lock_dt_flushlocal.c
new file mode 100644
index 0000000..ffd24e1
--- /dev/null
+++ b/test/mpi/rma/lock_dt_flushlocal.c
@@ -0,0 +1,110 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock+flush_local";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size, source, dest;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+ /* Determine the sender and receiver */
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ source = 0;
+ dest = size - 1;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ MPI_Aint slb, sextent;
+ MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush_local(dest, win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+
+ sendtype.InitBuf(&sendtype);
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count, recvtype.datatype,
+ dest, 0, recvtype.count, recvtype.datatype, MPI_REPLACE,
+ win);
+ MPI_Win_flush_local(dest, win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock(dest, win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else if (rank == dest) {
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ int err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(dest, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(dest, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt.c b/test/mpi/rma/lockall_dt.c
new file mode 100644
index 0000000..bdb7e97
--- /dev/null
+++ b/test/mpi/rma/lockall_dt.c
@@ -0,0 +1,107 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ }
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destinations to finish checking and reinitializing the buffers */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+
+ }
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flush.c b/test/mpi/rma/lockall_dt_flush.c
new file mode 100644
index 0000000..f6ddde3
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flush.c
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush(dest, win);
+ }
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destinations to finish checking and reinitializing the buffers */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush(dest, win);
+ }
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flushall.c b/test/mpi/rma/lockall_dt_flushall.c
new file mode 100644
index 0000000..9fdf416
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flushall.c
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush_all";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ }
+
+ MPI_Win_flush_all(win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+
+ }
+ MPI_Win_flush_all(win);
+ /*signal to dest that the ops are flushed so that it starts checking the result */
+ MPI_Barrier(comm);
+ /*make sure dest finishes checking the result before issuing unlock */
+ MPI_Barrier(comm);
+ MPI_Win_unlock_all(win);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Barrier(comm);
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flushlocal.c b/test/mpi/rma/lockall_dt_flushlocal.c
new file mode 100644
index 0000000..a3726b6
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flushlocal.c
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush_local";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ MPI_Aint slb, sextent;
+ MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush_local(dest, win);
+ }
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+
+ sendtype.InitBuf(&sendtype);
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destinations to finish checking and reinitializing the buffers */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+ MPI_Win_flush_local(dest, win);
+ }
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/lockall_dt_flushlocalall.c b/test/mpi/rma/lockall_dt_flushlocalall.c
new file mode 100644
index 0000000..9d662fa
--- /dev/null
+++ b/test/mpi/rma/lockall_dt_flushlocalall.c
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2015 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock_all+flush_local_all";
+*/
+
+int main(int argc, char *argv[])
+{
+ int errs = 0;
+ int rank, size;
+ int minsize = 2, count;
+ MPI_Comm comm;
+ MPI_Win win;
+ MPI_Aint lb, extent;
+ MTestDatatype sendtype, recvtype;
+
+ MTest_Init(&argc, &argv);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &size);
+ int source = 0;
+
+ MTEST_DATATYPE_FOR_EACH_COUNT(count) {
+ while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
+ recvtype.printErrors = 1;
+ recvtype.InitBuf(&recvtype);
+ MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
+
+ MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
+ (int) extent, MPI_INFO_NULL, comm, &win);
+ if (rank == source) {
+ int dest;
+ MPI_Aint slb, sextent;
+ MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
+ sendtype.InitBuf(&sendtype);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, dest, 0,
+ recvtype.count, recvtype.datatype, MPI_REPLACE, win);
+ }
+
+ MPI_Win_flush_local_all(win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+
+ sendtype.InitBuf(&sendtype);
+ char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
+
+ /*wait for the destination to finish checking and reinitializing the buffer */
+ MPI_Barrier(comm);
+
+ MPI_Win_lock_all(0, win);
+ for (dest = 0; dest < size; dest++)
+ if (dest != source) {
+ MPI_Get_accumulate(sendtype.buf, sendtype.count,
+ sendtype.datatype, resbuf, recvtype.count,
+ recvtype.datatype, dest, 0, recvtype.count,
+ recvtype.datatype, MPI_REPLACE, win);
+
+ }
+ MPI_Win_flush_local_all(win);
+ /* reset the send buffer to test local completion */
+ memset(sendtype.buf, 0, slb + sextent * sendtype.count);
+ MPI_Win_unlock_all(win);
+ MPI_Barrier(comm);
+ free(resbuf);
+ }
+ else {
+ int err;
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ recvtype.InitBuf(&recvtype);
+ MPI_Win_unlock(rank, win);
+
+ /*signal the source that checking and reinitialization is done */
+ MPI_Barrier(comm);
+
+ MPI_Barrier(comm);
+ MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
+ err = MTestCheckRecv(0, &recvtype);
+ if (err)
+ errs++;
+ MPI_Win_unlock(rank, win);
+ }
+
+ MPI_Win_free(&win);
+ MTestFreeDatatype(&sendtype);
+ MTestFreeDatatype(&recvtype);
+ }
+ }
+ MTestFreeComm(&comm);
+ }
+ MTest_Finalize(errs);
+ MPI_Finalize();
+ return 0;
+}
diff --git a/test/mpi/rma/testlist.in b/test/mpi/rma/testlist.in
index fbf65cc..5f59ccd 100644
--- a/test/mpi/rma/testlist.in
+++ b/test/mpi/rma/testlist.in
@@ -28,6 +28,15 @@ lockcontention2 4
lockcontention2 8
lockcontention3 8
lockopts 2
+lock_dt 2
+lock_dt_flush 2
+lock_dt_flushlocal 2
+lockall_dt 4
+lockall_dt_flush 4
+lockall_dt_flushall 4
+lockall_dt_flushlocal 4
+lockall_dt_flushlocalall 4
+lock_contention_dt 4
transpose4 2
fetchandadd 7
fetchandadd_tree 7
-----------------------------------------------------------------------
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-119-g3efedf1
by noreply@mpich.org 23 Jun '15
by noreply@mpich.org 23 Jun '15
23 Jun '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 3efedf179d0cd885d32f8b47eccc52f9f851ef17 (commit)
via 3503f3959706f45190e351c29cacce3f4728889a (commit)
from 1e8b428e5294512db56083890556a45a786787eb (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/3efedf179d0cd885d32f8b47eccc52f9f…
commit 3efedf179d0cd885d32f8b47eccc52f9f851ef17
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Tue Jun 23 11:36:50 2015 -0500
Simplify code: using MPIDI_CH3I_RMA_Ops_free_elem to delete operation.
Signed-off-by: Sangmin Seo <sseo(a)anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 2dcadf7..206ad50 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -545,8 +545,7 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
curr_op->reqs = NULL;
curr_op->reqs_size = 0;
}
- MPL_LL_DELETE(*op_list_head, *op_list_tail, curr_op);
- MPIDI_CH3I_Win_op_free(win_ptr, curr_op);
+ MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, op_list_head, op_list_tail, curr_op);
}
else {
if (read_flag == 1) {
http://git.mpich.org/mpich.git/commitdiff/3503f3959706f45190e351c29cacce3f4…
commit 3503f3959706f45190e351c29cacce3f4728889a
Author: Xin Zhao <xinzhao3(a)illinois.edu>
Date: Tue Jun 23 11:10:40 2015 -0500
Bug-fix on typo error.
Signed-off-by: Sangmin Seo <sseo(a)anl.gov>
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index f6a7ae3..2dcadf7 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -551,7 +551,7 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
else {
if (read_flag == 1) {
op_list_head = &curr_target->issued_write_op_list_head;
- op_list_head = &curr_target->issued_write_op_list_tail;
+ op_list_tail = &curr_target->issued_write_op_list_tail;
read_flag = 0;
}
else {
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/src/ch3u_rma_progress.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-117-g1e8b428
by noreply@mpich.org 22 Jun '15
by noreply@mpich.org 22 Jun '15
22 Jun '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 1e8b428e5294512db56083890556a45a786787eb (commit)
via 31d95ed7b18c47a56b28a35ad464a9ce96538fa8 (commit)
via 68f8c7aa798f7009529f85d17aa2c9395320b5a8 (commit)
via 5e67e4824d1d7f4c007f6860c6a628e6aac6ef63 (commit)
from 23b08871308fa33af2706707a114efe0f3fd7516 (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/1e8b428e5294512db56083890556a45a7…
commit 1e8b428e5294512db56083890556a45a786787eb
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Wed Jun 17 16:35:54 2015 -0500
Update PAMI device for larger count types
type promotions have resulted in a change to the device layer.
Ref: 1767
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
Signed-off-by: Sameh S Sharkawi <sssharka(a)us.ibm.com>
diff --git a/src/mpid/pamid/include/mpidi_datatypes.h b/src/mpid/pamid/include/mpidi_datatypes.h
index d3e4797..11c07e2 100644
--- a/src/mpid/pamid/include/mpidi_datatypes.h
+++ b/src/mpid/pamid/include/mpidi_datatypes.h
@@ -278,7 +278,7 @@ struct MPIDI_Request
MPIDI_MsgEnvelope envelope;
void *userbuf; /**< User buffer */
- unsigned userbufcount; /**< Userbuf data count */
+ MPI_Aint userbufcount; /**< Userbuf data count */
MPI_Datatype datatype; /**< Data type of message */
pami_task_t peer_pami; /**< The other guy's rank (in PAMI) */
unsigned peer_comm; /**< The other guy's rank (in the orig communicator) */
diff --git a/src/mpid/pamid/include/mpidi_prototypes.h b/src/mpid/pamid/include/mpidi_prototypes.h
index f2e60ae..d12f241 100644
--- a/src/mpid/pamid/include/mpidi_prototypes.h
+++ b/src/mpid/pamid/include/mpidi_prototypes.h
@@ -59,11 +59,11 @@ void MPIDI_Recvq_insert_ool (MPID_Request *q,MPID_Request *e);
/** \} */
void MPIDI_Buffer_copy(const void * const sbuf,
- int scount,
+ MPI_Aint scount,
MPI_Datatype sdt,
int * smpi_errno,
void * const rbuf,
- int rcount,
+ MPI_Aint rcount,
MPI_Datatype rdt,
MPIDI_msg_sz_t * rsz,
int * rmpi_errno);
@@ -77,7 +77,7 @@ void MPIDI_RecvMsg_procnull(MPID_Comm * comm,
unsigned is_blocking,
MPI_Status * status,
MPID_Request ** request);
-void MPIDI_RecvMsg_Unexp(MPID_Request * rreq, void * buf, int count, MPI_Datatype datatype);
+void MPIDI_RecvMsg_Unexp(MPID_Request * rreq, void * buf, MPI_Aint count, MPI_Datatype datatype);
/**
* \defgroup MPID_CALLBACKS MPID callbacks for communication
diff --git a/src/mpid/pamid/src/mpid_buffer.c b/src/mpid/pamid/src/mpid_buffer.c
index 2a4407b..9c21293 100644
--- a/src/mpid/pamid/src/mpid_buffer.c
+++ b/src/mpid/pamid/src/mpid_buffer.c
@@ -46,8 +46,8 @@
* \param[out] rmpi_errno Returns errors
*/
void MPIDI_Buffer_copy(
- const void * const sbuf, int scount, MPI_Datatype sdt, int * smpi_errno,
- void * const rbuf, int rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz, int * rmpi_errno)
+ const void * const sbuf, MPI_Aint scount, MPI_Datatype sdt, int * smpi_errno,
+ void * const rbuf, MPI_Aint rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz, int * rmpi_errno)
{
int sdt_contig;
int rdt_contig;
diff --git a/src/mpid/pamid/src/pt2pt/mpid_irecv.h b/src/mpid/pamid/src/pt2pt/mpid_irecv.h
index 1160ad3..1f8d4bc 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_irecv.h
+++ b/src/mpid/pamid/src/pt2pt/mpid_irecv.h
@@ -44,7 +44,7 @@
*/
static inline int
MPID_Irecv_inline(void * buf,
- int count,
+ MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
diff --git a/src/mpid/pamid/src/pt2pt/mpid_isend.h b/src/mpid/pamid/src/pt2pt/mpid_isend.h
index 1dc58af..b9e999b 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_isend.h
+++ b/src/mpid/pamid/src/pt2pt/mpid_isend.h
@@ -80,7 +80,7 @@ MPIDI_Context_local(MPID_Request * req)
*/
static inline int
MPID_Isend_inline(const void * buf,
- int count,
+ MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
diff --git a/src/mpid/pamid/src/pt2pt/mpid_send.h b/src/mpid/pamid/src/pt2pt/mpid_send.h
index 35acb1a..ce2f8f0 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_send.h
+++ b/src/mpid/pamid/src/pt2pt/mpid_send.h
@@ -43,7 +43,7 @@
*/
static inline int
MPID_Send_inline(const void * buf,
- int count,
+ MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_recv.h b/src/mpid/pamid/src/pt2pt/mpidi_recv.h
index aaa029b..211fbc3 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_recv.h
+++ b/src/mpid/pamid/src/pt2pt/mpidi_recv.h
@@ -135,7 +135,7 @@ MPIDI_Alloc_lock_inline(void **buf,size_t size)
*/
static inline int
MPIDI_Recv(void * buf,
- int count,
+ MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c b/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
index 41914fc..7bdbfba 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
@@ -26,7 +26,7 @@
void
MPIDI_RecvMsg_Unexp(MPID_Request * rreq,
void * buf,
- int count,
+ MPI_Aint count,
MPI_Datatype datatype)
{
/* ------------------------------------------------------------ */
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_send.h b/src/mpid/pamid/src/pt2pt/mpidi_send.h
index ba65e68..b7ed74d 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_send.h
+++ b/src/mpid/pamid/src/pt2pt/mpidi_send.h
@@ -74,7 +74,7 @@ MPIDI_SendDoneCB_inline(pami_context_t context,
*/
static inline int
MPIDI_Send(const void * buf,
- int count,
+ MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
http://git.mpich.org/mpich.git/commitdiff/31d95ed7b18c47a56b28a35ad464a9ce9…
commit 31d95ed7b18c47a56b28a35ad464a9ce96538fa8
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Jun 16 17:17:03 2015 -0500
a "large contig" type
despite promoting types throughout the gather path, still had one case of
constructing structs with larger-than-int blocklens. solution: borrow BigMPI
strategy and construct types-of-chunks to get around limitations.
Ref: #1767
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index d786c90..a6cf10d 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -4464,6 +4464,9 @@ int MPIR_Type_create_hindexed_block_impl(int count, int blocklength,
int MPIR_Type_contiguous_impl(int count,
MPI_Datatype old_type,
MPI_Datatype *new_type_p);
+int MPIR_Type_contiguous_x_impl(MPI_Count count,
+ MPI_Datatype old_type,
+ MPI_Datatype *new_type_p);
void MPIR_Type_get_extent_impl(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent);
void MPIR_Type_get_true_extent_impl(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
void MPIR_Type_get_envelope_impl(MPI_Datatype datatype, int *num_integers, int *num_addresses,
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index e979ede..964546c 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -329,10 +329,16 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
blocks[0] = sendcount;
struct_displs[0] = MPI_VOID_PTR_CAST_TO_MPI_AINT sendbuf;
types[0] = sendtype;
- blocks[1] = curr_cnt - nbytes;
+ /* check for overflow. work around int limits if needed*/
+ if (curr_cnt - nbytes != (int)(curr_cnt - nbytes)) {
+ blocks[1] = 1;
+ MPIR_Type_contiguous_x_impl(curr_cnt - nbytes,
+ MPI_BYTE, &(types[1]));
+ } else {
+ MPIU_Assign_trunc(blocks[1], curr_cnt - nbytes, int);
+ types[1] = MPI_BYTE;
+ }
struct_displs[1] = MPI_VOID_PTR_CAST_TO_MPI_AINT tmp_buf;
- types[1] = MPI_BYTE;
-
mpi_errno = MPIR_Type_create_struct_impl(2, blocks, struct_displs, types, &tmp_type);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
@@ -348,6 +354,8 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
MPIR_Type_free_impl(&tmp_type);
+ if (types[1] != MPI_BYTE)
+ MPIR_Type_free_impl(&types[1]);
}
break;
diff --git a/src/mpi/datatype/type_contiguous.c b/src/mpi/datatype/type_contiguous.c
index 91e6f00..ee4de6c 100644
--- a/src/mpi/datatype/type_contiguous.c
+++ b/src/mpi/datatype/type_contiguous.c
@@ -63,7 +63,53 @@ int MPIR_Type_contiguous_impl(int count,
goto fn_exit;
}
+#undef FUNCNAME
+#define FUNCNAME MPIR_Type_contiguous_x_impl
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPIR_Type_contiguous_x_impl(MPI_Count count,
+ MPI_Datatype oldtype,
+ MPI_Datatype *newtype)
+{
+ /* to make 'count' fit MPI-3 type processing routines (which take integer
+ * counts), we construct a type consisting of N INT_MAX chunks followed by
+ * a remainder. e.g for a count of 4000000000 bytes you would end up with
+ * one 2147483647-byte chunk followed immediately by a 1852516353-byte
+ * chunk */
+ MPI_Datatype chunks, remainder;
+ MPI_Aint lb, extent, disps[2];
+ int blocklens[2];
+ MPI_Datatype types[2];
+ int mpi_errno;
+
+ /* 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! */
+ MPIU_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_errno = MPIR_Type_vector_impl(c, INT_MAX, INT_MAX, oldtype, &chunks);
+ if (mpi_errno != MPI_SUCCESS) goto fn_fail;
+ mpi_errno = MPIR_Type_contiguous_impl(r, oldtype, &remainder);
+ if (mpi_errno != MPI_SUCCESS) goto fn_fail;
+ MPIR_Type_get_extent_impl(oldtype, &lb, &extent);
+
+ blocklens[0] = 1; blocklens[1] = 1;
+ disps[0] = 0; disps[1] = c*extent*INT_MAX;
+ types[0] = chunks; types[1] = remainder;
+
+ mpi_errno = MPIR_Type_create_struct_impl(2, blocklens, disps, types, newtype);
+
+ MPIR_Type_free_impl(&chunks);
+ MPIR_Type_free_impl(&remainder);
+
+fn_exit:
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
#endif
http://git.mpich.org/mpich.git/commitdiff/68f8c7aa798f7009529f85d17aa2c9395…
commit 68f8c7aa798f7009529f85d17aa2c9395320b5a8
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Jun 12 10:30:04 2015 -0500
promote more types to larger versions
The ongoing march towards 64-bit clean continues. Address areas where large
product of two ints might have overflowed.
Ref: #1767
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 1e18a17..d786c90 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2850,7 +2850,7 @@ int MPID_Comm_revoke(MPID_Comm *comm, int is_remote);
Communication
@*/
-int MPID_Send( const void *buf, int count, MPI_Datatype datatype,
+int MPID_Send( const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
@@ -2900,7 +2900,7 @@ int MPID_Rsend( const void *buf, int count, MPI_Datatype datatype,
Communication
@*/
-int MPID_Ssend( const void *buf, int count, MPI_Datatype datatype,
+int MPID_Ssend( const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
@@ -2955,7 +2955,7 @@ int MPID_tBsend( const void *buf, int count, MPI_Datatype datatype,
Communication
@*/
-int MPID_Isend( const void *buf, int count, MPI_Datatype datatype,
+int MPID_Isend( const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
@@ -3015,7 +3015,7 @@ int MPID_Issend( const void *buf, int count, MPI_Datatype datatype,
Communication
@*/
-int MPID_Recv( void *buf, int count, MPI_Datatype datatype,
+int MPID_Recv( void *buf, MPI_Aint count, MPI_Datatype datatype,
int source, int tag, MPID_Comm *comm, int context_offset,
MPI_Status *status, MPID_Request **request );
@@ -3035,7 +3035,7 @@ int MPID_Recv( void *buf, int count, MPI_Datatype datatype,
Communication
@*/
-int MPID_Irecv( void *buf, int count, MPI_Datatype datatype,
+int MPID_Irecv( void *buf, MPI_Aint count, MPI_Datatype datatype,
int source, int tag, MPID_Comm *comm, int context_offset,
MPID_Request **request );
@@ -3905,20 +3905,20 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
other internal operations. They are wrappers around MPID send/recv
functions. They do sends/receives by setting the context offset to
MPID_CONTEXT_INTRA(INTER)_COLL. */
-int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
- void *recvbuf, int recvcount, MPI_Datatype recvtype);
+int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
+ void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype);
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 */
-int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
+int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
-int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
+int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int tag,
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,
+int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
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,
+int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
+ int dest, int sendtag, void *recvbuf, MPI_Aint recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
@@ -4474,7 +4474,7 @@ int MPIR_Type_indexed_impl(int count, const int blocklens[], const int indices[]
void MPIR_Type_free_impl(MPI_Datatype *datatype);
int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype old_type, MPI_Datatype *newtype_p);
int MPIR_Type_struct_impl(int count, const int blocklens[], const MPI_Aint indices[], const MPI_Datatype old_types[], MPI_Datatype *newtype);
-int MPIR_Pack_impl(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position);
+int MPIR_Pack_impl(const void *inbuf, MPI_Aint incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position);
void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, MPI_Aint *size);
int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
void *outbuf, int outcount, MPI_Datatype datatype);
diff --git a/src/mpi/coll/gather.c b/src/mpi/coll/gather.c
index ee6384f..e979ede 100644
--- a/src/mpi/coll/gather.c
+++ b/src/mpi/coll/gather.c
@@ -92,10 +92,12 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- int curr_cnt=0, relative_rank, nbytes, is_homogeneous;
- int mask, sendtype_size, recvtype_size, src, dst, relative_src;
+ int relative_rank, is_homogeneous;
+ int mask, src, dst, relative_src;
+ MPI_Aint curr_cnt=0, nbytes, sendtype_size, recvtype_size;
int recvblks;
- int tmp_buf_size, missing;
+ int missing;
+ MPI_Aint tmp_buf_size;
void *tmp_buf=NULL;
MPI_Status status;
MPI_Aint extent=0; /* Datatype extent */
@@ -230,8 +232,11 @@ 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_ptr, &status, errflag);
+ /* small transfer size case. cast ok */
+ MPIU_Assert(recvblks*nbytes == (int)(recvblks*nbytes));
+ mpi_errno = MPIC_Recv(tmp_buf, (int)(recvblks * nbytes),
+ MPI_BYTE, 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);
@@ -267,7 +272,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
else /* Intermediate nodes store in temporary buffer */
{
- int offset;
+ MPI_Aint offset;
/* Estimate the amount of data that is going to come in */
recvblks = mask;
@@ -505,7 +510,8 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int rank, local_size, remote_size, mpi_errno=MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- int i, nbytes, sendtype_size, recvtype_size;
+ int i;
+ MPI_Aint nbytes, sendtype_size, recvtype_size;
MPI_Status status;
MPI_Aint extent, true_extent, true_lb = 0;
void *tmp_buf=NULL;
@@ -825,7 +831,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
/* catch common aliasing cases */
if (recvbuf != MPI_IN_PLACE && sendtype == recvtype && sendcount == recvcount && sendcount != 0) {
- int recvtype_size;
+ MPI_Aint recvtype_size;
MPID_Datatype_get_size_macro(recvtype, recvtype_size);
MPIR_ERRTEST_ALIAS_COLL(sendbuf, ((char *)recvbuf) + comm_ptr->rank*recvcount*recvtype_size,mpi_errno);
}
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 62c81df..b78d6b6 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -47,8 +47,8 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
#define FUNCNAME MPIR_Localcopy
#undef FCNAME
#define FCNAME "MPIR_Localcopy"
-int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
- void *recvbuf, int recvcount, MPI_Datatype recvtype)
+int MPIR_Localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
+ void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype)
{
int mpi_errno = MPI_SUCCESS;
int sendtype_iscontig, recvtype_iscontig;
@@ -268,7 +268,7 @@ int MPIC_Wait(MPID_Request * request_ptr, mpir_errflag_t *errflag)
#define FUNCNAME MPIC_Send
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
+int MPIC_Send(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
@@ -326,7 +326,7 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
#define FUNCNAME MPIC_Recv
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
+int MPIC_Recv(void *buf, MPI_Aint count, MPI_Datatype datatype, int source, int tag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
@@ -384,7 +384,7 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
#define FUNCNAME MPIC_Ssend
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
+int MPIC_Ssend(const void *buf, MPI_Aint count, MPI_Datatype datatype, int dest, int tag,
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
@@ -442,8 +442,8 @@ int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int
#define FUNCNAME MPIC_Sendrecv
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
- int dest, int sendtag, void *recvbuf, int recvcount,
+int MPIC_Sendrecv(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype,
+ int dest, int sendtag, void *recvbuf, MPI_Aint recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag)
{
diff --git a/src/mpi/datatype/pack.c b/src/mpi/datatype/pack.c
index 01b007d..fba8b94 100644
--- a/src/mpi/datatype/pack.c
+++ b/src/mpi/datatype/pack.c
@@ -31,7 +31,7 @@ int MPI_Pack(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Pack_impl(const void *inbuf,
- int incount,
+ MPI_Aint incount,
MPI_Datatype datatype,
void *outbuf,
MPI_Aint outsize,
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 760827a..ddcc336 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -706,35 +706,35 @@ typedef struct MPIDI_Comm_ops
/* Overriding calls in case of matching-capable interfaces */
int (*recv_posted)(struct MPIDI_VC *vc, struct MPID_Request *req);
- int (*send)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*send)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request);
- int (*rsend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
- int dest, int tag, MPID_Comm *comm, int context_offset,
+ int (*rsend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+ int dest, int tag, MPID_Comm *comm, MPI_Aint context_offset,
struct MPID_Request **request);
- int (*ssend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*ssend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
- int (*isend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*isend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
- int (*irsend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*irsend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
- int (*issend)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*issend)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
- int (*send_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*send_init)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*bsend_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request);
- int (*rsend_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*rsend_init)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
- int (*ssend_init)(struct MPIDI_VC *vc, const void *buf, int count, MPI_Datatype datatype,
+ int (*ssend_init)(struct MPIDI_VC *vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
int dest, int tag, MPID_Comm *comm, int context_offset,
struct MPID_Request **request );
int (*startall)(struct MPIDI_VC *vc, int count, struct MPID_Request *requests[]);
@@ -803,7 +803,7 @@ typedef struct MPIDI_VC
/* rendezvous function pointers. Called to send a rendevous
message or when one is matched */
- int (* rndvSend_fn)( struct MPID_Request **sreq_p, const void * buf, int count,
+ int (* rndvSend_fn)( struct MPID_Request **sreq_p, const void * buf, MPI_Aint count,
MPI_Datatype datatype, int dt_contig, MPIDI_msg_sz_t data_sz,
MPI_Aint dt_true_lb, int rank, int tag,
struct MPID_Comm * comm, int context_offset );
@@ -1082,7 +1082,7 @@ const char * MPIDI_VC_GetStateString(int);
/* Prototypes for internal device routines */
-int MPIDI_Isend_self(const void *, int, MPI_Datatype, int, int, MPID_Comm *,
+int MPIDI_Isend_self(const void *, MPI_Aint, MPI_Datatype, int, int, MPID_Comm *,
int, int, MPID_Request **);
/*--------------------------
@@ -1578,7 +1578,7 @@ MPID_Request * MPIDI_CH3U_Recvq_FDU_matchonly(int source, int tag, int context_i
int *foundp);
MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
int context_id, MPID_Comm *comm, void *user_buf,
- int user_count, MPI_Datatype datatype, int * foundp);
+ MPI_Aint user_count, MPI_Datatype datatype, int * foundp);
int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq);
MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match,
int * found);
@@ -1593,9 +1593,9 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq);
int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq);
int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq);
-void MPIDI_CH3U_Buffer_copy(const void * const sbuf, int scount,
+void MPIDI_CH3U_Buffer_copy(const void * const sbuf, MPI_Aint scount,
MPI_Datatype sdt, int * smpi_errno,
- void * const rbuf, int rcount, MPI_Datatype rdt,
+ void * const rbuf, MPI_Aint rcount, MPI_Datatype rdt,
MPIDI_msg_sz_t * rdata_sz, int * rmpi_errno);
int MPIDI_CH3U_Post_data_receive(int found, MPID_Request ** rreqp);
int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreqp);
@@ -1920,7 +1920,7 @@ int MPIDI_CH3_PktPrint_EagerSyncAck( FILE *fp, MPIDI_CH3_Pkt_t *pkt );
/* Routines to create packets (used in implementing MPI communications */
int MPIDI_CH3_EagerNoncontigSend( MPID_Request **, MPIDI_CH3_Pkt_type_t,
- const void *, int,
+ const void *, MPI_Aint,
MPI_Datatype, MPIDI_msg_sz_t, int, int, MPID_Comm *,
int );
int MPIDI_CH3_EagerContigSend( MPID_Request **, MPIDI_CH3_Pkt_type_t,
@@ -1948,7 +1948,7 @@ int MPIDI_CH3_SendNoncontig_iov( struct MPIDI_VC *vc, struct MPID_Request *sreq,
/* Routines to ack packets, called in the receive routines when a
message is matched */
int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *, MPID_Request * );
-int MPIDI_CH3_RecvFromSelf( MPID_Request *, void *, int, MPI_Datatype );
+int MPIDI_CH3_RecvFromSelf( MPID_Request *, void *, MPI_Aint, MPI_Datatype );
int MPIDI_CH3_RecvRndv( MPIDI_VC_t *, MPID_Request * );
/* Handler routines to continuing after an IOV is processed (assigned to the
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 390c5ea..11a32e3 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -364,7 +364,7 @@ typedef struct MPIDI_Request {
/* user_buf, user_count, and datatype needed to process
rendezvous messages. */
void *user_buf;
- int user_count;
+ MPI_Aint user_count;
MPI_Datatype datatype;
int drop_data;
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index abee52d..bf4db2b 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -33,8 +33,8 @@ Used indirectly by mpid_irecv, mpid_recv (through MPIDI_CH3_RecvFromSelf) and
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
void MPIDI_CH3U_Buffer_copy(
- const void * const sbuf, int scount, MPI_Datatype sdt, int * smpi_errno,
- void * const rbuf, int rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz,
+ const void * const sbuf, MPI_Aint scount, MPI_Datatype sdt, int * smpi_errno,
+ void * const rbuf, MPI_Aint rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rsz,
int * rmpi_errno)
{
int sdt_contig;
@@ -226,7 +226,7 @@ void MPIDI_CH3U_Buffer_copy(
* This routine is called by mpid_recv and mpid_irecv when a request
* matches a send-to-self message
*/
-int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, int count,
+int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, MPI_Aint count,
MPI_Datatype datatype )
{
MPID_Request * const sreq = rreq->partner_request;
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 2f16890..38369ce 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -80,7 +80,7 @@ int MPIDI_CH3_SendNoncontig_iov( MPIDI_VC_t *vc, MPID_Request *sreq,
/* MPIDI_CH3_EagerNoncontigSend - Eagerly send noncontiguous data */
int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
MPIDI_CH3_Pkt_type_t reqtype,
- const void * buf, int count,
+ const void * buf, MPI_Aint count,
MPI_Datatype datatype, MPIDI_msg_sz_t data_sz,
int rank,
int tag, MPID_Comm * comm,
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index e6c2c56..1f1bcfe 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -498,7 +498,7 @@ lock_exit:
#define FCNAME MPIDI_QUOTE(FUNCNAME)
MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int source, int tag,
int context_id, MPID_Comm *comm, void *user_buf,
- int user_count, MPI_Datatype datatype, int * foundp)
+ MPI_Aint user_count, MPI_Datatype datatype, int * foundp)
{
int mpi_errno = MPI_SUCCESS;
int found = FALSE;
diff --git a/src/mpid/ch3/src/mpid_irecv.c b/src/mpid/ch3/src/mpid_irecv.c
index e0cc472..5cb85ba 100644
--- a/src/mpid/ch3/src/mpid_irecv.c
+++ b/src/mpid/ch3/src/mpid_irecv.c
@@ -10,7 +10,7 @@
#define FUNCNAME MPID_Irecv
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Irecv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
+int MPID_Irecv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag,
MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
diff --git a/src/mpid/ch3/src/mpid_isend.c b/src/mpid/ch3/src/mpid_isend.c
index 11f60b8..b71933f 100644
--- a/src/mpid/ch3/src/mpid_isend.c
+++ b/src/mpid/ch3/src/mpid_isend.c
@@ -27,7 +27,7 @@
#define FUNCNAME MPID_Isend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Isend(const void * buf, int count, MPI_Datatype datatype, int rank,
+int MPID_Isend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
int tag, MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
diff --git a/src/mpid/ch3/src/mpid_recv.c b/src/mpid/ch3/src/mpid_recv.c
index 874f019..80d3fd9 100644
--- a/src/mpid/ch3/src/mpid_recv.c
+++ b/src/mpid/ch3/src/mpid_recv.c
@@ -10,7 +10,7 @@
#define FUNCNAME MPID_Recv
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Recv(void * buf, int count, MPI_Datatype datatype, int rank, int tag,
+int MPID_Recv(void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag,
MPID_Comm * comm, int context_offset,
MPI_Status * status, MPID_Request ** request)
{
diff --git a/src/mpid/ch3/src/mpid_send.c b/src/mpid/ch3/src/mpid_send.c
index cf25242..21a8477 100644
--- a/src/mpid/ch3/src/mpid_send.c
+++ b/src/mpid/ch3/src/mpid_send.c
@@ -15,7 +15,7 @@
#define FUNCNAME MPID_Send
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Send(const void * buf, int count, MPI_Datatype datatype, int rank,
+int MPID_Send(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank,
int tag, MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
diff --git a/src/mpid/ch3/src/mpid_ssend.c b/src/mpid/ch3/src/mpid_ssend.c
index b3d735c..3944138 100644
--- a/src/mpid/ch3/src/mpid_ssend.c
+++ b/src/mpid/ch3/src/mpid_ssend.c
@@ -15,7 +15,7 @@
#define FUNCNAME MPID_Ssend
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Ssend(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
+int MPID_Ssend(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
MPID_Request ** request)
{
MPIDI_msg_sz_t data_sz;
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 7521c68..453ab9e 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -16,7 +16,7 @@
#define FUNCNAME MPIDI_Isend_self
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
+int MPIDI_Isend_self(const void * buf, MPI_Aint count, MPI_Datatype datatype, int rank, int tag, MPID_Comm * comm, int context_offset,
int type, MPID_Request ** request)
{
MPIDI_Message_match match;
diff --git a/src/mpid/common/datatype/dataloop/segment_packunpack.c b/src/mpid/common/datatype/dataloop/segment_packunpack.c
index 7a2ea88..86f9f00 100644
--- a/src/mpid/common/datatype/dataloop/segment_packunpack.c
+++ b/src/mpid/common/datatype/dataloop/segment_packunpack.c
@@ -321,7 +321,9 @@ int PREPEND_PREFIX(Segment_blkidx_m2m)(DLOOP_Offset *blocks_p,
struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp;
DLOOP_Handle_get_size_macro(el_type, el_size);
- DBG_SEGMENT(printf( "blkidx m2m: elsize = %d, count = %d, blocklen = %d\n", (int)el_size, (int)count, (int)blocklen ));
+ DBG_SEGMENT( printf("blkidx m2m: elsize = %ld, count = %ld, blocklen = %ld,"
+ " blocks_left = %ld\n",
+ el_size, count, blocklen, blocks_left ));
while (blocks_left) {
char *src, *dest;
@@ -335,11 +337,10 @@ int PREPEND_PREFIX(Segment_blkidx_m2m)(DLOOP_Offset *blocks_p,
rel_off + offsetarray[curblock]);
cbufp = (char*) paramp->userbuf + rel_off + offsetarray[curblock];
- /* Type-cast blocklen to a large type for comparison, but once
- * we confirm that it is smaller than the blocks_left, we can
- * safely type-cast blocks_left to a smaller type */
- if ((DLOOP_Offset) blocklen > blocks_left)
- blocklen = (DLOOP_Count) blocks_left;
+ /* there was some casting going on here at one time but now all types
+ * are promoted ot big values */
+ if ( blocklen > blocks_left)
+ blocklen = blocks_left;
if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
src = paramp->streambuf;
http://git.mpich.org/mpich.git/commitdiff/5e67e4824d1d7f4c007f6860c6a628e6a…
commit 5e67e4824d1d7f4c007f6860c6a628e6aac6ef63
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Jun 12 10:28:57 2015 -0500
fixes for test case
- preprocessor constants need parens
- which showed the "always fail" case wasn't big enough
- compiler warned about variables possibly being used uninitialized
Ref: #1767
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/test/mpi/coll/gather_big.c b/test/mpi/coll/gather_big.c
index 58d15d3..7e6ccce 100644
--- a/test/mpi/coll/gather_big.c
+++ b/test/mpi/coll/gather_big.c
@@ -15,8 +15,8 @@
#define COUNT 1048576*32
#endif
#if 1
-/* Following will fail always work for -n 8 unless gather path is 64 bit clean */
-#define COUNT 1048576*32+1
+/* Following will fail for -n 8 unless gather path is 64 bit clean */
+#define COUNT (1024*1024*128+1)
#endif
#define VERIFY_CONST 100000000L
@@ -25,8 +25,8 @@ main(int argc, char *argv[])
{
int rank, size;
int i, j;
- long *sendbuf;
- long *recvbuf;
+ long *sendbuf=NULL;
+ long *recvbuf=NULL;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-----------------------------------------------------------------------
Summary of changes:
src/include/mpiimpl.h | 29 +++++++------
src/mpi/coll/gather.c | 36 +++++++++++-----
src/mpi/coll/helper_fns.c | 14 +++---
src/mpi/datatype/pack.c | 2 +-
src/mpi/datatype/type_contiguous.c | 46 ++++++++++++++++++++
src/mpid/ch3/include/mpidimpl.h | 34 +++++++-------
src/mpid/ch3/include/mpidpre.h | 2 +-
src/mpid/ch3/src/ch3u_buffer.c | 6 +-
src/mpid/ch3/src/ch3u_eager.c | 2 +-
src/mpid/ch3/src/ch3u_recvq.c | 2 +-
src/mpid/ch3/src/mpid_irecv.c | 2 +-
src/mpid/ch3/src/mpid_isend.c | 2 +-
src/mpid/ch3/src/mpid_recv.c | 2 +-
src/mpid/ch3/src/mpid_send.c | 2 +-
src/mpid/ch3/src/mpid_ssend.c | 2 +-
src/mpid/ch3/src/mpidi_isend_self.c | 2 +-
.../common/datatype/dataloop/segment_packunpack.c | 13 +++---
src/mpid/pamid/include/mpidi_datatypes.h | 2 +-
src/mpid/pamid/include/mpidi_prototypes.h | 6 +-
src/mpid/pamid/src/mpid_buffer.c | 4 +-
src/mpid/pamid/src/pt2pt/mpid_irecv.h | 2 +-
src/mpid/pamid/src/pt2pt/mpid_isend.h | 2 +-
src/mpid/pamid/src/pt2pt/mpid_send.h | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_recv.h | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_send.h | 2 +-
test/mpi/coll/gather_big.c | 8 ++--
27 files changed, 147 insertions(+), 83 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-113-g23b0887
by noreply@mpich.org 20 Jun '15
by noreply@mpich.org 20 Jun '15
20 Jun '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 23b08871308fa33af2706707a114efe0f3fd7516 (commit)
via bb923ddf5ab15e25367738a7759653e2fbb973c6 (commit)
via 7189bcde4875091fc35bfbec7faf2bb3cc78ee42 (commit)
from 7cda493bf0e9d1cea9991da7ba8df613a5de4261 (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/23b08871308fa33af2706707a114efe0f…
commit 23b08871308fa33af2706707a114efe0f3fd7516
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Fri Jun 19 10:33:37 2015 -0500
Add a progress hook mechanism to pamid
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/pamid/include/mpidimpl.h b/src/mpid/pamid/include/mpidimpl.h
index 5135c49..fabc9d4 100644
--- a/src/mpid/pamid/include/mpidimpl.h
+++ b/src/mpid/pamid/include/mpidimpl.h
@@ -184,4 +184,10 @@ MPIDI_Win_set_info(MPID_Win *win,
MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp);
MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2);
+
+int MPIDI_Progress_register_hook(int (*progress_fn)(int*));
+int MPIDI_Progress_deregister_hook(int (*progress_fn)(int*));
+
+#define MPID_Progress_register_hook(fn_) MPIDI_Progress_register_hook(fn_)
+#define MPID_Progress_deregister_hook(fn_) MPIDI_Progress_deregister_hook(fn_)
#endif
diff --git a/src/mpid/pamid/src/mpid_progress.c b/src/mpid/pamid/src/mpid_progress.c
index 53b930f..17191ff 100644
--- a/src/mpid/pamid/src/mpid_progress.c
+++ b/src/mpid/pamid/src/mpid_progress.c
@@ -21,6 +21,73 @@
*/
#include <mpidimpl.h>
+#define MAX_PROGRESS_HOOKS 16
+typedef int (*progress_func_ptr_t) (int* made_progress);
+static progress_func_ptr_t progress_hooks[MAX_PROGRESS_HOOKS] = { NULL };
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3I_Progress_register_hook
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_Progress_register_hook(int (*progress_fn)(int*))
+{
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_PROGRESS_REGISTER_HOOK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_PROGRESS_REGISTER_HOOK);
+ MPIU_THREAD_CS_ENTER(ASYNC,);
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] == NULL) {
+ progress_hooks[i] = progress_fn;
+ break;
+ }
+ }
+
+ if (i >= MAX_PROGRESS_HOOKS) {
+ return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
+ "MPIDI_Progress_register_hook", __LINE__,
+ MPI_ERR_INTERN, "**progresshookstoomany", 0 );
+ }
+
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(ASYNC,);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_PROGRESS_REGISTER_HOOK);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3I_Progress_deregister_hook
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*))
+{
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_PROGRESS_DEREGISTER_HOOK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_PROGRESS_DEREGISTER_HOOK);
+ MPIU_THREAD_CS_ENTER(ASYNC,);
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] == progress_fn) {
+ progress_hooks[i] = NULL;
+ break;
+ }
+ }
+
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(ASYNC,);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_PROGRESS_DEREGISTER_HOOK);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
void
MPIDI_Progress_init()
@@ -155,6 +222,7 @@ MPIDI_Progress_async_poll (pami_context_t context, void *cookie)
{
pami_result_t rc;
int loop_count=100;
+ int i, made_progress;
/* In the "global" mpich lock mode all application threads must acquire the
* ALLFUNC global lock upon entry to the API. The async progress thread
@@ -164,6 +232,12 @@ MPIDI_Progress_async_poll (pami_context_t context, void *cookie)
*/
if (MPIU_THREAD_CS_TRY(ALLFUNC,)) /* (0==try_acquire(0)) */
{
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] != NULL) {
+ progress_hooks[i](&made_progress);
+ }
+ }
+
/* There is a simplifying assertion when in the 'global' mpich lock mode
* that only a single context is supported. See the discussion in
* mpich/src/mpid/pamid/src/mpid_init.c for more information.
@@ -187,6 +261,13 @@ MPIDI_Progress_async_poll_perobj (pami_context_t context, void *cookie)
{
pami_result_t rc;
int loop_count=100;
+ int i, made_progress;
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] != NULL) {
+ progress_hooks[i](&made_progress);
+ }
+ }
/* In the "per object" mpich lock mode multiple application threads could be
* active within the API interacting with contexts and multiple async progress
http://git.mpich.org/mpich.git/commitdiff/bb923ddf5ab15e25367738a7759653e2f…
commit bb923ddf5ab15e25367738a7759653e2fbb973c6
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Wed Jun 17 09:51:20 2015 -0500
Add a progress hook mechanism to sock
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h b/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
index 71475dc..f1bc05d 100644
--- a/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/sock/include/mpidi_ch3_impl.h
@@ -72,6 +72,8 @@
channel interface */
int MPIDI_CH3I_Progress_init(void);
int MPIDI_CH3I_Progress_finalize(void);
+int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*));
+int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*));
int MPIDI_CH3I_VC_post_connect(MPIDI_VC_t *);
/* Shared memory window atomic/accumulate mutex implementation */
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 0fcc20d..f6adc49 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -7,6 +7,7 @@
#include "mpidi_ch3_impl.h"
#include "pmi.h"
#include "mpidu_sock.h"
+#include "mpl_utlist.h"
#ifdef HAVE_STRING_H
#include <string.h>
@@ -45,6 +46,9 @@ static inline int connection_post_recv_pkt(MPIDI_CH3I_Connection_t * conn);
static int adjust_iov(MPID_IOV ** iovp, int * countp, MPIU_Size_t nb);
+#define MAX_PROGRESS_HOOKS 16
+typedef int (*progress_func_ptr_t) (int* made_progress);
+static progress_func_ptr_t progress_hooks[MAX_PROGRESS_HOOKS] = { NULL };
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3i_Progress_test
@@ -55,6 +59,7 @@ static int MPIDI_CH3i_Progress_test(void)
MPIDU_Sock_event_t event;
int mpi_errno = MPI_SUCCESS;
int made_progress;
+ int i;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_TEST);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_TEST);
@@ -86,22 +91,11 @@ static int MPIDI_CH3i_Progress_test(void)
}
# endif
- /* make progress on NBC schedules */
- mpi_errno = MPIDU_Sched_progress(&made_progress);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
-#if defined HAVE_LIBHCOLL
- if (MPIR_CVAR_CH3_ENABLE_HCOLL) {
- mpi_errno = hcoll_do_progress();
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- }
-#endif /* HAVE_LIBHCOLL */
-
- /* make progress on RMA */
- if (MPIDI_CH3I_num_active_issued_win > 0 || MPIDI_CH3I_num_passive_win > 0) {
- mpi_errno = MPIDI_CH3I_RMA_Make_progress_global(&made_progress);
- if (mpi_errno)
- MPIU_ERR_POP(mpi_errno);
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] != NULL) {
+ mpi_errno = progress_hooks[i](&made_progress);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
}
mpi_errno = MPIDU_Sock_wait(MPIDI_CH3I_sock_set, 0, &event);
@@ -191,37 +185,19 @@ static int MPIDI_CH3i_Progress_wait(MPID_Progress_state * progress_state)
do
{
int made_progress = FALSE;
-
- /* make progress on NBC schedules, must come before we block on sock_wait */
- mpi_errno = MPIDU_Sched_progress(&made_progress);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- if (made_progress) {
- MPIDI_CH3_Progress_signal_completion();
- break;
- }
-
-#if defined HAVE_LIBHCOLL
- if (MPIR_CVAR_CH3_ENABLE_HCOLL) {
- mpi_errno = hcoll_do_progress();
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-
- /* if hcoll completed any pending requests, break. Else,
- * we are expecting at least one more socket event */
- if (progress_state->ch.completion_count != MPIDI_CH3I_progress_completion_count)
- break;
- }
-#endif /* HAVE_LIBHCOLL */
-
- /* make progress on RMA */
- if (MPIDI_CH3I_num_active_issued_win > 0 || MPIDI_CH3I_num_passive_win > 0) {
- mpi_errno = MPIDI_CH3I_RMA_Make_progress_global(&made_progress);
- if (mpi_errno)
- MPIU_ERR_POP(mpi_errno);
- if (made_progress) {
- MPIDI_CH3_Progress_signal_completion();
- break;
- }
+ int i;
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] != NULL) {
+ mpi_errno = progress_hooks[i](&made_progress);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (made_progress) {
+ MPIDI_CH3_Progress_signal_completion();
+ break; /* break the for loop */
+ }
+ }
}
+ if (made_progress) break; /* break the do loop */
# ifdef MPICH_IS_THREADED
@@ -962,6 +938,70 @@ int MPIDI_CH3I_Progress( int blocking, MPID_Progress_state *state )
return mpi_errno;
}
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3I_Progress_register_hook
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*))
+{
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
+ MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] == NULL) {
+ progress_hooks[i] = progress_fn;
+ break;
+ }
+ }
+
+ if (i >= MAX_PROGRESS_HOOKS) {
+ return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
+ "MPIDI_CH3I_Progress_register_hook", __LINE__,
+ MPI_ERR_INTERN, "**progresshookstoomany", 0 );
+ }
+
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3I_Progress_deregister_hook
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*))
+{
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
+ MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] == progress_fn) {
+ progress_hooks[i] = NULL;
+ break;
+ }
+ }
+
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
+
/* A convenience dummy symbol so that the PETSc folks can configure test to
* ensure that they have a working version of MPICH ch3:sock. Please don't
* delete it without consulting them. */
http://git.mpich.org/mpich.git/commitdiff/7189bcde4875091fc35bfbec7faf2bb3c…
commit 7189bcde4875091fc35bfbec7faf2bb3cc78ee42
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Tue Jun 16 16:18:08 2015 -0500
Add a progress hook mechanism to ch3 and nemesis
Signed-off-by: Pavan Balaji <balaji(a)anl.gov>
diff --git a/src/mpi/errhan/errnames.txt b/src/mpi/errhan/errnames.txt
index 694cc87..111f13d 100644
--- a/src/mpi/errhan/errnames.txt
+++ b/src/mpi/errhan/errnames.txt
@@ -460,6 +460,7 @@ unexpected messages queued.
**opnotpredefined:only predefined ops are valid
**init:Initialization failed
+**progresshookstoomany: too many progress hooks are registered
#
# To be removed
diff --git a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
index 33a28d0..ae4132a 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpidi_ch3_impl.h
@@ -50,6 +50,8 @@ extern struct MPID_Request *MPIDI_CH3I_shm_active_send;
int MPIDI_CH3I_Shm_supported(void);
int MPIDI_CH3I_Progress_init(void);
int MPIDI_CH3I_Progress_finalize(void);
+int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*));
+int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*));
int MPIDI_CH3I_Shm_send_progress(void);
int MPIDI_CH3I_Complete_sendq_with_error(MPIDI_VC_t * vc);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index e05fe3b..2e855f1 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -85,6 +85,10 @@ typedef struct qn_ent
static qn_ent_t *qn_head = NULL;
+#define MAX_PROGRESS_HOOKS 16
+typedef int (*progress_func_ptr_t) (int* made_progress);
+static progress_func_ptr_t progress_hooks[MAX_PROGRESS_HOOKS] = { NULL };
+
#ifdef HAVE_SIGNAL
static void sigusr1_handler(int sig)
{
@@ -280,6 +284,69 @@ int MPIDI_CH3I_Shm_send_progress(void)
goto fn_exit;
}
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3I_Progress_register_hook
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*))
+{
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
+ MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] == NULL) {
+ progress_hooks[i] = progress_fn;
+ break;
+ }
+ }
+
+ if (i >= MAX_PROGRESS_HOOKS) {
+ return MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
+ "MPIDI_CH3I_Progress_register_hook", __LINE__,
+ MPI_ERR_INTERN, "**progresshookstoomany", 0 );
+ }
+
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_REGISTER_HOOK);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
+
+#undef FUNCNAME
+#define FUNCNAME MPIDI_CH3I_Progress_deregister_hook
+#undef FCNAME
+#define FCNAME MPIDI_QUOTE(FUNCNAME)
+int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*))
+{
+ int mpi_errno = MPI_SUCCESS;
+ int i;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
+ MPIU_THREAD_CS_ENTER(MPIDCOMM,);
+
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] == progress_fn) {
+ progress_hooks[i] = NULL;
+ break;
+ }
+ }
+
+ fn_exit:
+ MPIU_THREAD_CS_EXIT(MPIDCOMM,);
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_PROGRESS_DEREGISTER_HOOK);
+ return mpi_errno;
+
+ fn_fail:
+ goto fn_exit;
+}
/* NOTE: it appears that this function is sometimes (inadvertently?) recursive.
* Some packet handlers, such as MPIDI_CH3_PktHandler_Close, call iStartMsg,
@@ -364,6 +431,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
MPID_nem_cell_ptr_t cell;
int in_fbox = 0;
MPIDI_VC_t *vc;
+ int i;
do /* receive progress */
{
@@ -463,27 +531,13 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking)
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
- /* make progress on NBC schedules */
- mpi_errno = MPIDU_Sched_progress(&made_progress);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- if (made_progress) {
- MPIDI_CH3_Progress_signal_completion();
- }
-
-#if defined HAVE_LIBHCOLL
- if (MPIR_CVAR_CH3_ENABLE_HCOLL) {
- mpi_errno = hcoll_do_progress();
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
- }
-#endif /* HAVE_LIBHCOLL */
-
- /* make progress on RMA */
- if (MPIDI_CH3I_num_active_issued_win > 0 || MPIDI_CH3I_num_passive_win > 0) {
- mpi_errno = MPIDI_CH3I_RMA_Make_progress_global(&made_progress);
- if (mpi_errno)
- MPIU_ERR_POP(mpi_errno);
- if (made_progress)
- MPIDI_CH3_Progress_signal_completion();
+ for (i = 0; i < MAX_PROGRESS_HOOKS; i++) {
+ if (progress_hooks[i] != NULL) {
+ mpi_errno = progress_hooks[i](&made_progress);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ if (made_progress)
+ MPIDI_CH3_Progress_signal_completion();
+ }
}
/* in the case of progress_wait, bail out if anything completed (CC-1) */
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 5b0c536..760827a 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -2059,4 +2059,11 @@ int MPIDI_CH3_ReqHandler_ReqOpsComplete(MPIDI_VC_t *, MPID_Request *,
*(eager_threshold_p) = (vc)->eager_max_msg_sz; \
} while (0)
+
+int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*));
+int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*));
+
+#define MPID_Progress_register_hook(fn_) MPIDI_CH3I_Progress_register_hook(fn_)
+#define MPID_Progress_deregister_hook(fn_) MPIDI_CH3I_Progress_deregister_hook(fn_)
+
#endif /* !defined(MPICH_MPIDIMPL_H_INCLUDED) */
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index 0c3892e..0452fc3 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -392,6 +392,11 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
MPIU_CHKPMEM_MALLOC(win_elem, MPIDI_RMA_Win_list_t *, sizeof(MPIDI_RMA_Win_list_t), mpi_errno,
"Window list element");
win_elem->win_ptr = *win_ptr;
+
+ if (MPIDI_RMA_Win_list == NULL) {
+ mpi_errno = MPID_Progress_register_hook(MPIDI_CH3I_RMA_Make_progress_global);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
MPL_LL_APPEND(MPIDI_RMA_Win_list, MPIDI_RMA_Win_list_tail, win_elem);
if (MPIDI_CH3U_Win_hooks.win_init != NULL) {
diff --git a/src/mpid/ch3/src/mpidi_rma.c b/src/mpid/ch3/src/mpidi_rma.c
index 28c9063..d047a29 100644
--- a/src/mpid/ch3/src/mpidi_rma.c
+++ b/src/mpid/ch3/src/mpidi_rma.c
@@ -223,6 +223,9 @@ int MPIDI_Win_free(MPID_Win ** win_ptr)
MPL_LL_DELETE(MPIDI_RMA_Win_list, MPIDI_RMA_Win_list_tail, win_elem);
MPIU_Free(win_elem);
+ if (MPIDI_RMA_Win_list == NULL)
+ MPID_Progress_deregister_hook(MPIDI_CH3I_RMA_Make_progress_global);
+
comm_ptr = (*win_ptr)->comm_ptr;
mpi_errno = MPIR_Comm_free_impl(comm_ptr);
if (mpi_errno)
diff --git a/src/mpid/common/hcoll/hcoll.h b/src/mpid/common/hcoll/hcoll.h
index 5671a0f..7956b6d 100644
--- a/src/mpid/common/hcoll/hcoll.h
+++ b/src/mpid/common/hcoll/hcoll.h
@@ -26,6 +26,6 @@ int hcoll_Iallgather_req(const void *sendbuf, int sendcount, MPI_Datatype sendty
MPID_Request ** request);
int hcoll_Iallreduce_req(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm * comm_ptr, MPID_Request ** request);
-int hcoll_do_progress(void);
+int hcoll_do_progress(int *made_progress);
#endif
diff --git a/src/mpid/common/hcoll/hcoll_init.c b/src/mpid/common/hcoll/hcoll_init.c
index 613a832..ee1a364 100644
--- a/src/mpid/common/hcoll/hcoll_init.c
+++ b/src/mpid/common/hcoll/hcoll_init.c
@@ -23,6 +23,7 @@ int hcoll_destroy(void *param ATTRIBUTE((unused)))
{
if (1 == hcoll_initialized) {
hcoll_finalize();
+ MPID_Progress_deregister_hook(hcoll_do_progress);
}
hcoll_initialized = 0;
return 0;
@@ -79,7 +80,11 @@ int hcoll_initialize(void)
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
- hcoll_initialized = 1;
+ if (!hcoll_initialized) {
+ hcoll_initialized = 1;
+ mpi_errno = MPID_Progress_register_hook(hcoll_do_progress);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
MPIR_Add_finalize(hcoll_destroy, 0, 0);
mpi_errno =
@@ -213,11 +218,11 @@ int hcoll_comm_destroy(MPID_Comm * comm_ptr, void *param)
goto fn_exit;
}
-int hcoll_do_progress(void)
+int hcoll_do_progress(int *made_progress)
{
- if (1 == hcoll_initialized) {
- hcoll_progress_fn();
- }
+ if (made_progress)
+ *made_progress = 0;
+ hcoll_progress_fn();
return MPI_SUCCESS;
}
diff --git a/src/mpid/common/sched/mpid_sched.c b/src/mpid/common/sched/mpid_sched.c
index b01a4d3..52304e1 100644
--- a/src/mpid/common/sched/mpid_sched.c
+++ b/src/mpid/common/sched/mpid_sched.c
@@ -409,6 +409,10 @@ int MPID_Sched_start(MPID_Sched_t *sp, MPID_Comm *comm, int tag, MPID_Request **
/* finally, enqueue in the list of all pending schedules so that the
* progress engine can make progress on it */
+ if (all_schedules.head == NULL) {
+ mpi_errno = MPID_Progress_register_hook(MPIDU_Sched_progress);
+ if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ }
MPL_DL_APPEND(all_schedules.head, s);
MPIU_DBG_MSG_P(COMM, TYPICAL, "started schedule s=%p\n", s);
@@ -936,7 +940,13 @@ fn_fail:
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIDU_Sched_progress(int *made_progress)
{
- return MPIDU_Sched_progress_state(&all_schedules, made_progress);
+ int mpi_errno;
+
+ mpi_errno = MPIDU_Sched_progress_state(&all_schedules, made_progress);
+ if (!mpi_errno && all_schedules.head == NULL)
+ MPIDI_CH3I_Progress_deregister_hook(MPIDU_Sched_progress);
+
+ return mpi_errno;
}
static const char *entry_to_str(enum MPIDU_Sched_entry_type type) ATTRIBUTE((unused,used));
-----------------------------------------------------------------------
Summary of changes:
src/mpi/errhan/errnames.txt | 1 +
.../ch3/channels/nemesis/include/mpidi_ch3_impl.h | 2 +
src/mpid/ch3/channels/nemesis/src/ch3_progress.c | 96 +++++++++++---
.../ch3/channels/sock/include/mpidi_ch3_impl.h | 2 +
src/mpid/ch3/channels/sock/src/ch3_progress.c | 132 +++++++++++++-------
src/mpid/ch3/include/mpidimpl.h | 7 +
src/mpid/ch3/src/mpid_rma.c | 5 +
src/mpid/ch3/src/mpidi_rma.c | 3 +
src/mpid/common/hcoll/hcoll.h | 2 +-
src/mpid/common/hcoll/hcoll_init.c | 15 ++-
src/mpid/common/sched/mpid_sched.c | 12 ++-
src/mpid/pamid/include/mpidimpl.h | 6 +
src/mpid/pamid/src/mpid_progress.c | 81 ++++++++++++
13 files changed, 290 insertions(+), 74 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-110-g7cda493
by noreply@mpich.org 19 Jun '15
by noreply@mpich.org 19 Jun '15
19 Jun '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 7cda493bf0e9d1cea9991da7ba8df613a5de4261 (commit)
from f039eebba1cd48a4a592391842b22c6e9a466c7b (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/7cda493bf0e9d1cea9991da7ba8df613a…
commit 7cda493bf0e9d1cea9991da7ba8df613a5de4261
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Fri Jun 19 11:13:20 2015 -0500
netmod/portals4: remove unused variables
No reviewer.
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index 5c3d03f..14c092f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -63,8 +63,6 @@ static int handler_send(const ptl_event_t *e)
{
int mpi_errno = MPI_SUCCESS;
MPID_Request *const sreq = e->user_ptr;
- MPIDI_VC_t *vc = sreq->ch.vc;
- MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
int i, ret;
-----------------------------------------------------------------------
Summary of changes:
.../channels/nemesis/netmod/portals4/ptl_send.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-109-gf039eeb
by noreply@mpich.org 19 Jun '15
by noreply@mpich.org 19 Jun '15
19 Jun '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 f039eebba1cd48a4a592391842b22c6e9a466c7b (commit)
from ef34d2c9e6e7e1b89e27b1fe9b9e2200105acfa0 (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/f039eebba1cd48a4a592391842b22c6e9…
commit f039eebba1cd48a4a592391842b22c6e9a466c7b
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Thu Jun 18 11:15:19 2015 -0500
better approach for do_accumulate_op
commit 83253a414 triggerd a bunch of new warnings. Take a different
approach. For simplicity of implementation, do_accumulate_op is defined
as MPI_User_function. We could split up internal routine and
user-provided routines, but that complicates the code for little
benefit:
Instead, keep do_accumlate_op with an int type, but check for overflow
before explicitly casting. In many places the count is simply '1'. In
stream processing there is an interal limit of 256k, so the assertion
should never fire.
Signed-off-by: Xin Zhao <xinzhao3(a)illinois.edu>
diff --git a/src/mpid/ch3/include/mpid_rma_shm.h b/src/mpid/ch3/include/mpid_rma_shm.h
index 31417a0..cb23a96 100644
--- a/src/mpid/ch3/include/mpid_rma_shm.h
+++ b/src/mpid/ch3/include/mpid_rma_shm.h
@@ -10,8 +10,8 @@
#include "mpl_utlist.h"
#include "mpid_rma_types.h"
-static inline int do_accumulate_op(void *source_buf, MPI_Aint source_count, MPI_Datatype source_dtp,
- void *target_buf, MPI_Aint target_count, MPI_Datatype target_dtp,
+static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datatype source_dtp,
+ void *target_buf, int target_count, MPI_Datatype target_dtp,
MPI_Aint stream_offset, MPI_Op acc_op);
#define ASSIGN_COPY(src, dest, count, type) \
@@ -399,7 +399,8 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
}
- mpi_errno = do_accumulate_op((void *) packed_buf, stream_count, basic_type,
+ MPIU_Assert(stream_count == (int) stream_count);
+ mpi_errno = do_accumulate_op((void *) packed_buf, (int) stream_count, basic_type,
(void *) ((char *) base + disp_unit * target_disp),
target_count, target_datatype, stream_offset, op);
@@ -541,7 +542,8 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
packed_buf = tmpbuf;
}
- mpi_errno = do_accumulate_op((void *) packed_buf, stream_count, basic_type,
+ MPIU_Assert(stream_count == (int) stream_count);
+ mpi_errno = do_accumulate_op((void *) packed_buf, (int) stream_count, basic_type,
(void *) ((char *) base + disp_unit * target_disp),
target_count, target_datatype, stream_offset, op);
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 968f189..bfaa7a7 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -806,8 +806,8 @@ static inline int MPIDI_CH3I_RMA_Handle_flush_ack(MPID_Win * win_ptr, int target
#define FUNCNAME do_accumulate_op
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int do_accumulate_op(void *source_buf, MPI_Aint source_count, MPI_Datatype source_dtp,
- void *target_buf, MPI_Aint target_count, MPI_Datatype target_dtp,
+static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datatype source_dtp,
+ void *target_buf, int target_count, MPI_Datatype target_dtp,
MPI_Aint stream_offset, MPI_Op acc_op)
{
int mpi_errno = MPI_SUCCESS;
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 981f877..d214a0c 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -187,7 +187,8 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq,
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
/* accumulate data from tmp_buf into user_buf */
- mpi_errno = do_accumulate_op(rreq->dev.user_buf, predef_count, basic_type,
+ MPIU_Assert(predef_count == (int) predef_count);
+ mpi_errno = do_accumulate_op(rreq->dev.user_buf, (int) predef_count, basic_type,
rreq->dev.real_user_buf, rreq->dev.user_count, rreq->dev.datatype,
stream_offset, rreq->dev.op);
if (win_ptr->shm_allocated == TRUE)
@@ -336,7 +337,8 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete(MPIDI_VC_t * vc, MPID_Request * rreq
}
/* accumulate data from tmp_buf into user_buf */
- mpi_errno = do_accumulate_op(rreq->dev.user_buf, predef_count, basic_type,
+ MPIU_Assert(predef_count == (int) predef_count);
+ mpi_errno = do_accumulate_op(rreq->dev.user_buf, (int) predef_count, basic_type,
rreq->dev.real_user_buf, rreq->dev.user_count, rreq->dev.datatype,
stream_offset, rreq->dev.op);
@@ -1245,7 +1247,8 @@ static inline int perform_acc_in_lock_queue(MPID_Win * win_ptr, MPIDI_RMA_Lock_e
/* Note: here stream_offset is 0 because when piggybacking LOCK, we must use
* the first stream unit. */
- mpi_errno = do_accumulate_op(lock_entry->data, recv_count, acc_pkt->datatype,
+ MPIU_Assert(recv_count = (int) recv_count);
+ mpi_errno = do_accumulate_op(lock_entry->data, (int) recv_count, acc_pkt->datatype,
acc_pkt->addr, acc_pkt->count, acc_pkt->datatype,
0, acc_pkt->op);
}
@@ -1415,7 +1418,8 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win * win_ptr,
/* Perform ACCUMULATE OP */
- mpi_errno = do_accumulate_op(lock_entry->data, recv_count, get_accum_pkt->datatype,
+ MPIU_Assert(recv_count == (int) recv_count);
+ mpi_errno = do_accumulate_op(lock_entry->data, (int) recv_count, get_accum_pkt->datatype,
get_accum_pkt->addr, get_accum_pkt->count, get_accum_pkt->datatype,
0, get_accum_pkt->op);
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/include/mpid_rma_shm.h | 10 ++++++----
src/mpid/ch3/include/mpidrma.h | 4 ++--
src/mpid/ch3/src/ch3u_handle_recv_req.c | 12 ++++++++----
3 files changed, 16 insertions(+), 10 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-108-gef34d2c
by noreply@mpich.org 18 Jun '15
by noreply@mpich.org 18 Jun '15
18 Jun '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 ef34d2c9e6e7e1b89e27b1fe9b9e2200105acfa0 (commit)
via 5df087024c2a39c9e24f88f343c23bb785afbf8b (commit)
via 3752b556c7110b167d46661821ef0840c779f221 (commit)
via 306cbd9706d74de513e6aa5cb681db01c786362c (commit)
via 974942e82b6d428b19235cf36bd327bb5cc54964 (commit)
from 83253a41423d0f30317f6de93560a6cec8e5a069 (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/ef34d2c9e6e7e1b89e27b1fe9b9e22001…
commit ef34d2c9e6e7e1b89e27b1fe9b9e2200105acfa0
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Wed Jun 17 16:40:57 2015 -0500
netmod/portals4: build on persistent GET ME design
Encode request handles in unused tag bits, eliminating the need
for hash table.
Signed-off-by: Antonio Pena Monferrer <apenya(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index 88e210a..2fd80c4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -23,28 +23,6 @@ static ptl_me_t get_me;
static ptl_handle_me_t me_handles[NUM_RECV_BUFS];
static ptl_handle_me_t get_me_handle;
-struct pending_gets_st {
- void *ptr;
- MPID_Request *req;
- UT_hash_handle hh;
-};
-static struct pending_gets_st *pending_gets = NULL;
-
-
-#undef FUNCNAME
-#define FUNCNAME find_req
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline MPID_Request * find_req(void *ptr)
-{
- struct pending_gets_st *pending_get;
- MPID_Request *req;
- HASH_FIND_PTR(pending_gets, &ptr, pending_get);
- req = pending_get->req;
- HASH_DEL(pending_gets, pending_get);
- MPIU_Free(pending_get);
- return req;
-}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptl_nm_init
@@ -64,11 +42,11 @@ int MPID_nem_ptl_nm_init(void)
overflow_me.ct_handle = PTL_CT_NONE;
overflow_me.uid = PTL_UID_ANY;
overflow_me.options = ( PTL_ME_OP_PUT | PTL_ME_MANAGE_LOCAL | PTL_ME_NO_TRUNCATE | PTL_ME_MAY_ALIGN |
- PTL_ME_IS_ACCESSIBLE | PTL_ME_EVENT_LINK_DISABLE );
+ PTL_ME_IS_ACCESSIBLE | PTL_ME_EVENT_LINK_DISABLE );
overflow_me.match_id.phys.pid = PTL_PID_ANY;
overflow_me.match_id.phys.nid = PTL_NID_ANY;
- overflow_me.match_bits = NPTL_MATCH(CTL_TAG, 0, MPI_ANY_SOURCE);
- overflow_me.ignore_bits = NPTL_MATCH_IGNORE;
+ overflow_me.match_bits = NPTL_MATCH(MPI_ANY_TAG, CTL_TAG, MPI_ANY_SOURCE);
+ overflow_me.ignore_bits = NPTL_MATCH_IGNORE_ANY_TAG;
overflow_me.min_free = PTL_MAX_EAGER;
/* allocate all overflow space at once */
@@ -91,8 +69,8 @@ int MPID_nem_ptl_nm_init(void)
PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
get_me.match_id.phys.pid = PTL_PID_ANY;
get_me.match_id.phys.nid = PTL_NID_ANY;
- get_me.match_bits = NPTL_MATCH(GET_TAG, 0, MPI_ANY_SOURCE);
- get_me.ignore_bits = NPTL_MATCH_IGNORE;
+ get_me.match_bits = NPTL_MATCH(MPI_ANY_TAG, GET_TAG, MPI_ANY_SOURCE);
+ get_me.ignore_bits = NPTL_MATCH_IGNORE_ANY_TAG;
get_me.min_free = 0;
ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &get_me, PTL_PRIORITY_LIST, NULL,
&get_me_handle);
@@ -151,7 +129,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
const size_t sent_sz = data_sz < (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz) ? data_sz : (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz-sizeof(ptl_size_t));
const size_t remaining = data_sz - sent_sz;
const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz+sreq->dev.ext_hdr_sz+(remaining?sizeof(ptl_size_t):0));
- ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
+ ptl_match_bits_t match_bits = NPTL_MATCH(sreq->handle, CTL_TAG, MPIDI_Process.my_pg_rank);
MPIDI_STATE_DECL(MPID_STATE_SEND_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_SEND_PKT);
@@ -175,19 +153,11 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
MPIU_Memcpy(sendbuf_ptr, data_p, sent_sz);
sendbuf_ptr += sent_sz;
if (remaining) {
- char *tmp_ptr = (char *)data_p + sent_sz;
- const char *endbuf = tmp_ptr + remaining;
/* The address/offset for the remote side to do the get is last in the buffer */
ptl_size_t *offset = (ptl_size_t *)sendbuf_ptr;
- *offset = (ptl_size_t)tmp_ptr;
- do {
- struct pending_gets_st *pending_get = MPIU_Malloc(sizeof(struct pending_gets_st));
- ++REQ_PTL(sreq)->num_gets;
- pending_get->ptr = tmp_ptr;
- pending_get->req = sreq;
- HASH_ADD_PTR(pending_gets, ptr, pending_get);
- tmp_ptr += MPIDI_nem_ptl_ni_limits.max_msg_size;
- } while (tmp_ptr < endbuf);
+ *offset = (ptl_size_t)data_p + sent_sz;
+ REQ_PTL(sreq)->num_gets = remaining / MPIDI_nem_ptl_ni_limits.max_msg_size;
+ if (remaining % MPIDI_nem_ptl_ni_limits.max_msg_size) REQ_PTL(sreq)->num_gets++;
}
}
@@ -226,7 +196,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
const size_t sent_sz = data_sz < (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz) ? data_sz : (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz-sizeof(ptl_size_t));
const size_t remaining = data_sz - sent_sz;
const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz+sreq->dev.ext_hdr_sz+(remaining?sizeof(ptl_size_t):0));
- ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
+ ptl_match_bits_t match_bits = NPTL_MATCH(sreq->handle, CTL_TAG, MPIDI_Process.my_pg_rank);
MPIDI_STATE_DECL(MPID_STATE_SEND_NONCONTIG_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_SEND_NONCONTIG_PKT);
@@ -252,25 +222,16 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
sendbuf_ptr += sent_sz;
if (remaining) { /* Post MEs for the remote gets */
- char *tmp_ptr, *endbuf;
ptl_size_t *offset = (ptl_size_t *)sendbuf_ptr;
TMPBUF(sreq) = MPIU_Malloc(remaining);
- tmp_ptr = TMPBUF(sreq);
- endbuf = (char *)TMPBUF(sreq) + remaining;
*offset = (ptl_size_t)TMPBUF(sreq);
first = last;
last = sreq->dev.segment_size;
MPID_Segment_pack(sreq->dev.segment_ptr, first, &last, TMPBUF(sreq));
MPIU_Assert(last == sreq->dev.segment_size);
- do {
- struct pending_gets_st *pending_get = MPIU_Malloc(sizeof(struct pending_gets_st));
- ++REQ_PTL(sreq)->num_gets;
- pending_get->ptr = tmp_ptr;
- pending_get->req = sreq;
- HASH_ADD_PTR(pending_gets, ptr, pending_get);
- tmp_ptr += MPIDI_nem_ptl_ni_limits.max_msg_size;
- } while (tmp_ptr < endbuf);
+ REQ_PTL(sreq)->num_gets = remaining / MPIDI_nem_ptl_ni_limits.max_msg_size;
+ if (remaining % MPIDI_nem_ptl_ni_limits.max_msg_size) REQ_PTL(sreq)->num_gets++;
}
}
@@ -426,6 +387,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
MPID_nem_ptl_vc_area * vc_ptl;
ptl_size_t remaining = NPTL_HEADER_GET_LENGTH(e->hdr_data);
ptl_me_t search_me;
+ MPI_Request sender_req_id = NPTL_MATCH_GET_TAG(e->match_bits);
MPIDI_PG_Get_vc(MPIDI_Process.my_pg, NPTL_MATCH_GET_RANK(e->match_bits), &vc);
vc_ptl = VC_PTL(vc);
@@ -458,13 +420,13 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
do {
MPIDI_CH3U_Request_increment_cc(req, &incomplete); /* Will be decremented - and eventually freed in REPLY */
ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
- size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), target_offset, req);
+ size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(sender_req_id, GET_TAG, MPIDI_Process.my_pg_rank), target_offset, req);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
MPID_nem_ptl_strerror(ret));
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
"PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%d)", size,
vc_ptl->id.phys.nid,
- vc_ptl->id.phys.pid, vc_ptl->ptc, GET_TAG));
+ vc_ptl->id.phys.pid, vc_ptl->ptc, sender_req_id));
buf_ptr += size;
remaining -= size;
target_offset += size;
@@ -485,8 +447,10 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
case PTL_EVENT_GET:
{
- MPID_Request *const req = find_req(e->start);
+ MPI_Request handle = NPTL_MATCH_GET_TAG(e->match_bits);
+ MPID_Request *req = NULL;
+ MPID_Request_get_ptr(handle, req);
if (--REQ_PTL(req)->num_gets == 0) {
MPIU_Free(TMPBUF(req));
if (REQ_PTL(req)->put_done)
http://git.mpich.org/mpich.git/commitdiff/5df087024c2a39c9e24f88f343c23bb78…
commit 5df087024c2a39c9e24f88f343c23bb785afbf8b
Author: Antonio Pena Monferrer <apenya(a)mcs.anl.gov>
Date: Tue Jun 16 23:45:18 2015 -0500
netmod/portals4: Use persistent ME in RMA
rma/manyget was failing because we reached the maximum number of MEs
allowed: we were posting an ME for every remote get. This patch
implements a single persistent ME instead for the remote gets.
Fixes #2264
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index 0f106c4..88e210a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -19,7 +19,32 @@
static char *recvbufs;
static ptl_me_t overflow_me;
+static ptl_me_t get_me;
static ptl_handle_me_t me_handles[NUM_RECV_BUFS];
+static ptl_handle_me_t get_me_handle;
+
+struct pending_gets_st {
+ void *ptr;
+ MPID_Request *req;
+ UT_hash_handle hh;
+};
+static struct pending_gets_st *pending_gets = NULL;
+
+
+#undef FUNCNAME
+#define FUNCNAME find_req
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline MPID_Request * find_req(void *ptr)
+{
+ struct pending_gets_st *pending_get;
+ MPID_Request *req;
+ HASH_FIND_PTR(pending_gets, &ptr, pending_get);
+ req = pending_get->req;
+ HASH_DEL(pending_gets, pending_get);
+ MPIU_Free(pending_get);
+ return req;
+}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptl_nm_init
@@ -57,6 +82,22 @@ int MPID_nem_ptl_nm_init(void)
MPID_nem_ptl_strerror(ret));
}
+ /* register persistent ME for GET operations */
+ get_me.start = NULL;
+ get_me.length = PTL_SIZE_MAX;
+ get_me.ct_handle = PTL_CT_NONE;
+ get_me.uid = PTL_UID_ANY;
+ get_me.options = ( PTL_ME_OP_GET | PTL_ME_IS_ACCESSIBLE | PTL_ME_NO_TRUNCATE |
+ PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
+ get_me.match_id.phys.pid = PTL_PID_ANY;
+ get_me.match_id.phys.nid = PTL_NID_ANY;
+ get_me.match_bits = NPTL_MATCH(GET_TAG, 0, MPI_ANY_SOURCE);
+ get_me.ignore_bits = NPTL_MATCH_IGNORE;
+ get_me.min_free = 0;
+ ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &get_me, PTL_PRIORITY_LIST, NULL,
+ &get_me_handle);
+ MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
+
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_NM_INIT);
return mpi_errno;
@@ -83,6 +124,10 @@ int MPID_nem_ptl_nm_finalize(void)
MPID_nem_ptl_strerror(ret));
}
+ ret = PtlMEUnlink(get_me_handle);
+ MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s",
+ MPID_nem_ptl_strerror(ret));
+
MPIU_Free(recvbufs);
fn_exit:
@@ -93,55 +138,6 @@ int MPID_nem_ptl_nm_finalize(void)
}
#undef FUNCNAME
-#define FUNCNAME meappend_large
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_bits_t match_bits, void *buf, size_t remaining)
-{
- int mpi_errno = MPI_SUCCESS;
- int ret;
- ptl_me_t me;
- MPIDI_STATE_DECL(MPID_STATE_MEAPPEND_LARGE);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MEAPPEND_LARGE);
-
- me.start = buf;
- me.length = remaining < MPIDI_nem_ptl_ni_limits.max_msg_size ?
- remaining : MPIDI_nem_ptl_ni_limits.max_msg_size;
- me.ct_handle = PTL_CT_NONE;
- me.uid = PTL_UID_ANY;
- me.options = ( PTL_ME_OP_GET | PTL_ME_USE_ONCE | PTL_ME_IS_ACCESSIBLE |
- PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
- me.match_id = id;
- me.match_bits = match_bits;
- me.ignore_bits = NPTL_MATCH_IGNORE;
- me.min_free = 0;
-
- while (remaining) {
- ptl_handle_me_t foo_me_handle;
-
- ++REQ_PTL(req)->num_gets;
-
- ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &me, PTL_PRIORITY_LIST, req,
- &foo_me_handle);
- MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
- MPID_nem_ptl_strerror(ret));
- MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, NPTL_MATCH_GET_TAG(match_bits)));
-
- me.start = (char *)me.start + me.length;
- remaining -= me.length;
- if (remaining < MPIDI_nem_ptl_ni_limits.max_msg_size)
- me.length = remaining;
- }
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MEAPPEND_LARGE);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
-
-#undef FUNCNAME
#define FUNCNAME send_pkt
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
@@ -151,10 +147,10 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
int mpi_errno = MPI_SUCCESS;
MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
int ret;
- char *sendbuf;
- const size_t sent_sz = data_sz < (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz) ? data_sz : (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz);
- const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz+sreq->dev.ext_hdr_sz);
+ char *sendbuf, *sendbuf_ptr;
+ const size_t sent_sz = data_sz < (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz) ? data_sz : (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz-sizeof(ptl_size_t));
const size_t remaining = data_sz - sent_sz;
+ const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz+sreq->dev.ext_hdr_sz+(remaining?sizeof(ptl_size_t):0));
ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
MPIDI_STATE_DECL(MPID_STATE_SEND_PKT);
@@ -163,11 +159,12 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
sendbuf = MPIU_Malloc(sendbuf_sz);
MPIU_Assert(sendbuf != NULL);
MPIU_Memcpy(sendbuf, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
+ sendbuf_ptr = sendbuf + sizeof(MPIDI_CH3_Pkt_t);
if (sreq->dev.ext_hdr_sz > 0) {
/* copy extended packet header to send buf */
- MPIU_Memcpy(sendbuf + sizeof(MPIDI_CH3_Pkt_t),
- sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz);
+ MPIU_Memcpy(sendbuf_ptr, sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz);
+ sendbuf_ptr += sreq->dev.ext_hdr_sz;
}
TMPBUF(sreq) = NULL;
@@ -175,12 +172,23 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
REQ_PTL(sreq)->put_done = 0;
if (data_sz) {
- MPIU_Memcpy(sendbuf + sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.ext_hdr_sz, data_p, sent_sz);
- if (remaining) /* Post MEs for the remote gets */
- mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank),
- (char *)data_p + sent_sz, remaining);
- if (mpi_errno)
- goto fn_fail;
+ MPIU_Memcpy(sendbuf_ptr, data_p, sent_sz);
+ sendbuf_ptr += sent_sz;
+ if (remaining) {
+ char *tmp_ptr = (char *)data_p + sent_sz;
+ const char *endbuf = tmp_ptr + remaining;
+ /* The address/offset for the remote side to do the get is last in the buffer */
+ ptl_size_t *offset = (ptl_size_t *)sendbuf_ptr;
+ *offset = (ptl_size_t)tmp_ptr;
+ do {
+ struct pending_gets_st *pending_get = MPIU_Malloc(sizeof(struct pending_gets_st));
+ ++REQ_PTL(sreq)->num_gets;
+ pending_get->ptr = tmp_ptr;
+ pending_get->req = sreq;
+ HASH_ADD_PTR(pending_gets, ptr, pending_get);
+ tmp_ptr += MPIDI_nem_ptl_ni_limits.max_msg_size;
+ } while (tmp_ptr < endbuf);
+ }
}
SENDBUF(sreq) = sendbuf;
@@ -213,11 +221,11 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
int mpi_errno = MPI_SUCCESS;
MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
int ret;
- char *sendbuf;
+ char *sendbuf, *sendbuf_ptr;
const size_t data_sz = sreq->dev.segment_size - sreq->dev.segment_first;
- const size_t sent_sz = data_sz < (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz) ? data_sz : (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz);
- const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz+sreq->dev.ext_hdr_sz);
+ const size_t sent_sz = data_sz < (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz) ? data_sz : (PAYLOAD_SIZE-sreq->dev.ext_hdr_sz-sizeof(ptl_size_t));
const size_t remaining = data_sz - sent_sz;
+ const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz+sreq->dev.ext_hdr_sz+(remaining?sizeof(ptl_size_t):0));
ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
MPIDI_STATE_DECL(MPID_STATE_SEND_NONCONTIG_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_SEND_NONCONTIG_PKT);
@@ -225,11 +233,12 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
sendbuf = MPIU_Malloc(sendbuf_sz);
MPIU_Assert(sendbuf != NULL);
MPIU_Memcpy(sendbuf, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
+ sendbuf_ptr = sendbuf + sizeof(MPIDI_CH3_Pkt_t);
if (sreq->dev.ext_hdr_sz > 0) {
/* copy extended packet header to send buf */
- MPIU_Memcpy(sendbuf + sizeof(MPIDI_CH3_Pkt_t),
- sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz);
+ MPIU_Memcpy(sendbuf_ptr, sreq->dev.ext_hdr_ptr, sreq->dev.ext_hdr_sz);
+ sendbuf_ptr += sreq->dev.ext_hdr_sz;
}
TMPBUF(sreq) = NULL;
@@ -239,18 +248,29 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
if (data_sz) {
MPIDI_msg_sz_t first = sreq->dev.segment_first;
MPIDI_msg_sz_t last = sreq->dev.segment_first + sent_sz;
- MPID_Segment_pack(sreq->dev.segment_ptr, first, &last, sendbuf + sizeof(MPIDI_CH3_Pkt_t) + sreq->dev.ext_hdr_sz);
+ MPID_Segment_pack(sreq->dev.segment_ptr, first, &last, sendbuf_ptr);
+ sendbuf_ptr += sent_sz;
if (remaining) { /* Post MEs for the remote gets */
+ char *tmp_ptr, *endbuf;
+ ptl_size_t *offset = (ptl_size_t *)sendbuf_ptr;
TMPBUF(sreq) = MPIU_Malloc(remaining);
+ tmp_ptr = TMPBUF(sreq);
+ endbuf = (char *)TMPBUF(sreq) + remaining;
+ *offset = (ptl_size_t)TMPBUF(sreq);
first = last;
last = sreq->dev.segment_size;
MPID_Segment_pack(sreq->dev.segment_ptr, first, &last, TMPBUF(sreq));
MPIU_Assert(last == sreq->dev.segment_size);
- mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), TMPBUF(sreq), remaining);
- if (mpi_errno)
- goto fn_fail;
+ do {
+ struct pending_gets_st *pending_get = MPIU_Malloc(sizeof(struct pending_gets_st));
+ ++REQ_PTL(sreq)->num_gets;
+ pending_get->ptr = tmp_ptr;
+ pending_get->req = sreq;
+ HASH_ADD_PTR(pending_gets, ptr, pending_get);
+ tmp_ptr += MPIDI_nem_ptl_ni_limits.max_msg_size;
+ } while (tmp_ptr < endbuf);
}
}
@@ -419,12 +439,13 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
int incomplete;
size_t size;
char *buf_ptr;
+ ptl_size_t target_offset;
MPID_Request *req = MPID_Request_create();
MPIU_Assert(req != NULL);
MPIDI_CH3U_Request_decrement_cc(req, &incomplete); /* We'll increment it below */
REQ_PTL(req)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
- REQ_PTL(req)->bytes_put = packet_sz + remaining;
+ REQ_PTL(req)->bytes_put = packet_sz + remaining - sizeof(ptl_size_t);
TMPBUF(req) = MPIU_Malloc(REQ_PTL(req)->bytes_put);
MPIU_Assert(TMPBUF(req) != NULL);
MPIU_Memcpy(TMPBUF(req), e->start, packet_sz);
@@ -432,11 +453,12 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
req->ch.vc = vc;
size = remaining < MPIDI_nem_ptl_ni_limits.max_msg_size ? remaining : MPIDI_nem_ptl_ni_limits.max_msg_size;
- buf_ptr = (char *)TMPBUF(req) + packet_sz;
- while (remaining) {
+ buf_ptr = (char *)TMPBUF(req) + packet_sz - sizeof(ptl_size_t);
+ target_offset = *((ptl_size_t *)buf_ptr);
+ do {
MPIDI_CH3U_Request_increment_cc(req, &incomplete); /* Will be decremented - and eventually freed in REPLY */
ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
- size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), 0, req);
+ size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), target_offset, req);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
MPID_nem_ptl_strerror(ret));
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
@@ -445,9 +467,10 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
vc_ptl->id.phys.pid, vc_ptl->ptc, GET_TAG));
buf_ptr += size;
remaining -= size;
+ target_offset += size;
if (remaining < MPIDI_nem_ptl_ni_limits.max_msg_size)
size = remaining;
- }
+ } while (remaining);
}
/* FIXME: this search/delete not be necessary if we set PTL_ME_UNEXPECTED_HDR_DISABLE
@@ -462,7 +485,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
case PTL_EVENT_GET:
{
- MPID_Request *const req = e->user_ptr;
+ MPID_Request *const req = find_req(e->start);
if (--REQ_PTL(req)->num_gets == 0) {
MPIU_Free(TMPBUF(req));
http://git.mpich.org/mpich.git/commitdiff/3752b556c7110b167d46661821ef0840c…
commit 3752b556c7110b167d46661821ef0840c779f221
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Mon Jun 15 16:41:49 2015 -0500
netmod/portals4: cleanup usage of unused variable
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
index 5d71929..5c3d03f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
@@ -48,7 +48,6 @@ static void big_meappend(void *buf, ptl_size_t left_to_send, MPIDI_VC_t *vc, ptl
/* increment the cc for each get operation */
MPIDI_CH3U_Request_increment_cc(sreq, &was_incomplete);
MPIU_Assert(was_incomplete);
- REQ_PTL(sreq)->num_gets++;
/* account for what has been sent */
me.start = (char *)me.start + me.length;
@@ -275,7 +274,6 @@ static int send_msg(ptl_hdr_data_t ssend_flag, struct MPIDI_VC *vc, const void *
/* increment the cc for the get operation */
MPIDI_CH3U_Request_increment_cc(sreq, &was_incomplete);
MPIU_Assert(was_incomplete);
- REQ_PTL(sreq)->num_gets = 1;
/* Create MD for first chunk */
md.start = sreq->dev.iov;
http://git.mpich.org/mpich.git/commitdiff/306cbd9706d74de513e6aa5cb681db01c…
commit 306cbd9706d74de513e6aa5cb681db01c786362c
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Tue Jun 16 16:29:13 2015 -0500
netmod/portals4: remove packing utility functions
MPID_Segment_pack/unpack should be all we need to manipulate noncontig
messages. Not sure why these were originally included.
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk b/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
index 764e821..8237dc2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
@@ -9,7 +9,6 @@ if BUILD_NEMESIS_NETMOD_PORTALS4
mpi_core_sources += \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c \
- src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_pack_byte.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index 0e136c7..92b840e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -64,7 +64,6 @@ static inline MPID_nem_ptl_req_area * REQ_PTL(MPID_Request *req) {
#define MPID_nem_ptl_init_req(req_) do { \
int i; \
for (i = 0; i < MPID_NEM_PTL_NUM_CHUNK_BUFFERS; ++i) { \
- REQ_PTL(req_)->overflow[i].len = 0; \
REQ_PTL(req_)->chunk_buffer[i] = NULL; \
} \
REQ_PTL(req_)->large = FALSE; \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_pack_byte.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_pack_byte.c
deleted file mode 100644
index ccb93bd..0000000
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_pack_byte.c
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2012 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "ptl_impl.h"
-
-
-#undef FUNCNAME
-#define FUNCNAME MPI_nem_ptl_pack_byte
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-void MPI_nem_ptl_pack_byte(MPID_Segment *segment, MPI_Aint first, MPI_Aint last, void *buf,
- MPID_nem_ptl_pack_overflow_t *overflow)
-{
- MPI_Aint my_last;
- MPI_Aint bytes;
- char *end;
- MPIDI_STATE_DECL(MPID_STATE_MPI_NEM_PTL_PACK_BYTE);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPI_NEM_PTL_PACK_BYTE);
-
- /* first copy out of overflow buffer */
- if (overflow->len) {
- if (overflow->len <= last-first) {
- MPIU_Memcpy(buf, &overflow->buf[overflow->offset], overflow->len);
- first += overflow->len;
- buf = (char *)buf + overflow->len;
- overflow->len = 0;
- if (last == first)
- goto fn_exit;
- } else {
- MPIU_Memcpy(buf, &overflow->buf[overflow->offset], last-first);
- overflow->offset += overflow->len - (last-first);
- overflow->len -= last-first;
- goto fn_exit;
- }
- }
-
- /* unpack as much as we can into buf */
- my_last = last;
- MPID_Segment_pack(segment, first, &my_last, buf);
-
- if (my_last == last)
- /* buf is completely filled */
- goto fn_exit;
-
- /* remember where the unfilled section starts and how large it is */
- end = &((char *)buf)[my_last-first];
- bytes = last - my_last;
-
- /* unpack some into the overflow */
- first = my_last;
- my_last += sizeof(overflow->buf);
- MPID_Segment_pack(segment, first, &my_last, overflow->buf);
- MPIU_Assert(my_last - first);
-
- /* fill in the rest of buf */
- MPIU_Memcpy(end, overflow->buf, bytes);
-
- /* save the beginning of the offset buffer and its length */
- overflow->offset = bytes;
- overflow->len = my_last-first - bytes;
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPI_NEM_PTL_PACK_BYTE);
- return;
-}
-
-/* MPID_nem_ptl_unpack_byte -- this function unpacks a contig buffer handling
- the case where there are bytes left in the buffer that are less than a basic
- datatype. Those bytes are copied into an overflow buffer so that the next
- time unpack_byte is called they can be "prepended" to that buffer before
- doing a segment_unpack. Note, that means that after calling unpack_byte,
- the last few bytes may not have been copied into the target buffer. */
-#undef FUNCNAME
-#define FUNCNAME MPID_nem_ptl_unpack_byte
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_ptl_unpack_byte(MPID_Segment *segment, MPI_Aint first, MPI_Aint last, void *buf,
- MPID_nem_ptl_pack_overflow_t *overflow)
-{
- int mpi_errno = MPI_SUCCESS;
- MPI_Aint my_last;
- MPI_Aint bytes;
- MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_UNPACK_BYTE);
-
- MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_UNPACK_BYTE);
-
- if (overflow->len) {
- /* if there is data in the overflow buffer, then we already know that
- it's too small to unpack with this datatype, so we return an error */
- MPIU_ERR_CHKANDJUMP(overflow->len >= last-first, mpi_errno, MPI_ERR_OTHER, "**dtypemismatch");
-
- /* bytes is the number of additional bytes to copy into the overflow buffer */
- bytes = sizeof(overflow->buf) - overflow->len;
- if (bytes > last-first)
- bytes = last-first;
-
- MPIU_Memcpy(overflow->buf + overflow->len, buf, bytes);
-
- /* Now there are (overflow->len + bytes) bytes in the overflow buffer.
- We try to unpack as many as we can */
- my_last = first + overflow->len + bytes;
- MPID_Segment_unpack(segment, first, &my_last, buf);
-
- /* we update the buf pointer to the */
- buf = ((char *)buf) + my_last-first - overflow->len;
- first = my_last;
-
- overflow->len = 0;
- }
-
- if (first == last)
- goto fn_exit;
-
- my_last = last;
- MPID_Segment_unpack(segment, first, &my_last, buf);
-
- if (my_last == last)
- /* buf has been completely unpacked */
- goto fn_exit;
-
- bytes = last - my_last;
-
- /* copy remaining bytes int overflow buffer */
- MPIU_Memcpy(overflow->buf, &((char *)buf)[my_last-first], bytes);
-
- overflow->offset = 0;
- overflow->len = bytes;
-
- fn_exit:
- MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_UNPACK_BYTE);
- return mpi_errno;
- fn_fail:
- goto fn_exit;
-}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
index fcc6184..357630c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -210,6 +210,8 @@ static int handler_recv_unpack_complete(const ptl_event_t *e)
int mpi_errno = MPI_SUCCESS;
MPID_Request *const rreq = e->user_ptr;
void *buf;
+ MPI_Aint last;
+
MPIDI_STATE_DECL(MPID_STATE_HANDLER_RECV_UNPACK_COMPLETE);
MPIDI_FUNC_ENTER(MPID_STATE_HANDLER_RECV_UNPACK_COMPLETE);
@@ -221,10 +223,9 @@ static int handler_recv_unpack_complete(const ptl_event_t *e)
else
buf = REQ_PTL(rreq)->chunk_buffer[0];
- mpi_errno = MPID_nem_ptl_unpack_byte(rreq->dev.segment_ptr, rreq->dev.segment_first,
- rreq->dev.segment_first + e->mlength, buf,
- &REQ_PTL(rreq)->overflow[0]);
- if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+ last = rreq->dev.segment_first + e->mlength;
+ MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, &last, buf);
+ MPIU_Assert(last == rreq->dev.segment_first + e->mlength);
mpi_errno = handler_recv_complete(e);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
http://git.mpich.org/mpich.git/commitdiff/974942e82b6d428b19235cf36bd327bb5…
commit 974942e82b6d428b19235cf36bd327bb5cc54964
Author: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Date: Mon Jun 15 15:06:45 2015 -0500
netmod/portals4: use separate EQ for flow control handling
Because we don't drain the EQs in the event of flow control, we need
to use a dedicated EQ for messages related to pausing and unpausing
communication. These messages are all consumed by the Rportals layer,
the user will never see anything.
Signed-off-by: Antonio J. Pena <apenya(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
index b29475c..1d308df 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c
@@ -37,6 +37,7 @@ ptl_handle_eq_t MPIDI_nem_ptl_eq;
ptl_handle_eq_t MPIDI_nem_ptl_get_eq;
ptl_handle_eq_t MPIDI_nem_ptl_control_eq;
ptl_handle_eq_t MPIDI_nem_ptl_origin_eq;
+ptl_handle_eq_t MPIDI_nem_ptl_rpt_eq;
ptl_pt_index_t MPIDI_nem_ptl_control_rpt_pt; /* portal for rportals control messages */
ptl_pt_index_t MPIDI_nem_ptl_get_rpt_pt; /* portal for rportals control messages */
ptl_handle_md_t MPIDI_nem_ptl_global_md;
@@ -204,6 +205,9 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_control_eq);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+ ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_rpt_eq);
+ MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc", "**ptleqalloc %s", MPID_nem_ptl_strerror(ret));
+
/* allocate a separate EQ for origin events. with this, we can implement rate-limit operations
to prevent a locally triggered flow control even */
ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EVENT_COUNT, &MPIDI_nem_ptl_origin_eq);
@@ -225,17 +229,17 @@ static int ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
/* allocate portal for MPICH control messages */
- ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_eq,
+ ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_rpt_eq,
PTL_PT_ANY, &MPIDI_nem_ptl_rpt_pt);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
/* allocate portal for MPICH control messages */
- ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_get_eq,
+ ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_rpt_eq,
PTL_PT_ANY, &MPIDI_nem_ptl_get_rpt_pt);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
/* allocate portal for MPICH control messages */
- ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_control_eq,
+ ret = PtlPTAlloc(MPIDI_nem_ptl_ni, PTL_PT_ONLY_USE_ONCE | PTL_PT_ONLY_TRUNCATE | PTL_PT_FLOWCTRL, MPIDI_nem_ptl_rpt_eq,
PTL_PT_ANY, &MPIDI_nem_ptl_control_rpt_pt);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc", "**ptlptalloc %s", MPID_nem_ptl_strerror(ret));
@@ -293,7 +297,7 @@ static int ptl_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int ret;
- ptl_handle_eq_t eqs[4];
+ ptl_handle_eq_t eqs[5];
MPIDI_STATE_DECL(MPID_STATE_PTL_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_PTL_FINALIZE);
@@ -309,7 +313,8 @@ static int ptl_finalize(void)
eqs[1] = MPIDI_nem_ptl_get_eq;
eqs[2] = MPIDI_nem_ptl_control_eq;
eqs[3] = MPIDI_nem_ptl_origin_eq;
- ret = MPID_nem_ptl_rptl_drain_eq(4, eqs);
+ eqs[4] = MPIDI_nem_ptl_rpt_eq;
+ ret = MPID_nem_ptl_rptl_drain_eq(5, eqs);
MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree", "**ptlptfree %s", MPID_nem_ptl_strerror(ret));
ret = MPID_nem_ptl_rptl_ptfini(MPIDI_nem_ptl_pt);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
index a94eb8a..1ba997e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c
@@ -134,6 +134,10 @@ int MPID_nem_ptl_poll(int is_blocking_poll)
while (1) {
int ctl_event = FALSE;
+ /* Check the rptls EQ first. It should never return an event. */
+ ret = MPID_nem_ptl_rptl_eqget(MPIDI_nem_ptl_rpt_eq, &event);
+ MPIU_Assert(ret == PTL_EQ_EMPTY);
+
/* check EQs for events */
ret = MPID_nem_ptl_rptl_eqget(MPIDI_nem_ptl_eq, &event);
MPIU_ERR_CHKANDJUMP(ret == PTL_EQ_DROPPED, mpi_errno, MPI_ERR_OTHER, "**eqdropped");
-----------------------------------------------------------------------
Summary of changes:
.../channels/nemesis/netmod/portals4/Makefile.mk | 1 -
.../channels/nemesis/netmod/portals4/ptl_impl.h | 1 -
.../channels/nemesis/netmod/portals4/ptl_init.c | 15 ++-
.../ch3/channels/nemesis/netmod/portals4/ptl_nm.c | 149 +++++++++-----------
.../nemesis/netmod/portals4/ptl_pack_byte.c | 141 ------------------
.../channels/nemesis/netmod/portals4/ptl_poll.c | 4 +
.../channels/nemesis/netmod/portals4/ptl_recv.c | 9 +-
.../channels/nemesis/netmod/portals4/ptl_send.c | 2 -
8 files changed, 87 insertions(+), 235 deletions(-)
delete mode 100644 src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_pack_byte.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-103-g83253a4
by noreply@mpich.org 17 Jun '15
by noreply@mpich.org 17 Jun '15
17 Jun '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 83253a41423d0f30317f6de93560a6cec8e5a069 (commit)
from 9c4b9b172428fa991ff6e7904d96b57e28fb24c7 (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/83253a41423d0f30317f6de93560a6cec…
commit 83253a41423d0f30317f6de93560a6cec8e5a069
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Jun 15 14:51:28 2015 -0500
some type promotions in RMA path
Signed-off-by: Xin Zhao <xinzhao3(a)illinois.edu>
diff --git a/src/mpid/ch3/include/mpid_rma_shm.h b/src/mpid/ch3/include/mpid_rma_shm.h
index f6d6b78..31417a0 100644
--- a/src/mpid/ch3/include/mpid_rma_shm.h
+++ b/src/mpid/ch3/include/mpid_rma_shm.h
@@ -10,8 +10,8 @@
#include "mpl_utlist.h"
#include "mpid_rma_types.h"
-static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datatype source_dtp,
- void *target_buf, int target_count, MPI_Datatype target_dtp,
+static inline int do_accumulate_op(void *source_buf, MPI_Aint source_count, MPI_Datatype source_dtp,
+ void *target_buf, MPI_Aint target_count, MPI_Datatype target_dtp,
MPI_Aint stream_offset, MPI_Op acc_op);
#define ASSIGN_COPY(src, dest, count, type) \
diff --git a/src/mpid/ch3/include/mpid_rma_types.h b/src/mpid/ch3/include/mpid_rma_types.h
index 120b9dd..a456d2f 100644
--- a/src/mpid/ch3/include/mpid_rma_types.h
+++ b/src/mpid/ch3/include/mpid_rma_types.h
@@ -26,10 +26,10 @@ enum MPIDI_RMA_Datatype {
/* to send derived datatype across in RMA ops */
typedef struct MPIDI_RMA_dtype_info { /* for derived datatypes */
int is_contig;
- int max_contig_blocks;
+ MPI_Aint max_contig_blocks;
MPI_Aint size;
MPI_Aint extent;
- int dataloop_size; /* not needed because this info is sent in
+ MPI_Aint dataloop_size; /* not needed because this info is sent in
* packet header. remove it after lock/unlock
* is implemented in the device */
void *dataloop; /* pointer needed to update pointers
@@ -61,7 +61,7 @@ typedef struct MPIDI_RMA_Op {
MPI_Datatype result_datatype;
struct MPID_Request **reqs;
- int reqs_size;
+ MPI_Aint reqs_size;
MPIDI_RMA_dtype_info dtype_info;
void *dataloop;
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index bfaa7a7..968f189 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -806,8 +806,8 @@ static inline int MPIDI_CH3I_RMA_Handle_flush_ack(MPID_Win * win_ptr, int target
#define FUNCNAME do_accumulate_op
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int do_accumulate_op(void *source_buf, int source_count, MPI_Datatype source_dtp,
- void *target_buf, int target_count, MPI_Datatype target_dtp,
+static inline int do_accumulate_op(void *source_buf, MPI_Aint source_count, MPI_Datatype source_dtp,
+ void *target_buf, MPI_Aint target_count, MPI_Datatype target_dtp,
MPI_Aint stream_offset, MPI_Op acc_op)
{
int mpi_errno = MPI_SUCCESS;
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/include/mpid_rma_shm.h | 4 ++--
src/mpid/ch3/include/mpid_rma_types.h | 6 +++---
src/mpid/ch3/include/mpidrma.h | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.2b3-102-g9c4b9b1
by noreply@mpich.org 16 Jun '15
by noreply@mpich.org 16 Jun '15
16 Jun '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 9c4b9b172428fa991ff6e7904d96b57e28fb24c7 (commit)
via ac07f982719436df23b25484c239ad2cc23b2a9e (commit)
from 394d46b764838dc9193efc012ea297cab3a33aac (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/9c4b9b172428fa991ff6e7904d96b57e2…
commit 9c4b9b172428fa991ff6e7904d96b57e28fb24c7
Author: Lena Oden <loden(a)anl.gov>
Date: Fri Jun 12 16:02:50 2015 -0500
Close remainig conns before sockset is destroyed
Loser of Head-to-Head connections are not necessarily
closed, if the sock set is destroyed. This patch
looks for all open connections, close the socket
and free the memory recourses. Fixes #2180
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index f09551d..0fcc20d 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -375,6 +375,8 @@ int MPIDI_CH3I_Progress_init(void)
int MPIDI_CH3I_Progress_finalize(void)
{
int mpi_errno;
+ MPIDI_CH3I_Connection_t *conn = NULL;
+
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_PROGRESS_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_PROGRESS_FINALIZE);
@@ -383,8 +385,16 @@ int MPIDI_CH3I_Progress_finalize(void)
mpi_errno = MPIDU_CH3I_ShutdownListener();
if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
- /* FIXME: Cleanly shutdown other socks and free connection structures.
- (close protocol?) */
+
+ /* Close open connections */
+ MPIDU_Sock_close_open_sockets(MPIDI_CH3I_sock_set,(void**) &conn);
+ while (conn != NULL) {
+ conn->state = CONN_STATE_CLOSING;
+ mpi_errno = MPIDI_CH3_Sockconn_handle_close_event(conn);
+ if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+ MPIDU_Sock_close_open_sockets(MPIDI_CH3I_sock_set,(void**) &conn);
+ }
+
/*
diff --git a/src/mpid/common/sock/mpidu_sock.h b/src/mpid/common/sock/mpidu_sock.h
index a9a9e95..9f752a9 100644
--- a/src/mpid/common/sock/mpidu_sock.h
+++ b/src/mpid/common/sock/mpidu_sock.h
@@ -229,6 +229,33 @@ int MPIDU_Sock_create_set(MPIDU_Sock_set_t * set);
/*@
+MPIDU_Sock_close_open_sockets - close the first open sockets of a sock_element
+
+Input Parameter:
+. set - set to be considered
+
+Output Parameter:
+. user_ptr - pointer to the user pointer pointer of a socket.
+
+Return value: a MPI error code with a Sock extended error class
++ MPI_SUCCESS - sock set successfully destroyed
+. MPIDU_SOCK_ERR_INIT - Sock module not initialized
+. MPIDU_SOCK_ERR_BAD_SET - invalid sock set
+. MPIDU_SOCK_ERR_NOMEM - unable to allocate required memory
+- MPIDU_SOCK_ERR_FAIL - unable to destroy the sock set (<BRT> because it still contained active sock objects?)
+
+
+Notes:
+This function only closes the first open socket of a sock_set and returns the
+user pointer of the sock-info structure. To close all sockets, the function must
+be called repeatedly, untiluser_ptr == NULL. The reason for this is
+that the overlying protocoll may need the user_ptr for further cleanup.
+
+@*/
+int MPIDU_Sock_close_open_sockets(struct MPIDU_Sock_set * sock_set, void** user_ptr );
+
+
+/*@
MPIDU_Sock_destroy_set - destroy an existing sock set, releasing an internal resource associated with that set
Input Parameter:
diff --git a/src/mpid/common/sock/poll/sock_set.i b/src/mpid/common/sock/poll/sock_set.i
index 6600aea..8948e1d 100644
--- a/src/mpid/common/sock/poll/sock_set.i
+++ b/src/mpid/common/sock/poll/sock_set.i
@@ -170,6 +170,38 @@ int MPIDU_Sock_create_set(struct MPIDU_Sock_set ** sock_setp)
/* --END ERROR HANDLING-- */
}
+#undef FUNCNAME
+#define FUNCNAME MPIDU_Sock_close_open_sockets
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int MPIDU_Sock_close_open_sockets(struct MPIDU_Sock_set * sock_set, void** user_ptr ){
+
+ int i;
+ int mpi_errno = MPI_SUCCESS;
+ struct pollinfo * pollinfos = NULL;
+ pollinfos = sock_set->pollinfos;
+ MPIDI_STATE_DECL(MPID_STATE_MPIDU_SOCK_CLOSE_OPEN_SOCKETS);
+
+ MPIDI_FUNC_ENTER(MPID_STATE_MPIDU_SOCK_CLOSE_OPEN_SOCKETS);
+
+ MPIDU_SOCKI_VERIFY_INIT(mpi_errno, fn_exit);
+ /* wakeup waiting socket if mullti-threades */
+ *user_ptr = NULL;
+ for (i = 0; i < sock_set->poll_array_elems; i++) {
+ if(pollinfos[i].sock != NULL && pollinfos[i].type != MPIDU_SOCKI_TYPE_INTERRUPTER){
+ close(pollinfos[i].fd);
+ MPIDU_Socki_sock_free(pollinfos[i].sock);
+ *user_ptr = pollinfos[i].user_ptr;
+ break;
+ }
+ }
+#ifdef USE_SOCK_VERIFY
+ fn_exit:
+#endif
+ MPIDI_FUNC_EXIT(MPID_STATE_MPIDU_SOCK_CLOSE_OPEN_SOCKETS);
+ return mpi_errno;
+}
+
#undef FUNCNAME
#define FUNCNAME MPIDU_Sock_destroy_set
http://git.mpich.org/mpich.git/commitdiff/ac07f982719436df23b25484c239ad2cc…
commit ac07f982719436df23b25484c239ad2cc23b2a9e
Author: Lena Oden <loden(a)anl.gov>
Date: Thu Jun 4 17:55:39 2015 -0500
Handling of discard connection to avoid reconnect
The loser of a head-to-head connection sometimes tries
to reconnect later, afer MPI_Finalize was called This
can lead to several errors in the socket layer, depending
on the state of the disarded connection and the appereance
of the connection events. Refs #2180
This Patch has two ways to handle this:
1.)
Discarded connections are marked with CONN_STATE_DISCARD,
so they are hold from connection. Furthermore, an error on
any discarded connection (because the remote side closed in
MPI_Finalize) is ignored and the connection is closed.
2.)
Add a finalize flag for process groups. If a process group is
closing and tries to close all VCs, a flag is set to mark this.
If the flag is set, a reconnection (in the socket state) is
refused and the connection is closed on both sided.
Both steps are necessary to catch all reconnection tries after
MPI_Finalize was called.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/sock/src/ch3_progress.c b/src/mpid/ch3/channels/sock/src/ch3_progress.c
index 8715193..f09551d 100644
--- a/src/mpid/ch3/channels/sock/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/sock/src/ch3_progress.c
@@ -458,6 +458,14 @@ static int MPIDI_CH3I_Progress_handle_sock_event(MPIDU_Sock_event_t * event)
{
MPIDI_CH3I_Connection_t * conn =
(MPIDI_CH3I_Connection_t *) event->user_ptr;
+ /* If we have a READ event on a discarded connection, we probably have
+ an error on this connection, if the remote side is closed due to
+ MPI_Finalize. Since the connection is discareded (and therefore not needed)
+ it can be closed and the error can be ignored */
+ if(conn->state == CONN_STATE_DISCARD){
+ MPIDI_CH3_Sockconn_handle_close_event(conn);
+ break;
+ }
MPID_Request * rreq = conn->recv_active;
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index 7692704..5b0c536 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -92,6 +92,13 @@ typedef struct MPIDI_PG
find a particular process group. */
void * id;
+ /* Flag to mark a procress group which is finalizing. This means thay
+ the VCs for this process group are closing, (normally becuase
+ MPI_Finalize was called). This is required to avoid a reconnection
+ of the VCs when the PG is closed due to unused elements in the event
+ queue */
+ int finalize;
+
/* Replacement abstraction for connection information */
/* Connection information needed to access processes in this process
group and to share the data with other processes. The items are
diff --git a/src/mpid/ch3/src/mpidi_pg.c b/src/mpid/ch3/src/mpidi_pg.c
index 6f35c59..2367259 100644
--- a/src/mpid/ch3/src/mpidi_pg.c
+++ b/src/mpid/ch3/src/mpidi_pg.c
@@ -200,6 +200,7 @@ int MPIDI_PG_Create(int vct_sz, void * pg_id, MPIDI_PG_t ** pg_ptr)
MPIU_Object_set_ref(pg, 0);
pg->size = vct_sz;
pg->id = pg_id;
+ pg->finalize = 0;
/* Initialize the connection information to null. Use
the appropriate MPIDI_PG_InitConnXXX routine to set up these
fields */
@@ -1216,6 +1217,7 @@ int MPIDI_PG_Close_VCs( void )
MPIDI_VC_GetStateString(vc->state)));
}
}
+ pg->finalize = 1;
pg = pg->next;
}
/* Note that we do not free the process groups within this routine, even
diff --git a/src/mpid/ch3/util/sock/ch3u_connect_sock.c b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
index efe0bc6..9c4f1e0 100644
--- a/src/mpid/ch3/util/sock/ch3u_connect_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_connect_sock.c
@@ -598,11 +598,13 @@ int MPIDI_CH3_Sockconn_handle_connect_event( MPIDI_CH3I_Connection_t *conn,
}
/* --END ERROR HANDLING-- */
- if (conn->state == CONN_STATE_CONNECTING) {
+ if (conn->state == CONN_STATE_CONNECTING || conn->state == CONN_STATE_DISCARD) {
MPIDI_CH3I_Pkt_sc_open_req_t *openpkt =
(MPIDI_CH3I_Pkt_sc_open_req_t *)&conn->pkt.type;
- MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CSEND);
- conn->state = CONN_STATE_OPEN_CSEND;
+ if(conn->state == CONN_STATE_CONNECTING){
+ MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CSEND);
+ conn->state = CONN_STATE_OPEN_CSEND;
+ }
MPIDI_Pkt_init(openpkt, MPIDI_CH3I_PKT_SC_OPEN_REQ);
openpkt->pg_id_len = (int) strlen(MPIDI_Process.my_pg->id) + 1;
openpkt->pg_rank = MPIR_Process.comm_world->rank;
@@ -688,6 +690,16 @@ int MPIDI_CH3_Sockconn_handle_close_event( MPIDI_CH3I_Connection_t * conn )
not be referenced anymore in any case. */
conn->vc = NULL;
}
+ else if(conn->state == CONN_STATE_DISCARD) {
+ /* post close, so the socket is closed and memmory leaks are avoided */
+ MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
+ conn->state = CONN_STATE_CLOSING;
+ mpi_errno = MPIDU_Sock_post_close(conn->sock);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_POP(mpi_errno);
+ }
+ goto fn_exit;
+ }
else {
MPIU_Assert(conn->state == CONN_STATE_LISTENING);
MPIDI_CH3I_listener_conn = NULL;
@@ -785,8 +797,9 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
MPIDI_CH3I_Pkt_sc_open_resp_t *openpkt =
(MPIDI_CH3I_Pkt_sc_open_resp_t *)&conn->pkt.type;
/* FIXME: is this the correct assert? */
- MPIU_Assert( conn->state == CONN_STATE_OPEN_CRECV );
- if (openpkt->ack) {
+
+ if (openpkt->ack && conn->state != CONN_STATE_DISCARD) {
+ MPIU_Assert( conn->state == CONN_STATE_OPEN_CRECV );
MPIDI_CH3I_VC *vcch = &conn->vc->ch;
MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_CONNECTED);
conn->state = CONN_STATE_CONNECTED;
@@ -812,6 +825,11 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
Why isn't it changed? Is there an assert here,
such as conn->vc->conn != conn (there is another connection
chosen for the vc)? */
+ /*Answer to FIXME */
+ /* Neither freed nor updated. This connection is the looser of
+ a head-to-head connection. The VC is still in use, but by
+ another sochekt connection. The refcount is not incremented
+ By chaning the assosiated connection. */
/* MPIU_Assert( conn->vc->ch.conn != conn ); */
/* Set the candidate vc for this connection to NULL (we
are discarding this connection because (I think) we
@@ -824,6 +842,11 @@ int MPIDI_CH3_Sockconn_handle_conn_event( MPIDI_CH3I_Connection_t * conn )
conn->vc = NULL;
conn->state = CONN_STATE_CLOSING;
/* FIXME: What does post close do here? */
+ /* Answer to FIXME: */
+ /* Since the connection is discarded, the socket is
+ no longer needed and should be closed. This is initiated with the post
+ close command. This also caused that the socket is removed from the
+ socket set, so no more polling on this socket*/
MPIU_DBG_MSG(CH3_DISCONNECT,TYPICAL,"CLosing sock (Post_close)");
mpi_errno = MPIDU_Sock_post_close(conn->sock);
if (mpi_errno != MPI_SUCCESS) {
@@ -881,6 +904,18 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
MPIDI_PG_Get_vc_set_active(pg, pg_rank, &vc);
MPIU_Assert(vc->pg_rank == pg_rank);
+ if(pg->finalize == 1) {
+ MPIDI_Pkt_init(openresp, MPIDI_CH3I_PKT_SC_OPEN_RESP);
+ openresp->ack = FALSE;
+ MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_LSEND);
+ conn->state = CONN_STATE_OPEN_LSEND;
+ mpi_errno = connection_post_send_pkt(conn);
+ if (mpi_errno != MPI_SUCCESS) {
+ MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_INTERN,
+ "**ch3|sock|open_lrecv_data");
+ }
+ goto fn_exit;
+ }
vcch = &vc->ch;
if (vcch->conn == NULL) {
/* no head-to-head connects, accept the connection */
@@ -902,6 +937,11 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
"vc=%p,conn=%p:Accept head-to-head connection (my process group), discarding vcch->conn=%p",vc,conn, vcch->conn));
+ /* mark old connection */
+ MPIDI_CH3I_Connection_t *old_conn = vcch->conn;
+ MPIU_DBG_CONNSTATECHANGE(old_conn,old_conn,CONN_STATE_DISCARD);
+ old_conn->state = CONN_STATE_DISCARD;
+
/* accept connection */
MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
@@ -926,6 +966,10 @@ int MPIDI_CH3_Sockconn_handle_connopen_event( MPIDI_CH3I_Connection_t * conn )
if (strcmp(MPIDI_Process.my_pg->id, pg->id) < 0) {
MPIU_DBG_MSG_FMT(CH3_CONNECT,TYPICAL,(MPIU_DBG_FDEST,
"vc=%p,conn=%p:Accept head-to-head connection (two process groups), discarding vcch->conn=%p",vc,conn, vcch->conn));
+ /* mark old connection */
+ MPIDI_CH3I_Connection_t *old_conn = vcch->conn;
+ MPIU_DBG_CONNSTATECHANGE(old_conn,old_conn,CONN_STATE_DISCARD);
+ old_conn->state = CONN_STATE_DISCARD;
/* accept connection */
MPIU_DBG_VCCHSTATECHANGE(vc,VC_STATE_CONNECTING);
vcch->state = MPIDI_CH3I_VC_STATE_CONNECTING;
@@ -973,11 +1017,13 @@ int MPIDI_CH3_Sockconn_handle_connwrite( MPIDI_CH3I_Connection_t * conn )
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_SOCKCONN_HANDLE_CONNWRITE);
- if (conn->state == CONN_STATE_OPEN_CSEND) {
+ if (conn->state == CONN_STATE_OPEN_CSEND || conn->state == CONN_STATE_DISCARD) {
/* finished sending open request packet */
/* post receive for open response packet */
- MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CRECV);
- conn->state = CONN_STATE_OPEN_CRECV;
+ if(conn->state == CONN_STATE_OPEN_CSEND){
+ MPIU_DBG_CONNSTATECHANGE(conn->vc,conn,CONN_STATE_OPEN_CRECV);
+ conn->state = CONN_STATE_OPEN_CRECV;
+ }
mpi_errno = connection_post_recv_pkt(conn);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpid/ch3/util/sock/ch3u_init_sock.c b/src/mpid/ch3/util/sock/ch3u_init_sock.c
index 68de1e2..a2a89fe 100644
--- a/src/mpid/ch3/util/sock/ch3u_init_sock.c
+++ b/src/mpid/ch3/util/sock/ch3u_init_sock.c
@@ -119,6 +119,7 @@ const char * MPIDI_Conn_GetStateString(int state)
case CONN_STATE_CONNECTED: name = "CONN_STATE_CONNECTED"; break;
case CONN_STATE_CLOSING: name = "CONN_STATE_CLOSING"; break;
case CONN_STATE_CLOSED: name = "CONN_STATE_CLOSED"; break;
+ case CONN_STATE_DISCARD: name = "CONN_STATE_DISCARD"; break;
case CONN_STATE_FAILED: name = "CONN_STATE_FAILE"; break;
}
diff --git a/src/mpid/ch3/util/sock/ch3usock.h b/src/mpid/ch3/util/sock/ch3usock.h
index 0231488..8de0f22 100644
--- a/src/mpid/ch3/util/sock/ch3usock.h
+++ b/src/mpid/ch3/util/sock/ch3usock.h
@@ -25,6 +25,7 @@ typedef enum MPIDI_CH3I_Conn_state
CONN_STATE_CONNECTED,
CONN_STATE_CLOSING,
CONN_STATE_CLOSED,
+ CONN_STATE_DISCARD,
CONN_STATE_FAILED
} MPIDI_CH3I_Conn_state;
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/channels/sock/src/ch3_progress.c | 22 ++++++++-
src/mpid/ch3/include/mpidimpl.h | 7 +++
src/mpid/ch3/src/mpidi_pg.c | 2 +
src/mpid/ch3/util/sock/ch3u_connect_sock.c | 62 +++++++++++++++++++++---
src/mpid/ch3/util/sock/ch3u_init_sock.c | 1 +
src/mpid/ch3/util/sock/ch3usock.h | 1 +
src/mpid/common/sock/mpidu_sock.h | 27 +++++++++++
src/mpid/common/sock/poll/sock_set.i | 32 +++++++++++++
8 files changed, 144 insertions(+), 10 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0