summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 91e55e6..0a2f084 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -201,8 +201,8 @@ H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo);
- H5S_hyper_print_diminfo_helper(f,"opt_diminfo",space->extent.u.simple.rank,space->select.sel_info.hslab->opt_diminfo);
- H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.u.simple.rank,space->select.sel_info.hslab->app_diminfo);
+ H5S_hyper_print_diminfo_helper(f,"opt_diminfo",space->extent.rank,space->select.sel_info.hslab->opt_diminfo);
+ H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.rank,space->select.sel_info.hslab->app_diminfo);
FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -249,7 +249,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
iter->u.hyp.iter_rank=0;
/* Get the rank of the dataspace */
- rank=space->extent.u.simple.rank;
+ rank=space->extent.rank;
/* Set the temporary pointer to the dimension information */
tdiminfo=space->select.sel_info.hslab->opt_diminfo;
@@ -262,7 +262,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
unsigned cont_dim=0; /* # of contiguous dimensions */
/* Set the temporary pointer to the dataspace extent's dimension sizes */
- mem_size=space->extent.u.simple.size;
+ mem_size=space->extent.size;
/*
* For a regular hyperslab to be contiguous up to some dimension, it
@@ -1715,27 +1715,27 @@ H5S_hyper_is_valid (const H5S_t *space)
hssize_t end; /* The high bound of a region in a dimension */
/* Check each dimension */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
/* if block or count is zero, then can skip the test since */
/* no data point is chosen */
if (diminfo[u].count && diminfo[u].block) {
/* Bounds check the start point in this dimension */
if((diminfo[u].start+space->select.offset[u])<0 ||
- (diminfo[u].start+space->select.offset[u])>=(hssize_t)space->extent.u.simple.size[u])
+ (diminfo[u].start+space->select.offset[u])>=(hssize_t)space->extent.size[u])
HGOTO_DONE(FALSE)
/* Compute the largest location in this dimension */
end=diminfo[u].start+diminfo[u].stride*(diminfo[u].count-1)+(diminfo[u].block-1)+space->select.offset[u];
/* Bounds check the end point in this dimension */
- if(end<0 || end>=(hssize_t)space->extent.u.simple.size[u])
+ if(end<0 || end>=(hssize_t)space->extent.size[u])
HGOTO_DONE(FALSE)
} /* end if */
} /* end for */
} /* end if */
else {
/* Call the recursive routine to validate the span tree */
- ret_value=H5S_hyper_is_valid_helper(space->select.sel_info.hslab->span_lst,space->select.offset,space->extent.u.simple.size,(hsize_t)0);
+ ret_value=H5S_hyper_is_valid_helper(space->select.sel_info.hslab->span_lst,space->select.offset,space->extent.size,(hsize_t)0);
} /* end else */
done:
@@ -1821,7 +1821,7 @@ H5S_get_select_hyper_nblocks(H5S_t *space)
/* Check for a "regular" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
/* Check each dimension */
- for(ret_value=1,u=0; u<space->extent.u.simple.rank; u++)
+ for(ret_value=1,u=0; u<space->extent.rank; u++)
ret_value*=space->select.sel_info.hslab->app_diminfo[u].count;
} /* end if */
else
@@ -1909,14 +1909,14 @@ H5S_hyper_serial_size (const H5S_t *space)
/* Check for a "regular" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
/* Check each dimension */
- for(block_count=1,u=0; u<space->extent.u.simple.rank; u++)
+ for(block_count=1,u=0; u<space->extent.rank; u++)
block_count*=space->select.sel_info.hslab->opt_diminfo[u].count;
- ret_value+=8*block_count*space->extent.u.simple.rank;
+ ret_value+=8*block_count*space->extent.rank;
} /* end if */
else {
/* Spin through hyperslab spans, adding 8 * rank bytes for each block */
block_count=H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
- ret_value+=8*space->extent.u.simple.rank*block_count;
+ ret_value+=8*space->extent.rank*block_count;
} /* end else */
done:
@@ -2052,13 +2052,13 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf)
buf+=4; /* skip over space for length */
/* Encode number of dimensions */
- UINT32ENCODE(buf, (uint32_t)space->extent.u.simple.rank);
+ UINT32ENCODE(buf, (uint32_t)space->extent.rank);
len+=4;
/* Check for a "regular" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
/* Set some convienence values */
- ndims=space->extent.u.simple.rank;
+ ndims=space->extent.rank;
fast_dim=ndims-1;
diminfo=space->select.sel_info.hslab->opt_diminfo;
@@ -2148,8 +2148,8 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf)
/* Add 8 bytes times the rank for each hyperslab selected */
H5_CHECK_OVERFLOW(block_count,hssize_t,hsize_t);
- H5_CHECK_OVERFLOW((8*space->extent.u.simple.rank*(hsize_t)block_count),hsize_t,size_t);
- len+=(size_t)(8*space->extent.u.simple.rank*block_count);
+ H5_CHECK_OVERFLOW((8*space->extent.rank*(hsize_t)block_count),hsize_t,size_t);
+ len+=(size_t)(8*space->extent.rank*block_count);
/* Encode each hyperslab in selection */
H5S_hyper_serialize_helper(space->select.sel_info.hslab->span_lst,start,end,(hsize_t)0,&buf);
@@ -2209,7 +2209,7 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf)
/* Deserialize slabs to select */
buf+=16; /* Skip over selection header */
UINT32DECODE(buf,rank); /* decode the rank of the point selection */
- if(rank!=space->extent.u.simple.rank)
+ if(rank!=space->extent.rank)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace");
UINT32DECODE(buf,num_elem); /* decode the number of points */
@@ -2401,7 +2401,7 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc
/* Check for a "regular" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
/* Set some convienence values */
- ndims=space->extent.u.simple.rank;
+ ndims=space->extent.rank;
fast_dim=ndims-1;
/* Check which set of dimension information to use */
@@ -2663,7 +2663,7 @@ H5S_hyper_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
assert(end);
/* Set the start and end arrays up */
- rank=space->extent.u.simple.rank;
+ rank=space->extent.rank;
for(i=0; i<rank; i++) {
start[i]=HSSIZET_MAX;
end[i]=HSSIZET_MIN;
@@ -2746,12 +2746,12 @@ H5S_hyper_is_contiguous(const H5S_t *space)
small_contiguous=FALSE; /* assume false initially */
/* Check for a "large contigous" block */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
if(diminfo[u].count>1) {
large_contiguous=FALSE;
break;
} /* end if */
- if(u>0 && diminfo[u].block!=space->extent.u.simple.size[u]) {
+ if(u>0 && diminfo[u].block!=space->extent.size[u]) {
large_contiguous=FALSE;
break;
} /* end if */
@@ -2760,12 +2760,12 @@ H5S_hyper_is_contiguous(const H5S_t *space)
/* If we didn't find a large contiguous block, check for a small one */
if(large_contiguous==FALSE) {
small_contiguous=TRUE;
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
if(diminfo[u].count>1) {
small_contiguous=FALSE;
break;
} /* end if */
- if(u<(space->extent.u.simple.rank-1) && diminfo[u].block!=1) {
+ if(u<(space->extent.rank-1) && diminfo[u].block!=1) {
small_contiguous=FALSE;
break;
} /* end if */
@@ -2814,7 +2814,7 @@ H5S_hyper_is_contiguous(const H5S_t *space)
} /* end if */
else {
/* If this span doesn't cover the entire dimension, then this selection isn't contiguous */
- if(((span->high-span->low)+1)!=(hssize_t)space->extent.u.simple.size[u]) {
+ if(((span->high-span->low)+1)!=(hssize_t)space->extent.size[u]) {
large_contiguous=FALSE;
break;
} /* end if */
@@ -2852,7 +2852,7 @@ H5S_hyper_is_contiguous(const H5S_t *space)
} /* end if */
else {
/* If this span doesn't cover the entire dimension, then this selection isn't contiguous */
- if(u<(space->extent.u.simple.rank-1) && ((span->high-span->low)+1)!=1) {
+ if(u<(space->extent.rank-1) && ((span->high-span->low)+1)!=1) {
small_contiguous=FALSE;
break;
} /* end if */
@@ -2918,7 +2918,7 @@ H5S_hyper_is_single(const H5S_t *space)
ret_value=TRUE; /* assume true and reset if the dimensions don't match */
/* Check for a single block */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
if(space->select.sel_info.hslab->opt_diminfo[u].count>1) {
ret_value=FALSE;
break;
@@ -3508,11 +3508,11 @@ H5S_hyper_convert(H5S_t *space)
unsigned u; /* Local index variable */
/* Fill in temporary information for the dimensions */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
tmp_start[u]=0;
tmp_stride[u]=1;
tmp_count[u]=1;
- tmp_block[u]=space->extent.u.simple.size[u];
+ tmp_block[u]=space->extent.size[u];
} /* end for */
/* Convert to hyperslab selection */
@@ -3641,7 +3641,7 @@ H5S_hyper_intersect (H5S_t *space1, H5S_t *space2)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
/* Check that the dataspaces are both the same rank */
- if(space1->extent.u.simple.rank!=space2->extent.u.simple.rank)
+ if(space1->extent.rank!=space2->extent.rank)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "dataspace ranks don't match");
/* Perform the span-by-span intersection check */
@@ -3868,7 +3868,7 @@ H5S_hyper_adjust(H5S_t *space, const hssize_t *offset)
/* Subtract the offset from the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
space->select.sel_info.hslab->opt_diminfo[u].start-=offset[u];
assert(space->select.sel_info.hslab->opt_diminfo[u].start>=0);
} /* end for */
@@ -3983,7 +3983,7 @@ H5S_hyper_move(H5S_t *space, const hssize_t *offset)
/* Move to the offset with the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
space->select.sel_info.hslab->opt_diminfo[u].start=offset[u];
assert(space->select.sel_info.hslab->opt_diminfo[u].start>=0);
} /* end for */
@@ -4037,7 +4037,7 @@ H5S_hyper_normalize_offset(H5S_t *space)
/* (Technically, this check shouldn't be in the "hyperslab" routines...) */
if(H5S_GET_SELECT_TYPE(space)!=H5S_SEL_ALL) {
/* Invert the selection offset */
- for(u=0; u<space->extent.u.simple.rank; u++)
+ for(u=0; u<space->extent.rank; u++)
space->select.offset[u] =- space->select.offset[u];
/* Call the existing 'adjust' routine */
@@ -4045,7 +4045,7 @@ H5S_hyper_normalize_offset(H5S_t *space)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization");
/* Zero out the selection offset */
- for(u=0; u<space->extent.u.simple.rank; u++)
+ for(u=0; u<space->extent.rank; u++)
space->select.offset[u] = 0;
} /* end if */
@@ -5287,7 +5287,7 @@ H5S_hyper_rebuild (H5S_t *space)
app_diminfo=space->select.sel_info.hslab->app_diminfo;
while(span!=NULL) {
/* Sanity check */
- assert(curr_dim<space->extent.u.simple.rank);
+ assert(curr_dim<space->extent.rank);
/* Recover the optimized dimension information */
app_diminfo[curr_dim].start = diminfo[curr_dim].start = span->low;
@@ -5347,7 +5347,7 @@ H5S_hyper_generate_spans(H5S_t *space)
assert(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS);
/* Get the diminfo */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
tmp_start[u]=space->select.sel_info.hslab->opt_diminfo[u].start;
tmp_stride[u]=space->select.sel_info.hslab->opt_diminfo[u].stride;
tmp_count[u]=space->select.sel_info.hslab->opt_diminfo[u].count;
@@ -5403,7 +5403,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
assert(block);
/* Generate span tree for new hyperslab information */
- if((new_spans=H5S_hyper_make_spans(space->extent.u.simple.rank,start,stride,count,block))==NULL)
+ if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information");
/* Generate list of blocks to add/remove based on selection operation */
@@ -5645,13 +5645,13 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/*
* Check for overlapping hyperslab blocks in new selection.
*/
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
if(count[u]>1 && stride[u]<block[u])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab blocks overlap");
} /* end for */
/* Optimize hyperslab parameters to merge contiguous blocks, etc. */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
/* contiguous hyperslabs have the block size equal to the stride */
if(stride[u]==block[u]) {
opt_count[u]=1;
@@ -5720,11 +5720,11 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
/* Fill in temporary information for the dimensions */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
tmp_start[u]=0;
tmp_stride[u]=1;
tmp_count[u]=1;
- tmp_block[u]=space->extent.u.simple.size[u];
+ tmp_block[u]=space->extent.size[u];
} /* end for */
/* Convert to hyperslab selection */
@@ -5768,7 +5768,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Save the diminfo */
space->select.num_elem=1;
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
space->select.sel_info.hslab->app_diminfo[u].start = start[u];
space->select.sel_info.hslab->app_diminfo[u].stride = stride[u];
space->select.sel_info.hslab->app_diminfo[u].count = count[u];
@@ -5862,7 +5862,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hssize_t start[],
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
if(stride!=NULL) {
/* Check for 0-sized strides */
- for(u=0; u<space->extent.u.simple.rank; u++) {
+ for(u=0; u<space->extent.rank; u++) {
if(stride[u]==0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value");
} /* end for */
@@ -5944,7 +5944,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
assert(len);
/* Set the rank of the fastest changing dimension */
- ndims=space->extent.u.simple.rank;
+ ndims=space->extent.rank;
fast_dim=(ndims-1);
/* Get the pointers to the current span info and span nodes */
@@ -5962,7 +5962,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
/* Compute the cumulative size of dataspace dimensions */
for(i=fast_dim, acc=elem_size; i>=0; i--) {
slab[i]=acc;
- acc*=space->extent.u.simple.size[i];
+ acc*=space->extent.size[i];
} /* end for */
/* Set the offset of the first element iterated on */
@@ -6393,7 +6393,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
tdiminfo=iter->u.hyp.diminfo;
/* Check if this is a "flattened" regular hyperslab selection */
- if(iter->u.hyp.iter_rank!=0 && iter->u.hyp.iter_rank<space->extent.u.simple.rank) {
+ if(iter->u.hyp.iter_rank!=0 && iter->u.hyp.iter_rank<space->extent.rank) {
/* Set the aliases for a few important dimension ranks */
ndims=iter->u.hyp.iter_rank;
fast_dim=ndims-1;
@@ -6406,14 +6406,14 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
} /* end if */
else {
/* Set the aliases for a few important dimension ranks */
- ndims=space->extent.u.simple.rank;
+ ndims=space->extent.rank;
fast_dim=ndims-1;
/* Set the local copy of the selection offset */
sel_off=space->select.offset;
/* Set up the pointer to the size of the memory space */
- mem_size=space->extent.u.simple.size;
+ mem_size=space->extent.size;
} /* end else */
/* initialize row sizes for each dimension */