summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_opttable.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-30 22:59:33 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-30 22:59:33 (GMT)
commitd8531b84827b78bc481ccdac77693fb9247ba979 (patch)
treee16e1dd108cccef622c4e1f4c459fba6fc224cbe /tools/h5repack/h5repack_opttable.c
parent95da5842dfd4caaca02460a6ff1ffa22b8b9a312 (diff)
downloadhdf5-d8531b84827b78bc481ccdac77693fb9247ba979.zip
hdf5-d8531b84827b78bc481ccdac77693fb9247ba979.tar.gz
hdf5-d8531b84827b78bc481ccdac77693fb9247ba979.tar.bz2
[svn-r7997] Purpose:
h5repack new features Description: added support for layout options Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_opttable.c')
-rw-r--r--tools/h5repack/h5repack_opttable.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c
index 0571656..a18c508 100644
--- a/tools/h5repack/h5repack_opttable.c
+++ b/tools/h5repack/h5repack_opttable.c
@@ -52,6 +52,7 @@ int options_table_init( pack_opttbl_t **tbl )
table->objs[i].filter.cd_values[j] = -1;
table->objs[i].chunk.rank = -1;
table->objs[i].refobj_id = -1;
+ table->objs[i].layout = -1;
}
*tbl = table;
@@ -76,9 +77,9 @@ int options_table_free( pack_opttbl_t *table )
}
/*-------------------------------------------------------------------------
- * Function: options_add_chunk
+ * Function: options_add_layout
*
- * Purpose: add a chunking -c option to the option list
+ * Purpose: add a layout option to the option list
*
* Return: 0, ok, -1, fail
*
@@ -86,11 +87,10 @@ int options_table_free( pack_opttbl_t *table )
*/
-int options_add_chunk( obj_list_t *obj_list,
- int n_objs,
- hsize_t *chunk_lengths,
- int chunk_rank,
- pack_opttbl_t *table )
+int options_add_layout( obj_list_t *obj_list,
+ int n_objs,
+ pack_info_t *pack,
+ pack_opttbl_t *table )
{
int i, j, k, I, added=0, found=0;
@@ -108,8 +108,10 @@ int options_add_chunk( obj_list_t *obj_list,
table->objs[i].filter.cd_values[j] = -1;
table->objs[i].chunk.rank = -1;
table->objs[i].refobj_id = -1;
+ table->objs[i].layout = -1;
}
}
+
/* search if this object is already in the table; "path" is the key */
if (table->nelems>0)
@@ -129,12 +131,15 @@ int options_add_chunk( obj_list_t *obj_list,
printf("Input Error: chunk information already inserted for <%s>\n",obj_list[j].obj);
exit(1);
}
- /* insert the chunk info */
+ /* insert the layout info */
else
{
- table->objs[i].chunk.rank = chunk_rank;
- for (k = 0; k < chunk_rank; k++)
- table->objs[i].chunk.chunk_lengths[k] = chunk_lengths[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];
+ }
found=1;
break;
}
@@ -147,9 +152,12 @@ int options_add_chunk( obj_list_t *obj_list,
I = table->nelems + added;
added++;
strcpy(table->objs[I].path,obj_list[j].obj);
- table->objs[I].chunk.rank = chunk_rank;
- for (k = 0; k < chunk_rank; k++)
- table->objs[I].chunk.chunk_lengths[k] = chunk_lengths[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];
+ }
}
} /* j */
}
@@ -163,9 +171,12 @@ int options_add_chunk( obj_list_t *obj_list,
I = table->nelems + added;
added++;
strcpy(table->objs[I].path,obj_list[j].obj);
- table->objs[I].chunk.rank = chunk_rank;
- for (k = 0; k < chunk_rank; k++)
- table->objs[I].chunk.chunk_lengths[k] = chunk_lengths[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];
+ }
}
}
@@ -208,6 +219,7 @@ int options_add_filter(obj_list_t *obj_list,
table->objs[i].filter.cd_values[j] = -1;
table->objs[i].chunk.rank = -1;
table->objs[i].refobj_id = -1;
+ table->objs[i].layout = -1;
}
}