summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/h5repack/h5repack.c22
-rwxr-xr-xtools/h5repack/h5repack.sh.in1
-rw-r--r--tools/h5repack/h5repack_opttable.c22
-rw-r--r--tools/h5repack/h5repack_parse.c9
-rw-r--r--tools/h5repack/testh5repack_main.c10
5 files changed, 43 insertions, 21 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index f9cb295..c0cc918 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -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;
}
}
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index 98b46ba..9e0be8e 100755
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -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
diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c
index cf76e82..d85e1f5 100644
--- a/tools/h5repack/h5repack_opttable.c
+++ b/tools/h5repack/h5repack_opttable.c
@@ -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];
+ }
}
}
diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c
index e6974c0..8f548b0 100644
--- a/tools/h5repack/h5repack_parse.c
+++ b/tools/h5repack/h5repack_parse.c
@@ -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);
diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c
index 8c1239f..dabc1aa 100644
--- a/tools/h5repack/testh5repack_main.c
+++ b/tools/h5repack/testh5repack_main.c
@@ -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();