[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b3-123-g7ddceb6

Service Account noreply at mpich.org
Tue Jun 23 13:45:41 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  7ddceb6969857851d06033a6f1a9654b5f83acc5 (commit)
       via  036d91a9927ccf5bb38d9ecc21882684319c46cf (commit)
       via  a500a7dae4b5d10c42904751f7f5a45b7fb249cd (commit)
      from  bac25133c02822ef28e5011a71ad713966c5f0c5 (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/7ddceb6969857851d06033a6f1a9654b5f83acc5

commit 7ddceb6969857851d06033a6f1a9654b5f83acc5
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Wed Jun 10 15:13:45 2015 -0500

    adjust flattened processing for repeated resize
    
    resize and struct are the two type constructors that can set the LB and
    UB markers on a type.  Struct, due to MPI-1 ideas, is a strange beast
    (they adjust only if they are lower/higher than the old ones (!) )
    but for resized it's clear that the markers shift.
    
    Closes #2088
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index beae9e5..1a2bf1a 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -58,6 +58,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
     flat->next = NULL;
     flat->blocklens = NULL;
     flat->indices = NULL;
+    flat->lb_idx = flat->ub_idx = -1;
 
     flat->count = ADIOI_Count_contiguous_blocks(datatype, &curr_index);
 #ifdef FLATTEN_DEBUG 
@@ -108,6 +109,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
 		  ADIO_Offset st_offset, MPI_Count *curr_index)
 {
     int i, k, m, n, basic_num, nonzeroth, is_hindexed_block=0;
+    int lb_updated=0;
     int combiner, old_combiner, old_is_contig;
     int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes;
     /* By using ADIO_Offset we preserve +/- sign and 
@@ -736,18 +738,31 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
 
     /* handle the Lb */
 	j = *curr_index;
-	flat->indices[j] = st_offset + adds[0];
-	/* this zero-length blocklens[] element, unlike eleswhere in the
-	 * flattening code, is correct and is used to indicate a lower bound
-	 * marker */
-	flat->blocklens[j] = 0;
-	flat->lb_idx = *curr_index;
-
-        #ifdef FLATTEN_DEBUG 
-        DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
-        #endif
+	/* when we process resized types, we (recursively) process the lower
+	 * bound, the type being resized, then the upper bound.  In the
+	 * resized-of-resized case, we might find ourselves updating the upper
+	 * bound based on the inner type, but the lower bound based on the
+	 * upper type.  check both lb and ub to prevent mixing updates */
+	if (flat->lb_idx == -1 && flat->ub_idx == -1) {
+	    flat->indices[j] = st_offset + adds[0];
+	    /* this zero-length blocklens[] element, unlike eleswhere in the
+	     * flattening code, is correct and is used to indicate a lower bound
+	     * marker */
+	    flat->blocklens[j] = 0;
+	    flat->lb_idx = *curr_index;
+	    lb_updated=1;
+
+	    #ifdef FLATTEN_DEBUG
+	    DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
+	    #endif
 
-	(*curr_index)++;
+	    (*curr_index)++;
+	} else {
+	    /* skipped over this chunk because something else higher-up in the
+	     * type construction set this for us already */
+	    flat->count--;
+	    st_offset -= adds[0];
+	}
 
 	/* handle the datatype */
 
@@ -773,12 +788,20 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
 	}
 
 	/* take care of the extent as a UB */
-	j = *curr_index;
-	flat->indices[j] = st_offset + adds[0] + adds[1];
-	/* again, zero-element ok: an upper-bound marker explicitly set by the
-	 * constructor of this resized type */
-	flat->blocklens[j] = 0;
-	flat->lb_idx = *curr_index;
+	/* see note above about mixing updates for why we check lb and ub */
+	if ((flat->lb_idx == -1 && flat->ub_idx == -1) || lb_updated) {
+	    j = *curr_index;
+	    flat->indices[j] = st_offset + adds[0] + adds[1];
+	    /* again, zero-element ok: an upper-bound marker explicitly set by the
+	     * constructor of this resized type */
+	    flat->blocklens[j] = 0;
+	    flat->ub_idx = *curr_index;
+	} else {
+	    /* skipped over this chunk because something else higher-up in the
+	     * type construction set this for us already */
+	    flat->count--;
+	    (*curr_index)--;
+	}
 
         #ifdef FLATTEN_DEBUG 
         DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]);

http://git.mpich.org/mpich.git/commitdiff/036d91a9927ccf5bb38d9ecc21882684319c46cf

commit 036d91a9927ccf5bb38d9ecc21882684319c46cf
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Thu Jun 4 16:43:55 2015 -0500

    record lb and ub index in flattened
    
    in deep types we might want to update the lb and ub, not simply
    append/prepend two tuples to the flattened representation.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index 86c2875..beae9e5 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -693,6 +693,10 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
 		    flat->indices[j] = st_offset + adds[n];
 		    MPI_Type_size_x(types[n], &old_size);
 		    flat->blocklens[j] = blocklength * old_size;
