summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-18 22:29:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-18 22:29:03 (GMT)
commitd5dfe34e0a2a968648a3e3291542983965e97548 (patch)
tree8f5921f8521ebf5a54aaa75c42817db8dfa9d695
parent4b160dd890fd02734410f79d2757ad8a88aa0626 (diff)
downloadhdf5-d5dfe34e0a2a968648a3e3291542983965e97548.zip
hdf5-d5dfe34e0a2a968648a3e3291542983965e97548.tar.gz
hdf5-d5dfe34e0a2a968648a3e3291542983965e97548.tar.bz2
[svn-r17380] Description:
Bring r17376 from trunk to 1.8 branch: Make similar change to windows VFD as sec2 VFD, when converting from a family file to a single file. Tweak file sizes expected for parallel tests. Tested on: FreeBSD/32 6.3 (duty) w/debug (h5committested on trunk)
-rw-r--r--src/H5FDsec2.c5
-rw-r--r--src/H5FDwindows.c51
-rw-r--r--testpar/t_mdset.c6
-rw-r--r--testpar/testphdf5.c31
4 files changed, 43 insertions, 50 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 7fc6426..f4c9947 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -397,7 +397,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
/* Get the FAPL */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
+ HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list")
/* This step is for h5repart tool only. If user wants to change file driver from
* family to sec2 while using h5repart, this private property should be set so that
@@ -406,7 +406,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
*/
if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0)
if(H5P_get(plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &file->fam_to_sec2) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property of changing family to sec2")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to sec2")
} /* end if */
/* Set return value */
@@ -535,7 +535,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c
index 37228d7..aca03c8 100644
--- a/src/H5FDwindows.c
+++ b/src/H5FDwindows.c
@@ -91,7 +91,11 @@ typedef struct H5FD_windows_t {
*/
DWORD fileindexlo;
DWORD fileindexhi;
- DWORD volumeserialnumber;
+ DWORD volumeserialnumber;
+
+ /* Information from properties set by 'h5repart' tool */
+ hbool_t fam_to_sec2; /* Whether to eliminate the family driver info
+ * and convert this file to a single file */
} H5FD_windows_t;
@@ -401,13 +405,31 @@ H5FD_windows_open(const char *name, unsigned flags, hid_t UNUSED fapl_id,
file->write_access=write_access; /* Note the write_access for later */
#endif /* WINDOWS_USE_STDIO */
- if( (filehandle = (HANDLE)_get_osfhandle(fd)) == INVALID_HANDLE_VALUE)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file handle for file")
+ if( (filehandle = (HANDLE)_get_osfhandle(fd)) == INVALID_HANDLE_VALUE)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file handle for file")
if(!GetFileInformationByHandle(filehandle, &fileinfo))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file information")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file information")
file->fileindexhi = fileinfo.nFileIndexHigh;
file->fileindexlo = fileinfo.nFileIndexLow;
- file->volumeserialnumber = fileinfo.dwVolumeSerialNumber;
+ file->volumeserialnumber = fileinfo.dwVolumeSerialNumber;
+
+ /* Check for non-default FAPL */
+ if(H5P_FILE_ACCESS_DEFAULT != fapl_id) {
+ H5P_genplist_t *plist; /* Property list pointer */
+
+ /* Get the FAPL */
+ if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list")
+
+ /* This step is for h5repart tool only. If user wants to change file driver from
+ * family to sec2 while using h5repart, this private property should be set so that
+ * in the later step, the library can ignore the family driver information saved
+ * in the superblock.
+ */
+ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0)
+ if(H5P_get(plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &file->fam_to_sec2) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to sec2")
+ } /* end if */
/* Set return value */
ret_value=(H5FD_t*)file;
@@ -520,17 +542,14 @@ done:
Based on code by Quincey Koziol
* Thursday, May 24 2007
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
-H5FD_windows_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
+H5FD_windows_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
- herr_t ret_value=SUCCEED;
+ const H5FD_windows_t *file = (const H5FD_windows_t*)_file; /* windows VFD info */
- FUNC_ENTER_NOAPI(H5FD_windows_query, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_windows_query)
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -539,11 +558,15 @@ H5FD_windows_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->fam_to_sec2)
+ *flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */
+ } /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value)
-}
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_windows_query() */
/*-------------------------------------------------------------------------
* Function: H5FD_windows_get_eoa
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index f7d7ebb..51f06d7 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -458,7 +458,7 @@ void big_dataset(void)
/* Check that file of the correct size was created */
file_size = h5_get_file_size(filename, fapl);
- VRFY((file_size == 2147485696ULL), "File is correct size(~2GB)");
+ VRFY((file_size == 2147485792ULL), "File is correct size(~2GB)");
/*
* Create >4GB HDF5 file
@@ -487,7 +487,7 @@ void big_dataset(void)
/* Check that file of the correct size was created */
file_size = h5_get_file_size(filename, fapl);
- VRFY((file_size == 4294969344ULL), "File is correct size(~4GB)");
+ VRFY((file_size == 4294969440ULL), "File is correct size(~4GB)");
/*
* Create >8GB HDF5 file
@@ -516,7 +516,7 @@ void big_dataset(void)
/* Check that file of the correct size was created */
file_size = h5_get_file_size(filename, fapl);
- VRFY((file_size == 8589936640ULL), "File is correct size(~8GB)");
+ VRFY((file_size == 8589936736ULL), "File is correct size(~8GB)");
/* Close fapl */
ret = H5Pclose(fapl);
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 175d159..4dabada 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -402,7 +402,7 @@ int main(int argc, char **argv)
"collective group and dataset write", &collngroups_params);
AddTest("ingrpr", independent_group_read, NULL,
"independent group and dataset read", &collngroups_params);
- AddTest("bigdset", big_dataset, NULL,
+ AddTest("bigdset", big_dataset, NULL,
"big dataset test", PARATESTFILE);
AddTest("fill", dataset_fillvalue, NULL,
"dataset fill value", PARATESTFILE);
@@ -463,35 +463,6 @@ int main(int argc, char **argv)
"collective irregular complex chunk read",PARATESTFILE);
-#if 0
- if((mpi_size > 3) && MAINPROCESS) {
- printf("Collective irregular chunk IO tests haven't been tested \n");
- printf(" for the number of process greater than 3.\n");
- printf("Please try with the number of process \n");
- printf(" no greater than 3 for collective irregular chunk IO test.\n");
- printf("Collective irregular chunk tests will be skipped \n");
- }
- AddTest((mpi_size > 3) ? "-ccontw" : "ccontw",
- coll_irregular_cont_write,NULL,
- "collective irregular contiguous write",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-ccontr" : "ccontr",
- coll_irregular_cont_read,NULL,
- "collective irregular contiguous read",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-cschunkw" : "cschunkw",
- coll_irregular_simple_chunk_write,NULL,
- "collective irregular simple chunk write",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-cschunkr" : "cschunkr",
- coll_irregular_simple_chunk_read,NULL,
- "collective irregular simple chunk read",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-ccchunkw" : "ccchunkw",
- coll_irregular_complex_chunk_write,NULL,
- "collective irregular complex chunk write",PARATESTFILE);
- AddTest((mpi_size > 3) ? "-ccchunkr" : "ccchunkr",
- coll_irregular_complex_chunk_read,NULL,
- "collective irregular complex chunk read",PARATESTFILE);
-#endif
-
-
AddTest("null", null_dataset, NULL,
"null dataset test", PARATESTFILE);