[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1.1-8-gbe93cae

Service Account noreply at mpich.org
Wed Jun 11 11:01:18 CDT 2014


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  be93caec6c6b9b230fbde9b1b296cde001fde934 (commit)
      from  3b9d2b36bc4066c5505d5a758b88359ea107d201 (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/be93caec6c6b9b230fbde9b1b296cde001fde934

commit be93caec6c6b9b230fbde9b1b296cde001fde934
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Mon Jun 9 17:12:17 2014 -0500

    Added support for thread-safe errno in Solaris
    
    The _REENTRANT macro is required to be defined in order to get
    thread-safe "errno" values. Modern POSIX systems provide this by default
    when using -lpthreads, but there are still some (Solaris) that require
    an explicit define. Since we weren't compiling with that macro, we were
    getting incorrect "errno" values from the threads (mainly 0).
    
    More details: since we use nonblocking sockets, our code was checking
    "errno" to not be EINPROGRESS whenever we got an error code from a
    connect/accept, in order to determine an actual error (a return value
    of -1 and errno of EINPROGRESS does not define an actual error but a
    "not yet" when using nonblocking sockets).
    
    This patch automatically gets this macro defined by configure whenever
    we are not building in MPI_THREAD_SINGLE mode only.
    
    Fixes #2107
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/configure.ac b/configure.ac
index 936f6ce..96545b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1352,6 +1352,13 @@ fi
 export MPICH_THREAD_LEVEL
 AC_DEFINE_UNQUOTED(MPICH_THREAD_LEVEL,$MPICH_THREAD_LEVEL,[Level of thread support selected at compile time])
 
+# If not in MPI_THREAD_SINGLE, we need -D_REENTRANT to get thread-safe "errno".
+# Most POSIX systems provide this by default when using -lpthread, but we only use it in MPI_THREAD_MULTIPLE.
+# Some systems (Solaris) still require an explicit define in any case.
+if test "$MPICH_THREAD_LEVEL" != "MPI_THREAD_SINGLE"; then
+    PAC_APPEND_FLAG([-D_REENTRANT], [CFLAGS])
+fi
+
 # Check for value thread_cs choice; set the refcount default if necessary
 thread_granularity=MPIU_THREAD_GRANULARITY_SINGLE
 thread_refcount=MPIU_REFCOUNT_NONE

-----------------------------------------------------------------------

Summary of changes:
 configure.ac |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list