From c33dd84b513d8f884d290ab3b8496b75f33769dc Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 7 Dec 2004 22:40:37 +0000 Subject: [PATCH] - Fix some configure.ac tests for figuring out the back-end C type for MPI_Offset - Make the ROMIO IO component use MPI_Offset for the back-end type for ADIO_Offset - Removed some extra verbage from configure warnings - Add some logic to configure to deduce an MPI datatype that corresponds to MPI_Offset (because ROMIO needs it). This is a bit of an abuse (i.e., ROMIO's configure should figure this out), but it's not too gratuitous because a) the ROMIO component is included in Open MPI, and b) other io components to be defined in the future could also use this information - Rename MCA: MPI Component Architecture -> Modular Component Architecture This commit was SVN r3742. --- configure.ac | 67 ++++++++++++++++--- .../io/romio/romio-dist/adio/include/adio.h | 11 +++ 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index ad4092bc1b..d50b28870a 100644 --- a/configure.ac +++ b/configure.ac @@ -652,7 +652,7 @@ else MPI_FORTRAN_INT_TYPE=int MPI_FORTRAN_REAL_TYPE=float MPI_FORTRAN_DBLPREC_TYPE=double - AC_MSG_WARN([*** WARNING: Did not detect a f77 compiler. Assuming default corresponding types]) + AC_MSG_WARN([*** Did not detect a f77 compiler. Assuming default corresponding types]) AC_MSG_WARN([*** Fortran LOGICAL = C $MPI_FORTRAN_LOGICAL_TYPE]) AC_MSG_WARN([*** Fortran INTEGER = C $MPI_FORTRAN_INT_TYPE]) AC_MSG_WARN([*** Fortran REAL = C $MPI_FORTRAN_REAL_TYPE]) @@ -676,31 +676,82 @@ AC_DEFINE_UNQUOTED(ompi_fortran_dblprec_t, $MPI_FORTRAN_DBLPREC_TYPE, # search for int32_t, long long, long, int. # MPI_OFFSET_TYPE="not found" +MPI_OFFSET_DATATYPE="not found" AC_MSG_CHECKING([checking for type of MPI_Offset]) if test "$ac_cv_type_int64_t" == "yes"; then MPI_OFFSET_TYPE=int64_t -elif test "$ac_cv_type_long_long_t" == "yes" -a "$ac_cv_sizeof_long_long" == 8; then + # Need to figure out MPI_OFFSET_DATATYPE below + MPI_OFFSET_SIZE=8 +elif test "$ac_cv_type_long_long" == "yes" -a "$ac_cv_sizeof_long_long" == 8; then MPI_OFFSET_TYPE="long long" -elif test "$ac_cv_type_long_t" == "yes" -a "$ac_cv_sizeof_long" == 8; then + MPI_OFFSET_DATATYPE=MPI_LONG_LONG + MPI_OFFSET_SIZE=8 +elif test "$ac_cv_type_long" == "yes" -a "$ac_cv_sizeof_long" == 8; then MPI_OFFSET_TYPE="long" + MPI_OFFSET_DATATYPE=MPI_LONG + MPI_OFFSET_SIZE=8 elif test "ac_cv_sizeof_int" == 8; then MPI_OFFSET_TYPE=int + MPI_OFFSET_DATATYPE=MPI_INT + MPI_OFFSET_SIZE=8 elif test "$ac_cv_type_int32_t" == "yes"; then MPI_OFFSET_TYPE=int32_t -elif test "$ac_cv_type_long_long_t" == "yes" -a "$ac_cv_sizeof_long_long" == 4; then + # Need to figure out MPI_OFFSET_DATATYPE below + MPI_OFFSET_SIZE=4 +elif test "$ac_cv_type_long_long" == "yes" -a "$ac_cv_sizeof_long_long" == 4; then MPI_OFFSET_TYPE="long long" -elif test "$ac_cv_type_long_t" == "yes" -a "$ac_cv_sizeof_long" == 4; then + MPI_OFFSET_DATATYPE=MPI_LONG_LONG + MPI_OFFSET_SIZE=4 +elif test "$ac_cv_type_long" == "yes" -a "$ac_cv_sizeof_long" == 4; then MPI_OFFSET_TYPE="long" + MPI_OFFSET_DATATYPE=MPI_LONG + MPI_OFFSET_SIZE=4 elif test "ac_cv_sizeof_int" == 4; then MPI_OFFSET_TYPE=int + MPI_OFFSET_DATATYPE=MPI_INT + MPI_OFFSET_SIZE=4 fi AC_MSG_RESULT([$MPI_OFFSET_TYPE]) -if test "$MPI_FINT_TYPE" = "not found"; then - AC_MSG_WARN([*** WARNING: Unable to find the right definition for MPI_Offset]) +if test "$MPI_OFFSET_TYPE" = "not found"; then + AC_MSG_WARN([*** Unable to find the right definition for MPI_Offset]) AC_MSG_ERROR([Cannot continue]) fi AC_DEFINE_UNQUOTED(MPI_Offset, $MPI_OFFSET_TYPE, [Type of MPI_Offset]) +# +# If we haven't already, figure out an MPI datatype that corresponds +# to the back-end C type of MPI_Offset. We'll only not have figured +# this out already if the type of MPI_Offset is int32_t or int64_t. +# + +AC_MSG_CHECKING([checking for an MPI datatype for MPI_Offset]) +if test "$MPI_OFFSET_DATATYPE" = "not found"; then + echo mpi_offset_type is "$MPI_OFFSET_TYPE" + if test "$MPI_OFFSET_TYPE" = "int64_t"; then + if test "$ac_cv_type_long_long" == "yes" -a "$ac_cv_sizeof_long_long" == 8; then + MPI_OFFSET_DATATYPE=MPI_LONG_LONG + elif test "$ac_cv_type_long" == "yes" -a "$ac_cv_sizeof_long" == 8; then + MPI_OFFSET_DATATYPE=MPI_LONG + elif test "ac_cv_sizeof_int" == 8; then + MPI_OFFSET_DATATYPE=MPI_INT + fi + elif test "$MPI_OFFSET_TYPE" = "int32_t"; then + echo in int32_t if block + if test "$ac_cv_type_long_long" == "yes" -a "$ac_cv_sizeof_long_long" == 4; then + MPI_OFFSET_DATATYPE=MPI_LONG_LONG + elif test "$ac_cv_type_long" == "yes" -a "$ac_cv_sizeof_long" == 4; then + MPI_OFFSET_DATATYPE=MPI_LONG + elif test "ac_cv_sizeof_int" == 4; then + MPI_OFFSET_DATATYPE=MPI_INT + fi + fi +fi +AC_MSG_RESULT([$MPI_OFFSET_DATATYPE]) +if test "$MPI_OFFSET_DATATYPE" = "not found"; then + AC_MSG_WARN([*** Unable to find an MPI datatype corresponding to MPI_Offset]) + AC_MSG_ERROR([Cannot continue]) +fi +AC_DEFINE_UNQUOTED(OMPI_OFFSET_DATATYPE, $MPI_OFFSET_DATATYPE, [MPI datatype corresponding to MPI_Offset]) # all: endian @@ -787,7 +838,7 @@ OMPI_CASE_SENSITIVE_FS_SETUP # MCA ################################## -ompi_show_title "MPI Component Architecture (MCA) setup" +ompi_show_title "Modular Component Architecture (MCA) setup" AC_MSG_CHECKING([for subdir args]) OMPI_CONFIG_SUBDIR_ARGS([ompi_subdir_args]) diff --git a/src/mca/io/romio/romio-dist/adio/include/adio.h b/src/mca/io/romio/romio-dist/adio/include/adio.h index bb53b4db59..ac8b891fc0 100644 --- a/src/mca/io/romio/romio-dist/adio/include/adio.h +++ b/src/mca/io/romio/romio-dist/adio/include/adio.h @@ -83,6 +83,15 @@ #define FDTYPE int #endif +/* Open MPI: MPI_Offset is defined by ompi_config.h. Also, taking a + little liberty with the fact that we know ROMIO is a component + included in the Open MPI distribution, we've already figured out an + MPI datatype corresponding to MPI_Offset. */ +#if 1 + typedef MPI_Offset ADIO_Offset; +# define ADIO_OFFSET OMPI_OFFSET_DATATYPE +#else +/* Open MPI: ignores all this stuff */ #ifdef MPI_OFFSET_IS_INT typedef int ADIO_Offset; # define ADIO_OFFSET MPI_INT @@ -100,6 +109,8 @@ typedef long ADIO_Offset; # define ADIO_OFFSET MPI_LONG #endif +/* Open MPI: end of section of ignored stuff */ +#endif #ifndef SX4 # define MPI_AINT MPI_LONG /* may need to change this later */