diff options
-rw-r--r-- | c++/src/H5FcreatProp.cpp | 22 | ||||
-rw-r--r-- | c++/src/H5FcreatProp.h | 9 | ||||
-rw-r--r-- | c++/test/tfile.cpp | 12 | ||||
-rw-r--r-- | doc/html/cpplus/CppInterfaces.html | 4 | ||||
-rw-r--r-- | src/H5P.c | 126 | ||||
-rw-r--r-- | src/H5Ppublic.h | 5 | ||||
-rw-r--r-- | test/tfile.c | 8 |
7 files changed, 184 insertions, 2 deletions
diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 7d6fc62..0e98cfd 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -72,6 +72,27 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con } } +#ifdef H5_WANT_H5_V1_4_COMPAT +void FileCreatPropList::setSymk( int ik, int lk ) const +{ + herr_t ret_value = H5Pset_sym_k( id, ik, lk ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::setSymk", + "H5Pset_sym_k failed"); + } +} + +void FileCreatPropList::getSymk( int& ik, int& lk ) const +{ + herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); + if( ret_value < 0 ) + { + throw PropListIException("FileCreatPropList::getSymk", + "H5Pget_sym_k failed"); + } +} +#else /* H5_WANT_H5_V1_4_COMPAT */ void FileCreatPropList::setSymk( int ik, unsigned lk ) const { herr_t ret_value = H5Pset_sym_k( id, ik, lk ); @@ -91,6 +112,7 @@ void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const "H5Pget_sym_k failed"); } } +#endif /* H5_WANT_H5_V1_4_COMPAT */ void FileCreatPropList::setIstorek( int ik ) const { diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 9dda55c..54b615b 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -33,12 +33,21 @@ class FileCreatPropList : public PropList { // file according to this file creation property list. void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; +#ifdef H5_WANT_H5_V1_4_COMPAT + // Sets the size of parameters used to control the symbol table nodes. + void setSymk( int int_nodes_k, int leaf_nodes_k ) const; + + // Retrieves the size of the symbol table B-tree 1/2 rank and the + // symbol table leaf node 1/2 size. + void getSymk( int& int_nodes_k, int& leaf_nodes_k ) const; +#else /* H5_WANT_H5_V1_4_COMPAT */ // Sets the size of parameters used to control the symbol table nodes. void setSymk( int int_nodes_k, unsigned leaf_nodes_k ) const; // Retrieves the size of the symbol table B-tree 1/2 rank and the // symbol table leaf node 1/2 size. void getSymk( int& int_nodes_k, unsigned& leaf_nodes_k ) const; +#endif /* H5_WANT_H5_V1_4_COMPAT */ // Sets the size of parameter used to control the B-trees for // indexing chunked datasets. diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 0bb2a36..9b0f49d 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -135,7 +135,11 @@ test_file_create(void) VERIFY(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes"); int iparm1; /*file-creation parameters */ +#ifdef H5_WANT_H5_V1_4_COMPAT + int iparm2; /*file-creation parameters */ +#else /* H5_WANT_H5_V1_4_COMPAT */ unsigned iparm2; /*file-creation parameters */ +#endif /* H5_WANT_H5_V1_4_COMPAT */ tmpl1.getSymk( iparm1, iparm2); VERIFY(iparm1, F1_SYM_INTERN_K, "FileCreatPropList::getSymk"); VERIFY(iparm2, F1_SYM_LEAF_K, "FileCreatPropList::getSymk"); @@ -185,7 +189,11 @@ test_file_create(void) VERIFY(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes"); int iparm1; /*file-creation parameters */ +#ifdef H5_WANT_H5_V1_4_COMPAT + int iparm2; /*file-creation parameters */ +#else /* H5_WANT_H5_V1_4_COMPAT */ unsigned iparm2; /*file-creation parameters */ +#endif /* H5_WANT_H5_V1_4_COMPAT */ tmpl1->getSymk( iparm1, iparm2); VERIFY(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk"); VERIFY(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk"); @@ -269,7 +277,11 @@ test_file_open(void) VERIFY(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes"); int iparm1; /*file-creation parameters */ +#ifdef H5_WANT_H5_V1_4_COMPAT + int iparm2; /*file-creation parameters */ +#else /* H5_WANT_H5_V1_4_COMPAT */ unsigned iparm2; /*file-creation parameters */ +#endif /* H5_WANT_H5_V1_4_COMPAT */ tmpl1.getSymk( iparm1, iparm2); VERIFY(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk"); VERIFY(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk"); diff --git a/doc/html/cpplus/CppInterfaces.html b/doc/html/cpplus/CppInterfaces.html index 32abd35..083c353 100644 --- a/doc/html/cpplus/CppInterfaces.html +++ b/doc/html/cpplus/CppInterfaces.html @@ -814,11 +814,11 @@ class FileAccPropList : public PropList void getAlignment( hsize_t& threshold, hsize_t& alignment ) const; // Sets the meta data cache and raw data chunk cache parameters. - void setCache( int mdc_nelmts, int rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; + void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const; // Retrieves maximum sizes of data caches and the preemption // policy value. - void getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; + void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; // Sets garbage collecting references flag. void setGcReferences( unsigned gc_ref = 0 ) const; @@ -956,6 +956,131 @@ done: FUNC_LEAVE(ret_value); } +#ifdef H5_WANT_H5_V1_4_COMPAT + +/*------------------------------------------------------------------------- + * Function: H5Pset_sym_k + * + * Purpose: IK is one half the rank of a tree that stores a symbol + * table for a group. Internal nodes of the symbol table are on + * average 75% full. That is, the average rank of the tree is + * 1.5 times the value of IK. + * + * LK is one half of the number of symbols that can be stored in + * a symbol table node. A symbol table node is the leaf of a + * symbol table tree which is used to store a group. When + * symbols are inserted randomly into a group, the group's + * symbol table nodes are 75% full on average. That is, they + * contain 1.5 times the number of symbols specified by LK. + * + * Either (or even both) of IK and LK can be zero in which case + * that value is left unchanged. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Tuesday, January 6, 1998 + * + * Modifications: + * + * Raymond Lu, Oct 14, 2001 + * Changed to the new generic property list. + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_sym_k(hid_t plist_id, int ik, int lk) +{ + int btree_k[H5B_NUM_BTREE_ID]; + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value=FAIL; /* return value */ + + FUNC_ENTER(H5Pset_sym_k, FAIL); + H5TRACE3("e","iIsIu",plist_id,ik,lk); + + /* Check arguments */ + if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + + /* Get the plist structure */ + if(NULL == (plist = H5I_object(plist_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set values */ + if (ik > 0) { + if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes"); + btree_k[H5B_SNODE_ID] = ik; + if(H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree nodes"); + } + if (lk > 0) + if(H5P_set(plist, H5F_CRT_SYM_LEAF_NAME, &lk) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for symbol table leaf nodes"); + + /* Set return value */ + ret_value=SUCCEED; + +done: + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_sym_k + * + * Purpose: Retrieves the symbol table B-tree 1/2 rank (IK) and the + * symbol table leaf node 1/2 size (LK). See H5Pset_sym_k() for + * details. Either (or even both) IK and LK may be null + * pointers. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Wednesday, January 7, 1998 + * + * Modifications: + * + * Raymond Lu + * Changed to the new generic property list. + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , int *lk /*out */ ) +{ + int btree_k[H5B_NUM_BTREE_ID]; + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value=FAIL; /* return value */ + + FUNC_ENTER(H5Pget_sym_k, FAIL); + H5TRACE3("e","ixx",plist_id,ik,lk); + + /* Check arguments */ + if(TRUE != H5P_isa_class(plist_id, H5P_FILE_CREATE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + + /* Get the plist structure */ + if(NULL == (plist = H5I_object(plist_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Get values */ + if (ik) { + if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree nodes"); + *ik = btree_k[H5B_SNODE_ID]; + } + if (lk) + if(H5P_get(plist, H5F_CRT_SYM_LEAF_NAME, lk) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for symbol table leaf nodes"); + + /* Set return value */ + ret_value=SUCCEED; + +done: + FUNC_LEAVE(ret_value); +} +#else /* H5_WANT_H5_V1_4_COMPAT */ /*------------------------------------------------------------------------- * Function: H5Pset_sym_k @@ -1079,6 +1204,7 @@ H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , unsigned *lk /*out */ ) done: FUNC_LEAVE(ret_value); } +#endif /* H5_WANT_H5_V1_4_COMPAT */ /*------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 9a34f58..bd908f4 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -156,8 +156,13 @@ __DLL__ herr_t H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size); __DLL__ herr_t H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/, size_t *sizeof_size/*out*/); +#ifdef H5_WANT_H5_V1_4_COMPAT +__DLL__ herr_t H5Pset_sym_k(hid_t plist_id, int ik, int lk); +__DLL__ herr_t H5Pget_sym_k(hid_t plist_id, int *ik/*out*/, int *lk/*out*/); +#else /* H5_WANT_H5_V1_4_COMPAT */ __DLL__ herr_t H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk); __DLL__ herr_t H5Pget_sym_k(hid_t plist_id, int *ik/*out*/, unsigned *lk/*out*/); +#endif /* H5_WANT_H5_V1_4_COMPAT */ __DLL__ herr_t H5Pset_istore_k(hid_t plist_id, int ik); __DLL__ herr_t H5Pget_istore_k(hid_t plist_id, int *ik/*out*/); __DLL__ herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); diff --git a/test/tfile.c b/test/tfile.c index 5cc21f0..308188a 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -64,7 +64,11 @@ test_file_create(void) size_t parm; /*file-creation parameters */ size_t parm2; /*file-creation parameters */ int iparm; +#ifdef H5_WANT_H5_V1_4_COMPAT + int iparm2; +#else /* H5_WANT_H5_V1_4_COMPAT */ unsigned iparm2; +#endif /* H5_WANT_H5_V1_4_COMPAT */ herr_t ret; /*generic return value */ /* Output message about test being performed */ @@ -297,7 +301,11 @@ test_file_open(void) size_t parm; /*file-creation parameters */ size_t parm2; /*file-creation parameters */ int iparm; +#ifdef H5_WANT_H5_V1_4_COMPAT + int iparm2; +#else /* H5_WANT_H5_V1_4_COMPAT */ unsigned iparm2; +#endif /* H5_WANT_H5_V1_4_COMPAT */ herr_t ret; /*generic return value */ /* Output message about test being performed */ |