[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-239-g05f42d1

Service Account noreply at mpich.org
Fri Oct 2 18:00:28 CDT 2015


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  05f42d10602b88f37993a24bdf31dc4d2a7bb08d (commit)
       via  98b772c7292852f9f67b8e45fdddd93a5f40b8de (commit)
      from  6dd87a93860d292800dd7edec1c9a04838802492 (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/05f42d10602b88f37993a24bdf31dc4d2a7bb08d

commit 05f42d10602b88f37993a24bdf31dc4d2a7bb08d
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Sep 30 17:08:21 2015 -0500

    binding/mpif_h: promote attribute copy argument types
    
    MPI-2.1 added new attribute functions that changed the type of the
    value and extra state arguments to be of MPI_ADDRESS_KIND in Fortran.
    The mpif_h bindings, however, would truncate these values by casting
    them as default Fortran integers when calling the underlying copy
    functions. We address the issue by substituting MPI_Aint in place
    of MPI_Fint for temporary variables in the binding code.
    
    Signed-off-by: Junchao Zhang <jczhang at mcs.anl.gov>

diff --git a/src/binding/fortran/mpif_h/buildiface b/src/binding/fortran/mpif_h/buildiface
index cd47698..9eebc69 100755
--- a/src/binding/fortran/mpif_h/buildiface
+++ b/src/binding/fortran/mpif_h/buildiface
@@ -4397,7 +4397,7 @@ sub build_specials {
 
     print $OUTFD " 
 /* The F77 attr copy function prototype and calling convention */
-typedef void (FORT_CALL F77_CopyFunction) (MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *,MPI_Fint *, MPI_Fint *, MPI_Fint *);
+typedef void (FORT_CALL F77_CopyFunction) (MPI_Fint *, MPI_Fint *, MPI_Aint *, MPI_Aint *, MPI_Aint *, MPI_Fint *, MPI_Fint *);
 
 /* Helper proxy function to thunk the attr copy function call into F77 calling convention */
 static
@@ -4416,9 +4416,9 @@ MPIR_Comm_copy_attr_f77_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)comm;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Fint fvalue = (MPI_Fint) MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
-    MPI_Fint* fextra  = (MPI_Fint*)extra_state;
-    MPI_Fint fnew = 0;
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint *fextra = (MPI_Aint *)extra_state;
+    MPI_Aint fnew = 0;
     MPI_Fint fflag = 0;
 
     ((F77_CopyFunction*)user_function)( &fhandle, &fkeyval, fextra, &fvalue, &fnew, &fflag, &ierr );
@@ -4430,7 +4430,7 @@ MPIR_Comm_copy_attr_f77_proxy(
 
 
 /* The F77 attr delete function prototype and calling convention */
-typedef void (FORT_CALL F77_DeleteFunction) (MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *, MPI_Fint *);
+typedef void (FORT_CALL F77_DeleteFunction) (MPI_Fint *, MPI_Fint *, MPI_Aint *, MPI_Aint *, MPI_Fint *);
 
 /* Helper proxy function to thunk the attr delete function call into F77 calling convention */
 static
@@ -4447,8 +4447,8 @@ MPIR_Comm_delete_attr_f77_proxy(
     MPI_Fint ierr = 0;
     MPI_Fint fhandle = (MPI_Fint)comm;
     MPI_Fint fkeyval = (MPI_Fint)keyval;
-    MPI_Fint fvalue = (MPI_Fint) MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
-    MPI_Fint* fextra  = (MPI_Fint*)extra_state;
+    MPI_Aint fvalue = MPIU_VOID_PTR_CAST_TO_MPI_AINT (value);
+    MPI_Aint *fextra = (MPI_Aint *)extra_state;
 
     ((F77_DeleteFunction*)user_function)( &fhandle, &fkeyval, &fvalue, fextra, &ierr );
     return (int)ierr;

http://git.mpich.org/mpich.git/commitdiff/98b772c7292852f9f67b8e45fdddd93a5f40b8de

commit 98b772c7292852f9f67b8e45fdddd93a5f40b8de
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Sep 30 09:46:00 2015 -0500

    tsuite: add Fortran attr copy test with large value
    
    The MPI provided attribute copy functions in MPICH do not handle
    the potentially larger integer values defined in MPI-2.1. This test
    illustrates the problem.
    
    Signed-off-by: Junchao Zhang <jczhang at mcs.anl.gov>

diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 08ce6e6..aa8caa4 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -784,6 +784,7 @@
 /f77/attr/baseattrf
 /f77/attr/commattr2f
 /f77/attr/commattr3f
+/f77/attr/commattr4f
 /f77/attr/commattrf
 /f77/attr/typeattr2f
 /f77/attr/typeattr3f
@@ -859,6 +860,7 @@
 /f90/attr/baseattrf90
 /f90/attr/commattr2f90
 /f90/attr/commattr3f90
+/f90/attr/commattr4f90
 /f90/attr/commattrf90
 /f90/attr/fandcattrf90
 /f90/attr/typeattr2f90
diff --git a/test/mpi/f77/attr/Makefile.am b/test/mpi/f77/attr/Makefile.am
index 0d9b503..cd54053 100644
--- a/test/mpi/f77/attr/Makefile.am
+++ b/test/mpi/f77/attr/Makefile.am
@@ -15,7 +15,8 @@ AM_DEFAULT_SOURCE_EXT = .f
 noinst_PROGRAMS =                   \
     attrmpi1f                       \
     baseattrf baseattr2f            \
-    commattrf commattr2f commattr3f \
+    commattrf commattr2f            \
+    commattr3f commattr4f           \
     typeattrf typeattr2f typeattr3f
 
 ## attraints.h will be distributed because it's listed in AC_CONFIG_FILES/AC_OUTPUT
diff --git a/test/mpi/f77/attr/commattr4f.f b/test/mpi/f77/attr/commattr4f.f
new file mode 100644
index 0000000..ddce319
--- /dev/null
+++ b/test/mpi/f77/attr/commattr4f.f
@@ -0,0 +1,90 @@
+C
+      program main
+C
+      include 'mpif.h'
+
+      integer    ierr
+      integer    errs
+      logical    found
+      integer    comm2
+      integer    key
+      include    'attraints.h'
+
+      errs = 0
+C
+C  initialize the mpi environment
+C
+      call mpi_init(ierr)
+
+      call mpi_comm_create_keyval(MPI_COMM_DUP_FN,
+     $     MPI_NULL_DELETE_FN,
+     $     key,
+     $     extrastate,
+     $     ierr)
+C
+C  set a value for the attribute
+C
+      valin = huge(valin)
+C
+C  set attr in comm_world
+C
+      call mpi_comm_set_attr(MPI_COMM_WORLD,
+     $     key,
+     $     valin,
+     $     ierr)
+      call mpi_comm_get_attr(MPI_COMM_WORLD,
+     $     key,
+     $     valout,
+     $     found,
+     $     ierr)
+      if (found .neqv. .true.) then
+         print *, "mpi_comm_set_attr reported key, but not found on ",
+     $        "mpi_comm_world"
+         errs = errs + 1
+      else if (valout .ne. valin) then
+         print *, "key found, but valin does not match valout"
+         print *, valout, " != ", valin
+         errs = errs + 1
+      end if
+C
+C  dup the communicator, attribute should follow
+C
+      call mpi_comm_dup(MPI_COMM_WORLD,
+     $     comm2,
+     $     ierr)
+C
+C  get the value for the attribute
+C
+      call mpi_comm_get_attr(comm2,
+     $     key,
+     $     valout,
+     $     found,
+     $     ierr)
+      if (found .neqv. .true.) then
+         print *, "mpi_comm_set_attr reported key, but not found on ",
+     $        "duped comm"
+         errs = errs + 1
+      else if (valout .ne. valin) then
+         print *, "key found, but value does not match that on ",
+     $        "mpi_comm_world"
+         print *, valout, " != ", valin
+         errs = errs + 1
+      end if
+C
+C     free the duped communicator
+C
+      call mpi_comm_free(comm2, ierr)
+C
+C     free keyval
+C
+      call mpi_comm_delete_attr(MPI_COMM_WORLD,
+     $     key, ierr)
+      call mpi_comm_free_keyval(key,
+     $     ierr)
+      call mpi_finalize(ierr)
+
+      if (errs .eq. 0) then
+         print *, " No Errors"
+      end if
+
+      end
diff --git a/test/mpi/f77/attr/testlist b/test/mpi/f77/attr/testlist
index 27d9d59..8558ec7 100644
--- a/test/mpi/f77/attr/testlist
+++ b/test/mpi/f77/attr/testlist
@@ -4,6 +4,7 @@ baseattr2f 1
 commattrf 1
 commattr2f 1
 commattr3f 1
+commattr4f 1
 typeattrf 1
 typeattr2f 1
 typeattr3f 1

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

Summary of changes:
 src/binding/fortran/mpif_h/buildiface |   14 +++---
 test/mpi/.gitignore                   |    2 +
 test/mpi/f77/attr/Makefile.am         |    3 +-
 test/mpi/f77/attr/commattr4f.f        |   90 +++++++++++++++++++++++++++++++++
 test/mpi/f77/attr/testlist            |    1 +
 5 files changed, 102 insertions(+), 8 deletions(-)
 create mode 100644 test/mpi/f77/attr/commattr4f.f


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list