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 *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. 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
|
|
|
|
/*
|
|
|
|
|
* Programmer: Robb Matzke <matzke@llnl.gov>
|
|
|
|
|
* Wednesday, April 8, 1998
|
|
|
|
|
*/
|
2001-04-04 02:09:16 +08:00
|
|
|
|
#include "h5test.h"
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
const char *FILENAME[] = {
|
|
|
|
|
"big",
|
|
|
|
|
NULL
|
|
|
|
|
};
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
|
#define DNAME "big.data"
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-04-15 00:44:46 +08:00
|
|
|
|
#define WRT_N 50
|
|
|
|
|
#define WRT_SIZE 4*1024
|
1998-05-14 01:58:24 +08:00
|
|
|
|
#define FAMILY_SIZE 1024*1024*1024
|
1998-11-03 01:58:28 +08:00
|
|
|
|
|
2005-03-30 06:14:47 +08:00
|
|
|
|
#define MAX_TRIES 100
|
|
|
|
|
|
2002-04-28 16:34:17 +08:00
|
|
|
|
#if H5_SIZEOF_LONG_LONG >= 8
|
1998-11-25 22:58:22 +08:00
|
|
|
|
# define GB8LL ((unsigned long_long)8*1024*1024*1024)
|
1998-10-24 02:16:48 +08:00
|
|
|
|
#else
|
1999-11-17 03:08:14 +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
|
|
|
|
|
2002-04-20 02:54:51 +08:00
|
|
|
|
/* Protocols */
|
2002-04-23 01:48:24 +08:00
|
|
|
|
static void usage(void);
|
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];
|
1998-07-16 05:21:15 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-11-25 22:58:22 +08:00
|
|
|
|
* Function: randll
|
1998-07-16 05:21:15 +08:00
|
|
|
|
*
|
1998-11-25 22:58:22 +08:00
|
|
|
|
* Purpose: Create a random long_long value.
|
2005-03-30 06:14:47 +08:00
|
|
|
|
* Ensures that a write at this value doesn't overlap any
|
|
|
|
|
* previous write.
|
1998-07-16 05:21:15 +08:00
|
|
|
|
*
|
1998-11-25 22:58:22 +08:00
|
|
|
|
* Return: Success: Random value
|
1998-07-16 05:21:15 +08:00
|
|
|
|
*
|
2005-03-30 06:14:47 +08:00
|
|
|
|
* Failure: Random value which overlaps another write
|
1998-07-16 05:21:15 +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
|
|
|
|
{
|
2005-03-30 06:14:47 +08:00
|
|
|
|
hsize_t acc;
|
|
|
|
|
int overlap = 1;
|
|
|
|
|
int i;
|
|
|
|
|
int tries = 0;
|
|
|
|
|
|
|
|
|
|
/* Generate up to MAX_TRIES random numbers until one of them */
|
|
|
|
|
/* does not overlap with any previous writes */
|
|
|
|
|
while(overlap != 0 && tries < MAX_TRIES)
|
|
|
|
|
{
|
|
|
|
|
acc = rand ();
|
|
|
|
|
acc *= rand ();
|
|
|
|
|
acc = acc % limit;
|
|
|
|
|
overlap = 0;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
2005-03-30 06:14:47 +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;
|
2005-03-30 06:14:47 +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++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-07-16 05:21:15 +08:00
|
|
|
|
* Function: is_sparse
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Determines if the file system of the current working
|
|
|
|
|
* directory supports holes.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: Non-zero if holes are supported; zero
|
|
|
|
|
* otherwise.
|
|
|
|
|
*
|
|
|
|
|
* Failure: zero
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, July 15, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static int
|
|
|
|
|
is_sparse(void)
|
|
|
|
|
{
|
|
|
|
|
int fd;
|
2002-04-19 15:20:41 +08:00
|
|
|
|
h5_stat_t sb;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2003-01-18 04:34:14 +08:00
|
|
|
|
if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666))<0) return 0;
|
|
|
|
|
if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0;
|
|
|
|
|
if (5!=HDwrite(fd, "hello", 5)) return 0;
|
|
|
|
|
if (HDclose(fd)<0) return 0;
|
|
|
|
|
if (HDstat("x.h5", &sb)<0) return 0;
|
|
|
|
|
if (HDunlink("x.h5")<0) return 0;
|
2000-11-11 23:58:12 +08:00
|
|
|
|
#ifdef H5_HAVE_STAT_ST_BLOCKS
|
2000-08-05 04:48:09 +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
|
|
|
|
}
|
|
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: enough_room
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: Non-zero
|
|
|
|
|
*
|
|
|
|
|
* Failure: zero
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Thursday, August 6, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static int
|
1998-11-25 22:58:22 +08:00
|
|
|
|
enough_room(hid_t fapl)
|
1998-08-07 05:32:33 +08:00
|
|
|
|
{
|
|
|
|
|
int ret_value=0;
|
|
|
|
|
int fd[68];
|
|
|
|
|
size_t i, size = (size_t)1 << 30;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
char filename[1024], name[1024];
|
1998-11-17 03:08:18 +08:00
|
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
|
/* Initialize file descriptors */
|
|
|
|
|
for (i=0; i<NELMTS(fd); i++) fd[i] = -1;
|
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
/* Get file name template */
|
1999-08-11 04:21:32 +08:00
|
|
|
|
assert(H5FD_FAMILY==H5Pget_driver(fapl));
|
1998-11-25 22:58:22 +08:00
|
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
|
|
|
|
|
1998-08-07 05:32:33 +08:00
|
|
|
|
/* Create files */
|
|
|
|
|
for (i=0; i<NELMTS(fd); i++) {
|
1998-11-25 22:58:22 +08:00
|
|
|
|
HDsnprintf(name, sizeof name, filename, i);
|
2004-08-07 03:29:57 +08:00
|
|
|
|
if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) {
|
1998-08-07 05:32:33 +08:00
|
|
|
|
goto done;
|
|
|
|
|
}
|
2004-08-07 03:29:57 +08:00
|
|
|
|
if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
|
1998-08-07 05:32:33 +08:00
|
|
|
|
goto done;
|
|
|
|
|
}
|
2004-08-07 03:29:57 +08:00
|
|
|
|
if (1!=HDwrite(fd[i], "X", 1)) {
|
1998-08-07 05:32:33 +08:00
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ret_value = 1;
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
for (i=0; i<NELMTS(fd) && fd[i]>=0; i++) {
|
1998-11-25 22:58:22 +08:00
|
|
|
|
HDsnprintf(name, sizeof name, filename, i);
|
2004-08-07 03:29:57 +08:00
|
|
|
|
if(HDclose(fd[i])<0)
|
2001-10-24 03:20:47 +08:00
|
|
|
|
ret_value=0;
|
2004-08-07 03:29:57 +08:00
|
|
|
|
HDunlink(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;
|
|
|
|
|
}
|
|
|
|
|
|
1998-07-16 05:21:15 +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
|
|
|
|
*
|
|
|
|
|
* Purpose: Creates a *big* dataset.
|
|
|
|
|
*
|
1998-07-16 05:21:15 +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
|
|
|
|
*
|
1998-07-16 05:21:15 +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
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, April 8, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
1998-07-16 05:21:15 +08:00
|
|
|
|
* Robb Matzke, 15 Jul 1998
|
|
|
|
|
* 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
|
1998-11-25 22:58:22 +08:00
|
|
|
|
writer (hid_t fapl, 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
|
|
|
|
{
|
|
|
|
|
hsize_t size1[4] = {8, 1024, 1024, 1024};
|
1998-07-16 05:21:15 +08:00
|
|
|
|
hsize_t size2[1] = {GB8LL};
|
2004-12-29 22:26:20 +08:00
|
|
|
|
hsize_t hs_start[1];
|
1998-04-15 00:44:46 +08:00
|
|
|
|
hsize_t hs_size[1];
|
1998-11-25 22:58:22 +08:00
|
|
|
|
hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
int *buf = malloc (sizeof(int) * WRT_SIZE);
|
|
|
|
|
int i, j;
|
1998-07-16 05:21:15 +08:00
|
|
|
|
FILE *out = fopen(DNAME, "w");
|
1998-11-25 22:58:22 +08:00
|
|
|
|
char filename[1024];
|
2003-04-09 07:16:40 +08:00
|
|
|
|
hid_t dcpl;
|
[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-11-25 22:58:22 +08:00
|
|
|
|
TESTING("large dataset write");
|
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
|
|
|
|
|
*/
|
1998-11-25 22:58:22 +08:00
|
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
1999-08-18 03:12:59 +08:00
|
|
|
|
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
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. */
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if ((space1 = H5Screate_simple (4, size1, size1))<0 ||
|
|
|
|
|
(space2 = H5Screate_simple (1, size2, size2))<0) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
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 */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
/*
|
2003-04-09 07:16:40 +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
|
|
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT))<0 ||
|
|
|
|
|
(d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT))<0) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
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);
|
|
|
|
|
if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, dcpl))<0 ||
|
|
|
|
|
(d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, dcpl))<0) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
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;
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if ((mem_space = H5Screate_simple (1, hs_size, hs_size))<0) goto error;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
for (i=0; i<wrt_n; i++) {
|
2005-03-30 06:14:47 +08:00
|
|
|
|
hs_start[0] = randll (size2[0], i);
|
1998-07-16 05:21:15 +08:00
|
|
|
|
HDfprintf (out, "#%03d 0x%016Hx\n", i, hs_start[0]);
|
|
|
|
|
if (H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL,
|
|
|
|
|
hs_size, NULL)<0) goto error;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
for (j=0; j<WRT_SIZE; j++) {
|
|
|
|
|
buf[j] = i+1;
|
|
|
|
|
}
|
1998-07-16 05:21:15 +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
|
|
|
|
|
1998-07-16 05:21:15 +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;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
free (buf);
|
2001-10-24 05:38:21 +08:00
|
|
|
|
fclose(out);
|
1998-11-25 22:58:22 +08:00
|
|
|
|
PASSED();
|
1998-07-16 05:21:15 +08:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
error:
|
1998-11-25 22:58:22 +08:00
|
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
|
H5Dclose(d1);
|
|
|
|
|
H5Dclose(d2);
|
|
|
|
|
H5Sclose(space1);
|
|
|
|
|
H5Sclose(space2);
|
|
|
|
|
H5Sclose(mem_space);
|
|
|
|
|
H5Fclose(file);
|
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
if (buf) free(buf);
|
|
|
|
|
if (out) fclose(out);
|
1998-07-16 05:21:15 +08:00
|
|
|
|
return 1;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: reader
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Reads some data from random locations in the dataset.
|
|
|
|
|
*
|
1998-07-16 05:21:15 +08:00
|
|
|
|
* Return: Success: 0
|
|
|
|
|
*
|
|
|
|
|
* Failure: >0
|
1998-04-15 00:44:46 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Friday, April 10, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
1998-07-16 05:21:15 +08:00
|
|
|
|
static int
|
1998-11-25 22:58:22 +08:00
|
|
|
|
reader (hid_t fapl)
|
1998-04-15 00:44:46 +08:00
|
|
|
|
{
|
1998-11-25 22:58:22 +08:00
|
|
|
|
FILE *script = NULL;
|
|
|
|
|
hid_t file=-1, mspace=-1, fspace=-1, d2=-1;
|
1998-07-16 05:21:15 +08:00
|
|
|
|
char ln[128], *s;
|
2004-12-29 22:26:20 +08:00
|
|
|
|
hsize_t hs_offset[1];
|
1998-04-15 00:44:46 +08:00
|
|
|
|
hsize_t hs_size[1] = {WRT_SIZE};
|
|
|
|
|
int *buf = malloc (sizeof(int) * WRT_SIZE);
|
1998-07-16 05:21:15 +08:00
|
|
|
|
int i, j, zero, wrong, nerrors=0;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
char filename[1024];
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/* Open script file */
|
1998-07-16 05:21:15 +08:00
|
|
|
|
script = fopen (DNAME, "r");
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/* Open HDF5 file */
|
1998-11-25 22:58:22 +08:00
|
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
1999-08-18 03:12:59 +08:00
|
|
|
|
if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/* Open the dataset */
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if ((d2 = H5Dopen (file, "d2"))<0) goto error;
|
|
|
|
|
if ((fspace = H5Dget_space (d2))<0) goto error;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/* Describe `buf' */
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if ((mspace = H5Screate_simple (1, hs_size, hs_size))<0) goto error;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/* Read each region */
|
|
|
|
|
while (fgets (ln, sizeof(ln), script)) {
|
|
|
|
|
if ('#'!=ln[0]) break;
|
1998-05-14 01:58:24 +08:00
|
|
|
|
i = (int)strtol (ln+1, &s, 10);
|
1998-04-15 00:44:46 +08:00
|
|
|
|
hs_offset[0] = HDstrtoll (s, NULL, 0);
|
1998-07-16 05:21:15 +08:00
|
|
|
|
HDfprintf (stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], "");
|
1998-04-15 00:44:46 +08:00
|
|
|
|
fflush (stdout);
|
|
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if (H5Sselect_hyperslab (fspace, H5S_SELECT_SET, hs_offset, NULL,
|
|
|
|
|
hs_size, NULL)<0) goto error;
|
|
|
|
|
if (H5Dread (d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf)<0) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/* Check */
|
|
|
|
|
for (j=zero=wrong=0; j<WRT_SIZE; j++) {
|
|
|
|
|
if (0==buf[j]) zero++;
|
|
|
|
|
else if (buf[j]!=i+1) wrong++;
|
|
|
|
|
}
|
|
|
|
|
if (zero) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" %d zero%s\n", zero, 1==zero?"":"s");
|
1998-04-15 00:44:46 +08:00
|
|
|
|
} else if (wrong) {
|
1998-11-25 22:58:22 +08:00
|
|
|
|
SKIPPED();
|
|
|
|
|
puts(" Possible overlap with another region.");
|
1998-07-16 05:21:15 +08:00
|
|
|
|
nerrors++;
|
1998-04-15 00:44:46 +08:00
|
|
|
|
} else {
|
1998-11-25 22:58:22 +08:00
|
|
|
|
PASSED();
|
1998-04-15 00:44:46 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1998-07-16 05:21:15 +08:00
|
|
|
|
if (H5Dclose (d2)<0) goto error;
|
|
|
|
|
if (H5Sclose (mspace)<0) goto error;
|
|
|
|
|
if (H5Sclose (fspace)<0) goto error;
|
|
|
|
|
if (H5Fclose (file)<0) goto error;
|
1998-05-01 13:16:50 +08:00
|
|
|
|
free (buf);
|
1998-04-15 00:44:46 +08:00
|
|
|
|
fclose (script);
|
1998-07-16 05:21:15 +08:00
|
|
|
|
return nerrors;
|
|
|
|
|
|
|
|
|
|
error:
|
1998-11-25 22:58:22 +08:00
|
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
|
H5Dclose(d2);
|
|
|
|
|
H5Sclose(mspace);
|
|
|
|
|
H5Sclose(fspace);
|
|
|
|
|
H5Fclose(file);
|
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
if (buf) free(buf);
|
|
|
|
|
if (script) fclose(script);
|
1998-07-16 05:21:15 +08:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-29 07:46:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: usage
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Print command usage
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Albert Chent
|
|
|
|
|
* 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,
|
2002-04-20 02:54:51 +08:00
|
|
|
|
"Usage: big [-h] [-c] [-fsize <fsize>}\n"
|
2002-03-29 07:46:55 +08:00
|
|
|
|
"\t-h\tPrint the help page\n"
|
2002-04-20 02:54:51 +08:00
|
|
|
|
"\t-c\tFile system Checking skipped. Caution: this test generates\n"
|
|
|
|
|
"\t\tmany big files and may fill up the file system.\n"
|
2002-03-29 07:46:55 +08:00
|
|
|
|
"\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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1998-04-15 00:44:46 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: main
|
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
|
* Purpose:
|
1998-04-15 00:44:46 +08:00
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
|
* Return: Success:
|
1998-04-15 00:44:46 +08:00
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
|
* Failure:
|
1998-04-15 00:44:46 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Friday, April 10, 1998
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
2002-03-29 07:46:55 +08:00
|
|
|
|
* Albert Cheng, 2002/03/28
|
|
|
|
|
* Added command option -fsize.
|
2002-04-20 02:54:51 +08:00
|
|
|
|
* Albert Cheng, 2002/04/19
|
|
|
|
|
* Added command option -c.
|
1998-04-15 00:44:46 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
int
|
2002-03-29 07:46:55 +08:00
|
|
|
|
main (int ac, char **av)
|
1998-04-15 00:44:46 +08:00
|
|
|
|
{
|
1998-11-25 22:58:22 +08:00
|
|
|
|
hid_t fapl=-1;
|
|
|
|
|
hsize_t family_size;
|
2002-03-29 07:46:55 +08:00
|
|
|
|
hsize_t family_size_def; /* default family file size */
|
2002-04-23 01:48:24 +08:00
|
|
|
|
double family_size_def_dbl; /* default family file size */
|
2002-04-20 02:54:51 +08:00
|
|
|
|
int cflag=1; /* check file system before test */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2002-03-29 07:46:55 +08:00
|
|
|
|
/* 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){
|
2002-04-23 01:48:24 +08:00
|
|
|
|
family_size_def_dbl = atof(*av);
|
|
|
|
|
H5_ASSIGN_OVERFLOW(family_size_def,family_size_def_dbl,double,hsize_t);
|
2002-03-29 07:46:55 +08:00
|
|
|
|
if (family_size_def <= 0)
|
|
|
|
|
family_size_def = (hsize_t)FAMILY_SIZE;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
printf("***Missing fsize value***\n");
|
|
|
|
|
usage();
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-04-20 02:54:51 +08:00
|
|
|
|
else if (strcmp("-c", *av)==0){
|
|
|
|
|
/* turn off file system check before test */
|
|
|
|
|
cflag=0;
|
|
|
|
|
}
|
2002-03-29 07:46:55 +08:00
|
|
|
|
else if (strcmp("-h", *av)==0){
|
|
|
|
|
usage();
|
|
|
|
|
return 0;
|
|
|
|
|
}else{
|
|
|
|
|
usage();
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
/* Reset library */
|
|
|
|
|
h5_reset();
|
|
|
|
|
fapl = h5_fileaccess();
|
|
|
|
|
|
|
|
|
|
/* The file driver must be the family driver */
|
1999-08-11 04:21:32 +08:00
|
|
|
|
if (H5FD_FAMILY!=H5Pget_driver(fapl)) {
|
2002-03-29 07:46:55 +08:00
|
|
|
|
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;
|
1999-08-11 04:21:32 +08:00
|
|
|
|
} else if (H5Pget_fapl_family(fapl, &family_size, NULL)<0) {
|
1998-11-25 22:58:22 +08:00
|
|
|
|
goto error;
|
2002-03-29 07:46:55 +08:00
|
|
|
|
} 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;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
2002-04-20 02:54:51 +08:00
|
|
|
|
if (cflag){
|
|
|
|
|
/*
|
|
|
|
|
* We shouldn't run this test if the file system doesn't support holes
|
|
|
|
|
* because we would generate multi-gigabyte files.
|
|
|
|
|
*/
|
|
|
|
|
puts("Checking if file system is adequate for this test...");
|
|
|
|
|
if (sizeof(long_long)<8 || 0==GB8LL) {
|
|
|
|
|
puts("Test skipped because sizeof(long_long) is too small. This");
|
|
|
|
|
puts("hardware apparently doesn't support 64-bit integer types.");
|
|
|
|
|
usage();
|
|
|
|
|
goto quit;
|
|
|
|
|
}
|
|
|
|
|
if (!is_sparse()) {
|
|
|
|
|
puts("Test skipped because file system does not support holes.");
|
|
|
|
|
usage();
|
|
|
|
|
goto quit;
|
|
|
|
|
}
|
|
|
|
|
if (!enough_room(fapl)) {
|
|
|
|
|
puts("Test skipped because of quota (file size or num open files).");
|
|
|
|
|
usage();
|
|
|
|
|
goto quit;
|
|
|
|
|
}
|
|
|
|
|
if (sizeof(hsize_t)<=4) {
|
|
|
|
|
puts("Test skipped because the hdf5 library was configured with the");
|
|
|
|
|
puts("--disable-hsizet flag in order to work around a compiler bug.");
|
|
|
|
|
usage();
|
|
|
|
|
goto quit;
|
|
|
|
|
}
|
1998-10-09 01:13:14 +08:00
|
|
|
|
}
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
/* Do the test */
|
|
|
|
|
if (writer(fapl, WRT_N)) goto error;
|
|
|
|
|
if (reader(fapl)) goto error;
|
|
|
|
|
puts("All big tests passed.");
|
2002-04-20 02:54:51 +08:00
|
|
|
|
|
|
|
|
|
quit:
|
|
|
|
|
/* End with normal exit code */
|
2000-09-10 08:08:27 +08:00
|
|
|
|
if (h5_cleanup(FILENAME, fapl)) remove(DNAME);
|
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:
|
1999-08-18 03:12:59 +08:00
|
|
|
|
if (fapl>=0) H5Pclose(fapl);
|
1998-11-25 22:58:22 +08:00
|
|
|
|
puts("*** TEST FAILED ***");
|
|
|
|
|
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
|
|
|
|
}
|