[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-50-gc8a19a9

Service Account noreply at mpich.org
Mon Mar 17 15:29:16 CDT 2014


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  c8a19a9fde0626b12329f6865c8f2e9c557a66fd (commit)
      from  486cac7655f0edbfc65958e1f5b7e4b065b88b5f (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/c8a19a9fde0626b12329f6865c8f2e9c557a66fd

commit c8a19a9fde0626b12329f6865c8f2e9c557a66fd
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Mon Mar 17 15:08:14 2014 -0500

    some lustre parameters larger than signed int
    
    Discussion with Michael Raymond: a customer would "like to use larger
    than 32-bit stripe units".  Technically, lustre only supports a 32 bit
    value for its stripe units -- an *unsigned* 32 bit value.
    
    Since we're here, let's double check that we do not try to jam a larger
    value into the lustre hint structure than lustre can support.
    
    Signed-off-by: Michael Raymond <mraymond at sgi.com>

diff --git a/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c b/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
index 7b70ba3..a6e87e8 100644
--- a/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
+++ b/src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c
@@ -15,7 +15,8 @@
 void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
 {
     char *value;
-    int flag, stripe_val[3], str_factor = -1, str_unit=0, start_iodev=-1;
+    int flag;
+    ADIO_Offset stripe_val[3], str_factor = -1, str_unit=0, start_iodev=-1;
     struct lov_user_md lum = { 0 };
     int err, myrank, fd_sys, perm, amode, old_mask;
     static char myname[] = "ADIOI_LUSTRE_SETINFO";
@@ -44,17 +45,17 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
 	    ADIOI_Info_get(users_info, "striping_unit", MPI_MAX_INFO_VAL,
 			 value, &flag);
 	    if (flag)
-		str_unit=atoi(value);
+		str_unit=atoll(value);
 
 	    ADIOI_Info_get(users_info, "striping_factor", MPI_MAX_INFO_VAL,
 			 value, &flag);
 	    if (flag)
-		str_factor=atoi(value);
+		str_factor=atoll(value);
 
 	    ADIOI_Info_get(users_info, "romio_lustre_start_iodevice",
                          MPI_MAX_INFO_VAL, value, &flag);
 	    if (flag)
-		start_iodev=atoi(value);
+		start_iodev=atoll(value);
 
             /* direct read and write */
 	    ADIOI_Info_get(users_info, "direct_read", MPI_MAX_INFO_VAL,
@@ -78,7 +79,7 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
 	    stripe_val[1] = str_unit;
 	    stripe_val[2] = start_iodev;
 	}
-	MPI_Bcast(stripe_val, 3, MPI_INT, 0, fd->comm);
+	MPI_Bcast(stripe_val, 3, MPI_OFFSET, 0, fd->comm);
 
 	if (stripe_val[0] != str_factor
 		|| stripe_val[1] != str_unit
@@ -121,8 +122,20 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
 		    lum.lmm_magic = LOV_USER_MAGIC;
 		    lum.lmm_pattern = 0;
 		    lum.lmm_stripe_size = str_unit;
+		    /* crude check for overflow of lustre internal datatypes.
+		     * Silently cap to large value if user provides a value
+		     * larger than lustre supports */
+		    if (lum.lmm_stripe_size != str_unit) {
+			lum.lmm_stripe_size = UINT_MAX;
+		    }
 		    lum.lmm_stripe_count = str_factor;
+		    if ( lum.lmm_stripe_count != str_factor) {
+			lum.lmm_stripe_count = USHRT_MAX;
+		    }
 		    lum.lmm_stripe_offset = start_iodev;
+		    if (lum.lmm_stripe_offset != start_iodev) {
+			lum.lmm_stripe_offset = USHRT_MAX;
+		    }
 
 		    err = ioctl(fd_sys, LL_IOC_LOV_SETSTRIPE, &lum);
 		    if (err == -1 && errno != EEXIST) {

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

Summary of changes:
 src/mpi/romio/adio/ad_lustre/ad_lustre_hints.c |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list