summaryrefslogtreecommitdiffstats
path: root/test/big.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-04-09 20:22:11 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-04-09 20:22:11 (GMT)
commitc96611f8b54caf83b386e78ebb398d3a69be752a (patch)
tree55a6e8e66c4e099dec84bb52eca725b9bae00d27 /test/big.c
parentc01750fa740943c0083711b353278143c79d50a3 (diff)
downloadhdf5-c96611f8b54caf83b386e78ebb398d3a69be752a.zip
hdf5-c96611f8b54caf83b386e78ebb398d3a69be752a.tar.gz
hdf5-c96611f8b54caf83b386e78ebb398d3a69be752a.tar.bz2
[svn-r339] Changes since 19980408
---------------------- ./src/H5Osdspace.c ./html/H5.format.html In the past we were allowed to have >2GB files on a 32-bit machine as long as no dataset within the file was larger than 4GB (or whatever sizeof(size_t) is). That's been fixed now. All dataset size calculations are done with `hsize_t' which is normally defined as `unsigned long long'. ./src/H5F.c ./src/H5Ffamily.c ./src/H5Fprivate.h ./src/H5P.c ./src/H5Ppublic.h The file family member size can now be set/queried. The default is still 64MB, but it can be set to 1GB by saying: H5Pset_family (plist, 30, H5P_DEFAULT); When opening an existing file family the specified bits-per-member is ignored and the first member of the family determines the bits-per-member, which can be retrieved with H5Pget_family(). ./acconfig.h ./configure.in ./src/H5config.h ./src/H5public.h Added `--disable-hsizet' so that those with old GCC compilers (<2.8.1) can still compile the code. ./src/H5.c ./src/H5private.h Added HDfprintf() which works just like fprintf() except you can give `H' as a size modifier for the integer conversions and supply an `hsize_t' or `hssize_t' argument without casting it. For instance: hsize_t npoints = H5Sget_npoints(space); HDfprintf(stdout,"Dataset has %Hd (%#018Hx) points\n", npoints, npoints); You can now give `%a' as a format to print an address, but all formating flags are ignored and it causes the return value of HDfprintf() to not include the characters in the address (but who uses the return value anyway :-). Example: H5G_t *grp; HDfprintf(stdout, "Group object header at %a\n", &(grp->ent.header)); Added HDstrtoll() which works exactly like [HD]strtol() except the result is an int64. ./src/debug.c Large addresses can now be entered from the command-line. Use either decimal, octal (leading `0') or hexadecimal (leading `0x') when giving the address. ./src/h5ls.c The printf format for dataset dimensions was changed to `%Hu' to support large datasets. ./test/big.c [NEW] A test for big datasets on 32-bit machines. This test is not run by default. Don't try to run it on an nfs-mounted file system or other file system that doesn't support holes because it creates two 32GB datasets of all zero.
Diffstat (limited to 'test/big.c')
-rw-r--r--test/big.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/big.c b/test/big.c
new file mode 100644
index 0000000..44d550f
--- /dev/null
+++ b/test/big.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 1998 NCSA
+ * All rights reserved.
+ *
+ * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Wednesday, April 8, 1998
+ */
+#include <assert.h>
+#include <hdf5.h>
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Creates a *big* dataset.
+ *
+ * Return: Success:
+ *
+ * Failure:
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, April 8, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main (void)
+{
+ hsize_t size1[4] = {8, 1024, 1024, 1024};
+ hsize_t size2[1] = {8589934592LL};
+ hid_t plist, file, space1, space2, dset;
+
+ /*
+ * Make sure that `hsize_t' is large enough to represent the entire data
+ * space.
+ */
+ assert (sizeof(hsize_t)>4);
+
+ /*
+ * We might be on a machine that has 32-bit files, so create an HDF5 file
+ * which is a family of files. Each member of the family will be 1GB
+ */
+ plist = H5Pcreate (H5P_FILE_ACCESS);
+ H5Pset_family (plist, 30, H5P_DEFAULT);
+ file = H5Fcreate ("big%05d.h5", H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+
+ /* Create simple data spaces according to the size specified above. */
+ space1 = H5Screate_simple (4, size1, size1);
+ space2 = H5Screate_simple (1, size2, size2);
+
+ /* Create the datasets */
+ dset = H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT);
+ H5Dclose (dset);
+ dset = H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT);
+ H5Dclose (dset);
+
+ H5Sclose (space1);
+ H5Sclose (space2);
+ H5Fclose (file);
+ exit (0);
+}