summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2007-01-08 14:54:12 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2007-01-08 14:54:12 (GMT)
commit77a2e54459cee60effc94513bdb047dbf2ef847b (patch)
tree810b00b0eb408c86d3edce96884c61ab851c6516
parent7fc6a486b94dcd8eff19db8816d9ab3b0bbeb440 (diff)
downloadhdf5-77a2e54459cee60effc94513bdb047dbf2ef847b.zip
hdf5-77a2e54459cee60effc94513bdb047dbf2ef847b.tar.gz
hdf5-77a2e54459cee60effc94513bdb047dbf2ef847b.tar.bz2
[svn-r13119] More code cleanup. Made shared messages zero-indexed instead of
one-indexed. Changed the names of some constants to be more consistent. Tested on juniper, smirom, and copper.
-rw-r--r--examples/h5_shared_mesg.c16
-rw-r--r--src/H5Fsuper.c6
-rw-r--r--src/H5Omessage.c3
-rw-r--r--src/H5Oprivate.h16
-rw-r--r--src/H5Opublic.h5
-rw-r--r--src/H5Oshared.c7
-rw-r--r--src/H5Pfcpl.c55
-rwxr-xr-xsrc/H5SM.c16
-rw-r--r--src/H5SMcache.c2
-rwxr-xr-xtest/objcopy.c2
-rw-r--r--test/tattr.c2
-rw-r--r--test/tsohm.c123
12 files changed, 114 insertions, 139 deletions
diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c
index f6e806c..4094b21 100644
--- a/examples/h5_shared_mesg.c
+++ b/examples/h5_shared_mesg.c
@@ -111,7 +111,7 @@ int main(void)
* it holds. For the simple case, we'll put every message that could be
* shared in this single index.
*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 40);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 40);
if(ret < 0) goto error;
/* The other property that can be set for shared messages is the
@@ -147,7 +147,7 @@ int main(void)
* will be about the same size as a normal file (with just a little extra
* overhead).
*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 1000);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 1000);
if(ret < 0) goto error;
ret = create_standard_file("only_huge_mesgs_file.h5", fcpl_id);
@@ -158,22 +158,22 @@ int main(void)
* attributes (which might make sense if we were going to use committed
* datatypes). We could change the flags on the index:
*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG | H5O_MESG_ATTR_FLAG, 40);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG | H5O_MESG_ATTR_FLAG, 40);
if(ret < 0) goto error;
ret = create_standard_file("only_dspaces_and_attrs_file.h5", fcpl_id);
if(ret < 0) goto error;
- /* We create a second index and put attributes in it to separate them from
- * datatypes and dataspaces (and then run some performance metrics to
+ /* We could create a second index and put attributes in it to separate them
+ * from datatypes and dataspaces (and then run some performance metrics to
* see whether this improved caching performance).
*/
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
if(ret < 0) goto error;
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG | H5O_MESG_SDSPACE_FLAG, 40);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_DTYPE_FLAG | H5O_MESG_SDSPACE_FLAG, 40);
if(ret < 0) goto error;
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_ATTR_FLAG, 40);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ATTR_FLAG, 40);
if(ret < 0) goto error;
ret = create_standard_file("separate_indexes_file.h5", fcpl_id);
@@ -186,7 +186,7 @@ int main(void)
*/
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
if(ret < 0) goto error;
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 40);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 40);
if(ret < 0) goto error;
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 5, 0);
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 821981c..d8c5d0e 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -372,12 +372,12 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc, haddr_t addr,
* fcpl */
if(shared->sohm_addr != HADDR_UNDEF)
{
- unsigned index_flags[H5SM_MAX_NINDEXES] = {0};
- unsigned minsizes[H5SM_MAX_NINDEXES] = {0};
+ unsigned index_flags[H5O_SHMESG_MAX_NINDEXES] = {0};
+ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES] = {0};
unsigned sohm_l2b; /* SOHM list-to-btree cutoff */
unsigned sohm_b2l; /* SOHM btree-to-list cutoff */
- HDassert(shared->sohm_nindexes > 0 && shared->sohm_nindexes <= H5SM_MAX_NINDEXES);
+ HDassert(shared->sohm_nindexes > 0 && shared->sohm_nindexes <= H5O_SHMESG_MAX_NINDEXES);
/* Read in the shared OH message information if there is any */
if(H5SM_get_info(f, index_flags, minsizes, &sohm_l2b, &sohm_b2l, dxpl_id) < 0)
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index 515e131..c7979d4 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -307,8 +307,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* JAMES: this will probably get put through its paces when extending shared
- * dataspaces */
herr_t
H5O_msg_write(H5O_loc_t *loc, unsigned type_id, unsigned overwrite,
unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id)
@@ -1362,7 +1360,6 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type,
} /* end if */
else {
/* If the message is shared, get the real message it points to */
- /* JAMES: test */
if(idx_msg->flags & H5O_MSG_FLAG_SHARED) {
if(NULL == (native_mesg = H5O_shared_read(f, dxpl_id,
idx_msg->native, idx_msg->type, NULL)))
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 9330d4a..392b223 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -46,21 +46,14 @@ typedef struct H5O_msg_class_t H5O_msg_class_t;
typedef struct H5O_t H5O_t;
/* JAMES: should these be in H5SM_private? or renamed? */
-/* JAMES: causes errors encoding/decoding if this is wrong. Can't be constant. */
+/* Fractal heap ID type for shared message heap IDs. The length of a heap ID
+ * depends on how the heap is configured; currently they're always stored in
+ * 8-byte fields, although only seven bytes are used.
+ */
#define H5SM_FHEAP_ID_LEN 7
-
-/* JAMES: not great? */
typedef uint64_t H5SM_fheap_id_t;
-/* JAMES for debugging */
-#define PRINT_BUF(buf, size) \
- if(1) { size_t x; \
- for(x=0; x<size; ++x) { \
- printf("%d ", *(((uint8_t *) buf) + x)); \
- } printf("\n"); }
-
-
/* Object header macros */
#define H5O_MESG_MAX_SIZE 65536 /*max obj header message size */
#define H5O_ALL (-1) /* Operate on all messages of type */
@@ -150,7 +143,6 @@ typedef struct H5O_shared_t {
H5O_loc_t oloc; /*object location info */
H5SM_fheap_id_t heap_id; /* ID within the SOHM heap */
} u;
- /* JAMES: add hash value? */
} H5O_shared_t;
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 4d4e59b..9ce8429 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -62,9 +62,8 @@
/* Maximum shared message values. Number of indexes is 8 to allow room to add
* new types of messages.
*/
-/* JAMES: make these H5O* */
-#define H5SM_MAX_NINDEXES 8
-#define H5SM_MAX_LIST_ELEMS 5000
+#define H5O_SHMESG_MAX_NINDEXES 8
+#define H5O_SHMESG_MAX_LIST_SIZE 5000
/*******************/
/* Public Typedefs */
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 579e08f..4112865 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -223,9 +223,6 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, const H5O_shared_t *shared, int adj
/* check args */
HDassert(f);
HDassert(shared);
- /* JAMES
- * NEW THOUGHT: I should increment SOHM ref count here (or in a parallel function)
- */
/*
* The shared message is stored in some other object header.
@@ -562,10 +559,6 @@ H5O_shared_link(H5F_t *f, hid_t dxpl_id, const void *_mesg)
HDassert(f);
HDassert(shared);
- /* JAMES_HEAP: see comment in link_adj. Unneccessary except for shared attributes, I think,
- * and they may yet take care of themselves.
- */
-
/* Increment the reference count on the shared object */
if(H5O_shared_link_adj(f, dxpl_id, shared, 1) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count")
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 35171e6..549b33f 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -75,9 +75,9 @@
/* Definitions for shared object header messages */
#define H5F_CRT_SHMSG_NINDEXES_SIZE sizeof(unsigned)
#define H5F_CRT_SHMSG_NINDEXES_DEF (0)
-#define H5F_CRT_SHMSG_INDEX_TYPES_SIZE sizeof(unsigned[H5SM_MAX_NINDEXES])
+#define H5F_CRT_SHMSG_INDEX_TYPES_SIZE sizeof(unsigned[H5O_SHMESG_MAX_NINDEXES])
#define H5F_CRT_SHMSG_INDEX_TYPES_DEF {0,0,0,0,0,0}
-#define H5F_CRT_SHMSG_INDEX_MINSIZE_SIZE sizeof(unsigned[H5SM_MAX_NINDEXES])
+#define H5F_CRT_SHMSG_INDEX_MINSIZE_SIZE sizeof(unsigned[H5O_SHMESG_MAX_NINDEXES])
#define H5F_CRT_SHMSG_INDEX_MINSIZE_DEF {250,250,250,250,250,250}
/* Definitions for shared object header list/btree phase change cutoffs */
#define H5F_CRT_SHMSG_LIST_MAX_SIZE sizeof(unsigned)
@@ -158,8 +158,8 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass)
unsigned objectdir_ver = H5F_CRT_OBJ_DIR_VERS_DEF; /* Default object directory version # */
unsigned sharedheader_ver = H5F_CRT_SHARE_HEAD_VERS_DEF; /* Default shared header message version # */
unsigned num_sohm_indexes = H5F_CRT_SHMSG_NINDEXES_DEF;
- unsigned sohm_index_flags[H5SM_MAX_NINDEXES] = H5F_CRT_SHMSG_INDEX_TYPES_DEF;
- unsigned sohm_index_minsizes[H5SM_MAX_NINDEXES] = H5F_CRT_SHMSG_INDEX_MINSIZE_DEF;
+ unsigned sohm_index_flags[H5O_SHMESG_MAX_NINDEXES] = H5F_CRT_SHMSG_INDEX_TYPES_DEF;
+ unsigned sohm_index_minsizes[H5O_SHMESG_MAX_NINDEXES] = H5F_CRT_SHMSG_INDEX_MINSIZE_DEF;
unsigned sohm_list_max = H5F_CRT_SHMSG_LIST_MAX_DEF;
unsigned sohm_btree_min = H5F_CRT_SHMSG_BTREE_MIN_DEF;
herr_t ret_value = SUCCEED; /* Return value */
@@ -690,7 +690,9 @@ done:
* zero then shared object header messages are disabled
* for this file.
*
- * These indexes can be configured with JAMES
+ * These indexes can then be configured with
+ * H5Pset_shared_mesg_index. H5Pset_shared_mesg_phase_chage
+ * also controls settings for all indexes.
*
* Return: Non-negative on success/Negative on failure
*
@@ -709,8 +711,8 @@ H5Pset_shared_mesg_nindexes(hid_t plist_id, unsigned nindexes)
H5TRACE2("e", "iIu", plist_id, nindexes);
/* Check argument */
- if (nindexes > H5SM_MAX_NINDEXES)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "number of indexes is greater than H5SM_MAX_NINDEXES");
+ if (nindexes > H5O_SHMESG_MAX_NINDEXES)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "number of indexes is greater than H5O_SHMESG_MAX_NINDEXES");
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
@@ -765,6 +767,9 @@ done:
* message that should be stored in this index and the minimum
* size of a message in the index.
*
+ * INDEX_NUM is zero-indexed (in a file with three indexes,
+ * they are numbered 0, 1, and 2).
+ *
* Return: Non-negative on success/Negative on failure
*
* Programmer: James Laird
@@ -777,16 +782,14 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
{
H5P_genplist_t *plist; /* Property list pointer */
unsigned nindexes; /* Number of SOHM indexes */
- unsigned type_flags[H5SM_MAX_NINDEXES]; /* Array of mesg_type_flags*/
- unsigned minsizes[H5SM_MAX_NINDEXES]; /* Array of min_mesg_sizes*/
+ unsigned type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Array of mesg_type_flags*/
+ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Array of min_mesg_sizes*/
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_shared_mesg_index, FAIL)
H5TRACE4("e", "iIuIuIu", plist_id, index_num, mesg_type_flags, min_mesg_size);
/* Check arguments */
- if(index_num == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index_num must be at least 1");
if(mesg_type_flags > H5O_MESG_ALL_FLAG)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "unrecognized flags in mesg_type_flags");
@@ -799,8 +802,8 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of indexes");
/* Range check */
- if(index_num > nindexes)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index_num is greater than number of indexes in property list");
+ if(index_num >= nindexes)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index_num is too large; no such index");
/* Get arrays of type flags and message sizes */
if(H5P_get(plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, type_flags) < 0)
@@ -809,8 +812,8 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get current min sizes")
/* Set values in arrays */
- type_flags[index_num - 1] = mesg_type_flags;
- minsizes[index_num - 1] = min_mesg_size;
+ type_flags[index_num] = mesg_type_flags;
+ minsizes[index_num] = min_mesg_size;
/* Write arrays back to plist */
if(H5P_set(plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, type_flags) < 0)
@@ -842,18 +845,14 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type
{
H5P_genplist_t *plist; /* Property list pointer */
unsigned nindexes; /* Number of SOHM indexes */
- unsigned type_flags[H5SM_MAX_NINDEXES]; /* Array of mesg_type_flags*/
- unsigned minsizes[H5SM_MAX_NINDEXES]; /* Array of min_mesg_sizes*/
+ unsigned type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Array of mesg_type_flags*/
+ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Array of min_mesg_sizes*/
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pget_shared_mesg_index, FAIL);
H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags,
min_mesg_size);
- /* Check arguments */
- if(index_num == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index_num must be at least 1")
-
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
@@ -862,7 +861,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type
if(H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of indexes")
- if(index_num > nindexes)
+ if(index_num >= nindexes)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index_num is greater than number of indexes in property list")
/* Get arrays of type flags and message sizes */
@@ -873,9 +872,9 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type
/* Get values from arrays */
if(mesg_type_flags)
- *mesg_type_flags = type_flags[index_num - 1];
+ *mesg_type_flags = type_flags[index_num];
if(min_mesg_size)
- *min_mesg_size = minsizes[index_num - 1];
+ *min_mesg_size = minsizes[index_num];
done:
FUNC_LEAVE_API(ret_value);
@@ -917,10 +916,10 @@ H5Pset_shared_mesg_phase_change(hid_t plist_id, unsigned max_list, unsigned min_
*/
if(max_list + 1 < min_btree)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "minimum B-tree value is greater than maximum list value")
- if(max_list > H5SM_MAX_LIST_ELEMS)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "max list value is larger than H5SM_MAX_LIST_ELEMS")
- if(min_btree > H5SM_MAX_LIST_ELEMS)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "min btree value is larger than H5SM_MAX_LIST_ELEMS")
+ if(max_list > H5O_SHMESG_MAX_LIST_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "max list value is larger than H5O_SHMESG_MAX_LIST_SIZE")
+ if(min_btree > H5O_SHMESG_MAX_LIST_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "min btree value is larger than H5O_SHMESG_MAX_LIST_SIZE")
/* Avoid the strange case where max_list == 0 and min_btree == 1, so deleting the
* last message in a B-tree makes it become an empty list.
diff --git a/src/H5SM.c b/src/H5SM.c
index 74315d7..38d1b34 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -73,9 +73,9 @@ static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag);
/*********************/
H5FL_DEFINE(H5SM_master_table_t);
-H5FL_ARR_DEFINE(H5SM_index_header_t, H5SM_MAX_NINDEXES);
+H5FL_ARR_DEFINE(H5SM_index_header_t, H5O_SHMESG_MAX_NINDEXES);
H5FL_DEFINE(H5SM_list_t);
-H5FL_ARR_DEFINE(H5SM_sohm_t, H5SM_MAX_LIST_ELEMS);
+H5FL_ARR_DEFINE(H5SM_sohm_t, H5O_SHMESG_MAX_LIST_SIZE);
/*****************************/
@@ -111,8 +111,8 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, hid_t dxpl_id)
haddr_t table_addr = HADDR_UNDEF;
unsigned num_indexes;
unsigned list_max, btree_min;
- unsigned index_type_flags[H5SM_MAX_NINDEXES];
- unsigned minsizes[H5SM_MAX_NINDEXES];
+ unsigned index_type_flags[H5O_SHMESG_MAX_NINDEXES];
+ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES];
unsigned type_flags_used;
unsigned x;
hsize_t table_size;
@@ -141,7 +141,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, hid_t dxpl_id)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get SOHM message min sizes")
/* Verify that values are valid */
- if(num_indexes > H5SM_MAX_NINDEXES)
+ if(num_indexes > H5O_SHMESG_MAX_NINDEXES)
HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "number of indexes in property list is too large")
/* Check that type flags weren't duplicated anywhere */
@@ -168,7 +168,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, hid_t dxpl_id)
* min.
*/
HDassert(list_max + 1 >= btree_min);
- HDassert(table->num_indexes > 0 && table->num_indexes <= H5SM_MAX_NINDEXES);
+ HDassert(table->num_indexes > 0 && table->num_indexes <= H5O_SHMESG_MAX_NINDEXES);
/* Allocate the SOHM indexes as an array. */
if(NULL == (table->indexes = (H5SM_index_header_t *)H5FL_ARR_MALLOC(H5SM_index_header_t, (size_t)table->num_indexes)))
@@ -439,7 +439,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id)
{
header->index_type = H5SM_LIST;
- if((list_addr = H5SM_create_list(f, header, dxpl_id)) == HADDR_UNDEF) /* JAMES: only allocate part of the list? */
+ if((list_addr = H5SM_create_list(f, header, dxpl_id)) == HADDR_UNDEF)
HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "list creation failed for SOHM index")
header->index_addr = list_addr;
@@ -937,7 +937,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5SM_index_header_t *header,
if (NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, NULL, header, H5AC_WRITE)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "unable to load SOHM index")
- /* JAMES: not very effecient (gets hash value twice, searches list twice). Refactor. */
+ /* JAMES: not very efficient (gets hash value twice, searches list twice). Refactor. */
/* See if the message is already in the index and get its location */
/* JAMES: should return a pointer to the message */
list_pos = H5SM_find_in_list(list, &key);
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index d4323b0..5e8f58f 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -44,7 +44,7 @@
/* Local Macros */
/****************/
/* JAMES: should this change according to address size? */
-#define H5F_LISTBUF_SIZE H5SM_LIST_SIZEOF_MAGIC + H5SM_MAX_LIST_ELEMS * 16
+#define H5F_LISTBUF_SIZE H5SM_LIST_SIZEOF_MAGIC + H5O_SHMESG_MAX_LIST_SIZE * 16
#define H5SM_LIST_VERSION 0 /* Verion of Shared Object Header Message List Indexes */
diff --git a/test/objcopy.c b/test/objcopy.c
index f321a25..8778ad4 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -7115,7 +7115,7 @@ main(void)
/* Create an FCPL with sharing enabled */
if((fcpl_shared = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR
if(H5Pset_shared_mesg_nindexes(fcpl_shared, 1) < 0) TEST_ERROR
- if(H5Pset_shared_mesg_index(fcpl_shared, 1, H5O_MESG_ALL_FLAG, (size_t) 10) < 0) TEST_ERROR
+ if(H5Pset_shared_mesg_index(fcpl_shared, 0, H5O_MESG_ALL_FLAG, (size_t) 10) < 0) TEST_ERROR
/* Test in all configurations */
for(configuration = 0; configuration <= MAX_CONFIGURATION; configuration++) {
diff --git a/test/tattr.c b/test/tattr.c
index cc0200d..99e03ab 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -2968,7 +2968,7 @@ test_attr(void)
/* Make attributes > 1 byte shared (i.e. all of them :-) */
ret = H5Pset_shared_mesg_nindexes(fcpl2, (unsigned)1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl2, (unsigned)1, H5O_MESG_ATTR_FLAG, (unsigned)1);
+ ret = H5Pset_shared_mesg_index(fcpl2, (unsigned)0, H5O_MESG_ATTR_FLAG, (unsigned)1);
CHECK_I(ret, "H5Pset_shared_mesg_index");
#ifndef QAK
diff --git a/test/tsohm.c b/test/tsohm.c
index 3bdb340..23a2975 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -24,20 +24,20 @@
/* Default SOHM values */
#define DEF_NUM_INDEXES 0
-const unsigned def_type_flags[H5SM_MAX_NINDEXES] = {0,0,0,0,0,0};
-const unsigned def_minsizes[H5SM_MAX_NINDEXES] = {250,250,250,250,250,250};
+const unsigned def_type_flags[H5O_SHMESG_MAX_NINDEXES] = {0,0,0,0,0,0};
+const unsigned def_minsizes[H5O_SHMESG_MAX_NINDEXES] = {250,250,250,250,250,250};
#define DEF_L2B 50
#define DEF_B2L 40
/* Non-default SOHM values for testing */
#define TEST_NUM_INDEXES 4
-const unsigned test_type_flags[H5SM_MAX_NINDEXES] =
+const unsigned test_type_flags[H5O_SHMESG_MAX_NINDEXES] =
{H5O_MESG_FILL_FLAG,
H5O_MESG_DTYPE_FLAG | H5O_MESG_ATTR_FLAG,
H5O_MESG_SDSPACE_FLAG,
H5O_MESG_PLINE_FLAG,
0, 0};
-const unsigned test_minsizes[H5SM_MAX_NINDEXES] = {0, 2, 40, 100, 3, 1000};
+const unsigned test_minsizes[H5O_SHMESG_MAX_NINDEXES] = {0, 2, 40, 100, 3, 1000};
#define TEST_L2B 65
#define TEST_B2L 64
@@ -55,7 +55,7 @@ const unsigned test_minsizes[H5SM_MAX_NINDEXES] = {0, 2, 40, 100, 3, 1000};
typedef struct dtype1_struct {
int i1;
- char str[10]; /* JAMES */
+ char str[10];
int i2;
int i3;
int i4;
@@ -176,12 +176,12 @@ static void check_fcpl_values(hid_t fcpl_id, const unsigned nindexes_in,
VERIFY(num_indexes, nindexes_in, "H5Pget_shared_mesg_nindexes");
/* Verify index flags and minsizes are set */
- for(x=1; x<=num_indexes; ++x)
+ for(x=0; x<num_indexes; ++x)
{
ret = H5Pget_shared_mesg_index(fcpl_id, x, &index_flags, &min_mesg_size);
CHECK_I(ret, "H5Pget_shared_mesg_index");
- VERIFY(index_flags, flags_in[x-1], "H5Pget_shared_mesg_index");
- VERIFY(min_mesg_size, minsizes_in[x-1], "H5Pget_shared_mesg_index");
+ VERIFY(index_flags, flags_in[x], "H5Pget_shared_mesg_index");
+ VERIFY(min_mesg_size, minsizes_in[x], "H5Pget_shared_mesg_index");
}
/* Check list-to-btree and btree-to-list values */
@@ -259,9 +259,9 @@ static void test_sohm_fcpl(void)
/* Set up index values */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, TEST_NUM_INDEXES);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- for(x=1; x<=TEST_NUM_INDEXES; ++x)
+ for(x=0; x<TEST_NUM_INDEXES; ++x)
{
- ret = H5Pset_shared_mesg_index(fcpl_id, x, test_type_flags[x-1], test_minsizes[x-1]);
+ ret = H5Pset_shared_mesg_index(fcpl_id, x, test_type_flags[x], test_minsizes[x]);
CHECK_I(ret, "H5Pset_shared_mesg_index");
}
@@ -305,31 +305,32 @@ static void test_sohm_fcpl(void)
/* Test giving bogus values to H5P* functions */
H5E_BEGIN_TRY {
/* Trying to create too many indexes should fail */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5SM_MAX_NINDEXES + 1);
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES + 1);
VERIFY(ret, -1, "H5Pset_shared_mesg_nindexes");
- /* Trying to set index 0 or an index higher than the current number
+ /* Trying to set index to an index higher than the current number
* of indexes should fail.
*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, 0, 15);
+ ret = H5Pset_shared_mesg_index(fcpl_id, H5O_SHMESG_MAX_NINDEXES, 0, 15);
VERIFY(ret, -1, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, H5SM_MAX_NINDEXES + 1, 0, 15);
- VERIFY(ret, -1, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, TEST_NUM_INDEXES + 1, 0, 15);
+ ret = H5Pset_shared_mesg_index(fcpl_id, TEST_NUM_INDEXES, 0, 15);
VERIFY(ret, -1, "H5Pset_shared_mesg_index");
/* Setting an unknown flag (all flags + 1) should fail */
ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG + 1, 15);
VERIFY(ret, -1, "H5Pset_shared_mesg_index");
- /* Try setting two different indexes to hold fill messages */
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_FILL_FLAG, 15 /* JAMES */);
+ /* Try setting two different indexes to hold fill messages. They
+ * should hold even very small messages for testing, even though we
+ * wouldn't really want to share such tiny messages in the real world.
+ */
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_FILL_FLAG, 15);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_FILL_FLAG, 15 /* JAMES */);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_FILL_FLAG, 15);
CHECK_I(ret, "H5Pset_shared_mesg_index");
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
VERIFY(fid, -1, "H5Fcreate");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG, 15 /* JAMES */);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG, 15);
CHECK_I(ret, "H5Pset_shared_mesg_index");
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
VERIFY(fid, -1, "H5Fcreate");
@@ -341,11 +342,11 @@ static void test_sohm_fcpl(void)
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, 12);
VERIFY(ret, -1, "H5Pset_shared_mesg_phase_change");
/* Setting them to extremely large values should also fail */
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5SM_MAX_LIST_ELEMS + 1, 0);
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5O_SHMESG_MAX_LIST_SIZE + 1, 0);
VERIFY(ret, -1, "H5Pset_shared_mesg_phase_change");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, H5SM_MAX_LIST_ELEMS + 10);
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, H5O_SHMESG_MAX_LIST_SIZE + 10);
VERIFY(ret, -1, "H5Pset_shared_mesg_phase_change");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5SM_MAX_LIST_ELEMS, H5SM_MAX_LIST_ELEMS+1);
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5O_SHMESG_MAX_LIST_SIZE, H5O_SHMESG_MAX_LIST_SIZE+1);
VERIFY(ret, -1, "H5Pset_shared_mesg_phase_change");
} H5E_END_TRY
@@ -355,7 +356,7 @@ static void test_sohm_fcpl(void)
* have corrupted the fcpl, although we do need to reset the
* second index that we changed above.
*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, test_type_flags[1], 15 /* JAMES */);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, test_type_flags[1], 15 /* JAMES */);
CHECK_I(ret, "H5Pset_shared_mesg_index");
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, 11);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
@@ -364,13 +365,13 @@ static void test_sohm_fcpl(void)
ret = H5Fclose(fid);
CHECK_I(ret, "H5Fclose");
- /* Test edge cases; H5SM_MAX_NINDEXES and H5SM_MAX_LIST_ELEMS should be
+ /* Test edge cases; H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be
* valid values. Also, creating a file with uninitialized indexes
* (indexes 3-5) should work.
*/
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5SM_MAX_NINDEXES);
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5SM_MAX_LIST_ELEMS, H5SM_MAX_LIST_ELEMS);
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5O_SHMESG_MAX_LIST_SIZE, H5O_SHMESG_MAX_LIST_SIZE);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(fid, "H5Fcreate");
@@ -796,7 +797,7 @@ static void test_sohm_size1(void)
/* Tests one index holding only datatype messages */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, num_indexes);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, index_flags, min_mesg_size);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, index_flags, min_mesg_size);
CHECK_I(ret, "H5Pset_shared_mesg_index");
ret = H5Pset_shared_mesg_phase_change(fcpl_id, list_max, btree_min);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
@@ -849,7 +850,7 @@ static void test_sohm_size1(void)
/* Tests one index holding only datatype messages */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, num_indexes);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, index_flags, min_mesg_size);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, index_flags, min_mesg_size);
CHECK_I(ret, "H5Pset_shared_mesg_index");
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
@@ -1075,42 +1076,42 @@ static void test_sohm_attrs(void)
/* Run tests with only one kind of message to be shared */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ATTR_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
/* Verify */
sohm_attr_helper(fcpl_id);
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_DTYPE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
/* Run with any two types shared */
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ATTR_FLAG | H5O_MESG_DTYPE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ATTR_FLAG | H5O_MESG_DTYPE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG | H5O_MESG_ATTR_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG | H5O_MESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
/* Run test with all three kinds of message shared */
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG | H5O_MESG_ATTR_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG | H5O_MESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
@@ -1119,19 +1120,19 @@ static void test_sohm_attrs(void)
/* Try using two indexes */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ATTR_FLAG | H5O_MESG_DTYPE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ATTR_FLAG | H5O_MESG_DTYPE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_SDSPACE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_DTYPE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_ATTR_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ATTR_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
@@ -1140,7 +1141,7 @@ static void test_sohm_attrs(void)
/* One index for each kind of message */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 3);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 3, H5O_MESG_SDSPACE_FLAG, 2);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_SDSPACE_FLAG, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
sohm_attr_helper(fcpl_id);
@@ -1932,7 +1933,7 @@ static void test_sohm_size2(int close_reopen)
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 20);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Set the indexes to use a medium-sized list */
@@ -1983,11 +1984,11 @@ static void test_sohm_size2(int close_reopen)
/* JAMES: should be zero-indexed? */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 3);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG, 20);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_FILL_FLAG | H5O_MESG_PLINE_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_FILL_FLAG | H5O_MESG_PLINE_FLAG, 20);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, 3, H5O_MESG_ATTR_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_ATTR_FLAG, 20);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Use lists that are the same size as the "medium" list on the previous
@@ -2012,18 +2013,12 @@ static void test_sohm_size2(int close_reopen)
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
/* Edit the same property list (this should work) and don't share all messages.
- * Also create one index that holds no messages, to make sure this doesn't
- * break anything.
*/
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, 3);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_PLINE_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_PLINE_FLAG, 20);
CHECK_I(ret, "H5Pset_shared_mesg_index");
-/* JAMES ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_NONE_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG, 100000);
CHECK_I(ret, "H5Pset_shared_mesg_index");
-*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG, 100000);
- ret = H5Pset_shared_mesg_index(fcpl_id, 3, H5O_MESG_ATTR_FLAG | H5O_MESG_SDSPACE_FLAG, 20);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_ATTR_FLAG | H5O_MESG_SDSPACE_FLAG, 20);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Use "normal-sized" lists. */
@@ -2044,7 +2039,7 @@ static void test_sohm_size2(int close_reopen)
/* Change the second index to hold only gigantic messages. Result should
* be the same as the previous file.
*/
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG, 100000);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG, 100000);
CHECK_I(ret, "H5Pset_shared_mesg_index");
share_some_toobig_index = size2_helper(fcpl_id, close_reopen);
@@ -2058,14 +2053,14 @@ static void test_sohm_size2(int close_reopen)
* as one gains from sharing them.
*/
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG | H5O_MESG_SDSPACE_FLAG, 1);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_DTYPE_FLAG | H5O_MESG_SDSPACE_FLAG, 1);
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 1000, 900);
share_tiny_index = size2_helper(fcpl_id, close_reopen);
size2_verify();
/* Create the same file but don't share the really tiny messages */
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG | H5O_MESG_SDSPACE_FLAG, 100);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_DTYPE_FLAG | H5O_MESG_SDSPACE_FLAG, 100);
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 1000, 900);
type_space_index = size2_helper(fcpl_id, close_reopen);
@@ -2715,7 +2710,7 @@ test_sohm_delete(void)
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 16);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
@@ -2744,9 +2739,9 @@ test_sohm_delete(void)
/* Use two indexes */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG | H5O_MESG_ATTR_FLAG, 16);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_SDSPACE_FLAG | H5O_MESG_ATTR_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_DTYPE_FLAG, 16);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Use big list indexes */
@@ -2900,9 +2895,9 @@ test_sohm_delete_revert(void)
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_DTYPE_FLAG, 10);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_DTYPE_FLAG, 10);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_MESG_SDSPACE_FLAG, 10);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_SDSPACE_FLAG, 10);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Call the helper function to test this FCPL. */
@@ -2917,7 +2912,7 @@ test_sohm_delete_revert(void)
/* Try sharing all messages */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 10);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 10);
CHECK_I(ret, "H5Pset_shared_mesg_index");
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, 5);
@@ -3032,7 +3027,7 @@ test_sohm_extlink(void)
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_MESG_ALL_FLAG, 16);
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_MESG_ALL_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Test using external links when the source or destination file uses