[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-223-gc532aac

mysql vizuser noreply at mpich.org
Sat May 18 15:24:31 CDT 2013


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  c532aacc14f77a04ffca0c212731700a5d3d9a01 (commit)
       via  76b46a77b7bffd88a19db4011b1b4165f718f44d (commit)
      from  533b8b374eec4562d4a50d5ef87e1695c43efad1 (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/c532aacc14f77a04ffca0c212731700a5d3d9a01

commit c532aacc14f77a04ffca0c212731700a5d3d9a01
Author: Jed Brown <jedbrown at mcs.anl.gov>
Date:   Sat May 18 12:55:38 2013 -0500

    test: add attrdeleteget, MPI_Attr_get called from delete_fn
    
    With MS-MPI 64-bit from HPC Pack 2008 and 2012, MPI_Attr_get returns
    error code 773 when called from delete_fn on a communicator obtained
    from MPI_Comm_split.
    
    The standard is not explicit that the 'comm' argument of delete_fn must
    be valid, so this test is only in effect when !USE_STRICT_MPI.
    
    Signed-off-by: Jed Brown <jedbrown at mcs.anl.gov>
    Signed-off-by: Satish Balay <balay at mcs.anl.gov>

diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 3aadba2..0bdcd15 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -51,6 +51,7 @@
 /attr/attrerr
 /attr/attrerrcomm
 /attr/attrerrtype
+/attr/attrdeleteget
 /attr/attric
 /attr/attrorder
 /attr/attrordercomm
diff --git a/test/mpi/attr/Makefile.am b/test/mpi/attr/Makefile.am
index a672192..e1d788b 100644
--- a/test/mpi/attr/Makefile.am
+++ b/test/mpi/attr/Makefile.am
@@ -18,6 +18,7 @@ noinst_PROGRAMS =      \
     attrerr            \
     attrerrcomm        \
     attrerrtype        \
+    attrdeleteget      \
     attr2type          \
     attrorder          \
     attrordercomm      \
diff --git a/test/mpi/attr/attrdeleteget.c b/test/mpi/attr/attrdeleteget.c
new file mode 100644
index 0000000..4d63eeb
--- /dev/null
+++ b/test/mpi/attr/attrdeleteget.c
@@ -0,0 +1,49 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2013 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int key = MPI_KEYVAL_INVALID;
+char a[100];
+
+int delete_fn (MPI_Comm, int, void *, void *);
+
+int main(int argc,char **argv)
+{
+    MPI_Comm scomm;
+    int errs = 0;
+
+    MTest_Init(&argc, &argv);
+    MPI_Comm_split(MPI_COMM_WORLD, 1, 0, &scomm);
+    MPI_Comm_create_keyval(MPI_NULL_COPY_FN, delete_fn, &key, &errs);
+    MPI_Comm_set_attr(scomm, key, a);
+    MPI_Comm_free(&scomm);
+    MTest_Finalize(errs);
+    MPI_Finalize();
+    return 0;
+}
+
+int delete_fn(MPI_Comm comm,int keyval,void *attr_val,void *extra_state)
+{
+#ifndef USE_STRICT_MPI
+    int err,flg,*errs = extra_state;
+    void *ptr;
+
+    if (comm == MPI_COMM_NULL) {
+        printf("MPI_COMM_NULL passed to delete_fn\n");
+        (*errs)++;
+    }
+    err = MPI_Comm_get_attr(comm,key,&ptr,&flg);
+    if (err != MPI_SUCCESS) {
+        printf("MPI_Comm_get_attr returned error %d, presumably due to invalid communicator\n", err);
+        (*errs)++;
+    }
+#endif
+    return 0;
+}
diff --git a/test/mpi/attr/testlist b/test/mpi/attr/testlist
index 61bd613..4db94df 100644
--- a/test/mpi/attr/testlist
+++ b/test/mpi/attr/testlist
@@ -7,6 +7,7 @@ attrend2 1
 attrend2 5
 attrerrcomm 1
 attrerrtype 1
+attrdeleteget 1
 attr2type 1
 attrorder 1
 attrordercomm 1

http://git.mpich.org/mpich.git/commitdiff/76b46a77b7bffd88a19db4011b1b4165f718f44d

commit 76b46a77b7bffd88a19db4011b1b4165f718f44d
Author: Jed Brown <jedbrown at mcs.anl.gov>
Date:   Fri May 17 22:41:48 2013 -0500

    config: change PAC_FUNC_NEEDS_DECL to check by assignment
    
    The old method attempts to create a failed compile when the function
    *is* already declared, by creating an incompatible declaration.  That is
    insufficient with clang-3.2, which only warns in case of incompatible
    redeclaration of a library function:
    
      conftest.c:44:5: warning: incompatible redeclaration of library function 'strncmp'
      int strncmp(double, int, double, const char *);
          ^
      /usr/include/string.h:143:12: note: 'strncmp' is a builtin with type 'int (const char *, const char *, size_t)'
      extern int strncmp (const char *__s1, const char *__s2, size_t __n)
                 ^
      1 warning generated.
    
    Instead, we take the opposite approach, generating a failed compile when
    the library function has *not* been declared in the header.
    
      void (*fptr)(void) = (void(*)(void))strncmp;
    
    Signed-off-by: Jed Brown <jedbrown at mcs.anl.gov>

diff --git a/confdb/aclocal_cc.m4 b/confdb/aclocal_cc.m4
index 7a92a8a..10964e1 100644
--- a/confdb/aclocal_cc.m4
+++ b/confdb/aclocal_cc.m4
@@ -1205,25 +1205,22 @@ dnl Sets 'NEEDS_<funcname>_DECL' if 'funcname' is not declared by the
 dnl headerfiles.
 dnl
 dnl Approach:
-dnl Try to compile a program with the function, but passed with an incorrect
-dnl calling sequence.  If the compilation fails, then the declaration
-dnl is provided within the header files.  If the compilation succeeds,
-dnl the declaration is required.
+dnl Attempt to assign library function to function pointer.  If the function
+dnl is not declared in a header, this will fail.  Use a non-static global so
+dnl the compiler does not warn about an unused variable.
 dnl
-dnl We use a 'double' as the first argument to try and catch varargs
-dnl routines that may use an int or pointer as the first argument.
+dnl Simply calling the function is not enough because C89 compilers allow
+dnl calls to implicitly-defined functions.  Re-declaring a library function
+dnl with an incompatible prototype is also not sufficient because some
+dnl compilers (notably clang-3.2) only produce a warning in this case.
 dnl
-dnl There is one difficulty - if the compiler has been instructed to
-dnl fail on implicitly defined functions, then this test will always
-dnl fail.
-dnl 
 dnl D*/
 AC_DEFUN([PAC_FUNC_NEEDS_DECL],[
 AC_CACHE_CHECK([whether $2 needs a declaration],
 pac_cv_func_decl_$2,[
 AC_TRY_COMPILE([$1
-int $2(double, int, double, const char *);],[int a=$2(1.0,27,1.0,"foo");],
-pac_cv_func_decl_$2=yes,pac_cv_func_decl_$2=no)])
+void (*fptr)(void) = (void(*)(void))$2;],[],
+pac_cv_func_decl_$2=no,pac_cv_func_decl_$2=yes)])
 if test "$pac_cv_func_decl_$2" = "yes" ; then
 changequote(<<,>>)dnl
 define(<<PAC_FUNC_NAME>>, translit(NEEDS_$2_DECL, [a-z *], [A-Z__]))dnl

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

Summary of changes:
 confdb/aclocal_cc.m4          |   21 +++++++----------
 test/mpi/.gitignore           |    1 +
 test/mpi/attr/Makefile.am     |    1 +
 test/mpi/attr/attrdeleteget.c |   49 +++++++++++++++++++++++++++++++++++++++++
 test/mpi/attr/testlist        |    1 +
 5 files changed, 61 insertions(+), 12 deletions(-)
 create mode 100644 test/mpi/attr/attrdeleteget.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list