diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-15 06:26:08 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-15 06:26:08 (GMT) |
commit | 173083e1a5c9696be01bd983dd8c9bb87eb5a433 (patch) | |
tree | c8c4aa2dd961d18b48d0c734da3e16ea107e6c6f /src/H5FDfamily.c | |
parent | ec7ca0dea2fba8071ce57e4f61d685c3e4d0d111 (diff) | |
download | hdf5-173083e1a5c9696be01bd983dd8c9bb87eb5a433.zip hdf5-173083e1a5c9696be01bd983dd8c9bb87eb5a433.tar.gz hdf5-173083e1a5c9696be01bd983dd8c9bb87eb5a433.tar.bz2 |
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
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 (kagiso) 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 production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5FDfamily.c')
-rw-r--r-- | src/H5FDfamily.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index e259a4e..9817270 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -61,14 +61,19 @@ typedef struct H5FD_family_t { hid_t memb_fapl_id; /*file access property list for members */ hsize_t memb_size; /*actual size of each member file */ hsize_t pmem_size; /*member size passed in from property */ - hsize_t mem_newsize; /*new member size passed in as private - *property. It's used only by h5repart */ unsigned nmembs; /*number of family members */ unsigned amembs; /*number of member slots allocated */ H5FD_t **memb; /*dynamic array of member pointers */ haddr_t eoa; /*end of allocated addresses */ char *name; /*name generator printf format */ unsigned flags; /*flags for opening additional members */ + + /* Information from properties set by 'h5repart' tool */ + hsize_t mem_newsize; /*new member size passed in as private + * property. It's used only by h5repart */ + hbool_t repart_members; /* Whether to mark the superblock dirty + * when it is loaded, so that the family + * member sizes can be re-encoded */ } H5FD_family_t; /* Driver-specific file access properties */ @@ -741,9 +746,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_t *ret_value=NULL; char memb_name[4096], temp[4096]; hsize_t eof=HADDR_UNDEF; - hsize_t fam_newsize = 0; unsigned t_flags = flags & ~H5F_ACC_CREAT; - H5P_genplist_t *plist; /* Property list pointer */ FUNC_ENTER_NOAPI(H5FD_family_open, NULL) @@ -765,6 +768,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->mem_newsize = 0; /*New member size used by h5repart only */ } /* end if */ else { + H5P_genplist_t *plist; /* Property list pointer */ H5FD_family_fapl_t *fa; if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -772,11 +776,19 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, fa = (H5FD_family_fapl_t *)H5P_get_driver_info(plist); HDassert(fa); - /* New family file size. It's used by h5repart only. */ - if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) + /* Check for new family file size. It's used by h5repart only. */ + if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) { + hsize_t fam_newsize = 0; /* New member size, when repartitioning */ + + /* Get the new family file size */ if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &fam_newsize) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get new family member size") + /* Store information for later */ + file->mem_newsize = fam_newsize; /* New member size passed in through property */ + file->repart_members = TRUE; + } /* end if */ + if(fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) { if(H5I_inc_ref(fa->memb_fapl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") @@ -789,7 +801,6 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, } /* end else */ file->memb_size = fa->memb_size; /* Actual member size to be updated later */ file->pmem_size = fa->memb_size; /* Member size passed in through property */ - file->mem_newsize = fam_newsize; /* New member size passed in through property */ } /* end else */ file->name = H5MM_strdup(name); file->flags = flags; @@ -797,8 +808,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, /* Check that names are unique */ sprintf(memb_name, name, 0); sprintf(temp, name, 1); - - if (!strcmp(memb_name, temp)) + if(!HDstrcmp(memb_name, temp)) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file names not unique") /* Open all the family members */ @@ -968,23 +978,20 @@ done: * (listed in H5FDpublic.h) * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol * Friday, August 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t -H5FD_family_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) +H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) { - herr_t ret_value = SUCCEED; + const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */ - FUNC_ENTER_NOAPI(H5FD_family_query, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_query) /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -993,10 +1000,13 @@ H5FD_family_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes. */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + + /* Check for flags that are set by h5repart */ + if(file->repart_members) + *flags |= H5FD_FEAT_DIRTY_SBLK_LOAD; /* Mark the superblock dirty when it is loaded (so the family member sizes are rewritten) */ } /* end if */ -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_family_query() */ |