2008-10-28 20:22:29 +03:00
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
dnl University Research and Technology
|
|
|
|
dnl Corporation. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
dnl of Tennessee Research Foundation. All rights
|
|
|
|
dnl reserved.
|
2015-02-03 09:19:22 +03:00
|
|
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl University of Stuttgart. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
dnl All rights reserved.
|
2014-05-08 06:01:35 +04:00
|
|
|
dnl Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
|
|
|
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
|
2016-01-07 04:20:20 +03:00
|
|
|
dnl Copyright (c) 2014-2016 Research Organization for Information Science
|
2014-09-25 11:26:16 +04:00
|
|
|
dnl and Technology (RIST). All rights reserved.
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl $COPYRIGHT$
|
2015-02-03 09:19:22 +03:00
|
|
|
dnl
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl Additional copyrights may follow
|
2015-02-03 09:19:22 +03:00
|
|
|
dnl
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
2014-05-07 01:16:29 +04:00
|
|
|
dnl OPAL_CONFIG_POSIX_THREADS()
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl
|
|
|
|
dnl Configure posix threads, setting the following variables (but
|
|
|
|
dnl not calling AC_SUBST on them).
|
|
|
|
|
|
|
|
# ********************************************************************
|
|
|
|
#
|
2014-05-07 01:16:29 +04:00
|
|
|
# Internal macros - do not call from outside OPAL_CONFIG_POSIX_THREADS
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# ********************************************************************
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_PTHREAD_TRY_LINK], [
|
|
|
|
# BEGIN: OPAL_INTL_PTHREAD_TRY_LINK
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Make sure that we can run a small application in C or C++, which
|
|
|
|
# ever is the current language. Do make sure that C or C++ is the
|
|
|
|
# current language.
|
|
|
|
#
|
|
|
|
# As long as this is not being run....
|
|
|
|
# pthread_t may be anything from an int to a struct -- init with self-tid.
|
|
|
|
#
|
2014-04-19 17:13:06 +04:00
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
|
|
|
#include <pthread.h>
|
2023-02-01 17:12:57 +03:00
|
|
|
#ifdef __KPDA__
|
|
|
|
#include <process.h>
|
|
|
|
#endif
|
2014-04-19 17:13:06 +04:00
|
|
|
|
|
|
|
int i = 3;
|
|
|
|
pthread_t me, newthread;
|
|
|
|
|
|
|
|
void cleanup_routine(void *foo);
|
|
|
|
void *thread_main(void *foo);
|
|
|
|
|
|
|
|
void cleanup_routine(void *foo) { i = 4; }
|
|
|
|
void *thread_main(void *foo) { i = 2; return (void*) &i; }
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
pthread_attr_t attr;
|
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
me = pthread_self();
|
2014-12-01 13:02:31 +03:00
|
|
|
pthread_atfork(NULL, NULL, NULL);
|
2015-06-24 06:59:57 +03:00
|
|
|
pthread_attr_init(&attr);
|
2014-04-19 17:13:06 +04:00
|
|
|
pthread_cleanup_push(cleanup_routine, 0);
|
2015-06-24 06:59:57 +03:00
|
|
|
pthread_create(&newthread, &attr, thread_main, 0);
|
2014-04-19 17:13:06 +04:00
|
|
|
pthread_join(newthread, 0);
|
2015-06-24 06:59:57 +03:00
|
|
|
pthread_cleanup_pop(0);
|
2014-04-19 17:13:06 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}]])],
|
2008-10-28 20:22:29 +03:00
|
|
|
[$1], [$2])
|
2014-05-08 06:01:35 +04:00
|
|
|
# END: OPAL_INTL_PTHREAD_TRY_LINK
|
2008-10-28 20:22:29 +03:00
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN], [
|
|
|
|
# BEGIN: OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Make sure that we can run a small application in Fortran, with
|
|
|
|
# pthreads living in a C object file
|
|
|
|
|
|
|
|
# Fortran module
|
|
|
|
cat > conftestf.f <<EOF
|
|
|
|
program fpthread
|
|
|
|
call pthreadtest
|
|
|
|
end
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# C module
|
|
|
|
if test -f conftest.h; then
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_conftest_h="#include \"conftest.h\""
|
2008-10-28 20:22:29 +03:00
|
|
|
else
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_conftest_h=""
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
|
|
|
cat > conftest.c <<EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <pthread.h>
|
2023-02-01 17:12:57 +03:00
|
|
|
#ifdef __KPDA__
|
|
|
|
#include <process.h>
|
|
|
|
#endif
|
2014-05-08 06:01:35 +04:00
|
|
|
$opal_conftest_h
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2014-04-19 17:13:06 +04:00
|
|
|
int i = 3;
|
|
|
|
pthread_t me, newthread;
|
|
|
|
|
|
|
|
void cleanup_routine(void *foo);
|
|
|
|
void *thread_main(void *foo);
|
|
|
|
void pthreadtest_f(void);
|
|
|
|
|
|
|
|
void cleanup_routine(void *foo) { i = 4; }
|
|
|
|
void *thread_main(void *foo) { i = 2; return (void*) &i; }
|
|
|
|
|
2012-04-18 23:29:07 +04:00
|
|
|
void pthreadtest_f(void)
|
2008-10-28 20:22:29 +03:00
|
|
|
{
|
2014-04-19 17:13:06 +04:00
|
|
|
pthread_attr_t attr;
|
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
me = pthread_self();
|
2014-12-22 13:13:45 +03:00
|
|
|
pthread_atfork(NULL, NULL, NULL);
|
2015-06-24 06:59:57 +03:00
|
|
|
pthread_attr_init(&attr);
|
2014-04-19 17:13:06 +04:00
|
|
|
pthread_cleanup_push(cleanup_routine, 0);
|
2015-06-24 06:59:57 +03:00
|
|
|
pthread_create(&newthread, &attr, thread_main, 0);
|
2016-01-07 04:20:20 +03:00
|
|
|
pthread_join(newthread, 0);
|
2015-06-24 06:59:57 +03:00
|
|
|
pthread_cleanup_pop(0);
|
2008-10-28 20:22:29 +03:00
|
|
|
}
|
2012-04-18 23:29:07 +04:00
|
|
|
|
|
|
|
void pthreadtest(void)
|
2012-04-23 19:28:26 +04:00
|
|
|
{ pthreadtest_f(); }
|
2012-04-18 23:29:07 +04:00
|
|
|
|
|
|
|
void pthreadtest_(void)
|
2012-04-23 19:28:26 +04:00
|
|
|
{ pthreadtest_f(); }
|
2012-04-18 23:29:07 +04:00
|
|
|
|
|
|
|
void pthreadtest__(void)
|
2012-04-23 19:28:26 +04:00
|
|
|
{ pthreadtest_f(); }
|
2012-04-18 23:29:07 +04:00
|
|
|
|
|
|
|
void PTHREADTEST(void)
|
2012-04-23 19:28:26 +04:00
|
|
|
{ pthreadtest_f(); }
|
2012-04-18 23:29:07 +04:00
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Try the compile
|
2010-11-13 02:22:11 +03:00
|
|
|
OPAL_LOG_COMMAND(
|
2008-10-28 20:22:29 +03:00
|
|
|
[$CC $CFLAGS -I. -c conftest.c],
|
2010-11-13 02:22:11 +03:00
|
|
|
OPAL_LOG_COMMAND(
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
[$FC $FCFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
|
2008-10-28 20:22:29 +03:00
|
|
|
[HAPPY=1],
|
|
|
|
[HAPPY=0]),
|
|
|
|
[HAPPY=0])
|
|
|
|
|
|
|
|
if test "$HAPPY" = "1"; then
|
|
|
|
$1
|
|
|
|
else
|
2010-11-13 02:22:11 +03:00
|
|
|
OPAL_LOG_MSG([here is the C program:], 1)
|
|
|
|
OPAL_LOG_FILE([conftest.c])
|
2008-10-28 20:22:29 +03:00
|
|
|
if test -f conftest.h; then
|
2010-11-13 02:22:11 +03:00
|
|
|
OPAL_LOG_MSG([here is contest.h:], 1)
|
|
|
|
OPAL_LOG_FILE([conftest.h])
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
2010-11-13 02:22:11 +03:00
|
|
|
OPAL_LOG_MSG([here is the fortran program:], 1)
|
|
|
|
OPAL_LOG_FILE([conftestf.f])
|
2008-10-28 20:22:29 +03:00
|
|
|
$2
|
|
|
|
fi
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
unset HAPPY opal_conftest_h
|
2008-10-28 20:22:29 +03:00
|
|
|
rm -rf conftest*
|
2014-05-08 06:01:35 +04:00
|
|
|
# END: OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN
|
2008-10-28 20:22:29 +03:00
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
|
|
|
# ********************************************************************
|
|
|
|
#
|
|
|
|
# Try to compile thread support without any special flags
|
|
|
|
#
|
|
|
|
# ********************************************************************
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_PLAIN_C], [
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# C compiler
|
|
|
|
#
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_c_success" = "0"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_CHECKING([if C compiler and POSIX threads work as is])
|
|
|
|
|
2014-09-25 11:26:16 +04:00
|
|
|
AC_LANG_PUSH(C)
|
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_c_success=1,
|
|
|
|
opal_pthread_c_success=0)
|
|
|
|
AC_LANG_POP(C)
|
|
|
|
if test "$opal_pthread_c_success" = "1"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_PLAIN_CXX], [
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# C++ compiler
|
|
|
|
#
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_cxx_success" = "0"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work as is])
|
|
|
|
|
2014-09-25 11:26:16 +04:00
|
|
|
AC_LANG_PUSH(C++)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_cxx_success=1,
|
2014-09-25 11:26:16 +04:00
|
|
|
opal_pthread_cxx_success=0)
|
|
|
|
AC_LANG_POP(C++)
|
|
|
|
if test "$opal_pthread_cxx_success" = "1"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_PLAIN_FC], [
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Fortran compiler
|
|
|
|
#
|
2014-10-06 14:56:47 +04:00
|
|
|
if test "$opal_pthread_fortran_success" = "0" && \
|
|
|
|
test "$OMPI_TRY_FORTRAN_BINDINGS" -gt "$OMPI_FORTRAN_NO_BINDINGS" && \
|
|
|
|
test $ompi_fortran_happy -eq 1; then
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work as is])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-09-25 11:26:16 +04:00
|
|
|
AC_LANG_PUSH(C)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN(opal_pthread_fortran_success=1,
|
2014-09-25 11:26:16 +04:00
|
|
|
opal_pthread_fortran_success=0)
|
|
|
|
AC_LANG_POP(C)
|
|
|
|
if test "$opal_pthread_fortran_success" = "1"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_PLAIN], [
|
|
|
|
# BEGIN: OPAL_INTL_POSIX_THREADS_PLAIN
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Check if can compile without any special flags
|
|
|
|
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in
|
|
|
|
# case. Some systems (OS X, for example) generally don't need
|
|
|
|
# the defines, but then will on one system header here or there
|
|
|
|
# why take chances?
|
|
|
|
#
|
|
|
|
|
|
|
|
# Only run C++ and Fortran if those compilers already configured
|
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
2014-05-08 06:01:35 +04:00
|
|
|
[OPAL_INTL_POSIX_THREADS_PLAIN_C],
|
|
|
|
[opal_pthread_c_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
|
|
|
[OPAL_INTL_POSIX_THREADS_PLAIN_CXX],
|
2014-05-08 06:01:35 +04:00
|
|
|
[opal_pthread_cxx_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_FC],
|
2014-05-08 06:01:35 +04:00
|
|
|
[OPAL_INTL_POSIX_THREADS_PLAIN_FC],
|
|
|
|
[opal_pthread_fortran_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
# End: OPAL_INTL_POSIX_THREADS_PLAIN
|
2008-10-28 20:22:29 +03:00
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
|
|
|
# ********************************************************************
|
|
|
|
#
|
|
|
|
# Try to compile thread support with special compiler flags
|
|
|
|
#
|
|
|
|
# ********************************************************************
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS_C], [
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# C compiler
|
|
|
|
#
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_c_success" = "0"; then
|
2014-09-25 11:17:58 +04:00
|
|
|
for pf in $pflags; do
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pf])
|
|
|
|
CFLAGS="$orig_CFLAGS $pf"
|
|
|
|
AC_LANG_PUSH(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_c_success=1,
|
|
|
|
opal_pthread_c_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_c_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
PTHREAD_CFLAGS="$pf"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
break
|
|
|
|
else
|
|
|
|
PTHREAD_CFLAGS=
|
|
|
|
CFLAGS="$orig_CFLAGS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX], [
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# C++ compiler
|
|
|
|
#
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_cxx_success" = "0"; then
|
2014-09-25 11:17:58 +04:00
|
|
|
for pf in $pflags; do
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pf])
|
|
|
|
CXXFLAGS="$orig_CXXFLAGS $pf"
|
|
|
|
AC_LANG_PUSH(C++)
|
2014-05-08 06:01:35 +04:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_cxx_success=1,
|
|
|
|
opal_pthread_cxx_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C++)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_cxx_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
PTHREAD_CXXFLAGS="$pf"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
break
|
|
|
|
else
|
|
|
|
PTHREAD_CXXFLAGS=
|
|
|
|
CXXFLAGS="$orig_CXXFLAGS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Fortran compiler
|
|
|
|
#
|
2014-10-06 14:56:47 +04:00
|
|
|
if test "$opal_pthread_fortran_success" = "0" && \
|
|
|
|
test "$OMPI_TRY_FORTRAN_BINDINGS" -gt "$OMPI_FORTRAN_NO_BINDINGS" && \
|
|
|
|
test $ompi_fortran_happy -eq 1; then
|
2014-09-25 11:17:58 +04:00
|
|
|
for pf in $pflags; do
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $pf])
|
2012-04-23 19:28:26 +04:00
|
|
|
FCFLAGS="$orig_FCFLAGS $pf"
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_PUSH(C)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN(opal_pthread_fortran_success=1,
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_fortran_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_fortran_success" = "1"; then
|
2012-04-23 19:28:26 +04:00
|
|
|
PTHREAD_FCFLAGS="$pf"
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
break
|
|
|
|
else
|
2012-04-23 19:28:26 +04:00
|
|
|
PTHREAD_FCFLAGS=
|
|
|
|
FCFLAGS="$orig_FCFLAGS"
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS],[
|
|
|
|
# Begin: OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
2015-06-24 06:59:57 +03:00
|
|
|
# If above didn't work, try some super-special compiler flags
|
2008-10-28 20:22:29 +03:00
|
|
|
# that get evaluated to the "right" things.
|
|
|
|
#
|
|
|
|
# -Kthread:
|
|
|
|
# -kthread: FreeBSD kernel threads
|
|
|
|
# -pthread: Modern GCC (most all platforms)
|
|
|
|
# -pthreads: GCC on solaris
|
|
|
|
# -mthreads:
|
|
|
|
# -mt: Solaris native compilers / HP-UX aCC
|
|
|
|
#
|
|
|
|
# Put -mt before -mthreads because HP-UX aCC will properly compile
|
|
|
|
# with -mthreads (reading as -mt), but emit a warning about unknown
|
|
|
|
# flags hreads. Stupid compilers.
|
|
|
|
|
|
|
|
case "${host_cpu}-${host_os}" in
|
|
|
|
*solaris*)
|
|
|
|
pflags="-pthread -pthreads -mt"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
pflags="-Kthread -kthread -pthread -pthreads -mt -mthreads"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Only run C++ and Fortran if those compilers already configured
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
2014-05-08 06:01:35 +04:00
|
|
|
[OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS_C],
|
|
|
|
[opal_pthread_c_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
|
|
|
[OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
|
2014-05-08 06:01:35 +04:00
|
|
|
[opal_pthread_cxx_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_FC],
|
2014-05-08 06:01:35 +04:00
|
|
|
[OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
|
|
|
|
[opal_pthread_fortran_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
# End: OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
2008-10-28 20:22:29 +03:00
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
|
|
|
# ********************************************************************
|
|
|
|
#
|
|
|
|
# Try to compile thread support with extra libs
|
|
|
|
#
|
|
|
|
# ********************************************************************
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_LIBS_C],[
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# C compiler
|
|
|
|
#
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_c_success" = "0"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
for pl in $plibs; do
|
|
|
|
AC_MSG_CHECKING([if C compiler and POSIX threads work with $pl])
|
|
|
|
case "${host_cpu}-${host-_os}" in
|
|
|
|
*-aix* | *-freebsd*)
|
|
|
|
if test "`echo $CPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
|
2011-01-29 00:05:40 +03:00
|
|
|
PTHREAD_CPPFLAGS="-D_THREAD_SAFE"
|
2008-10-28 20:22:29 +03:00
|
|
|
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "`echo $CPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
|
|
|
|
PTHREAD_CPPFLAGS="-D_REENTRANT"
|
|
|
|
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
LIBS="$orig_LIBS $pl"
|
|
|
|
AC_LANG_PUSH(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_c_success=1,
|
|
|
|
opal_pthread_c_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_c_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
PTHREAD_LIBS="$pl"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
PTHREAD_CPPFLAGS=
|
|
|
|
CPPFLAGS="$orig_CPPFLAGS"
|
|
|
|
LIBS="$orig_LIBS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_LIBS_CXX],[
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# C++ compiler
|
|
|
|
#
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_cxx_success" = "0"; then
|
2015-02-03 09:19:22 +03:00
|
|
|
if test ! "$opal_pthread_c_success" = "0" && test ! "$PTHREAD_LIBS" = "" ; then
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $PTHREAD_LIBS])
|
|
|
|
case "${host_cpu}-${host-_os}" in
|
|
|
|
*-aix* | *-freebsd*)
|
|
|
|
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
|
2011-01-29 00:05:40 +03:00
|
|
|
PTHREAD_CXXCPPFLAGS="-D_THREAD_SAFE"
|
2008-10-28 20:22:29 +03:00
|
|
|
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
|
|
|
|
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
|
|
|
|
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
|
|
|
AC_LANG_PUSH(C++)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_cxx_success=1,
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_cxx_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C++)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_cxx_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
|
|
|
LIBS="$orig_LIBS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_ERROR([Can not find working threads configuration. aborting])
|
|
|
|
fi
|
2015-06-24 06:59:57 +03:00
|
|
|
else
|
2008-10-28 20:22:29 +03:00
|
|
|
for pl in $plibs; do
|
|
|
|
AC_MSG_CHECKING([if C++ compiler and POSIX threads work with $pl])
|
|
|
|
case "${host_cpu}-${host-_os}" in
|
|
|
|
*-aix* | *-freebsd*)
|
|
|
|
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
|
2011-01-29 00:05:40 +03:00
|
|
|
PTHREAD_CXXCPPFLAGS="-D_THREAD_SAFE"
|
2008-10-28 20:22:29 +03:00
|
|
|
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
|
|
|
|
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
|
|
|
|
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
LIBS="$orig_LIBS $pl"
|
|
|
|
AC_LANG_PUSH(C++)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK(opal_pthread_cxx_success=1,
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_cxx_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C++)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_cxx_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
PTHREAD_LIBS="$pl"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
PTHREAD_CXXCPPFLAGS=
|
|
|
|
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
|
|
|
LIBS="$orig_LIBS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_LIBS_FC],[
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Fortran compiler
|
|
|
|
#
|
2014-10-06 14:56:47 +04:00
|
|
|
if test "$opal_pthread_fortran_success" = "0" && \
|
|
|
|
test "$OMPI_TRY_FORTRAN_BINDINGS" -gt "$OMPI_FORTRAN_NO_BINDINGS" && \
|
|
|
|
test $ompi_fortran_happy -eq 1; then
|
2015-02-03 09:19:22 +03:00
|
|
|
if test ! "$opal_pthread_c_success" = "0" && test ! "$PTHREAD_LIBS" = "" ; then
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $PTHREAD_LIBS])
|
2008-10-28 20:22:29 +03:00
|
|
|
LIBS="$orig_LIBS $PTHREAD_LIBS"
|
|
|
|
AC_LANG_PUSH(C)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN(opal_pthread_fortran_success=1,
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_fortran_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_fortran_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
LIBS="$orig_LIBS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_ERROR([Can not find working threads configuration. aborting])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
for pl in $plibs; do
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $pl])
|
2008-10-28 20:22:29 +03:00
|
|
|
LIBS="$orig_LIBS $pl"
|
|
|
|
AC_LANG_PUSH(C)
|
2015-06-24 06:59:57 +03:00
|
|
|
OPAL_INTL_PTHREAD_TRY_LINK_FORTRAN(opal_pthread_fortran_success=1,
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_fortran_success=0)
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)
|
2014-05-08 06:01:35 +04:00
|
|
|
if test "$opal_pthread_fortran_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
PTHREAD_LIBS="$pl"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
break
|
|
|
|
else
|
|
|
|
LIBS="$orig_LIBS"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFUN([OPAL_INTL_POSIX_THREADS_LIBS],[
|
|
|
|
# Begin: OPAL_INTL_POSIX_THREADS_LIBS
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# if we can't find a super-special compiler flags, try some libraries.
|
|
|
|
# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in case. Some
|
|
|
|
# systems (OS X, for example) generally don't need the defines, but
|
|
|
|
# then will on one system header here or there why take chances?
|
|
|
|
#
|
|
|
|
# libpthreads: AIX - must check before libpthread
|
|
|
|
# liblthread: LinuxThreads on FreeBSD
|
|
|
|
# libpthread: The usual place (like we can define usual!)
|
|
|
|
plibs="-lpthreads -llthread -lpthread"
|
|
|
|
|
|
|
|
# Only run C++ and Fortran if those compilers already configured
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CC],
|
|
|
|
[OPAL_INTL_POSIX_THREADS_LIBS_C],
|
2014-05-08 06:01:35 +04:00
|
|
|
[opal_pthread_c_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
|
|
|
[OPAL_INTL_POSIX_THREADS_LIBS_CXX],
|
2014-05-08 06:01:35 +04:00
|
|
|
[opal_pthread_cxx_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
AC_PROVIDE_IFELSE([AC_PROG_FC],
|
2014-05-08 06:01:35 +04:00
|
|
|
[OPAL_INTL_POSIX_THREADS_LIBS_FC],
|
|
|
|
[opal_pthread_fortran_success=1])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
# End: OPAL_INTL_POSIX_THREADS_LIBS]
|
2008-10-28 20:22:29 +03:00
|
|
|
)dnl
|
|
|
|
|
|
|
|
|
|
|
|
#********************************************************************
|
|
|
|
#
|
|
|
|
# External macro (aka, the real thing)
|
|
|
|
#
|
|
|
|
#********************************************************************
|
2014-05-07 01:16:29 +04:00
|
|
|
AC_DEFUN([OPAL_CONFIG_POSIX_THREADS],[
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_REQUIRE([AC_PROG_GREP])
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_c_success=0
|
|
|
|
opal_pthread_fortran_success=0
|
|
|
|
opal_pthread_cxx_success=0
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
orig_CFLAGS="$CFLAGS"
|
2012-04-23 19:28:26 +04:00
|
|
|
orig_FCFLAGS="$FCFLAGS"
|
2008-10-28 20:22:29 +03:00
|
|
|
orig_CXXFLAGS="$CXXFLAGS"
|
|
|
|
orig_CPPFLAGS="$CPPFLAGS"
|
|
|
|
orig_CXXCPPFLAGS="$CXXCPPFLAGS"
|
|
|
|
orig_LDFLAGS="$LDFLAGS"
|
|
|
|
orig_LIBS="$LIBS"
|
|
|
|
|
2011-01-29 00:05:40 +03:00
|
|
|
PTHREAD_CFLAGS=
|
2012-04-23 19:28:26 +04:00
|
|
|
PTHREAD_FCFLAGS=
|
2008-10-28 20:22:29 +03:00
|
|
|
PTHREAD_CXXFLAGS=
|
|
|
|
PTHREAD_CPPFLAGS=
|
|
|
|
PTHREAD_CXXCPPFLAGS=
|
|
|
|
PTHREAD_LDFLAGS=
|
|
|
|
PTHREAD_LIBS=
|
|
|
|
|
|
|
|
# Try with the basics, mam.
|
2014-05-08 06:01:35 +04:00
|
|
|
OPAL_INTL_POSIX_THREADS_PLAIN
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Try the super-special compiler flags.
|
2014-05-08 06:01:35 +04:00
|
|
|
OPAL_INTL_POSIX_THREADS_SPECIAL_FLAGS
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Try the normal linking methods (that's no fun)
|
2014-05-08 06:01:35 +04:00
|
|
|
OPAL_INTL_POSIX_THREADS_LIBS
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-03-03 21:09:09 +04:00
|
|
|
#
|
|
|
|
# check to see if we can create shared memory mutexes and conditions
|
|
|
|
#
|
|
|
|
AC_CHECK_FUNCS([pthread_mutexattr_setpshared pthread_condattr_setpshared])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# check to see if we can set error checking mutexes
|
|
|
|
#
|
|
|
|
|
|
|
|
# LinuxThreads
|
|
|
|
AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
[[#include <pthread.h>]],
|
|
|
|
[[pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK_NP);]])],
|
|
|
|
[result="yes" defval=1], [result="no" defval=0])
|
|
|
|
AC_MSG_RESULT([$result])
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFINE_UNQUOTED([OPAL_HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], [$defval],
|
2008-10-28 20:22:29 +03:00
|
|
|
[If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK_NP])
|
|
|
|
|
|
|
|
# Mac OS X
|
|
|
|
AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK])
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
[[#include <pthread.h>]],
|
|
|
|
[[pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK);]])],
|
|
|
|
[result="yes" defval=1], [result="no" defval=0])
|
|
|
|
AC_MSG_RESULT([$result])
|
2014-05-08 06:01:35 +04:00
|
|
|
AC_DEFINE_UNQUOTED([OPAL_HAVE_PTHREAD_MUTEX_ERRORCHECK], [$defval],
|
2008-10-28 20:22:29 +03:00
|
|
|
[If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK])
|
|
|
|
|
|
|
|
CFLAGS="$orig_CFLAGS"
|
2012-04-23 19:28:26 +04:00
|
|
|
FCFLAGS="$orig_FCFLAGS"
|
2008-10-28 20:22:29 +03:00
|
|
|
CXXFLAGS="$orig_CXXFLAGS"
|
|
|
|
CPPFLAGS="$orig_CPPFLAGS"
|
|
|
|
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
|
|
|
|
LDFLAGS="$orig_LDFLAGS"
|
|
|
|
LIBS="$orig_LIBS"
|
|
|
|
|
2014-10-06 14:56:47 +04:00
|
|
|
if test "$OMPI_TRY_FORTRAN_BINDINGS" = "$OMPI_FORTRAN_NO_BINDINGS" || \
|
|
|
|
test $ompi_fortran_happy -ne 1; then
|
2014-05-08 06:01:35 +04:00
|
|
|
opal_pthread_fortran_success=1
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
|
|
|
|
2015-02-03 09:19:22 +03:00
|
|
|
if test "$opal_pthread_c_success" = "1" && \
|
|
|
|
test "$opal_pthread_cxx_success" = "1" && \
|
|
|
|
test "$opal_pthread_fortran_success" = "1"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
internal_useless=1
|
|
|
|
$1
|
|
|
|
else
|
|
|
|
internal_useless=1
|
|
|
|
$2
|
|
|
|
fi
|
|
|
|
|
2014-05-08 06:01:35 +04:00
|
|
|
unset opal_pthread_c_success opal_pthread_fortran_success opal_pthread_cxx_success
|
2008-10-28 20:22:29 +03:00
|
|
|
unset internal_useless
|
|
|
|
])dnl
|