mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r9106] Purpose:
bug fix Description: the option CHUNK:NONE (remove chunking ) was not setting the layout to contiguous Solution: Platforms tested: linux solaris AIX Misc. update:
This commit is contained in:
parent
ad655bf083
commit
8c0f8b1a95
@ -198,11 +198,21 @@ int h5repack_addlayout(const char* str,
|
||||
if (options->all_layout==1 )
|
||||
{
|
||||
options->layout_g=pack.layout;
|
||||
if (pack.layout==H5D_CHUNKED) {
|
||||
/* if we are chunking all set the global chunking type */
|
||||
options->chunk_g.rank=pack.chunk.rank;
|
||||
for (j = 0; j < pack.chunk.rank; j++)
|
||||
options->chunk_g.chunk_lengths[j] = pack.chunk.chunk_lengths[j];
|
||||
if (pack.layout==H5D_CHUNKED)
|
||||
{
|
||||
/* -2 means the NONE option, remove chunking
|
||||
and set the global layout to contiguous */
|
||||
if (pack.chunk.rank==-2)
|
||||
{
|
||||
options->layout_g = H5D_CONTIGUOUS;
|
||||
}
|
||||
/* otherwise set the global chunking type */
|
||||
else
|
||||
{
|
||||
options->chunk_g.rank=pack.chunk.rank;
|
||||
for (j = 0; j < pack.chunk.rank; j++)
|
||||
options->chunk_g.chunk_lengths[j] = pack.chunk.chunk_lengths[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,7 +279,7 @@ static int check_options(pack_opt_t *options)
|
||||
else if (options->op_tbl->objs[i].chunk.rank==-2)
|
||||
{
|
||||
if (options->verbose)
|
||||
printf(" <%s> %s\n",name,"NONE");
|
||||
printf(" <%s> %s\n",name,"NONE (contigous)");
|
||||
has_ck=1;
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,6 @@ TOOLTEST()
|
||||
# is read-only, 1 is write-only, and 0 is not present.
|
||||
|
||||
# copy files (these files have no filters; test2.h5 has copied references that h5diff detects)
|
||||
TOOLTEST test1.h5
|
||||
TOOLTEST test3.h5
|
||||
TOOLTEST test4.h5
|
||||
TOOLTEST test5.h5
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
@ -90,10 +90,22 @@ static void aux_tblinsert_layout(pack_opttbl_t *table,
|
||||
int k;
|
||||
|
||||
table->objs[I].layout = pack->layout;
|
||||
if (H5D_CHUNKED==pack->layout) {
|
||||
table->objs[I].chunk.rank = pack->chunk.rank;
|
||||
for (k = 0; k < pack->chunk.rank; k++)
|
||||
table->objs[I].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k];
|
||||
if (H5D_CHUNKED==pack->layout)
|
||||
{
|
||||
/* -2 means the NONE option, remove chunking
|
||||
and set the layout to contiguous */
|
||||
if (pack->chunk.rank==-2)
|
||||
{
|
||||
table->objs[I].layout = H5D_CONTIGUOUS;
|
||||
table->objs[I].chunk.rank = -2;
|
||||
}
|
||||
/* otherwise set the chunking type */
|
||||
else
|
||||
{
|
||||
table->objs[I].chunk.rank = pack->chunk.rank;
|
||||
for (k = 0; k < pack->chunk.rank; k++)
|
||||
table->objs[I].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,6 +383,11 @@ obj_list_t* parse_layout(const char *str,
|
||||
char sobj[MAX_NC_NAME];
|
||||
char sdim[10];
|
||||
char slayout[10];
|
||||
|
||||
|
||||
memset(sdim, '\0', sizeof(sdim));
|
||||
memset(sobj, '\0', sizeof(sobj));
|
||||
memset(slayout, '\0', sizeof(slayout));
|
||||
|
||||
/* check for the end of object list and number of objects */
|
||||
for ( i=0, n=0; i<len; i++)
|
||||
@ -481,7 +486,9 @@ obj_list_t* parse_layout(const char *str,
|
||||
sdim[k]=c;
|
||||
k++; /*increment sdim index */
|
||||
|
||||
if (!isdigit(c) && c!='x' && c!='N' && c!='O' && c!='N' && c!='E'){
|
||||
if (!isdigit(c) && c!='x'
|
||||
&& c!='N' && c!='O' && c!='N' && c!='E'
|
||||
){
|
||||
if (obj_list) free(obj_list);
|
||||
printf("Parse layout error: <%s> Not a valid character in <%s>\n",
|
||||
sdim,str);
|
||||
|
@ -72,8 +72,6 @@ int main (void)
|
||||
TEST_ERROR;
|
||||
if (h5repack_verify(FNAME1OUT,&pack_options)<=0)
|
||||
TEST_ERROR;
|
||||
if (h5repack_cmpdcpl(FNAME1,FNAME1OUT)<=0)
|
||||
TEST_ERROR;
|
||||
if (h5repack_end (&pack_options)<0)
|
||||
TEST_ERROR;
|
||||
PASSED();
|
||||
@ -91,9 +89,7 @@ int main (void)
|
||||
TEST_ERROR;
|
||||
if (h5repack_verify(FNAME2OUT,&pack_options)<=0)
|
||||
TEST_ERROR;
|
||||
if (h5repack_cmpdcpl(FNAME2,FNAME2OUT)<=0)
|
||||
TEST_ERROR;
|
||||
if (h5repack_end (&pack_options)<0)
|
||||
if (h5repack_end (&pack_options)<0)
|
||||
TEST_ERROR;
|
||||
PASSED();
|
||||
|
||||
@ -111,9 +107,7 @@ int main (void)
|
||||
TEST_ERROR;
|
||||
if (h5repack_verify(FNAME3OUT,&pack_options)<=0)
|
||||
TEST_ERROR;
|
||||
if (h5repack_cmpdcpl(FNAME3,FNAME3OUT)<=0)
|
||||
TEST_ERROR;
|
||||
if (h5repack_end (&pack_options)<0)
|
||||
if (h5repack_end (&pack_options)<0)
|
||||
TEST_ERROR;
|
||||
|
||||
PASSED();
|
||||
|
Loading…
Reference in New Issue
Block a user