Commit 036d91a9 authored by Rob Latham's avatar Rob Latham
Browse files

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's avatarPavan Balaji <balaji@anl.gov>
parent a500a7da
......@@ -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]);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment