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 2c8dbec59a75cb3cb4503f1e579137895f286067 (commit) via 57483cc6b0cda2c69f97ed39d3e67ebbbc43b108 (commit) via 9660b206c3163d02585fb7f89f0c6c60cc2d7865 (commit) via 3e24fc0bfbe6f70a0fea8fa4bc7da153e1a5fb1a (commit) via 3269d074c09238d7f7639c2a5cf349a171e26263 (commit) via 533caea3104f24bfc0e83de8548fd91fe25d1a2c (commit) from d3394d85e8c3dfd6567bf2b2a20c6cfb1ab5ea5c (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/2c8dbec59a75cb3cb4503f1e579137895f... commit 2c8dbec59a75cb3cb4503f1e579137895f286067 Author: Pavan Balaji <[email protected]> Date: Sat Jun 8 21:10:58 2013 -0500 Throw warning when async thread is not started. If the user asked for an asynchronous thread, but the device does not provide MPI_THREAD_MULTIPLE support, throw a warning. diff --git a/src/mpi/init/init.c b/src/mpi/init/init.c index 344f062..bc19b0c 100644 --- a/src/mpi/init/init.c +++ b/src/mpi/init/init.c @@ -121,11 +121,16 @@ int MPI_Init( int *argc, char ***argv ) mpi_errno = MPIR_Init_thread( argc, argv, threadLevel, &provided ); if (mpi_errno != MPI_SUCCESS) goto fn_fail; - if (MPIR_PARAM_ASYNC_PROGRESS && provided == MPI_THREAD_MULTIPLE) { - mpi_errno = MPIR_Init_async_thread(); - if (mpi_errno) goto fn_fail; + if (MPIR_PARAM_ASYNC_PROGRESS) { + if (provided == MPI_THREAD_MULTIPLE) { + mpi_errno = MPIR_Init_async_thread(); + if (mpi_errno) goto fn_fail; - MPIR_async_thread_initialized = 1; + MPIR_async_thread_initialized = 1; + } + else { + printf("WARNING: No MPI_THREAD_MULTIPLE support (needed for async progress)\n"); + } } /* ... end of body of routine ... */ diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c index daecdeb..042f13d 100644 --- a/src/mpi/init/initthread.c +++ b/src/mpi/init/initthread.c @@ -593,11 +593,16 @@ int MPI_Init_thread( int *argc, char ***argv, int required, int *provided ) mpi_errno = MPIR_Init_thread( argc, argv, reqd, provided ); if (mpi_errno != MPI_SUCCESS) goto fn_fail; - if (MPIR_PARAM_ASYNC_PROGRESS && *provided == MPI_THREAD_MULTIPLE) { - mpi_errno = MPIR_Init_async_thread(); - if (mpi_errno) goto fn_fail; + if (MPIR_PARAM_ASYNC_PROGRESS) { + if (*provided == MPI_THREAD_MULTIPLE) { + mpi_errno = MPIR_Init_async_thread(); + if (mpi_errno) goto fn_fail; - MPIR_async_thread_initialized = 1; + MPIR_async_thread_initialized = 1; + } + else { + printf("WARNING: No MPI_THREAD_MULTIPLE support (needed for async progress)\n"); + } } /* ... end of body of routine ... */ http://git.mpich.org/mpich.git/commitdiff/57483cc6b0cda2c69f97ed39d3e67ebbbc... commit 57483cc6b0cda2c69f97ed39d3e67ebbbc43b108 Author: Pavan Balaji <[email protected]> Date: Sat Jun 8 20:56:10 2013 -0500 Remove arbitrary restriction on the thread-level. diff --git a/configure.ac b/configure.ac index 50a8231..017e96c 100644 --- a/configure.ac +++ b/configure.ac @@ -1333,11 +1333,7 @@ case "$enable_threads" in esac # Check that the requested thread level is available. threadLevelOK=yes -if test -z "$MPID_MAX_THREAD_LEVEL" ; then - if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" -o "$MPICH_THREAD_LEVEL" = "MPI_THREAD_SERIALIZED" ; then - threadLevelOK=no - fi -else +if test ! -z "$MPID_MAX_THREAD_LEVEL" ; then # Check that MPID_MAX_THREAD_LEVEL is at least as large as the # selected MPICH_THREAD_LEVEL case $MPICH_THREAD_LEVEL in http://git.mpich.org/mpich.git/commitdiff/9660b206c3163d02585fb7f89f0c6c60cc... commit 9660b206c3163d02585fb7f89f0c6c60cc2d7865 Author: Pavan Balaji <[email protected]> Date: Sat Jun 8 18:46:59 2013 -0500 Control default thread level from the environment. 1. Use the params interface to control the default thread level. 2. Don't restrict support for the default thread level only in THREAD_MULTIPLE installations. diff --git a/src/mpi/init/init.c b/src/mpi/init/init.c index 40c28f2..344f062 100644 --- a/src/mpi/init/init.c +++ b/src/mpi/init/init.c @@ -100,34 +100,18 @@ int MPI_Init( int *argc, char ***argv ) mpi_errno = MPIR_Param_init_params(); if (mpi_errno) MPIU_ERR_POP(mpi_errno); -#if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE) - /* If we support all thread levels, allow the use of an environment - variable to set the default thread level */ - { - const char *str = 0; - threadLevel = MPI_THREAD_SINGLE; - if (MPL_env2str( "MPICH_THREADLEVEL_DEFAULT", &str )) { - if (strcmp(str,"MULTIPLE") == 0 || strcmp(str,"multiple") == 0) { - threadLevel = MPI_THREAD_MULTIPLE; - } - else if (strcmp(str,"SERIALIZED") == 0 || strcmp(str,"serialized") == 0) { - threadLevel = MPI_THREAD_SERIALIZED; - } - else if (strcmp(str,"FUNNELED") == 0 || strcmp(str,"funneled") == 0) { - threadLevel = MPI_THREAD_FUNNELED; - } - else if (strcmp(str,"SINGLE") == 0 || strcmp(str,"single") == 0) { - threadLevel = MPI_THREAD_SINGLE; - } - else { - MPIU_Error_printf( "Unrecognized thread level %s\n", str ); - exit(1); - } - } + if (!strcmp(MPIR_PARAM_DEFAULT_THREAD_LEVEL, "MPI_THREAD_MULTIPLE")) + threadLevel = MPI_THREAD_MULTIPLE; + else if (!strcmp(MPIR_PARAM_DEFAULT_THREAD_LEVEL, "MPI_THREAD_SERIALIZED")) + threadLevel = MPI_THREAD_SERIALIZED; + else if (!strcmp(MPIR_PARAM_DEFAULT_THREAD_LEVEL, "MPI_THREAD_FUNNELED")) + threadLevel = MPI_THREAD_FUNNELED; + else if (!strcmp(MPIR_PARAM_DEFAULT_THREAD_LEVEL, "MPI_THREAD_SINGLE")) + threadLevel = MPI_THREAD_SINGLE; + else { + MPIU_Error_printf("Unrecognized thread level %s\n", MPIR_PARAM_DEFAULT_THREAD_LEVEL); + exit(1); } -#else - threadLevel = MPI_THREAD_SINGLE; -#endif /* If the user requested for asynchronous progress, request for * THREAD_MULTIPLE. */ diff --git a/src/mpid/pamid/src/mpidi_env.c b/src/mpid/pamid/src/mpidi_env.c index ee1c799..b85c40d 100644 --- a/src/mpid/pamid/src/mpidi_env.c +++ b/src/mpid/pamid/src/mpidi_env.c @@ -69,7 +69,7 @@ * libraries (gcc, xl, xl.ndebug) and MPI_Init_thread() is called with * MPI_THREAD_MULTIPLE. * - NOTE: This environment variable has the same effect as setting - * MPICH_THREADLEVEL_DEFAULT=multiple + * MPIR_PARAM_DEFAULT_THREAD_LEVEL=multiple * * - PAMID_CONTEXT_MAX - This variable sets the maximum allowable number * of contexts. Contexts are a method of dividing hardware resources diff --git a/src/util/param/params.yml b/src/util/param/params.yml index fced791..394a7fc 100644 --- a/src/util/param/params.yml +++ b/src/util/param/params.yml @@ -362,6 +362,14 @@ parameters: If set to true, MPICH will spawn an additional thread to make asynchronous progress on all communication operations. + - category : threads + name : DEFAULT_THREAD_LEVEL + type : string + default : "MPI_THREAD_SINGLE" + class : device + description : >- + Sets the default thread level to use when using MPI_INIT. + ############################################################## # other MPI-level parameters - category : developer http://git.mpich.org/mpich.git/commitdiff/3e24fc0bfbe6f70a0fea8fa4bc7da153e1... commit 3e24fc0bfbe6f70a0fea8fa4bc7da153e1a5fb1a Author: Pavan Balaji <[email protected]> Date: Sat Jun 8 18:41:55 2013 -0500 ASYNC_THREAD improvements. Use the params interface to check the ASYNC_PROGRESS variable. diff --git a/src/mpi/init/init.c b/src/mpi/init/init.c index a9a06a4..40c28f2 100644 --- a/src/mpi/init/init.c +++ b/src/mpi/init/init.c @@ -97,6 +97,9 @@ int MPI_Init( int *argc, char ***argv ) /* ... body of routine ... */ + mpi_errno = MPIR_Param_init_params(); + if (mpi_errno) MPIU_ERR_POP(mpi_errno); + #if (MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE) /* If we support all thread levels, allow the use of an environment variable to set the default thread level */ @@ -128,15 +131,13 @@ int MPI_Init( int *argc, char ***argv ) /* If the user requested for asynchronous progress, request for * THREAD_MULTIPLE. */ - rc = 0; - MPL_env2bool("MPICH_ASYNC_PROGRESS", &rc); - if (rc) + if (MPIR_PARAM_ASYNC_PROGRESS) threadLevel = MPI_THREAD_MULTIPLE; mpi_errno = MPIR_Init_thread( argc, argv, threadLevel, &provided ); if (mpi_errno != MPI_SUCCESS) goto fn_fail; - if (rc && provided == MPI_THREAD_MULTIPLE) { + if (MPIR_PARAM_ASYNC_PROGRESS && provided == MPI_THREAD_MULTIPLE) { mpi_errno = MPIR_Init_async_thread(); if (mpi_errno) goto fn_fail; diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c index 4fae2d2..daecdeb 100644 --- a/src/mpi/init/initthread.c +++ b/src/mpi/init/initthread.c @@ -587,15 +587,13 @@ int MPI_Init_thread( int *argc, char ***argv, int required, int *provided ) /* If the user requested for asynchronous progress, request for * THREAD_MULTIPLE. */ - rc = 0; - MPL_env2bool("MPICH_ASYNC_PROGRESS", &rc); - if (rc) + if (MPIR_PARAM_ASYNC_PROGRESS) reqd = MPI_THREAD_MULTIPLE; mpi_errno = MPIR_Init_thread( argc, argv, reqd, provided ); if (mpi_errno != MPI_SUCCESS) goto fn_fail; - if (rc && *provided == MPI_THREAD_MULTIPLE) { + if (MPIR_PARAM_ASYNC_PROGRESS && *provided == MPI_THREAD_MULTIPLE) { mpi_errno = MPIR_Init_async_thread(); if (mpi_errno) goto fn_fail; diff --git a/src/util/param/params.yml b/src/util/param/params.yml index 635f8a3..fced791 100644 --- a/src/util/param/params.yml +++ b/src/util/param/params.yml @@ -353,6 +353,15 @@ parameters: for the eager allocation protocol. If the application is running out of context IDs, reducing this value may help. + - category : threads + name : ASYNC_PROGRESS + type : boolean + default : false + class : device + description : >- + If set to true, MPICH will spawn an additional thread to make + asynchronous progress on all communication operations. + ############################################################## # other MPI-level parameters - category : developer http://git.mpich.org/mpich.git/commitdiff/3269d074c09238d7f7639c2a5cf349a171... commit 3269d074c09238d7f7639c2a5cf349a171e26263 Author: Pavan Balaji <[email protected]> Date: Sat Jun 8 17:40:16 2013 -0500 Thread package is no longer required for SERIALIZED mode. diff --git a/configure.ac b/configure.ac index 858ef02..50a8231 100644 --- a/configure.ac +++ b/configure.ac @@ -1320,9 +1320,7 @@ case "$enable_threads" in MPICH_THREAD_LEVEL=MPI_THREAD_FUNNELED ;; serialized) - # We require a thread package even in serialized mode, since we - # use that for the aynchronous threads - thread_pkg_required=yes + thread_pkg_required=no MPICH_THREAD_LEVEL=MPI_THREAD_SERIALIZED ;; multiple) http://git.mpich.org/mpich.git/commitdiff/533caea3104f24bfc0e83de8548fd91fe2... commit 533caea3104f24bfc0e83de8548fd91fe25d1a2c Author: Pavan Balaji <[email protected]> Date: Sat Jun 8 17:39:00 2013 -0500 Initiate the asynchronous thread only in MULTIPLE mode. We were originally initiating the asynchronous thread in SERIALIZED mode as well. But this is incorrect, since the remaining threads do not acquire a lock and will conflict with this thread. diff --git a/src/mpi/init/async.c b/src/mpi/init/async.c index 4fc2e2f..c003827 100644 --- a/src/mpi/init/async.c +++ b/src/mpi/init/async.c @@ -10,13 +10,15 @@ #ifndef MPICH_MPI_FROM_PMPI -#if MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED +#if MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE static MPID_Comm *progress_comm_ptr; static MPIU_Thread_id_t progress_thread_id; static MPIU_Thread_mutex_t progress_mutex; static MPIU_Thread_cond_t progress_cond; static volatile int progress_thread_done = 0; +/* We can use whatever tag we want; we use a different communicator + * for communicating with the progress thread. */ #define WAKE_TAG 100 #undef FUNCNAME @@ -68,7 +70,7 @@ static void progress_fn(void * data) return; } -#endif /* MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED */ +#endif /* MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE */ #undef FUNCNAME #define FUNCNAME MPIR_Init_async_thread @@ -76,7 +78,7 @@ static void progress_fn(void * data) #define FCNAME MPIU_QUOTE(FUNCNAME) int MPIR_Init_async_thread(void) { -#if MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED +#if MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE int mpi_errno = MPI_SUCCESS; MPID_Comm *comm_self_ptr; int err = 0; @@ -107,7 +109,7 @@ int MPIR_Init_async_thread(void) goto fn_exit; #else return MPI_SUCCESS; -#endif /* MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED */ +#endif /* MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE */ } #undef FUNCNAME @@ -117,7 +119,7 @@ int MPIR_Init_async_thread(void) int MPIR_Finalize_async_thread(void) { int mpi_errno = MPI_SUCCESS; -#if MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED +#if MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE MPID_Request *request_ptr = NULL; MPI_Request request; MPI_Status status; @@ -159,7 +161,7 @@ int MPIR_Finalize_async_thread(void) MPID_MPI_FUNC_EXIT(MPID_STATE_MPIR_FINALIZE_ASYNC_THREAD); -#endif /* MPICH_THREAD_LEVEL >= MPI_THREAD_SERIALIZED */ +#endif /* MPICH_THREAD_LEVEL == MPI_THREAD_MULTIPLE */ return mpi_errno; } ----------------------------------------------------------------------- Summary of changes: configure.ac | 10 +----- src/mpi/init/async.c | 14 +++++---- src/mpi/init/init.c | 58 ++++++++++++++++----------------------- src/mpi/init/initthread.c | 17 +++++++----- src/mpid/pamid/src/mpidi_env.c | 2 +- src/util/param/params.yml | 17 +++++++++++ 6 files changed, 62 insertions(+), 56 deletions(-) hooks/post-receive -- MPICH primary repository