+		    if (types[n] == MPI_LB)
+			flat->lb_idx = j;
+		    if (types[n] == MPI_UB)
+			flat->ub_idx = j;
 #ifdef FLATTEN_DEBUG
 		    DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]);
 #endif
@@ -737,6 +741,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
 	 * flattening code, is correct and is used to indicate a lower bound
 	 * marker */
 	flat->blocklens[j] = 0;
+	flat->lb_idx = *curr_index;
 
         #ifdef FLATTEN_DEBUG 
         DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
@@ -773,6 +778,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
 	/* again, zero-element ok: an upper-bound marker explicitly set by the
 	 * constructor of this resized type */
 	flat->blocklens[j] = 0;
+	flat->lb_idx = *curr_index;
 
         #ifdef FLATTEN_DEBUG 
         DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]);
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index d2dbc94..555af6d 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -114,6 +114,16 @@ typedef struct ADIOI_Fl_node {
     MPI_Count count;                   /* no. of contiguous blocks */
     ADIO_Offset *blocklens;      /* array of contiguous block lengths (bytes)*/
     ADIO_Offset *indices;        /* array of byte offsets of each block */
+    /* the type processing code in ROMIO loops through the flattened
+     * representation to tile file views.  so, we cannot simply indicate a
+     * lower bound and upper bound with entries here -- those are instead
+     * indicated by offset-length pairs with zero length.  In order to deal
+     * with repeatedly resetting the LB and UB though (as in resized of
+     * resized, or struct of resized, perhaps?), indicate where in the
+     * tuple-stream the lb and ub parts are kept
+     * (-1 indicates "not explicitly set") */
+    ADIO_Offset lb_idx;
+    ADIO_Offset ub_idx;
     struct ADIOI_Fl_node *next;  /* pointer to next node */
 } ADIOI_Flatlist_node;
 

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

commit a500a7dae4b5d10c42904751f7f5a45b7fb249cd
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Wed May 20 15:06:36 2015 -0500

    hoist ROMIO init into MPI_Init
    
    some libraries like HDF5 want to register their cleanup routines into
    finalize.  these cleanup routines use MPI-IO, so they need to fire
    before ROMIO cleans up.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index a6cf10d..42979d6 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -4341,6 +4341,7 @@ int MPIR_Type_size_x_impl(MPI_Datatype datatype, MPI_Count *size);
 /* random initializers */
 int MPIR_Group_init(void);
 int MPIR_Comm_init(MPID_Comm *);
+int MPIR_MPIOInit(int *error);
 
 
 /* Collective functions cannot be called from multiple threads. These
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index 6be0c7b..1e876b3 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -560,6 +560,10 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
     if (mpi_errno == MPI_SUCCESS) 
 	mpi_errno = MPID_InitCompleted();
 
+#ifdef HAVE_ROMIO
+    MPIR_MPIOInit(&mpi_errno);
+#endif
+
 fn_exit:
     MPIU_THREAD_CS_EXIT(INIT,required);
     /* Make fields of MPIR_Process global visible and set mpich_state
diff --git a/src/mpi/romio/mpi-io/mpir-mpioinit.c b/src/mpi/romio/mpi-io/mpir-mpioinit.c
index be78b45..9a5512a 100644
--- a/src/mpi/romio/mpi-io/mpir-mpioinit.c
+++ b/src/mpi/romio/mpi-io/mpir-mpioinit.c
@@ -19,23 +19,8 @@ extern int ADIO_Init_keyval;
 
 void MPIR_MPIOInit(int * error_code) {
 
-    int flag;
-    char myname[] = "MPIR_MPIOInit";
-
     /* first check if ADIO has been initialized. If not, initialize it */
     if (ADIO_Init_keyval == MPI_KEYVAL_INVALID) {
-        MPI_Initialized(&flag);
-
-	/* --BEGIN ERROR HANDLING-- */
-        if (!flag) {
-	    *error_code = MPIO_Err_create_code(MPI_SUCCESS, 
-		    MPIR_ERR_RECOVERABLE, myname, __LINE__, 
-		    MPI_ERR_OTHER, "**initialized", 0);
-	    *error_code = MPIO_Err_return_file(MPI_FILE_NULL, *error_code);
-	    return;
-	}
-	/* --END ERROR HANDLING-- */
-
         MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval,
                           (void *) 0);  
 

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

Summary of changes:
 src/include/mpiimpl.h                |    1 +
 src/mpi/init/initthread.c            |    4 ++
 src/mpi/romio/adio/common/flatten.c  |   59 +++++++++++++++++++++++++--------
 src/mpi/romio/adio/include/adioi.h   |   10 ++++++
 src/mpi/romio/mpi-io/mpir-mpioinit.c |   15 --------
 5 files changed, 59 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list