2003-04-01 01:59:04 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
2017-04-18 03:32:16 +08:00
|
|
|
* the COPYING file, which can be found at the root of the source code *
|
2021-02-17 22:52:04 +08:00
|
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
2017-04-18 03:32:16 +08:00
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
* help@hdfgroup.org. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
/*
|
2020-08-07 08:58:07 +08:00
|
|
|
* Programmer: Robb Matzke
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
* Wednesday, April 8, 1998
|
2020-09-05 05:51:30 +08:00
|
|
|
* Modified: Albert Cheng
|
|
|
|
* September 11, 2010
|
2010-11-12 02:17:02 +08:00
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* The purpose of this test is to verify if a virtual file driver can handle:
|
|
|
|
* a. Large file (2GB)
|
2012-03-05 22:17:14 +08:00
|
|
|
* This should exceed 32bits I/O system since offset is a signed
|
|
|
|
* integral type (in order to support negative offset with respect to
|
|
|
|
* end of file).
|
2010-11-12 02:17:02 +08:00
|
|
|
* b. Extra Large file (4GB)
|
2012-03-05 22:17:14 +08:00
|
|
|
* This definite exceeds 32bit I/O and file systems.
|
2010-11-12 02:17:02 +08:00
|
|
|
* c. Huge file (tens of GB)
|
2012-03-05 22:17:14 +08:00
|
|
|
* This verifies the HDF5 library handles big logical file size
|
|
|
|
* correctly.
|
2010-11-12 02:17:02 +08:00
|
|
|
* In practice, if a VFD can handle a big file size, there is no need to
|
|
|
|
* test the smaller file sizes. E.g., If it can handle the Huge file,
|
|
|
|
* there is no need to test the Extra large or Large files. Therefore the
|
|
|
|
* test starts with larger size files and continues to test the smaller size
|
|
|
|
* files only if the large sige file tests have failed.
|
|
|
|
*
|
|
|
|
* Another consideration is that even if a VFD is capable to handle a
|
|
|
|
* huge file but it is likely to take a long time to write every byte
|
|
|
|
* of a huge file. E.g., a simple workstation may have disks of write
|
|
|
|
* speed of 10MB/sec. A huge file of 30GB will take about an hour to
|
|
|
|
* write it. Therefore, this test will run the huge file test only if the
|
|
|
|
* underlying file system supports sparse file. (A Sparse file here means
|
|
|
|
* that disk space is allocated only when the contents are actually written.
|
|
|
|
* E.g., If one creates a new file, seeks forward 10 million bytes, writes
|
|
|
|
* 1 bytes and closes the file, then a sparse file, will show file size of
|
|
|
|
* 10 million bytes but actaully uses only couple disk blocks, much smaller
|
|
|
|
* than the formal file size.)
|
|
|
|
*
|
|
|
|
* One more consideration is that we want to distinguish an HDF5 library
|
|
|
|
* failure from some system limits such as current free disk space or user
|
|
|
|
* disk space quota. Therefore, the test will first attempt to verify no
|
|
|
|
* such limits exist before running the actual VFD tests.
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
*/
|
2001-04-04 02:09:16 +08:00
|
|
|
#include "h5test.h"
|
1998-04-15 00:44:46 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define DNAME "big.data"
|
1998-11-25 22:58:22 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define WRT_N 50
|
|
|
|
#define WRT_SIZE 4 * 1024
|
|
|
|
#define FAMILY_SIZE 1024 * 1024 * 1024
|
1998-11-03 01:58:28 +08:00
|
|
|
|
2010-08-04 07:35:42 +08:00
|
|
|
#define GB (HDoff_t)0x40000000L
|
2007-04-24 02:57:51 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define MAX_TRIES 100
|
2005-03-30 06:14:47 +08:00
|
|
|
|
2002-04-28 16:34:17 +08:00
|
|
|
#if H5_SIZEOF_LONG_LONG >= 8
|
2020-09-30 22:27:10 +08:00
|
|
|
#define GB8LL ((unsigned long long)8 * 1024 * 1024 * 1024)
|
1998-10-24 02:16:48 +08:00
|
|
|
#else
|
2020-09-30 22:27:10 +08:00
|
|
|
#define GB8LL 0 /*cannot do the test*/
|
1998-10-24 02:16:48 +08:00
|
|
|
#endif
|
1998-11-03 01:58:28 +08:00
|
|
|
|
2020-04-21 07:12:00 +08:00
|
|
|
/* Define Small, Large, Extra Large, Huge File which
|
2010-11-18 07:30:49 +08:00
|
|
|
* corrspond to less than 2GB, 2GB, 4GB, and tens of GB file size.
|
2015-12-11 10:05:50 +08:00
|
|
|
* NO_FILE stands for "no file" to be tested.
|
2010-11-18 07:30:49 +08:00
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
typedef enum fsizes_t { SFILE, LFILE, XLFILE, HUGEFILE, NO_FILE } fsizes_t;
|
|
|
|
fsizes_t file_size = NO_FILE;
|
|
|
|
|
|
|
|
const char *FILENAME[] = {"big", "sec2", "stdio", NULL};
|
|
|
|
int cflag = 1; /* check file system before test */
|
|
|
|
int sparse_support = 0; /* sparse file supported, default false */
|
|
|
|
int have_space = 0; /* enough space for huge file test, default false */
|
|
|
|
hsize_t family_size_def = FAMILY_SIZE; /* default family file size */
|
2010-11-17 03:17:04 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
/* Prototypes */
|
2002-04-23 01:48:24 +08:00
|
|
|
static void usage(void);
|
2020-09-30 22:27:10 +08:00
|
|
|
static int test_sec2(hid_t fapl);
|
|
|
|
static int test_stdio(hid_t fapl);
|
|
|
|
static int test_family(hid_t fapl);
|
2002-04-20 02:54:51 +08:00
|
|
|
|
2005-03-30 06:14:47 +08:00
|
|
|
/* Array used to record all addresses at which data has been written */
|
|
|
|
/* so far. Used to prevent overlapping writes. */
|
|
|
|
static hsize_t values_used[WRT_N];
|
2020-09-05 05:51:30 +08:00
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: randll
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Create a random long long value.
|
|
|
|
* Ensures that a write at this value doesn't overlap any
|
2020-09-24 22:57:21 +08:00
|
|
|
* previous write.
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success: Random value
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure: Random value which overlaps another write
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Robb Matzke
|
1998-11-25 22:58:22 +08:00
|
|
|
* Tuesday, November 24, 1998
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1998-11-25 22:58:22 +08:00
|
|
|
static hsize_t
|
2005-03-30 06:14:47 +08:00
|
|
|
randll(hsize_t limit, int current_index)
|
1998-07-16 05:21:15 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hsize_t acc = 0;
|
2020-09-05 05:51:30 +08:00
|
|
|
int overlap = 1;
|
|
|
|
int i;
|
|
|
|
int tries = 0;
|
2005-03-30 06:14:47 +08:00
|
|
|
|
|
|
|
/* Generate up to MAX_TRIES random numbers until one of them */
|
|
|
|
/* does not overlap with any previous writes */
|
2020-09-30 22:27:10 +08:00
|
|
|
while (overlap != 0 && tries < MAX_TRIES) {
|
2016-07-23 06:43:18 +08:00
|
|
|
acc = (hsize_t)HDrandom();
|
|
|
|
acc *= (hsize_t)HDrandom();
|
2020-09-30 22:27:10 +08:00
|
|
|
acc = acc % limit;
|
2005-03-30 06:14:47 +08:00
|
|
|
overlap = 0;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < current_index; i++) {
|
|
|
|
if ((acc >= values_used[i]) && (acc < values_used[i] + WRT_SIZE))
|
2005-08-14 04:53:35 +08:00
|
|
|
overlap = 1;
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((acc + WRT_SIZE >= values_used[i]) && (acc + WRT_SIZE < values_used[i] + WRT_SIZE))
|
2005-08-14 04:53:35 +08:00
|
|
|
overlap = 1;
|
2005-03-30 06:14:47 +08:00
|
|
|
}
|
|
|
|
tries++;
|
|
|
|
}
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
values_used[current_index] = acc;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2005-03-30 06:14:47 +08:00
|
|
|
return acc;
|
1998-07-16 05:21:15 +08:00
|
|
|
}
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: is_sparse
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Determines if the file system of the current working
|
2020-09-24 22:57:21 +08:00
|
|
|
* directory supports holes.
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success: Non-zero if holes are supported; zero
|
|
|
|
* otherwise.
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure: zero
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Robb Matzke
|
1998-07-16 05:21:15 +08:00
|
|
|
* Wednesday, July 15, 1998
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
is_sparse(void)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
int fd;
|
|
|
|
h5_stat_t sb;
|
|
|
|
|
|
|
|
if ((fd = HDopen("x.h5", O_RDWR | O_TRUNC | O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0)
|
|
|
|
return 0;
|
|
|
|
if (HDlseek(fd, (off_t)(1024 * 1024), SEEK_SET) != 1024 * 1024)
|
|
|
|
return 0;
|
|
|
|
if (5 != HDwrite(fd, "hello", (size_t)5))
|
|
|
|
return 0;
|
|
|
|
if (HDclose(fd) < 0)
|
|
|
|
return 0;
|
|
|
|
if (HDstat("x.h5", &sb) < 0)
|
|
|
|
return 0;
|
|
|
|
if (HDremove("x.h5") < 0)
|
|
|
|
return 0;
|
2000-11-11 23:58:12 +08:00
|
|
|
#ifdef H5_HAVE_STAT_ST_BLOCKS
|
2020-09-30 22:27:10 +08:00
|
|
|
return ((unsigned long)sb.st_blocks * 512 < (unsigned long)sb.st_size);
|
1998-10-24 02:16:48 +08:00
|
|
|
#else
|
1998-11-03 01:58:28 +08:00
|
|
|
return (0);
|
1998-10-24 02:16:48 +08:00
|
|
|
#endif
|
1998-07-16 05:21:15 +08:00
|
|
|
}
|
|
|
|
|
2007-04-24 02:57:51 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: supports_big
|
2007-04-24 02:57:51 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Determines if the file system of the current working
|
2020-09-24 22:57:21 +08:00
|
|
|
* directory supports big files.
|
2007-04-24 02:57:51 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success: Non-zero if big files are supported; zero
|
|
|
|
* otherwise.
|
2007-04-24 02:57:51 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure: zero
|
2007-04-24 02:57:51 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Raymond Lu
|
2007-04-24 02:57:51 +08:00
|
|
|
* Wednesday, April 18, 2007
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2010-11-18 07:30:49 +08:00
|
|
|
static fsizes_t
|
2013-10-25 12:57:01 +08:00
|
|
|
supports_big(void)
|
2007-04-24 02:57:51 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
int fd = -1;
|
|
|
|
fsizes_t fsize = NO_FILE;
|
2007-04-24 02:57:51 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((fd = HDopen("y.h5", O_RDWR | O_TRUNC | O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0)
|
2012-03-05 22:17:14 +08:00
|
|
|
goto error;
|
2013-10-25 12:57:01 +08:00
|
|
|
|
|
|
|
/* Write a few byte at the beginning */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (5 != HDwrite(fd, "hello", (size_t)5))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
|
|
|
fsize = SFILE;
|
|
|
|
|
|
|
|
/* Write a few bytes at 2GB */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDlseek(fd, 2 * GB, SEEK_SET) != 2 * GB)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (5 != HDwrite(fd, "hello", (size_t)5))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
|
|
|
fsize = LFILE;
|
|
|
|
|
|
|
|
/* Write a few bytes at 4GB */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDlseek(fd, 4 * GB, SEEK_SET) != 4 * GB)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (5 != HDwrite(fd, "hello", (size_t)5))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
|
|
|
fsize = XLFILE;
|
|
|
|
|
|
|
|
/* If this supports sparse_file, write a few bytes at 32GB */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!sparse_support)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDlseek(fd, 32 * GB, SEEK_SET) != 32 * GB)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (5 != HDwrite(fd, "hello", (size_t)5))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto quit;
|
|
|
|
fsize = HUGEFILE;
|
2012-03-05 22:17:14 +08:00
|
|
|
|
2010-11-18 07:30:49 +08:00
|
|
|
quit:
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDclose(fd) < 0)
|
2012-03-05 22:17:14 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDremove("y.h5") < 0)
|
2012-03-05 22:17:14 +08:00
|
|
|
goto error;
|
2013-10-25 12:57:01 +08:00
|
|
|
return fsize;
|
2007-04-24 02:57:51 +08:00
|
|
|
|
2010-11-18 07:30:49 +08:00
|
|
|
error:
|
2020-09-30 22:27:10 +08:00
|
|
|
if (fd >= 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
HDclose(fd);
|
|
|
|
HDremove("y.h5");
|
2010-11-18 07:30:49 +08:00
|
|
|
}
|
2013-10-25 12:57:01 +08:00
|
|
|
return fsize;
|
2007-04-24 02:57:51 +08:00
|
|
|
}
|
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: enough_room
|
1998-08-07 05:32:33 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Tries to create a bunch of sparse files to see if quotas will
|
|
|
|
* get in the way. Some systems also have problems opening
|
|
|
|
* enough files and we'll check that too.
|
1998-08-07 05:32:33 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success: Non-zero
|
1998-08-07 05:32:33 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure: zero
|
1998-08-07 05:32:33 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Robb Matzke
|
1998-08-07 05:32:33 +08:00
|
|
|
* Thursday, August 6, 1998
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2019-07-10 11:15:36 +08:00
|
|
|
/* Disable warning for "format not a string literal" here -QAK */
|
|
|
|
/*
|
|
|
|
* This pragma only needs to surround the snprintf() calls with
|
|
|
|
* 'name' in the code below, but early (4.4.7, at least) gcc only
|
|
|
|
* allows diagnostic pragmas to be toggled outside of functions.
|
|
|
|
*/
|
2020-09-05 05:51:30 +08:00
|
|
|
H5_GCC_DIAG_OFF("format-nonliteral")
|
1998-08-07 05:32:33 +08:00
|
|
|
static int
|
1998-11-25 22:58:22 +08:00
|
|
|
enough_room(hid_t fapl)
|
1998-08-07 05:32:33 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
int ret_value = 0;
|
|
|
|
int fd[68];
|
|
|
|
size_t i, size = (size_t)1 << 30;
|
|
|
|
char filename[1024], name[1024];
|
1998-11-17 03:08:18 +08:00
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
/* Initialize file descriptors */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < NELMTS(fd); i++)
|
|
|
|
fd[i] = -1;
|
1998-08-07 05:32:33 +08:00
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
/* Get file name template */
|
2020-09-30 22:27:10 +08:00
|
|
|
HDassert(H5FD_FAMILY == H5Pget_driver(fapl));
|
2013-10-25 12:57:01 +08:00
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
|
1998-11-25 22:58:22 +08:00
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
/* Create files */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < NELMTS(fd); i++) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDsnprintf(name, sizeof(name), filename, i);
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((fd[i] = HDopen(name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
|
|
|
|
goto done;
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
if (1 != HDwrite(fd[i], "X", (size_t)1)) {
|
2012-03-05 22:17:14 +08:00
|
|
|
goto done;
|
|
|
|
}
|
1998-08-07 05:32:33 +08:00
|
|
|
}
|
|
|
|
ret_value = 1;
|
|
|
|
|
2012-03-05 22:17:14 +08:00
|
|
|
done:
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < NELMTS(fd) && fd[i] >= 0; i++) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDsnprintf(name, sizeof(name), filename, i);
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDclose(fd[i]) < 0)
|
|
|
|
ret_value = 0;
|
2012-03-05 22:17:14 +08:00
|
|
|
HDremove(name);
|
1998-08-07 05:32:33 +08:00
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
return ret_value;
|
|
|
|
}
|
2020-09-05 05:51:30 +08:00
|
|
|
H5_GCC_DIAG_ON("format-nonliteral")
|
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: writer
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Creates a *big* dataset.
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success: 0
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure: >0
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Robb Matzke
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
* Wednesday, April 8, 1998
|
|
|
|
*
|
|
|
|
* Modifications:
|
2020-09-05 05:51:30 +08:00
|
|
|
* Robb Matzke, 15 Jul 1998
|
2020-09-24 22:57:21 +08:00
|
|
|
* Addresses are written to the file DNAME instead of stdout.
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1998-07-16 05:21:15 +08:00
|
|
|
static int
|
2020-09-30 22:27:10 +08:00
|
|
|
writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n)
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hsize_t size1[4] = {8, 1024, 1024, 1024};
|
|
|
|
hsize_t size2[1] = {GB8LL};
|
|
|
|
hsize_t hs_start[1];
|
|
|
|
hsize_t hs_size[1];
|
|
|
|
hid_t file = -1, space1 = -1, space2 = -1, mem_space = -1, d1 = -1, d2 = -1;
|
|
|
|
int * buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE);
|
|
|
|
int i, j;
|
|
|
|
FILE * out = HDfopen(DNAME, "w");
|
|
|
|
hid_t dcpl;
|
|
|
|
|
|
|
|
switch (testsize) {
|
|
|
|
case LFILE:
|
|
|
|
TESTING("Large dataset write(2GB)");
|
|
|
|
/* reduce size1 to produce a 2GB dataset */
|
|
|
|
size1[1] = 1024 / 16;
|
|
|
|
size2[0] /= 16;
|
|
|
|
break;
|
2013-08-10 04:42:27 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
case XLFILE:
|
|
|
|
TESTING("Extra large dataset write(4GB)");
|
|
|
|
/* reduce size1 to produce a 4GB dataset */
|
|
|
|
size1[1] = 1024 / 8;
|
|
|
|
size2[0] /= 8;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HUGEFILE:
|
|
|
|
TESTING("Huge dataset write");
|
|
|
|
/* Leave size1 as 32GB */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SFILE:
|
|
|
|
TESTING("small dataset write(1GB)");
|
|
|
|
/* reduce size1 to produce a 1GB dataset */
|
|
|
|
size1[1] = 1024 / 32;
|
|
|
|
size2[0] /= 32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NO_FILE:
|
|
|
|
/* what to do?? */
|
|
|
|
HDfprintf(stdout, "Unexpected file size of NO_FILE\n");
|
|
|
|
goto error;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
HDfprintf(stdout, "Unexpected file size(%d)\n", testsize);
|
|
|
|
goto error;
|
|
|
|
break;
|
2010-11-18 07:30:49 +08:00
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
goto error;
|
1999-08-18 03:12:59 +08:00
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
/* Create simple data spaces according to the size specified above. */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((space1 = H5Screate_simple(4, size1, size1)) < 0 ||
|
|
|
|
(space2 = H5Screate_simple(1, size2, size2)) < 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
goto error;
|
1998-07-16 05:21:15 +08:00
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
/* Create the datasets */
|
2012-03-05 22:17:14 +08:00
|
|
|
/*
|
|
|
|
* The fix below is provided for bug#921
|
|
|
|
* H5Dcreate with H5P_DEFAULT creation properties
|
|
|
|
* will create a set of solid 1GB files; test will crash if quotas are enforced
|
|
|
|
* or it will take some time to write a file.
|
|
|
|
* We should create a dataset allocating space late and never writing fill values.
|
|
|
|
* EIP 4/8/03
|
|
|
|
*/
|
2003-04-09 07:16:40 +08:00
|
|
|
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
|
|
|
H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
|
|
|
|
H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ||
|
|
|
|
(d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
goto error;
|
2003-04-09 07:16:40 +08:00
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-15 00:44:46 +08:00
|
|
|
/* Write some things to them randomly */
|
|
|
|
hs_size[0] = WRT_SIZE;
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((mem_space = H5Screate_simple(1, hs_size, hs_size)) < 0)
|
|
|
|
goto error;
|
|
|
|
for (i = 0; i < wrt_n; i++) {
|
|
|
|
/* start position must be at least hs_size from the end */
|
|
|
|
hs_start[0] = randll(size2[0] - hs_size[0], i);
|
|
|
|
HDfprintf(out, "#%03d 0x%016" PRIxHSIZE "\n", i, hs_start[0]);
|
|
|
|
if (H5Sselect_hyperslab(space2, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0)
|
|
|
|
goto error;
|
|
|
|
for (j = 0; j < WRT_SIZE; j++) {
|
|
|
|
buf[j] = i + 1;
|
2012-03-05 22:17:14 +08:00
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Dwrite(d2, H5T_NATIVE_INT, mem_space, space2, H5P_DEFAULT, buf) < 0)
|
|
|
|
goto error;
|
1998-04-15 00:44:46 +08:00
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Dclose(d1) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Dclose(d2) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Sclose(mem_space) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Sclose(space1) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Sclose(space2) < 0)
|
|
|
|
goto error;
|
|
|
|
if (H5Fclose(file) < 0)
|
|
|
|
goto error;
|
|
|
|
HDfree(buf);
|
2012-03-05 22:17:14 +08:00
|
|
|
HDfclose(out);
|
1998-11-25 22:58:22 +08:00
|
|
|
PASSED();
|
1998-07-16 05:21:15 +08:00
|
|
|
return 0;
|
|
|
|
|
2012-03-05 22:17:14 +08:00
|
|
|
error:
|
2020-09-30 22:27:10 +08:00
|
|
|
H5E_BEGIN_TRY
|
|
|
|
{
|
2012-03-05 22:17:14 +08:00
|
|
|
H5Dclose(d1);
|
|
|
|
H5Dclose(d2);
|
|
|
|
H5Sclose(space1);
|
|
|
|
H5Sclose(space2);
|
|
|
|
H5Sclose(mem_space);
|
|
|
|
H5Fclose(file);
|
2020-09-30 22:27:10 +08:00
|
|
|
}
|
|
|
|
H5E_END_TRY;
|
|
|
|
if (buf)
|
|
|
|
HDfree(buf);
|
|
|
|
if (out)
|
|
|
|
HDfclose(out);
|
1998-07-16 05:21:15 +08:00
|
|
|
return 1;
|
1998-04-15 00:44:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: reader
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Reads some data from random locations in the dataset.
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success: 0
|
1998-07-16 05:21:15 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure: >0
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Robb Matzke
|
1998-04-15 00:44:46 +08:00
|
|
|
* Friday, April 10, 1998
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1998-07-16 05:21:15 +08:00
|
|
|
static int
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (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/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
reader(char *filename, hid_t fapl)
|
1998-04-15 00:44:46 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
FILE * script = NULL;
|
|
|
|
hid_t file = -1, mspace = -1, fspace = -1, d2 = -1;
|
2020-09-05 05:51:30 +08:00
|
|
|
char ln[128], *s;
|
2020-09-30 22:27:10 +08:00
|
|
|
hsize_t hs_offset[1];
|
|
|
|
hsize_t hs_size[1] = {WRT_SIZE};
|
|
|
|
int * buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE);
|
|
|
|
int i, j, zero, wrong, nerrors = 0;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
/* Open script file */
|
2012-03-05 22:17:14 +08:00
|
|
|
script = HDfopen(DNAME, "r");
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
/* Open HDF5 file */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
/* Open the dataset */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((d2 = H5Dopen2(file, "d2", H5P_DEFAULT)) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
if ((fspace = H5Dget_space(d2)) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
/* Describe `buf' */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((mspace = H5Screate_simple(1, hs_size, hs_size)) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
/* Read each region */
|
2020-09-30 22:27:10 +08:00
|
|
|
while (HDfgets(ln, (int)sizeof(ln), script)) {
|
|
|
|
if ('#' != ln[0])
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (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/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
break;
|
2020-09-30 22:27:10 +08:00
|
|
|
i = (int)HDstrtol(ln + 1, &s, 10);
|
2016-07-23 06:43:18 +08:00
|
|
|
hs_offset[0] = HDstrtoull(s, NULL, 0);
|
Squash my changes on branch `fprintf-experiment` into one commit for
reapplication to my new warnings branch, `warnings-again`. These
changes are included:
commit 915551b7bf64e777dd2007386ec77b1d117770da
Merge: 63858c2 a8892bb
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 17:39:49 2019 -0600
Merge remote-tracking branch 'hdf5/develop' into fprintf-experiment
commit a8892bb42d6f6e4fbc30fae0eb2b957f81c938b9
Merge: 5c911d8 f907b51
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 17:33:54 2019 -0600
Merge pull request #2055 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:add-werror-and-squash-some to develop
* commit 'f907b511d06612dafc7814a7c30f2f3d2b76d52b':
Oops, remove more C99 designated initializers for VS 2010 compatibility.
commit 63858c22e168acaec0af8ced6641f26102cc6bb0
Merge: 20ae787 5c911d8
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 17:04:42 2019 -0600
Merge remote-tracking branch 'hdf5/develop' into fprintf-experiment
commit 5c911d8baf3ee7fe654269088eebdf07f59a8192
Merge: b8a5671 62208b0
Author: David Young <dyoung@hdfgroup.org>
Date: Mon Nov 25 16:58:27 2019 -0600
Merge pull request #2030 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:add-werror-and-squash-some to develop
* commit '62208b056a09c01855fbac7f75146be58ad6bfe5': (44 commits)
Add an #include to get a function declaration.
Don't use C99 designated initializers, they're not compatible with Visual Studio 2010.
Quiet some more maybe-uninitialized warnings---each is a false positive, *sigh*. This is more code that may not compile with VS2010, *sigh sigh*.
Always warn on maybe-uninitialized. -Wincompatible-pointer-types was not available until GCC 5, so enable it only if that's the GCC version we're using.
Only promote maybe-uninitialized warnings to errors on GCC 8. Even on GCC 8, there may be false positives at low optimization levels? I need to check.
Only use -Werror=cast-function-type with GCC 8 and later.
Put all of the -W options back into the order I found them in so that it's easier to compare old and new config/gnu-flags.
Add new source files to CMakeLists.txt.
Mention the -Werror= flags in libhdf5.settings.in.
free -> HDfree
Promote decleration-after-statement warnings to errors.
Quiet decleration-after-statement warnings.
Move a statement under some declarations since some vintages of Visual Studio don't like declarations after statements.
Document H5D__chunk_mem_xfree_wrapper().
Undo accidental test deletion.
Oops, delete a debug printf that snuck in here.
Undo my changes to the HD macros, hadn't really intended those to be on this branch....
Make errors of some more warnings. Move disabled warnings to DEVELOPER_WARNING_CFLAGS. Put just one warning option on a line, and sort some of the options.
Cast to the parameter type, H5VL_token_t *, instead of to unsigned char *.
Change hdset_reg_ref_t and H5R_ref_t from arrays of unsigned char to structs containing those arrays. Encapsulating the arrays in this way makes it easier to write and think about pointers to these types, casts to/from these types, etc.
...
commit 20ae7877e33931b95e8c3502b027d6c3fe94a11f
Merge: 46f8c61 edd5297
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:34:09 2019 -0600
Merge remote-tracking branch 'origin/add-werror-and-squash-some' into fprintf-experiment
commit 46f8c613d5117a8be5bc8385a072daa0b4262f06
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:29:00 2019 -0600
GCC really wants us to use `ll` to format `long long`, so try to make that work
before any other format modifier. Seems like we're not compiling the autoconf
test program with -Werror=format ? Probably should.
commit eee35b8ef3759c391327cd48a9b3c56b6f8abc99
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:28:05 2019 -0600
It's hard to know just how wide an HDoff_t will be, and I don't think POSIX or
C standards provide a PRI macro for it, so cast to intmax_t and format using
PRIdMAX.
commit 86eab12df7a89b546a38e99f8178dd2adbcb3433
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 15:26:25 2019 -0600
URemove some casts.se the right format string for the argument. Here and there
stop casting a printf argument.
commit f722f7cbecbaa99449941484b014426f62f1bed5
Merge: 58e3743 6d5ec83
Author: David Young <dyoung@hdfgroup.org>
Date: Fri Nov 22 14:44:16 2019 -0600
Merge branch 'add-werror-and-squash-some' into fprintf-experiment
commit 58e3743b7faa9836606ee91798fe80dfc0040da7
Author: David Young <dyoung@hdfgroup.org>
Date: Wed Nov 20 21:07:21 2019 -0600
Remove custom HDfprintf implementation, using the standard library's,
instead. Take a swipe at repairing fprintf format strings, mainly
replacing "%Hu" with "%" PRIuHSIZE, "%a" with "%" PRIuHADDR, "%Zu" with
"%zu".
Here and there remove an awkward cast of a printf argument to `long
long` and use PRI[doux]8, PRI[doux]32, or PRI[doux]64, instead.
Change occurrences of "%t" to "%s" and perform a suitable change of
argument, `cond` -> `cond ? "TRUE" : "FALSE"`.
Some occurrences of %Hu, %a, and %t remain, they just weren't flagged by
the compiler because of #ifdef'age.
commit d4366909293fa970c23512ac80e5d865d76cddbf
Author: David Young <dyoung@hdfgroup.org>
Date: Wed Nov 20 20:54:32 2019 -0600
Promote format-string warnigns to errors.
2019-11-28 03:58:43 +08:00
|
|
|
HDfprintf(stdout, "#%03d 0x%016" PRIxHSIZE "%47s", i, hs_offset[0], "");
|
2012-03-05 22:17:14 +08:00
|
|
|
HDfflush(stdout);
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
if (H5Dread(d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
|
|
|
/* Check */
|
|
|
|
for (j = zero = wrong = 0; j < WRT_SIZE; j++) {
|
|
|
|
if (0 == buf[j])
|
|
|
|
zero++;
|
|
|
|
else if (buf[j] != i + 1)
|
|
|
|
wrong++;
|
|
|
|
}
|
|
|
|
if (zero) {
|
2012-03-05 22:17:14 +08:00
|
|
|
H5_FAILED();
|
2019-01-11 09:51:42 +08:00
|
|
|
HDprintf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
|
2020-09-30 22:27:10 +08:00
|
|
|
}
|
|
|
|
else if (wrong) {
|
2012-03-05 22:17:14 +08:00
|
|
|
SKIPPED();
|
|
|
|
HDputs(" Possible overlap with another region.");
|
|
|
|
nerrors++;
|
2020-09-30 22:27:10 +08:00
|
|
|
}
|
|
|
|
else {
|
2012-03-05 22:17:14 +08:00
|
|
|
PASSED();
|
|
|
|
}
|
1998-04-15 00:44:46 +08:00
|
|
|
}
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Dclose(d2) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
if (H5Sclose(mspace) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
if (H5Sclose(fspace) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
if (H5Fclose(file) < 0)
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
HDfree(buf);
|
2012-03-05 22:17:14 +08:00
|
|
|
HDfclose(script);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (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/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
return nerrors;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (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/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
error:
|
2020-09-30 22:27:10 +08:00
|
|
|
H5E_BEGIN_TRY
|
|
|
|
{
|
2012-03-05 22:17:14 +08:00
|
|
|
H5Dclose(d2);
|
|
|
|
H5Sclose(mspace);
|
|
|
|
H5Sclose(fspace);
|
|
|
|
H5Fclose(file);
|
2020-09-30 22:27:10 +08:00
|
|
|
}
|
|
|
|
H5E_END_TRY;
|
|
|
|
if (buf)
|
2012-03-05 22:17:14 +08:00
|
|
|
HDfree(buf);
|
2020-09-30 22:27:10 +08:00
|
|
|
if (script)
|
2012-03-05 22:17:14 +08:00
|
|
|
HDfclose(script);
|
1998-07-16 05:21:15 +08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2002-03-29 07:46:55 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: usage
|
2002-03-29 07:46:55 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Purpose: Print command usage
|
2002-03-29 07:46:55 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: void
|
2002-03-29 07:46:55 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Albert Chent
|
2002-03-29 07:46:55 +08:00
|
|
|
* Mar 28, 2002
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2002-04-18 22:05:38 +08:00
|
|
|
static void
|
2002-03-29 07:46:55 +08:00
|
|
|
usage(void)
|
|
|
|
{
|
|
|
|
HDfprintf(stdout,
|
2020-09-30 22:27:10 +08:00
|
|
|
"Usage: big [-h] [-c] [-fsize <fsize>}\n"
|
|
|
|
"\t-h\tPrint the help page\n"
|
|
|
|
"\t-c\tFile system Checking skipped. Caution: this test generates\n"
|
|
|
|
"\t\tmany big files and may fill up the file system.\n"
|
|
|
|
"\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
|
|
|
|
"\t\ta positive float point number. Default value is %" PRIuHSIZE ".\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);
|
2002-03-29 07:46:55 +08:00
|
|
|
}
|
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
static int
|
|
|
|
test_sec2(hid_t fapl)
|
2010-11-12 02:17:02 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
char filename[1024];
|
|
|
|
fsizes_t testsize;
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
testsize = supports_big();
|
2020-09-30 22:27:10 +08:00
|
|
|
if (testsize == NO_FILE) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
|
|
|
|
goto quit;
|
|
|
|
}
|
|
|
|
/* Test big file with the SEC2 driver */
|
|
|
|
HDputs("Testing big file with the SEC2 Driver ");
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
|
2012-03-05 22:17:14 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (writer(filename, fapl, testsize, WRT_N))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (reader(filename, fapl))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
2012-03-05 22:17:14 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
HDputs("Test passed with the SEC2 Driver.");
|
2012-03-05 22:17:14 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
quit:
|
|
|
|
/* End with normal return code */
|
|
|
|
/* Clean up the test file */
|
2015-09-22 10:11:54 +08:00
|
|
|
h5_clean_files(FILENAME, fapl);
|
|
|
|
HDremove(DNAME);
|
2013-10-25 12:57:01 +08:00
|
|
|
return 0;
|
2012-03-05 22:17:14 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
error:
|
|
|
|
HDputs("*** TEST FAILED ***");
|
|
|
|
return 1;
|
|
|
|
} /* end test_sec2() */
|
2012-03-05 22:17:14 +08:00
|
|
|
|
2020-04-21 07:12:00 +08:00
|
|
|
static int
|
2013-10-25 12:57:01 +08:00
|
|
|
test_stdio(hid_t fapl)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
char filename[1024];
|
|
|
|
fsizes_t testsize;
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
testsize = supports_big();
|
2020-09-30 22:27:10 +08:00
|
|
|
if (testsize == NO_FILE) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
|
|
|
|
goto quit;
|
|
|
|
}
|
|
|
|
HDputs("\nTesting big file with the STDIO Driver ");
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (writer(filename, fapl, testsize, WRT_N))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (reader(filename, fapl))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
HDputs("Test passed with the STDIO Driver.");
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
/* Flush stdout at the end of this test routine to ensure later
|
|
|
|
* output to stderr will not come out before it.
|
|
|
|
*/
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
quit:
|
|
|
|
/* End with normal return code */
|
|
|
|
/* Clean up the test file */
|
2015-09-22 10:11:54 +08:00
|
|
|
h5_clean_files(FILENAME, fapl);
|
|
|
|
HDremove(DNAME);
|
2013-10-25 12:57:01 +08:00
|
|
|
HDfflush(stdout);
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
error:
|
|
|
|
HDputs("*** TEST FAILED ***");
|
|
|
|
HDfflush(stdout);
|
|
|
|
return 1;
|
|
|
|
} /* end test_stdio() */
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
static int
|
|
|
|
test_family(hid_t fapl)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
char filename[1024];
|
2013-10-25 12:57:01 +08:00
|
|
|
|
|
|
|
/* Test huge file with the family driver */
|
|
|
|
HDputs("Testing big file with the Family Driver ");
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (cflag) {
|
2013-10-25 12:57:01 +08:00
|
|
|
/*
|
|
|
|
* We shouldn't run this test if the file system doesn't support holes
|
|
|
|
* because we would generate multi-gigabyte files.
|
|
|
|
*/
|
|
|
|
HDputs("Checking if file system is adequate for this test...");
|
2020-09-30 22:27:10 +08:00
|
|
|
if (sizeof(long long) < 8 || 0 == GB8LL) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDputs("Test skipped because sizeof(long long) is too small. This");
|
|
|
|
HDputs("hardware apparently doesn't support 64-bit integer types.");
|
|
|
|
usage();
|
2012-03-05 22:17:14 +08:00
|
|
|
goto quit;
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!sparse_support) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDputs("Test skipped because file system does not support holes.");
|
|
|
|
usage();
|
|
|
|
goto quit;
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!enough_room(fapl)) {
|
2013-10-25 12:57:01 +08:00
|
|
|
HDputs("Test skipped because of quota (file size or num open files).");
|
|
|
|
usage();
|
|
|
|
goto quit;
|
|
|
|
}
|
|
|
|
}
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
/* Do the test with the Family Driver */
|
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (writer(filename, fapl, HUGEFILE, WRT_N))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (reader(filename, fapl))
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
2010-11-12 02:17:02 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
HDputs("Test passed with the Family Driver.");
|
2010-11-12 02:17:02 +08:00
|
|
|
|
|
|
|
quit:
|
|
|
|
/* End with normal return code */
|
|
|
|
/* Clean up the test file */
|
2015-09-22 10:11:54 +08:00
|
|
|
h5_clean_files(FILENAME, fapl);
|
|
|
|
HDremove(DNAME);
|
2010-11-12 02:17:02 +08:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
error:
|
2012-03-05 22:17:14 +08:00
|
|
|
HDputs("*** TEST FAILED ***");
|
2010-11-12 02:17:02 +08:00
|
|
|
return 1;
|
2013-10-25 12:57:01 +08:00
|
|
|
} /* end test_family() */
|
2010-11-12 02:17:02 +08:00
|
|
|
|
1998-04-15 00:44:46 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2020-09-05 05:51:30 +08:00
|
|
|
* Function: main
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Purpose:
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Return: Success:
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2020-09-24 22:57:21 +08:00
|
|
|
* Failure:
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2020-09-05 05:51:30 +08:00
|
|
|
* Programmer: Robb Matzke
|
1998-04-15 00:44:46 +08:00
|
|
|
* Friday, April 10, 1998
|
|
|
|
*
|
|
|
|
* Modifications:
|
2020-09-05 05:51:30 +08:00
|
|
|
* Albert Cheng, 2002/03/28
|
|
|
|
* Added command option -fsize.
|
|
|
|
* Albert Cheng, 2002/04/19
|
|
|
|
* Added command option -c.
|
1998-04-15 00:44:46 +08:00
|
|
|
*
|
2007-06-05 03:42:13 +08:00
|
|
|
* Raymond Lu, 2007/05/25
|
|
|
|
* Added similar tests for SEC2 and STDIO drivers.
|
|
|
|
*
|
1998-04-15 00:44:46 +08:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
int
|
2020-09-30 22:27:10 +08:00
|
|
|
main(int ac, char **av)
|
1998-04-15 00:44:46 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
unsigned long seed = 0; /* Random # seed */
|
|
|
|
hid_t fapl = -1;
|
|
|
|
hid_t driver = -1;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-03-29 07:46:55 +08:00
|
|
|
/* parameters setup */
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
while (--ac > 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
av++;
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp("-fsize", *av) == 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
/* specify a different family file size */
|
2020-09-30 22:27:10 +08:00
|
|
|
ac--;
|
|
|
|
av++;
|
2012-03-05 22:17:14 +08:00
|
|
|
if (ac > 0) {
|
|
|
|
family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
else {
|
2019-01-11 09:51:42 +08:00
|
|
|
HDprintf("***Missing fsize value***\n");
|
2012-03-05 22:17:14 +08:00
|
|
|
usage();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
else if (HDstrcmp("-c", *av) == 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
/* turn off file system check before test */
|
2020-09-30 22:27:10 +08:00
|
|
|
cflag = 0;
|
2012-03-05 22:17:14 +08:00
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
else if (HDstrcmp("-h", *av) == 0) {
|
2012-03-05 22:17:14 +08:00
|
|
|
usage();
|
|
|
|
return 0;
|
2020-09-30 22:27:10 +08:00
|
|
|
}
|
|
|
|
else {
|
2012-03-05 22:17:14 +08:00
|
|
|
usage();
|
|
|
|
return 1;
|
|
|
|
}
|
2002-03-29 07:46:55 +08:00
|
|
|
}
|
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
/* check VFD to see if this is one we test */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((fapl = h5_fileaccess()) < 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((driver = H5Pget_driver(fapl)) < 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
|
2010-11-18 07:30:49 +08:00
|
|
|
/* check sparse file support unless cflag is not set. */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (cflag)
|
2012-03-05 22:17:14 +08:00
|
|
|
sparse_support = is_sparse();
|
2010-11-12 02:17:02 +08:00
|
|
|
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
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
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
/* Choose random # seed */
|
|
|
|
seed = (unsigned long)HDtime(NULL);
|
2020-08-07 04:56:04 +08:00
|
|
|
#if 0
|
2012-03-05 22:17:14 +08:00
|
|
|
/* seed = (unsigned long)1155438845; */
|
|
|
|
HDfprintf(stderr, "Random # seed was: %lu\n", seed);
|
2020-08-07 04:56:04 +08:00
|
|
|
#endif
|
2016-07-23 06:43:18 +08:00
|
|
|
HDsrandom((unsigned)seed);
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
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
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
2013-10-25 12:57:01 +08:00
|
|
|
/* run VFD-specific test */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5FD_SEC2 == driver) {
|
|
|
|
if (test_sec2(fapl) != 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
else if (H5FD_STDIO == driver) {
|
|
|
|
if (test_stdio(fapl) != 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
}
|
2020-09-30 22:27:10 +08:00
|
|
|
else if (H5FD_FAMILY == driver) {
|
|
|
|
if (test_family(fapl) != 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
HDputs("This VFD is not supported");
|
2002-04-20 02:54:51 +08:00
|
|
|
|
|
|
|
/* End with normal exit code */
|
2013-10-25 12:57:01 +08:00
|
|
|
/* fapls are cleaned up in the vfd test code */
|
1998-11-25 22:58:22 +08:00
|
|
|
return 0;
|
1998-07-16 05:21:15 +08:00
|
|
|
|
2002-04-20 02:54:51 +08:00
|
|
|
error:
|
2012-03-05 22:17:14 +08:00
|
|
|
HDputs("*** TEST FAILED ***");
|
2020-09-30 22:27:10 +08:00
|
|
|
if (fapl > 0)
|
2013-10-25 12:57:01 +08:00
|
|
|
H5Pclose(fapl);
|
1998-11-25 22:58:22 +08:00
|
|
|
return 1;
|
[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.
1998-04-10 04:22:11 +08:00
|
|
|
}
|