r10724 - in mpich2/trunk: . src/binding/f77 src/mpi/datatype src/mpid/common/datatype test/mpi/datatype
Author: gropp Date: 2012-12-07 16:14:08 -0600 (Fri, 07 Dec 2012) New Revision: 10724 Modified: mpich2/trunk/configure.ac mpich2/trunk/src/binding/f77/buildiface mpich2/trunk/src/mpi/datatype/type_get_name.c mpich2/trunk/src/mpi/datatype/typeutil.c mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h mpich2/trunk/test/mpi/datatype/typename.c Log: Correct implementation of MPI_COUNT, remove MPI_2COMPLEX and MPI_2DOUBLE_COMPLEX (invalid since MPI 1.1), and update generation of Fortran predefined MPI values Modified: mpich2/trunk/configure.ac =================================================================== --- mpich2/trunk/configure.ac 2012-12-07 22:13:22 UTC (rev 10723) +++ mpich2/trunk/configure.ac 2012-12-07 22:14:08 UTC (rev 10724) @@ -4260,10 +4260,23 @@ fi # Get the size for the bsendoverhead -AC_CHECK_SIZEOF(MPIR_Bsend_data_t,128,[ +AC_CHECK_SIZEOF(MPIR_Bsend_data_t,0,[ #define MPI_Datatype int +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif #include "${master_top_srcdir}/src/include/mpibsend.h"] ) +if test "$ac_cv_sizeof_MPIR_Bsend_data_t" = "0" ; then + AC_MSG_ERROR([Unable to determine the size of MPI_BSEND_OVERHEAD"]) + # In the past, a default of 128 was used (still likely good enough), + # but the autoconf SIZEOF macro has been changed to ignore the second + # argument, so code that depended on the prior defined behavior now + # silently breaks. +fi BSEND_OVERHEAD=$ac_cv_sizeof_MPIR_Bsend_data_t export BSEND_OVERHEAD AC_SUBST(BSEND_OVERHEAD) @@ -5356,16 +5369,16 @@ # Find the size of OPA_ptr_t. This step needs to come after the OPA # configure above in order to get the size OPA_ptr_t evaluated for # this platform. -AC_CHECK_SIZEOF(OPA_ptr_t,-1,[ +AC_CHECK_SIZEOF(OPA_ptr_t,0,[ #include "${master_top_srcdir}/src/openpa/src/opa_primitives.h" pthread_mutex_t *OPA_emulation_lock; ]) if test "$enable_f77" != "yes" ; then # These are Fortran datatypes ONLY. Set to null if no Fortran compiler. + # Removed the invalid 2COMPLEX and 2DOUBLE_COMPLEX for name in CHARACTER INTEGER REAL LOGICAL COMPLEX DOUBLE_PRECISION \ - 2INTEGER 2REAL DOUBLE_COMPLEX 2COMPLEX 2DOUBLE_PRECISION \ - 2DOUBLE_COMPLEX ; do + 2INTEGER 2REAL DOUBLE_COMPLEX 2DOUBLE_PRECISION ; do fullname="MPI_$name" eval $fullname=MPI_DATATYPE_NULL done @@ -5384,8 +5397,8 @@ AC_SUBST(MPI_2REAL) AC_SUBST(MPI_DOUBLE_COMPLEX) AC_SUBST(MPI_2DOUBLE_PRECISION) -AC_SUBST(MPI_2COMPLEX) -AC_SUBST(MPI_2DOUBLE_COMPLEX) +dnl AC_SUBST(MPI_2COMPLEX) +dnl AC_SUBST(MPI_2DOUBLE_COMPLEX) AC_SUBST(MPI_FINT) # If ROMIO was successfully configured, then ROMIO will have exported the @@ -5535,7 +5548,7 @@ # 0x4c000045 is 1275068485 in decimal, add ($MPI_SIZEOF_COUNT * 256) and you get # the decimal equivalent of the hex number -MPI_F77_COUNT=`expr 1275068484 '+' '(' 256 '*' $MPI_SIZEOF_OFFSET ')'` +MPI_F77_COUNT=`expr 1275068485 '+' '(' 256 '*' $MPI_SIZEOF_OFFSET ')'` AC_SUBST([MPI_F77_COUNT]) # ---------------------------------------------------------------------------- Modified: mpich2/trunk/src/binding/f77/buildiface =================================================================== --- mpich2/trunk/src/binding/f77/buildiface 2012-12-07 22:13:22 UTC (rev 10723) +++ mpich2/trunk/src/binding/f77/buildiface 2012-12-07 22:14:08 UTC (rev 10724) @@ -3746,16 +3746,21 @@ foreach $key (IDENT,CONGRUENT,SIMILAR,UNEQUAL) { &print_mpif_int( "MPI_$key" ); } + # Window flavor and model + foreach $key (FLAVOR_CREATE,FLAVOR_ALLOCATE,FLAVOR_DYNAMIC,FLAVOR_SHARED, + SEPARATE, UNIFIED) { + &print_mpif_int( "MPI_WIN_$key" ); + } # Collective operations - foreach $key (MAX, MIN, SUM, PROD, LAND, BAND, LOR, BOR, LXOR, BXOR, MINLOC, MAXLOC, REPLACE ) { + foreach $key (MAX, MIN, SUM, PROD, LAND, BAND, LOR, BOR, LXOR, BXOR, MINLOC, MAXLOC, REPLACE, NO_OP ) { &print_mpif_int( "MPI_$key" ); } # Objects - foreach $key ('COMM_WORLD', 'COMM_SELF', 'GROUP_EMPTY', 'COMM_NULL', 'WIN_NULL', 'FILE_NULL', 'GROUP_NULL', 'OP_NULL', 'DATATYPE_NULL', 'REQUEST_NULL', 'ERRHANDLER_NULL', 'INFO_NULL', ) { + foreach $key ('COMM_WORLD', 'COMM_SELF', 'GROUP_EMPTY', 'COMM_NULL', 'WIN_NULL', 'FILE_NULL', 'GROUP_NULL', 'OP_NULL', 'DATATYPE_NULL', 'REQUEST_NULL', 'ERRHANDLER_NULL', 'INFO_NULL', 'INFO_ENV' ) { &print_mpif_int( "MPI_$key" ); } # Attributes - foreach $key (TAG_UB, HOST, IO, WTIME_IS_GLOBAL, UNIVERSE_SIZE, LASTUSEDCODE, APPNUM, WIN_BASE, WIN_SIZE, WIN_DISP_UNIT ) { + foreach $key (TAG_UB, HOST, IO, WTIME_IS_GLOBAL, UNIVERSE_SIZE, LASTUSEDCODE, APPNUM, WIN_BASE, WIN_SIZE, WIN_DISP_UNIT, WIN_CREATE_FLAVOR, WIN_MODEL ) { # Special cast: The Fortran versions of these attributes have # value 1 greater than the C versions $attrval = $mpidef{"MPI_$key"}; @@ -3768,7 +3773,7 @@ &print_mpif_int( "MPI_$key" ); } # String sizes - # See MPI-2 2.6.2 and 4.12.9; the constants for string lenghts are + # See MPI-2 2.6.2 and 4.12.9; the constants for string lengths are # defined as one less than the C/C++ version # Missing - max processor name! @@ -3805,10 +3810,14 @@ # # Datatypes # These are determined and set at configure time - foreach $key (COMPLEX, DOUBLE_COMPLEX, LOGICAL, REAL, DOUBLE_PRECISION, INTEGER, '2INTEGER', '2COMPLEX', '2DOUBLE_PRECISION', '2REAL', '2DOUBLE_COMPLEX', CHARACTER) { + foreach $key (COMPLEX, DOUBLE_COMPLEX, LOGICAL, REAL, DOUBLE_PRECISION, INTEGER, '2INTEGER', '2DOUBLE_PRECISION', '2REAL', CHARACTER) { print MPIFFD " INTEGER MPI_$key\n"; print MPIFFD " PARAMETER (MPI_$key=\@MPI_$key\@)\n"; } + # 2COMPLEX and 2DOUBLE_COMPLEX were defined in MPI 1 and removed in + # MPI 1.1. Don't define them for the Fortran interface. + #foreach $key ('2COMPLEX', '2DOUBLE_COMPLEX') { + #} # Value of MPI_BYTE from top level configure! $mpidef{"MPI_BYTE"} = hex "0x4c00010d"; foreach $key (BYTE, UB, LB, PACKED) { @@ -4918,9 +4927,12 @@ # Eat until we find the closing right brace $enum_line = $1; while (! ($enum_line =~ /}/)) { - $enum_line .= <MPIFD>; + my $newline = <MPIFD>; + $newline =~ s/\r*\n//; + $enum_line .= $newline; $linecount++; } + print "Handling enum $enum_line...\n" if $debug; # Now process for names and values while (($enum_line =~ /\s*(MPI[X]*_[A-Z_0-9]*)\s*=\s*([a-fx0-9]*)(.*)/)) { $mpidef{$1} = $2; Modified: mpich2/trunk/src/mpi/datatype/type_get_name.c =================================================================== --- mpich2/trunk/src/mpi/datatype/type_get_name.c 2012-12-07 22:13:22 UTC (rev 10723) +++ mpich2/trunk/src/mpi/datatype/type_get_name.c 2012-12-07 22:14:08 UTC (rev 10724) @@ -111,6 +111,7 @@ /* address/offset types */ type_name_entry(MPI_AINT), type_name_entry(MPI_OFFSET), + type_name_entry(MPI_COUNT), { 0, (char *) 0 }, /* Sentinel used to indicate the last element */ }; Modified: mpich2/trunk/src/mpi/datatype/typeutil.c =================================================================== --- mpich2/trunk/src/mpi/datatype/typeutil.c 2012-12-07 22:13:22 UTC (rev 10723) +++ mpich2/trunk/src/mpi/datatype/typeutil.c 2012-12-07 22:14:08 UTC (rev 10724) @@ -73,9 +73,10 @@ MPI_C_DOUBLE_COMPLEX, MPI_C_LONG_DOUBLE_COMPLEX, - /* address/offset types */ + /* address/offset/count types */ MPI_AINT, MPI_OFFSET, + MPI_COUNT, /* Fortran types */ MPI_COMPLEX, @@ -219,7 +220,6 @@ MPID_Datatype *dptr; MPI_Datatype d = MPI_DATATYPE_NULL; static int is_init = 0; - char error_msg[1024]; /* FIXME: This is actually an error, since this routine should only be called once */ @@ -246,14 +246,11 @@ if (dptr < MPID_Datatype_builtin || dptr > MPID_Datatype_builtin + MPID_DATATYPE_N_BUILTIN) { - MPIU_Snprintf(error_msg, 1024, - "%dth builtin datatype handle references invalid memory", - i); mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__, MPI_ERR_INTERN, - "**fail", "**fail %s", - error_msg); + "**typeinitbadmem", "**typeinitbadmem %d", + i); return mpi_errno; } /* --END ERROR HANDLING-- */ @@ -274,16 +271,11 @@ /* --BEGIN ERROR HANDLING-- */ if (d != -1 && i < sizeof(mpi_dtypes)/sizeof(*mpi_dtypes) && mpi_dtypes[i] != -1) { /* We did not hit the end-of-list */ - /*MPIU_Internal_error_printf( "Did not initialize all of the predefined datatypes (only did first %d)\n", i-1 );*/ - MPIU_Snprintf(error_msg, 1024, - "Did not initialize all of the predefined datatypes (only did first %d)\n", - i-1); - - mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, - FCNAME, __LINE__, - MPI_ERR_INTERN, "**fail", - "**fail %s", error_msg); - return mpi_errno; + mpi_errno = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_FATAL, + FCNAME, __LINE__, + MPI_ERR_INTERN, "**typeinitfail", + "**typeinitfail %d", i-1); + return mpi_errno; } /* --END ERROR HANDLING-- */ is_init = 1; Modified: mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h =================================================================== --- mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h 2012-12-07 22:13:22 UTC (rev 10723) +++ mpich2/trunk/src/mpid/common/datatype/mpid_datatype.h 2012-12-07 22:14:08 UTC (rev 10724) @@ -427,7 +427,9 @@ * here. */ /* FIXME calculating this value this way is foolish, we should make this more * automatic and less error prone */ -#define MPID_DATATYPE_N_BUILTIN 68 +/* FIXME: Given that this is relatively static, an adequate alternative is + to provide a check that this value is valid. */ +#define MPID_DATATYPE_N_BUILTIN 69 extern MPID_Datatype MPID_Datatype_builtin[MPID_DATATYPE_N_BUILTIN + 1]; extern MPID_Datatype MPID_Datatype_direct[]; Modified: mpich2/trunk/test/mpi/datatype/typename.c =================================================================== --- mpich2/trunk/test/mpi/datatype/typename.c 2012-12-07 22:13:22 UTC (rev 10723) +++ mpich2/trunk/test/mpi/datatype/typename.c 2012-12-07 22:14:08 UTC (rev 10724) @@ -114,12 +114,12 @@ #if MTEST_HAVE_MIN_MPI_VERSION(2,2) /* added in MPI-2.2 */ { MPI_C_LONG_DOUBLE_COMPLEX, "MPI_C_LONG_DOUBLE_COMPLEX" }, + { MPI_AINT, "MPI_AINT" }, + { MPI_OFFSET, "MPI_OFFSET" }, #endif #if MTEST_HAVE_MIN_MPI_VERSION(3,0) /* added in MPI 3 */ { MPI_COUNT, "MPI_COUNT" }, - { MPI_AINT, "MPI_AINT" }, - { MPI_OFFSET, "MPI_OFFSET" }, #endif { 0, (char *)0 }, /* Sentinal used to indicate the last element */ };
participants (1)
-
gropp@mcs.anl.gov