[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-232-g16e3319
Service Account
noreply at mpich.org
Mon Sep 21 22:12:31 CDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 16e3319b40808591a8f48e2f09e4574c20e38254 (commit)
via 6cae5cab8a6d3f99b1b2f0ba317fa9ed48b604bc (commit)
via a4b4bc990587665f11f2a9f7afaaa219c7e3ab7f (commit)
via ca076d13ad58f586c55b5eaf7c17f1d8517f28ba (commit)
via 861c6db4af70feaf110c563b028407d7d95f0f71 (commit)
from 7b8bd055dfdeb7a0d9c264e088376ff8fa9341b1 (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/16e3319b40808591a8f48e2f09e4574c20e38254
commit 16e3319b40808591a8f48e2f09e4574c20e38254
Author: Sangmin Seo <sseo at anl.gov>
Date: Mon Sep 21 17:44:30 2015 -0500
romio: add matching MPIR_Ext_cs_exit calls.
Some ROMIO functions returned without calling MPIR_Ext_cs_exit.
Signed-off-by: Rob Latham <robl at mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/cb_config_list.c b/src/mpi/romio/adio/common/cb_config_list.c
index 60cb6c1..508722a 100644
--- a/src/mpi/romio/adio/common/cb_config_list.c
+++ b/src/mpi/romio/adio/common/cb_config_list.c
@@ -145,6 +145,7 @@ int ADIOI_cb_gather_name_array(MPI_Comm comm,
if (found) {
ADIOI_Assert(array != NULL);
*arrayp = array;
+ MPIR_Ext_cs_exit(ADIO_THREAD_MUTEX);
return 0;
}
}
diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index 1fb7f54..743f09f 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -34,7 +34,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: is_contig %#X\n",is_contig);
#endif
- if (is_contig) return;
+ if (is_contig) goto fn_exit;
/* has it already been flattened? */
flat = ADIOI_Flatlist;
@@ -43,7 +43,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: found datatype %#X\n", datatype);
#endif
- return;
+ goto fn_exit;
}
else {
prev = flat;
@@ -100,6 +100,8 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
);
}
#endif
+
+ fn_exit:
MPIR_Ext_cs_exit(ADIO_THREAD_MUTEX);
}
http://git.mpich.org/mpich.git/commitdiff/6cae5cab8a6d3f99b1b2f0ba317fa9ed48b604bc
commit 6cae5cab8a6d3f99b1b2f0ba317fa9ed48b604bc
Author: Sangmin Seo <sseo at anl.gov>
Date: Mon Sep 21 11:38:21 2015 -0500
romio: add MPIR_Ext_cs_yield_global.
If the progress engine is blocked in wait callbacks of the extended
generalized request, we have to yield for another thread to be able to
unblock the progress engine. We added MPIR_Ext_cs_yield_global to
resolve the issue.
Signed-off-by: Rob Latham <robl at mcs.anl.gov>
diff --git a/src/glue/romio/glue_romio.c b/src/glue/romio/glue_romio.c
index f78afc3..5de161f 100644
--- a/src/glue/romio/glue_romio.c
+++ b/src/glue/romio/glue_romio.c
@@ -72,13 +72,18 @@ void MPIR_Ext_cs_exit(void *mutex_p)
MPID_THREAD_CS_EXIT(GLOBAL, *((MPID_Thread_mutex_t *) mutex_p));
}
+void MPIR_Ext_cs_yield(void *mutex_p)
+{
+ MPID_THREAD_CS_YIELD(GLOBAL, *((MPID_Thread_mutex_t *) mutex_p));
+}
+
/* This routine is for a thread to yield control when the thread is waiting for
* the completion of communication inside a ROMIO routine but the progress
* engine is blocked by another thread. */
-void MPIR_Ext_cs_yield(void *mutex_p)
+void MPIR_Ext_cs_yield_global(void)
{
/* TODO: check whether the progress engine is blocked */
- MPID_THREAD_CS_YIELD(GLOBAL, *((MPID_Thread_mutex_t *) mutex_p));
+ MPID_THREAD_CS_YIELD(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
}
/* will consider MPI_DATATYPE_NULL to be an error */
diff --git a/src/include/glue_romio.h.in b/src/include/glue_romio.h.in
index 72ce3ac..d2b97a9 100644
--- a/src/include/glue_romio.h.in
+++ b/src/include/glue_romio.h.in
@@ -56,6 +56,7 @@ void MPIR_Ext_thread_mutex_destroy(void *mutex_p);
void MPIR_Ext_cs_enter(void *mutex_p);
void MPIR_Ext_cs_exit(void *mutex_p);
void MPIR_Ext_cs_yield(void *mutex_p);
+void MPIR_Ext_cs_yield_global(void);
/* to facilitate error checking */
int MPIR_Ext_datatype_iscommitted(MPI_Datatype datatype);
diff --git a/src/mpi/romio/adio/common/ad_iread_coll.c b/src/mpi/romio/adio/common/ad_iread_coll.c
index 1cd8ed9..6cf85e9 100644
--- a/src/mpi/romio/adio/common/ad_iread_coll.c
+++ b/src/mpi/romio/adio/common/ad_iread_coll.c
@@ -1329,6 +1329,10 @@ static int ADIOI_GEN_irc_wait_fn(int count, void **array_of_states,
if ((timeout > 0) && (timeout < (MPI_Wtime() - starttime)))
goto fn_exit;
+
+ /* If the progress engine is blocked, we have to yield for another
+ * thread to be able to unblock the progress engine. */
+ MPIR_EXT_CS_YIELD_GLOBAL();
}
}
diff --git a/src/mpi/romio/adio/common/ad_iwrite_coll.c b/src/mpi/romio/adio/common/ad_iwrite_coll.c
index c5ac8b4..3cb86ad 100644
--- a/src/mpi/romio/adio/common/ad_iwrite_coll.c
+++ b/src/mpi/romio/adio/common/ad_iwrite_coll.c
@@ -1554,6 +1554,10 @@ static int ADIOI_GEN_iwc_wait_fn(int count, void **array_of_states,
if ((timeout > 0) && (timeout < (MPI_Wtime() - starttime)))
goto fn_exit;
+
+ /* If the progress engine is blocked, we have to yield for another
+ * thread to be able to unblock the progress engine. */
+ MPIR_EXT_CS_YIELD_GLOBAL();
}
}
diff --git a/src/mpi/romio/mpi-io/mpioimpl.h b/src/mpi/romio/mpi-io/mpioimpl.h
index c96ec64..452c2cb 100644
--- a/src/mpi/romio/mpi-io/mpioimpl.h
+++ b/src/mpi/romio/mpi-io/mpioimpl.h
@@ -21,6 +21,7 @@
#define ROMIO_THREAD_CS_ENTER(mutex) MPIR_Ext_cs_enter(mutex)
#define ROMIO_THREAD_CS_EXIT(mutex) MPIR_Ext_cs_exit(mutex)
#define ROMIO_THREAD_CS_YIELD(mutex) MPIR_Ext_cs_yield(mutex)
+#define MPIR_EXT_CS_YIELD_GLOBAL() MPIR_Ext_cs_yield_global()
/* committed datatype checking support in ROMIO */
#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) \
@@ -36,6 +37,7 @@
#define ROMIO_THREAD_CS_ENTER(mutex)
#define ROMIO_THREAD_CS_EXIT(mutex)
#define ROMIO_THREAD_CS_YIELD(mutex)
+#define MPIR_EXT_CS_YIELD_GLOBAL()
#define MPIO_DATATYPE_ISCOMMITTED(dtype_, err_) do {} while (0)
#ifdef HAVE_WINDOWS_H
#define MPIU_UNREFERENCED_ARG(a) a
http://git.mpich.org/mpich.git/commitdiff/a4b4bc990587665f11f2a9f7afaaa219c7e3ab7f
commit a4b4bc990587665f11f2a9f7afaaa219c7e3ab7f
Author: Pavan Balaji <balaji at anl.gov>
Date: Mon Sep 21 16:06:17 2015 -0500
Remove unused declarations.
Signed-off-by: Sangmin Seo <sseo at anl.gov>
diff --git a/src/mpi/comm/intercomm_merge.c b/src/mpi/comm/intercomm_merge.c
index 3fe11c2..fcdd0f1 100644
--- a/src/mpi/comm/intercomm_merge.c
+++ b/src/mpi/comm/intercomm_merge.c
@@ -255,7 +255,6 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
MPID_Comm *new_intracomm_ptr;
- MPID_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_INTERCOMM_MERGE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
@@ -263,8 +262,6 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm)
MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_INTERCOMM_MERGE);
- MPID_THREADPRIV_GET;
-
/* Validate parameters, especially handles needing to be converted */
# ifdef HAVE_ERROR_CHECKING
{
diff --git a/src/mpi/datatype/type_match_size.c b/src/mpi/datatype/type_match_size.c
index 7e7e735..b8bbbe8 100644
--- a/src/mpi/datatype/type_match_size.c
+++ b/src/mpi/datatype/type_match_size.c
@@ -83,7 +83,6 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
MPI_Datatype matched_datatype = MPI_DATATYPE_NULL;
int i;
MPI_Aint tsize;
- MPID_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_MATCH_SIZE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
@@ -92,8 +91,6 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_TYPE_MATCH_SIZE);
- MPID_THREADPRIV_GET;
-
/* Validate parameters and objects (post conversion) */
# ifdef HAVE_ERROR_CHECKING
{
http://git.mpich.org/mpich.git/commitdiff/ca076d13ad58f586c55b5eaf7c17f1d8517f28ba
commit ca076d13ad58f586c55b5eaf7c17f1d8517f28ba
Author: Pavan Balaji <balaji at anl.gov>
Date: Mon Sep 21 15:53:10 2015 -0500
Added back the implementation of recursive locks.
Since ROMIO is somewhat decoupled from MPICH, we still have to jump
through some hoops to get locks working correctly. This patch
essentially reverts the removal of the recursive locks in
[fa11ecd3c995].
Signed-off-by: Sangmin Seo <sseo at anl.gov>
Signed-off-by: Rob Latham <robl at mcs.anl.gov>
diff --git a/src/util/thread/mpiu_thread.h b/src/util/thread/mpiu_thread.h
index 2a14446..296fb83 100644
--- a/src/util/thread/mpiu_thread.h
+++ b/src/util/thread/mpiu_thread.h
@@ -119,6 +119,10 @@ typedef struct {
/* error string storage for MPIU_Strerror */
char strerrbuf[MPIU_STRERROR_BUF_SIZE];
+
+#if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE)
+ int lock_depth;
+#endif
} MPIUI_Per_thread_t;
#if defined (MPICH_IS_THREADED)
diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
index 0832c9c..959b34e 100644
--- a/src/util/thread/mpiu_thread_global.h
+++ b/src/util/thread/mpiu_thread_global.h
@@ -8,9 +8,9 @@
#define MPIU_THREAD_GLOBAL_H_INCLUDED
/* GLOBAL locks are all real ops */
-#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("GLOBAL", mutex)
-#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("GLOBAL", mutex)
-#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("GLOBAL", mutex)
+#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) MPIUI_THREAD_CS_ENTER_RECURSIVE("GLOBAL", mutex)
+#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) MPIUI_THREAD_CS_EXIT_RECURSIVE("GLOBAL", mutex)
+#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) MPIUI_THREAD_CS_YIELD_RECURSIVE("GLOBAL", mutex)
/* POBJ locks are all NO-OPs */
#define MPIUI_THREAD_CS_ENTER_POBJ(mutex)
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
index 895f5c0..5ac8e65 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -12,6 +12,7 @@
#define MPIU_THREAD_CHECK_BEGIN if (MPIR_ThreadInfo.isThreaded) {
#define MPIU_THREAD_CHECK_END }
+/* Nonrecursive mutex macros */
#define MPIUI_THREAD_CS_ENTER_NONRECURSIVE(lockname, mutex) \
do { \
int err_; \
@@ -38,6 +39,44 @@
MPIU_THREAD_CHECK_END; \
} while (0)
+
+/* Recursive mutex macros */
+/* We don't need to protect the depth variable since it is thread
+ * private and sequentially accessed within a thread */
+#define MPIUI_THREAD_CS_ENTER_RECURSIVE(lockname, mutex) \
+ do { \
+ int depth_; \
+ MPIU_THREADPRIV_DECL; \
+ MPIU_THREADPRIV_GET; \
+ \
+ MPIU_THREAD_CHECK_BEGIN; \
+ depth_ = MPIU_THREADPRIV_FIELD(lock_depth); \
+ MPIU_DBG_MSG_S(THREAD, TYPICAL, "recursive locking %s", lockname); \
+ if (depth_ == 0) { \
+ MPIUI_THREAD_CS_ENTER_NONRECURSIVE(lockname, mutex); \
+ } \
+ MPIU_THREADPRIV_FIELD(lock_depth) += 1; \
+ MPIU_THREAD_CHECK_END; \
+ } while (0)
+
+#define MPIUI_THREAD_CS_EXIT_RECURSIVE(lockname, mutex) \
+ do { \
+ int depth_; \
+ MPIU_THREADPRIV_DECL; \
+ MPIU_THREADPRIV_GET; \
+ \
+ MPIU_THREAD_CHECK_BEGIN; \
+ depth_ = MPIU_THREADPRIV_FIELD(lock_depth); \
+ MPIU_DBG_MSG_S(THREAD, TYPICAL, "recursive unlocking %s", lockname); \
+ if (depth_ == 1) { \
+ MPIUI_THREAD_CS_EXIT_NONRECURSIVE(lockname, mutex); \
+ } \
+ MPIU_THREADPRIV_FIELD(lock_depth) -= 1; \
+ MPIU_THREAD_CHECK_END; \
+ } while (0)
+
+#define MPIUI_THREAD_CS_YIELD_RECURSIVE MPIUI_THREAD_CS_YIELD_NONRECURSIVE
+
#define MPIU_THREAD_CS_ENTER(name, mutex) MPIUI_THREAD_CS_ENTER_##name(mutex)
#define MPIU_THREAD_CS_EXIT(name, mutex) MPIUI_THREAD_CS_EXIT_##name(mutex)
#define MPIU_THREAD_CS_YIELD(name, mutex) MPIUI_THREAD_CS_YIELD_##name(mutex)
http://git.mpich.org/mpich.git/commitdiff/861c6db4af70feaf110c563b028407d7d95f0f71
commit 861c6db4af70feaf110c563b028407d7d95f0f71
Author: Pavan Balaji <balaji at anl.gov>
Date: Mon Sep 21 15:20:04 2015 -0500
Rename MPIUI_THREAD_CS_*_REAL to MPIUI_THREAD_CS_*_NONRECURSIVE.
We only have nonrecursive mutex functions right now. The plan is to
add back the recursive functions.
Signed-off-by: Sangmin Seo <sseo at anl.gov>
Signed-off-by: Rob Latham <robl at mcs.anl.gov>
diff --git a/src/util/thread/mpiu_thread_global.h b/src/util/thread/mpiu_thread_global.h
index 0b72c29..0832c9c 100644
--- a/src/util/thread/mpiu_thread_global.h
+++ b/src/util/thread/mpiu_thread_global.h
@@ -8,9 +8,9 @@
#define MPIU_THREAD_GLOBAL_H_INCLUDED
/* GLOBAL locks are all real ops */
-#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) MPIUI_THREAD_CS_ENTER_REAL("GLOBAL", mutex)
-#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) MPIUI_THREAD_CS_EXIT_REAL("GLOBAL", mutex)
-#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) MPIUI_THREAD_CS_YIELD_REAL("GLOBAL", mutex)
+#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("GLOBAL", mutex)
+#define MPIUI_THREAD_CS_EXIT_GLOBAL(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("GLOBAL", mutex)
+#define MPIUI_THREAD_CS_YIELD_GLOBAL(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("GLOBAL", mutex)
/* POBJ locks are all NO-OPs */
#define MPIUI_THREAD_CS_ENTER_POBJ(mutex)
diff --git a/src/util/thread/mpiu_thread_multiple.h b/src/util/thread/mpiu_thread_multiple.h
index 082c920..895f5c0 100644
--- a/src/util/thread/mpiu_thread_multiple.h
+++ b/src/util/thread/mpiu_thread_multiple.h
@@ -12,7 +12,7 @@
#define MPIU_THREAD_CHECK_BEGIN if (MPIR_ThreadInfo.isThreaded) {
#define MPIU_THREAD_CHECK_END }
-#define MPIUI_THREAD_CS_ENTER_REAL(lockname, mutex) \
+#define MPIUI_THREAD_CS_ENTER_NONRECURSIVE(lockname, mutex) \
do { \
int err_; \
MPIU_THREAD_CHECK_BEGIN; \
@@ -21,7 +21,7 @@
MPIU_THREAD_CHECK_END; \
} while (0)
-#define MPIUI_THREAD_CS_EXIT_REAL(lockname, mutex) \
+#define MPIUI_THREAD_CS_EXIT_NONRECURSIVE(lockname, mutex) \
do { \
int err_; \
MPIU_THREAD_CHECK_BEGIN; \
@@ -30,7 +30,7 @@
MPIU_THREAD_CHECK_END; \
} while (0)
-#define MPIUI_THREAD_CS_YIELD_REAL(lockname, mutex) \
+#define MPIUI_THREAD_CS_YIELD_NONRECURSIVE(lockname, mutex) \
do { \
MPIU_THREAD_CHECK_BEGIN; \
MPIU_DBG_MSG_S(THREAD, TYPICAL, "yielding %s", lockname); \
diff --git a/src/util/thread/mpiu_thread_pobj.h b/src/util/thread/mpiu_thread_pobj.h
index 8990cdd..2713e4c 100644
--- a/src/util/thread/mpiu_thread_pobj.h
+++ b/src/util/thread/mpiu_thread_pobj.h
@@ -75,9 +75,9 @@
* reverse order. */
/* POBJ locks are all real ops */
-#define MPIUI_THREAD_CS_ENTER_POBJ(mutex) MPIUI_THREAD_CS_ENTER_REAL("POBJ", mutex)
-#define MPIUI_THREAD_CS_EXIT_POBJ(mutex) MPIUI_THREAD_CS_EXIT_REAL("POBJ", mutex)
-#define MPIUI_THREAD_CS_YIELD_POBJ(mutex) MPIUI_THREAD_CS_YIELD_REAL("POBJ", mutex)
+#define MPIUI_THREAD_CS_ENTER_POBJ(mutex) MPIUI_THREAD_CS_ENTER_NONRECURSIVE("POBJ", mutex)
+#define MPIUI_THREAD_CS_EXIT_POBJ(mutex) MPIUI_THREAD_CS_EXIT_NONRECURSIVE("POBJ", mutex)
+#define MPIUI_THREAD_CS_YIELD_POBJ(mutex) MPIUI_THREAD_CS_YIELD_NONRECURSIVE("POBJ", mutex)
/* GLOBAL locks are all NO-OPs */
#define MPIUI_THREAD_CS_ENTER_GLOBAL(mutex)
-----------------------------------------------------------------------
Summary of changes:
src/glue/romio/glue_romio.c | 9 ++++-
src/include/glue_romio.h.in | 1 +
src/mpi/comm/intercomm_merge.c | 3 --
src/mpi/datatype/type_match_size.c | 3 --
src/mpi/romio/adio/common/ad_iread_coll.c | 4 ++
src/mpi/romio/adio/common/ad_iwrite_coll.c | 4 ++
src/mpi/romio/adio/common/cb_config_list.c | 1 +
src/mpi/romio/adio/common/flatten.c | 6 ++-
src/mpi/romio/mpi-io/mpioimpl.h | 2 +
src/util/thread/mpiu_thread.h | 4 ++
src/util/thread/mpiu_thread_global.h | 6 ++--
src/util/thread/mpiu_thread_multiple.h | 45 ++++++++++++++++++++++++++--
src/util/thread/mpiu_thread_pobj.h | 6 ++--
13 files changed, 75 insertions(+), 19 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list