summaryrefslogtreecommitdiffstats
path: root/test/big.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-03-28 23:46:55 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-03-28 23:46:55 (GMT)
commit0a8228c4a9e86f55a88ed06f193c17dba16dc973 (patch)
tree30006f07e852c568614aa1363d020c7d741ceab1 /test/big.c
parentf8bfe1cb01fb7079b5307892b004a2c4f5c5ae09 (diff)
downloadhdf5-0a8228c4a9e86f55a88ed06f193c17dba16dc973.zip
hdf5-0a8228c4a9e86f55a88ed06f193c17dba16dc973.tar.gz
hdf5-0a8228c4a9e86f55a88ed06f193c17dba16dc973.tar.bz2
[svn-r5113] Purpose:
feature Description: Added -fsize <fsize> option which controls the family file size used. This can be used to test the file size limits of a machine or file system. Platforms tested: modi4 (passed even 20GB file size). Eirene (started to fail when 2GB is used. Expected since linux 2.2 does not support large than 2GB file size.) burrwhite (passed up to 4GB. Expected since Linux 2.4 supports larger than 2GB file size.) Then it failed at 4GB and beyond. This is probably a bug in the family file driver.
Diffstat (limited to 'test/big.c')
-rw-r--r--test/big.c82
1 files changed, 74 insertions, 8 deletions
diff --git a/test/big.c b/test/big.c
index 5f8363e..2e2ec31 100644
--- a/test/big.c
+++ b/test/big.c
@@ -339,6 +339,38 @@ reader (hid_t fapl)
return 1;
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: usage
+ *
+ * Purpose: Print command usage
+ *
+ * Return: void
+ *
+ * Programmer: Albert Chent
+ * Mar 28, 2002
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+usage(void)
+{
+ HDfprintf(stdout,
+ "Usage: big [-h] [-fsize <fsize>}\n"
+ "\t-h\tPrint the help page\n"
+ "\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
+ "\t\ta positive float point number. Default value is %Hu.\n"
+ "Examples:\n"
+ "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
+ "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
+ "\tBe sure the file system can support the file size requested\n"
+ , (hsize_t)FAMILY_SIZE);
+}
+
+
/*-------------------------------------------------------------------------
* Function: main
@@ -353,30 +385,64 @@ reader (hid_t fapl)
* Friday, April 10, 1998
*
* Modifications:
+ * Albert Cheng, 2002/03/28
+ * Added command option -fsize.
*
*-------------------------------------------------------------------------
*/
int
-main (void)
+main (int ac, char **av)
{
hid_t fapl=-1;
hsize_t family_size;
+ hsize_t family_size_def; /* default family file size */
+ /* parameters setup */
+ family_size_def = FAMILY_SIZE;
+
+ while (--ac > 0){
+ av++;
+ if (strcmp("-fsize", *av)==0){
+ /* specify a different family file size */
+ ac--; av++;
+ if (ac > 0){
+ family_size_def = (hsize_t) atof(*av);
+ if (family_size_def <= 0)
+ family_size_def = (hsize_t)FAMILY_SIZE;
+ ac--; av++;
+ }
+ else{
+ printf("***Missing fsize value***\n");
+ usage();
+ return 1;
+ }
+ }
+ else if (strcmp("-h", *av)==0){
+ usage();
+ return 0;
+ }else{
+ usage();
+ return 1;
+ }
+ }
+
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
/* The file driver must be the family driver */
if (H5FD_FAMILY!=H5Pget_driver(fapl)) {
- printf("Changing file drivers to the family driver, %lu bytes each\n",
- (unsigned long)FAMILY_SIZE);
- if (H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) goto error;
+ HDfprintf(stdout,
+ "Changing file drivers to the family driver, %Hu bytes each\n",
+ family_size_def);
+ if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT)<0) goto error;
} else if (H5Pget_fapl_family(fapl, &family_size, NULL)<0) {
goto error;
- } else if (family_size!=(hsize_t)FAMILY_SIZE) {
- printf("Changing family member size from %lu to %lu\n",
- (unsigned long)family_size, (unsigned long)FAMILY_SIZE);
- if (H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) goto error;
+ } else if (family_size!=family_size_def) {
+ HDfprintf(stdout, "Changing family member size from %Hu to %Hu\n",
+ family_size, family_size_def);
+ if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT)<0)
+ goto error;
}
/*