Skip to content

Commit e1899df

Browse files
committed
threads: Removed unneeded Linux Threads check
Remove the "threads have different pids" check, which was really a check for the old LinuxThreads behavior, as it is no longer used. In addition to NPTL being released 17 years ago and the default basically everywhere, nothing in Open MPI uses the macro set and this is just dead code at this point. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent ca65630 commit e1899df

File tree

1 file changed

+0
-97
lines changed

1 file changed

+0
-97
lines changed

opal/mca/threads/pthreads/configure.m4

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -30,101 +30,6 @@
3030
# ********************************************************************
3131

3232

33-
AC_DEFUN([OPAL_CHECK_PTHREAD_PIDS],[
34-
#
35-
# Arguments: none
36-
#
37-
# Dependencies: None
38-
#
39-
# Sets:
40-
# OPAL_THREADS_HAVE_DIFFERENT_PIDS (variable)
41-
#
42-
# Test for Linux-like threads in the system. OPAL no longer supports
43-
# systems with different PIDs for threads in the same process, so error
44-
# out if we detect that case.
45-
#
46-
47-
AC_MSG_CHECKING([if threads have different pids (pthreads on linux)])
48-
49-
OPAL_VAR_SCOPE_PUSH([CFLAGS_save CPPFLAGS_save LDFLAGS_save LIBS_save MSG])
50-
CFLAGS_save="$CFLAGS"
51-
CFLAGS="$CFLAGS $THREAD_CFLAGS"
52-
CPPFLAGS_save="$CPPFLAGS"
53-
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
54-
LDFLAGS_save="$LDFLAGS"
55-
LDFLAGS="$THREAD_LDFLAGS"
56-
LIBS_save="$LIBS"
57-
LIBS="$THREAD_LIBS"
58-
AC_RUN_IFELSE([AC_LANG_SOURCE([#include <pthread.h>
59-
#include <sys/types.h>
60-
#include <unistd.h>
61-
#include <stdlib.h>
62-
63-
void *checkpid(void *arg);
64-
int main() {
65-
pthread_t thr;
66-
int pid, *retval;
67-
pid = getpid();
68-
pthread_create(&thr, NULL, checkpid, &pid);
69-
pthread_join(thr, (void **) &retval);
70-
exit(*retval);
71-
}
72-
73-
static int ret;
74-
void *checkpid(void *arg) {
75-
int ppid = *((int *) arg);
76-
if (ppid == getpid())
77-
ret = 0;
78-
else
79-
ret = 1;
80-
pthread_exit((void *) &ret);
81-
}])],
82-
[MSG=no OPAL_THREADS_HAVE_DIFFERENT_PIDS=0],
83-
[MSG=yes OPAL_THREADS_HAVE_DIFFERENT_PIDS=1],
84-
[
85-
# If we're cross compiling, we can't do another AC_* function here because
86-
# it we haven't displayed the result from the last one yet. So defer
87-
# another test until below.
88-
OPAL_THREADS_HAVE_DIFFERENT_PIDS=
89-
MSG="cross compiling (need another test)"])
90-
91-
CFLAGS="$CFLAGS_save"
92-
CPPFLAGS="$CPPFLAGS_save"
93-
LDFLAGS="$LDFLAGS_save"
94-
LIBS="$LIBS_save"
95-
96-
AC_MSG_RESULT([$MSG])
97-
98-
AS_IF([test "x$OPAL_THREADS_HAVE_DIFFERENT_PIDS" = "x"],
99-
[ # If we are cross-compiling, look for the symbol
100-
# __linuxthreads_create_event, which seems to only exist in the
101-
# Linux Threads-based pthreads implementation (i.e., the one
102-
# that has different PIDs for each thread). We *could* switch
103-
# on $host here and only test *linux* hosts, but this test is
104-
# pretty unique, so why bother? Note that AC_CHECK_FUNC works
105-
# properly in cross-compiling environments in recent-enough
106-
# versions of Autoconf (which is one of the reasons we mandate
107-
# recent versions in autogen!).
108-
AC_CHECK_FUNC([__linuxthreads_create_event],
109-
[OPAL_THREADS_HAVE_DIFFERENT_PIDS=1])])
110-
111-
AS_IF([test "$OPAL_THREADS_HAVE_DIFFERENT_PIDS" = "1"],
112-
[AC_MSG_WARN([This version of Open MPI only supports environments where])
113-
AC_MSG_WARN([threads have the same PID. Please use an older version of])
114-
AC_MSG_WARN([Open MPI if you need support on systems with different])
115-
AC_MSG_WARN([PIDs for threads in the same process. Open MPI 1.4.x])
116-
AC_MSG_WARN([supports such systems, as does at least some versions the])
117-
AC_MSG_WARN([Open MPI 1.5.x series.])
118-
AC_MSG_ERROR([Cannot continue])
119-
])
120-
121-
#
122-
# if pthreads is not available, then the system does not have an insane threads
123-
# model
124-
#
125-
OPAL_VAR_SCOPE_POP
126-
])dnl
127-
12833
AC_DEFUN([OPAL_INTL_PTHREAD_TRY_LINK], [
12934
# BEGIN: OPAL_INTL_PTHREAD_TRY_LINK
13035
#
@@ -774,8 +679,6 @@ THREAD_CXXCPPFLAGS="$TPKG_CXXCPPFLAGS"
774679
THREAD_LDFLAGS="$TPKG_LDFLAGS"
775680
THREAD_LIBS="$TPKG_LIBS"
776681

777-
OPAL_CHECK_PTHREAD_PIDS
778-
779682
AS_IF([test "$CXX" = "no"], [opal_pthread_cxx_success=1])
780683

781684
if test "$OMPI_TRY_FORTRAN_BINDINGS" = "$OMPI_FORTRAN_NO_BINDINGS" || \

0 commit comments

Comments
 (0)