summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-10-08 06:11:44 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-10-08 06:11:44 (GMT)
commit39fc26566e18ac81c43986ed2013676e2918ded2 (patch)
treed6241c1c75a5769ad876258b182e84ff02d33e41 /src/H5F.c
parent43fc25841e2b4b0ad163fe967e6e0750ad3c6bba (diff)
downloadhdf5-39fc26566e18ac81c43986ed2013676e2918ded2.zip
hdf5-39fc26566e18ac81c43986ed2013676e2918ded2.tar.gz
hdf5-39fc26566e18ac81c43986ed2013676e2918ded2.tar.bz2
[svn-r24263] Changes to do re-reads for metadata with checksums when a file is opened with SWMR access.
There are debugging printfs which will be removed when coding is finalized. Also some bug fixes: 1) accum.c--clean up some warning messages and use new_argv/new_envp for the call to execve. 2) hl/tools/h5watch--clean up some warning messages and a bug fix for h5watch.c. This checkin is awaiting code review feedback.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/H5F.c b/src/H5F.c
index e442803..60b9b3e 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -338,6 +338,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
/* Make a copy of the default file access property list */
if(NULL == (old_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+
if((ret_value = H5P_copy_plist(old_plist, app_ref)) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list")
if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(ret_value)))
@@ -366,6 +367,8 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size")
if(H5P_set(new_plist, H5F_ACS_LATEST_FORMAT_NAME, &(f->shared->latest_format)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
+ if(H5P_set(new_plist, H5F_ACS_READ_ATTEMPTS_NAME, &(f->read_attempts)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
if(f->shared->efc)
efc_size = H5F_efc_max_nfiles(f->shared->efc);
if(H5P_set(new_plist, H5F_ACS_EFC_SIZE_NAME, &efc_size) < 0)
@@ -930,6 +933,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
/* Get the FAPL values to cache */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list")
+
if(H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, &(f->shared->mdc_initCacheCfg)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial metadata cache resize config")
if(H5P_get(plist, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, &(f->shared->rdcc_nslots)) < 0)
@@ -960,6 +964,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
if(NULL == (f->shared->efc = H5F_efc_create(efc_size)))
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't create external file cache")
+
/* Get the VFD values to cache */
f->shared->maxaddr = H5FD_get_maxaddr(lf);
if(!H5F_addr_defined(f->shared->maxaddr))
@@ -1355,6 +1360,22 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
file->intent = flags;
file->open_name = H5MM_xstrdup(name);
+ /* Get the file access property list, for future queries */
+ if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list")
+
+ /* Retrieve the # of read attempts here so that sohm in superblock will get the correct # of attempts */
+ if(H5P_get(a_plist, H5F_ACS_READ_ATTEMPTS_NAME, &file->read_attempts) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get the # of read attempts")
+
+ /* When opening file with SWMR access, the # of read attempts is H5_SWMR_READ_ATTEMPTS if not set */
+ /* When opening file with non-SWMR access, the # of read attempts is always H5F_READ_ATTEMPTS (set or not set) */
+ if(file->intent & H5F_ACC_SWMR_READ || file->intent & H5F_ACC_SWMR_WRITE) {
+ if(!file->read_attempts)
+ file->read_attempts = H5F_SWMR_READ_ATTEMPTS;
+ } else
+ file->read_attempts = H5F_READ_ATTEMPTS;
+
/*
* Read or write the file superblock, depending on whether the file is
* empty or not.
@@ -1386,9 +1407,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group")
} /* end if */
- /* Get the file access property list, for future queries */
- if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list")
/*
* Decide the file close degree. If it's the first time to open the
@@ -2120,6 +2138,9 @@ H5Freopen(hid_t file_id)
/* Keep old file's read/write intent in new file */
new_file->intent = old_file->intent;
+ /* Keep old file's read attempts in new file */
+ new_file->read_attempts = old_file->read_attempts;
+
/* Duplicate old file's names */
new_file->open_name = H5MM_xstrdup(old_file->open_name);
new_file->actual_name = H5MM_xstrdup(old_file->actual_name);