[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2-14-g0deaab3

Service Account noreply at mpich.org
Tue Dec 8 09:30:16 CST 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  0deaab3b9316ccba0aa64315cbd2e1b1ab3017b4 (commit)
       via  f15293d982f832ba064a606423adf016acd968ce (commit)
      from  4e195146c8fd4d2130edba140798ebbc2fdf69c2 (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/0deaab3b9316ccba0aa64315cbd2e1b1ab3017b4

commit 0deaab3b9316ccba0aa64315cbd2e1b1ab3017b4
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Wed Dec 2 15:12:55 2015 -0600

    test/mpi/io: test case for external32 bug
    
    exercise more external32 paths.  test case contributed by Adam Moody,
    LLNL
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 9be20f6..4466ece 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -490,6 +490,7 @@
 /io/setinfo
 /io/setviewcur
 /io/userioerr
+/io/external32-derived-dtype
 /maint/testmerge
 /maint/conftimestamp
 /maint/f77tof90
diff --git a/test/mpi/io/Makefile.am b/test/mpi/io/Makefile.am
index e03cdb3..a7e53ac 100644
--- a/test/mpi/io/Makefile.am
+++ b/test/mpi/io/Makefile.am
@@ -26,7 +26,8 @@ noinst_PROGRAMS = \
     resized2      \
     bigtype       \
     hindexed_io   \
-    simple_collective
+    simple_collective \
+    external32-derived-dtype
 
 
 if BUILD_MPIX_TESTS
diff --git a/test/mpi/io/external32-derived-dtype.c b/test/mpi/io/external32-derived-dtype.c
new file mode 100644
index 0000000..8391a22
--- /dev/null
+++ b/test/mpi/io/external32-derived-dtype.c
@@ -0,0 +1,106 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2015 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ *
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include "mpi.h"
+
+static void read_file(const char *name, void *buf, MPI_Datatype dt)
+{
+    int rank, rc;
+    MPI_File fh;
+    char datarep[] = "external32";
+    int amode = MPI_MODE_RDONLY;
+    MPI_Status status;
+    MPI_Offset offset;
+
+    /* get our rank */
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    /* open file */
+    rc = MPI_File_open(MPI_COMM_WORLD, (char *) name,
+	    amode, MPI_INFO_NULL, &fh);
+    if (rc != MPI_SUCCESS) {
+        printf("Rank %d: Failed to open file %s\n", rank, name);
+        fflush(stdout);
+        MPI_Abort(MPI_COMM_WORLD, 1);
+        return;
+    }
+
+    /* set file view to be sequence of datatypes past header */
+    MPI_File_set_view(fh, 0, dt, dt, datarep, MPI_INFO_NULL);
+
+    /* issue a collective read: In 3.2 and older the external32 code
+     * path had a bug that would cause an overlapping memcopy and crash
+     */
+    offset = rank;
+    MPI_File_read_at_all(fh, offset, buf, 1, dt, &status);
+
+    /* close file */
+    MPI_File_close(&fh);
+
+    return;
+}
+
+static void write_file(const char *name, void *buf, MPI_Datatype dt)
+{
+    int rank, amode;
+    char datarep[] = "external32";
+    MPI_Status status;
+    MPI_File fh;
+    MPI_Offset offset;
+
+    /* get our rank in job */
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    /* open file */
+    amode = MPI_MODE_WRONLY | MPI_MODE_CREATE;
+    MPI_File_open(MPI_COMM_WORLD, (char *) name, amode, MPI_INFO_NULL, &fh);
+
+    /* truncate file to 0 bytes */
+    MPI_File_set_size(fh, 0);
+
+    /* set file view to be sequence of datatypes past header */
+    MPI_File_set_view(fh, 0, dt, dt, datarep, MPI_INFO_NULL);
+
+    /* collective write of file info */
+    offset = rank;
+    MPI_File_write_at_all(fh, offset, buf, 1, dt, &status);
+
+    /* close file */
+    MPI_File_close(&fh);
+
+    return;
+}
+
+/* write and read a file in which each process writes one int
+ * in rank order */
+int main(int argc, char *argv[])
+{
+
+    char buf[2] = "a";
+    MPI_Datatype dt;
+    int blocks[2] = { 1, 1 };
+    int disps[2] = { 0, 1 };
+
+    MPI_Init(&argc, &argv);
+    MPI_Type_indexed(2, blocks, disps, MPI_CHAR, &dt);
+    MPI_Type_commit(&dt);
+
+    write_file("testfile", buf, dt);
+
+    read_file("testfile", buf, dt);
+
+    MPI_Type_free(&dt);
+
+    /* if we get this far, then we've passed.  No verification in this test at
+     * this time. */
+    fprintf(stdout, " No Errors\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/io/testlist.in b/test/mpi/io/testlist.in
index 9604d33..0760eb2 100644
--- a/test/mpi/io/testlist.in
+++ b/test/mpi/io/testlist.in
@@ -12,6 +12,7 @@ resized2 1
 bigtype 1
 hindexed_io 1
 simple_collective 1 arg="simple_collective.testfile"
+external32-derived-dtype 1
 i_bigtype 1 mpiversion=3.1
 i_hindexed_io 1 mpiversion=3.1
 i_rdwrord 4 mpiversion=3.1

http://git.mpich.org/mpich.git/commitdiff/f15293d982f832ba064a606423adf016acd968ce

commit f15293d982f832ba064a606423adf016acd968ce
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Fri Nov 13 14:52:21 2015 -0600

    romio external32: convert correct buffer
    
    In commit [53f11fd73b] we picked up a "convert the correct buffer" fix,
    but did not propagate it to the other read cases
    
    The write case uses a different pattern and does not suffer from this
    bug
    
    see http://mailman.cse.ohio-state.edu/pipermail/mvapich-discuss/2015-October/005773.html
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/src/mpi/romio/mpi-io/iread_all.c b/src/mpi/romio/mpi-io/iread_all.c
index afe44f6..2615e56 100644
--- a/src/mpi/romio/mpi-io/iread_all.c
+++ b/src/mpi/romio/mpi-io/iread_all.c
@@ -136,7 +136,7 @@ int MPIOI_File_iread_all(MPI_File fh,
     /* --END ERROR HANDLING-- */
 
     if (e32_buf != NULL) {
-        error_code = MPIU_read_external32_conversion_fn(xbuf, datatype,
+        error_code = MPIU_read_external32_conversion_fn(buf, datatype,
                                                         count, e32_buf);
         ADIOI_Free(e32_buf);
     }
diff --git a/src/mpi/romio/mpi-io/read_all.c b/src/mpi/romio/mpi-io/read_all.c
index e0b605d..efce783 100644
--- a/src/mpi/romio/mpi-io/read_all.c
+++ b/src/mpi/romio/mpi-io/read_all.c
@@ -129,7 +129,7 @@ int MPIOI_File_read_all(MPI_File fh,
     /* --END ERROR HANDLING-- */
 
     if (e32_buf != NULL) {
-        error_code = MPIU_read_external32_conversion_fn(xbuf, datatype,
+        error_code = MPIU_read_external32_conversion_fn(buf, datatype,
                 count, e32_buf);
 	ADIOI_Free(e32_buf);
     }
diff --git a/src/mpi/romio/mpi-io/read_allb.c b/src/mpi/romio/mpi-io/read_allb.c
index 2110f71..ae1053b 100644
--- a/src/mpi/romio/mpi-io/read_allb.c
+++ b/src/mpi/romio/mpi-io/read_allb.c
@@ -126,7 +126,7 @@ int MPIOI_File_read_all_begin(MPI_File fh,
     /* --END ERROR HANDLING-- */
 
     if (e32_buf != NULL) {
-        error_code = MPIU_read_external32_conversion_fn(xbuf, datatype,
+        error_code = MPIU_read_external32_conversion_fn(buf, datatype,
                 count, e32_buf);
 	ADIOI_Free(e32_buf);
     }
diff --git a/src/mpi/romio/mpi-io/read_ordb.c b/src/mpi/romio/mpi-io/read_ordb.c
index 5548bde..050934b 100644
--- a/src/mpi/romio/mpi-io/read_ordb.c
+++ b/src/mpi/romio/mpi-io/read_ordb.c
@@ -125,7 +125,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
     /* --END ERROR HANDLING-- */
 
     if (e32_buf != NULL) {
-        error_code = MPIU_read_external32_conversion_fn(xbuf, datatype,
+        error_code = MPIU_read_external32_conversion_fn(buf, datatype,
                 count, e32_buf);
 	ADIOI_Free(e32_buf);
     }
diff --git a/src/mpi/romio/mpi-io/read_sh.c b/src/mpi/romio/mpi-io/read_sh.c
index 8ebbf87..83c29da 100644
--- a/src/mpi/romio/mpi-io/read_sh.c
+++ b/src/mpi/romio/mpi-io/read_sh.c
@@ -144,7 +144,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
     /* --END ERROR HANDLING-- */
 
     if (e32_buf != NULL) {
-        error_code = MPIU_read_external32_conversion_fn(xbuf, datatype,
+        error_code = MPIU_read_external32_conversion_fn(buf, datatype,
                 count, e32_buf);
 	ADIOI_Free(e32_buf);
     }

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

Summary of changes:
 src/mpi/romio/mpi-io/iread_all.c       |    2 +-
 src/mpi/romio/mpi-io/read_all.c        |    2 +-
 src/mpi/romio/mpi-io/read_allb.c       |    2 +-
 src/mpi/romio/mpi-io/read_ordb.c       |    2 +-
 src/mpi/romio/mpi-io/read_sh.c         |    2 +-
 test/mpi/.gitignore                    |    1 +
 test/mpi/io/Makefile.am                |    3 +-
 test/mpi/io/external32-derived-dtype.c |  106 ++++++++++++++++++++++++++++++++
 test/mpi/io/testlist.in                |    1 +
 9 files changed, 115 insertions(+), 6 deletions(-)
 create mode 100644 test/mpi/io/external32-derived-dtype.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list