summaryrefslogtreecommitdiffstats
path: root/src/H5Pdcpl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-07-29 21:39:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-07-29 21:39:14 (GMT)
commit913adc97563247edb3e41ccaf827aae30a885b23 (patch)
treef3b496d60139c37a6dcbdc69005635e73ae3a579 /src/H5Pdcpl.c
parent7b93d00cd6446633d1d45705cf66d1353e241d1e (diff)
downloadhdf5-913adc97563247edb3e41ccaf827aae30a885b23.zip
hdf5-913adc97563247edb3e41ccaf827aae30a885b23.tar.gz
hdf5-913adc97563247edb3e41ccaf827aae30a885b23.tar.bz2
[svn-r17261] Description:
Refactoring dataset layout information to segregate the constant items from the variable items (at least from a storage standpoint). Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.7 (amazon) in debug mode Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r--src/H5Pdcpl.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 7ed1b96..0762fbf 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -48,22 +48,27 @@
/****************/
/* Define default layout information */
-#define H5D_DEF_LAYOUT_COMPACT_INIT {(hbool_t)FALSE, (size_t)0, NULL}
-#define H5D_DEF_LAYOUT_CONTIG_INIT {HADDR_UNDEF, (hsize_t)0}
-#define H5D_DEF_LAYOUT_CHUNK_INIT {H5D_CHUNK_BTREE, (unsigned)1, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NULL, {{HADDR_UNDEF, NULL}}}
+#define H5D_DEF_STORAGE_COMPACT_INIT {(hbool_t)FALSE, (size_t)0, NULL}
+#define H5D_DEF_STORAGE_CONTIG_INIT {HADDR_UNDEF}
+#define H5D_DEF_STORAGE_CHUNK_INIT {H5D_CHUNK_BTREE, {{HADDR_UNDEF}}}
+#define H5D_DEF_LAYOUT_CONTIG_INIT {(hsize_t)0}
+#define H5D_DEF_LAYOUT_CHUNK_INIT {H5D_CHUNK_BTREE, (unsigned)1, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, NULL, {{NULL}}}
#ifdef H5_HAVE_C99_DESIGNATED_INITIALIZER
-#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, { .compact = H5D_DEF_LAYOUT_COMPACT_INIT }}
-#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, { .contig = H5D_DEF_LAYOUT_CONTIG_INIT }}
-#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, { .chunk = H5D_DEF_LAYOUT_CHUNK_INIT }}
+#define H5D_DEF_STORAGE_COMPACT {H5D_COMPACT, { .compact = H5D_DEF_STORAGE_COMPACT_INIT }}
+#define H5D_DEF_STORAGE_CONTIG {H5D_CONTIGUOUS, { .contig = H5D_DEF_STORAGE_CONTIG_INIT }}
+#define H5D_DEF_STORAGE_CHUNK {H5D_CHUNKED, { .chunk = H5D_DEF_STORAGE_CHUNK_INIT }}
+#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, { .contig = H5D_DEF_LAYOUT_CONTIG_INIT }, H5D_DEF_STORAGE_COMPACT}
+#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, { .contig = H5D_DEF_LAYOUT_CONTIG_INIT }, H5D_DEF_STORAGE_CONTIG}
+#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, { .chunk = H5D_DEF_LAYOUT_CHUNK_INIT }, H5D_DEF_STORAGE_CHUNK}
#else /* H5_HAVE_C99_DESIGNATED_INITIALIZER */
/* Note that the compact & chunked layout initialization values are using the
* contiguous layout initialization in the union, because the contiguous
* layout is first in the union. These values are overridden in the
* H5P_init_def_layout() routine. -QAK
*/
-#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}}
-#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}}
-#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}}
+#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}}
+#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}}
+#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CONTIG_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}}
#endif /* H5_HAVE_C99_DESIGNATED_INITIALIZER */
/* ======== Dataset creation properties ======== */
@@ -264,12 +269,12 @@ H5P_dcrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data)
dst_layout.ops = NULL;
switch(dst_layout.type) {
case H5D_COMPACT:
- dst_layout.u.compact.buf = H5MM_xfree(dst_layout.u.compact.buf);
- HDmemset(&dst_layout.u.compact, 0, sizeof(dst_layout.u.compact));
+ dst_layout.store.u.compact.buf = H5MM_xfree(dst_layout.store.u.compact.buf);
+ HDmemset(&dst_layout.store.u.compact, 0, sizeof(dst_layout.store.u.compact));
break;
case H5D_CONTIGUOUS:
- dst_layout.u.contig.addr = HADDR_UNDEF;
+ dst_layout.store.u.contig.addr = HADDR_UNDEF;
dst_layout.u.contig.size = 0;
break;
@@ -762,14 +767,18 @@ done:
static herr_t
H5P_init_def_layout(void)
{
- const H5O_layout_compact_t def_compact = H5D_DEF_LAYOUT_COMPACT_INIT;
- const H5O_layout_chunk_t def_chunk = H5D_DEF_LAYOUT_CHUNK_INIT;
+ const H5O_layout_compact_t def_layout_compact = H5D_DEF_LAYOUT_COMPACT_INIT;
+ const H5O_layout_chunk_t def_layout_chunk = H5D_DEF_LAYOUT_CHUNK_INIT;
+ const H5O_storage_compact_t def_store_compact = H5D_DEF_STORAGE_COMPACT_INIT;
+ const H5O_storage_chunk_t def_store_chunk = H5D_DEF_STORAGE_CHUNK_INIT;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_init_def_layout)
/* Initialize the default layout info for non-contigous layouts */
- H5D_def_layout_compact_g.u.compact = def_compact;
+ H5D_def_layout_compact_g.u.compact = def_layout_compact;
+ H5D_def_layout_compact_g.store.u.compact = def_store_compact;
H5D_def_layout_chunk_g.u.chunk = def_chunk;
+ H5D_def_layout_compact_g.store.u.chunk = def_store_chunk;
/* Note that we've initialized the default values */
H5P_dcrt_def_layout_init_g = TRUE;