2003-02-17 23:54:15 +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 *
|
|
|
|
|
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
|
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/* Programmer: Robb Matzke <matzke@llnl.gov>
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Wednesday, October 15, 1997
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Tests various aspects of indexed raw data storage.
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*/
|
2003-02-17 23:54:15 +08:00
|
|
|
|
|
2000-10-10 15:44:33 +08:00
|
|
|
|
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
|
|
|
|
|
|
2001-04-04 02:09:16 +08:00
|
|
|
|
#include "h5test.h"
|
|
|
|
|
#include "H5private.h"
|
|
|
|
|
#include "H5Dprivate.h"
|
2002-05-29 02:18:01 +08:00
|
|
|
|
#include "H5Eprivate.h"
|
2001-04-04 02:09:16 +08:00
|
|
|
|
#include "H5Iprivate.h"
|
|
|
|
|
#include "H5Pprivate.h"
|
|
|
|
|
#include "H5Fpkg.h"
|
|
|
|
|
#include "H5Gprivate.h"
|
|
|
|
|
#include "H5MMprivate.h"
|
|
|
|
|
#include "H5Oprivate.h"
|
2002-04-26 02:02:17 +08:00
|
|
|
|
#include "H5Pprivate.h"
|
2001-04-04 02:09:16 +08:00
|
|
|
|
#include "H5Vprivate.h"
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
const char *FILENAME[] = {
|
|
|
|
|
"istore",
|
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
#define TEST_SMALL 0x0001
|
|
|
|
|
#define TEST_MEDIUM 0x0002
|
|
|
|
|
#define TEST_LARGE 0x0004
|
1997-10-23 06:08:14 +08:00
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
hsize_t align_g[3] = {50, 50, 50};
|
|
|
|
|
hssize_t zero[H5O_LAYOUT_NDIMS];
|
1998-01-21 03:10:08 +08:00
|
|
|
|
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Function: print_array
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Prints the values in an array
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Return: void
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Friday, October 10, 1997
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static void
|
1998-11-19 02:40:09 +08:00
|
|
|
|
print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
|
1997-10-21 07:14:35 +08:00
|
|
|
|
{
|
1998-04-07 23:34:16 +08:00
|
|
|
|
size_t i, j, k;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < nx; i++) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
if (nz > 1) {
|
1999-03-02 03:44:32 +08:00
|
|
|
|
printf("i=%lu:\n", (unsigned long)i);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
} else {
|
1999-03-02 03:44:32 +08:00
|
|
|
|
printf("%03lu:", (unsigned long)i);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < ny; j++) {
|
|
|
|
|
if (nz > 1)
|
1999-03-02 03:44:32 +08:00
|
|
|
|
printf("%03lu:", (unsigned long)j);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
for (k = 0; k < nz; k++) {
|
|
|
|
|
printf(" %3d", *array++);
|
|
|
|
|
}
|
|
|
|
|
if (nz > 1)
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
printf("\n");
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1997-10-21 07:14:35 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Function: new_object
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Creates a new object that refers to a indexed storage of raw
|
|
|
|
|
* data. No raw data is stored.
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-11-25 22:58:22 +08:00
|
|
|
|
* Return: Success: 0
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-11-25 22:58:22 +08:00
|
|
|
|
* Failure: -1
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, October 15, 1997
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
1998-01-06 11:07:15 +08:00
|
|
|
|
static int
|
2001-08-15 06:09:56 +08:00
|
|
|
|
new_object(H5F_t *f, const char *name, unsigned ndims, H5G_entry_t *ent/*out*/)
|
1997-10-21 07:14:35 +08:00
|
|
|
|
{
|
1998-04-09 05:43:02 +08:00
|
|
|
|
H5O_layout_t layout;
|
2001-08-15 06:09:56 +08:00
|
|
|
|
unsigned u;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
/* Create the object header */
|
[svn-r6252] Purpose:
Lots of performance improvements & a couple new internal API interfaces.
Description:
Performance Improvements:
- Cached file offset & length sizes in shared file struct, to avoid
constantly looking them up in the FCPL.
- Generic property improvements:
- Added "revision" number to generic property classes to speed
up comparisons.
- Changed method of storing properties from using a hash-table
to the TBBT routines in the library.
- Share the propery names between classes and the lists derived
from them.
- Removed redundant 'def_value' buffer from each property.
- Switching code to use a "copy on write" strategy for
properties in each list, where the properties in each list
are shared with the properties in the class, until a
property's value is changed in a list.
- Fixed error in layout code which was allocating too many buffers.
- Redefined public macros of the form (H5open()/H5check, <variable>)
internally to only be (<variable>), avoiding innumerable useless
calls to H5open() and H5check_version().
- Reuse already zeroed buffers in H5F_contig_fill instead of
constantly re-zeroing them.
- Don't write fill values if writing entire dataset.
- Use gettimeofday() system call instead of time() system when
checking the modification time of a dataset.
- Added reference counted string API and use it for tracking the
names of objects opening in a file (for the ID->name code).
- Removed redundant H5P_get() calls in B-tree routines.
- Redefine H5T datatype macros internally to the library, to avoid
calling H5check redundantly.
- Keep dataspace information for dataset locally instead of reading
from disk each time. Added new module to track open objects
in a file, to allow this (which will be useful eventually for
some FPH5 metadata caching issues).
- Remove H5AC_find macro which was inlining metadata cache lookups,
and call function instead.
- Remove redundant memset() calls from H5G_namei() routine.
- Remove redundant checking of object type when locating objects
in metadata cache and rely on the address only.
- Create default dataset object to use when default dataset creation
property list is used to create datasets, bypassing querying
for all the property list values.
- Use default I/O vector size when performing raw data with the
default dataset transfer property list, instead of querying for
I/O vector size.
- Remove H5P_DEFAULT internally to the library, replacing it with
more specific default property list based on the type of
property list needed.
- Remove redundant memset() calls in object header message (H5O*)
routines.
- Remove redunant memset() calls in data I/O routines.
- Split free-list allocation routines into malloc() and calloc()-
like routines, instead of one combined routine.
- Remove lots of indirection in H5O*() routines.
- Simplify metadata cache entry comparison routine (used when
flushing entire cache out).
- Only enable metadata cache statistics when H5AC_DEBUG is turned
on, instead of always tracking them.
- Simplify address comparison macro (H5F_addr_eq).
- Remove redundant metadata cache entry protections during dataset
creation by protecting the object header once and making all
the modifications necessary for the dataset creation before
unprotecting it.
- Reduce # of "number of element in extent" computations performed
by computing and storing the value during dataspace creation.
- Simplify checking for group location's file information, when file
has not been involving in file-mounting operations.
- Use binary encoding for modification time, instead of ASCII.
- Hoist H5HL_peek calls (to get information in a local heap)
out of loops in many group routine.
- Use static variable for iterators of selections, instead of
dynamically allocation them each time.
- Lookup & insert new entries in one step, avoiding traversing
group's B-tree twice.
- Fixed memory leak in H5Gget_objname_idx() routine (tangential to
performance improvements, but fixed along the way).
- Use free-list for reference counted strings.
- Don't bother copying object names into cached group entries,
since they are re-created when an object is opened.
The benchmark I used to measure these results created several thousand
small (2K) datasets in a file and wrote out the data for them. This is
Elena's "regular.c" benchmark.
These changes resulted in approximately ~4.3x speedup of the
development branch when compared to the previous code in the
development branch and ~1.4x speedup compared to the release
branch.
Additionally, these changes reduce the total memory used (code and
data) by the development branch by ~800KB, bringing the development
branch back into the same ballpark as the release branch.
I'll send out a more detailed description of the benchmark results
as a followup note.
New internal API routines:
Added "reference counted strings" API for tracking strings that get
used by multiple owners without duplicating the strings.
Added "ternary search tree" API for text->object mappings.
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}
Other platforms/configurations tested?
FreeBSD 4.7 (sleipnir) serial & parallel
Solaris 2.6 (baldric) serial
2003-01-10 01:20:03 +08:00
|
|
|
|
HDmemset(ent,0,sizeof(H5G_entry_t));
|
2003-02-11 01:26:09 +08:00
|
|
|
|
if (H5O_create(f, H5P_DATASET_XFER_DEFAULT, 64, ent)) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
puts(" H5O_create() = NULL");
|
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/* create chunked storage */
|
|
|
|
|
layout.type = H5D_CHUNKED;
|
|
|
|
|
layout.ndims = ndims;
|
2001-01-10 05:22:30 +08:00
|
|
|
|
for (u = 0; u < ndims; u++) {
|
|
|
|
|
if (u < (int)NELMTS(align_g)) {
|
|
|
|
|
layout.dim[u] = align_g[u];
|
1998-04-09 05:43:02 +08:00
|
|
|
|
} else {
|
2001-01-10 05:22:30 +08:00
|
|
|
|
layout.dim[u] = 2;
|
1998-04-09 05:43:02 +08:00
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
2002-08-27 21:42:22 +08:00
|
|
|
|
/* Create the root of the B-tree that describes chunked storage */
|
2003-02-11 01:26:09 +08:00
|
|
|
|
H5F_istore_create (f, H5P_DATASET_XFER_DEFAULT, &layout/*in,out*/);
|
2003-02-17 23:54:15 +08:00
|
|
|
|
if (H5O_modify(ent, H5O_LAYOUT_ID, H5O_NEW_MESG, 0, 1, &layout, H5P_DATASET_XFER_DEFAULT) < 0) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
puts(" H5O_modify istore message failure.");
|
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/* Give the object header a name */
|
2003-02-11 01:26:09 +08:00
|
|
|
|
if (H5G_insert(H5G_entof(H5G_rootof(f)), name, ent, H5P_DATASET_XFER_DEFAULT) < 0) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" H5G_insert(f, name=\"%s\", ent) failed\n", name);
|
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/* Close the header */
|
|
|
|
|
H5O_close(ent);
|
|
|
|
|
return 0;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
return -1;
|
1997-10-21 07:14:35 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Function: test_create
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Creates a named object that refers to indexed storage of raw
|
|
|
|
|
* data. No raw data is stored.
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Return: Success: SUCCEED
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Failure: FAIL
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, October 15, 1997
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
1998-01-17 06:23:43 +08:00
|
|
|
|
test_create(H5F_t *f, const char *prefix)
|
1997-10-21 07:14:35 +08:00
|
|
|
|
{
|
1998-04-09 05:43:02 +08:00
|
|
|
|
H5G_entry_t handle;
|
2001-08-15 06:09:56 +08:00
|
|
|
|
unsigned u;
|
1998-04-09 05:43:02 +08:00
|
|
|
|
char name[256];
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
TESTING("istore create");
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
2001-01-10 05:22:30 +08:00
|
|
|
|
for (u = 1; u <= H5O_LAYOUT_NDIMS; u++) {
|
|
|
|
|
HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
|
|
|
|
|
if (new_object(f, name, u, &handle) < 0)
|
1998-04-09 05:43:02 +08:00
|
|
|
|
return FAIL;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
PASSED();
|
1998-01-17 06:23:43 +08:00
|
|
|
|
return SUCCEED;
|
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Function: test_extend
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Creates an empty object and then writes to it in such a way
|
|
|
|
|
* as to always extend the object's domain without creating
|
|
|
|
|
* holes and without causing the object to become concave.
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Return: Success: SUCCEED
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Failure: FAIL
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, October 15, 1997
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
1998-01-17 06:23:43 +08:00
|
|
|
|
test_extend(H5F_t *f, const char *prefix,
|
1998-04-09 05:43:02 +08:00
|
|
|
|
size_t nx, size_t ny, size_t nz)
|
1997-10-21 07:14:35 +08:00
|
|
|
|
{
|
1998-04-09 05:43:02 +08:00
|
|
|
|
H5G_entry_t handle;
|
|
|
|
|
hsize_t i, j, k, ctr;
|
2001-08-15 06:09:56 +08:00
|
|
|
|
unsigned ndims;
|
1998-11-19 02:40:09 +08:00
|
|
|
|
uint8_t *buf = NULL, *check = NULL, *whole = NULL;
|
1998-04-09 05:43:02 +08:00
|
|
|
|
char dims[64], s[256], name[256];
|
|
|
|
|
hssize_t offset[3];
|
|
|
|
|
hssize_t max_corner[3];
|
|
|
|
|
hsize_t size[3];
|
|
|
|
|
hsize_t whole_size[3];
|
|
|
|
|
hsize_t nelmts;
|
|
|
|
|
H5O_layout_t layout;
|
2002-04-26 02:02:17 +08:00
|
|
|
|
H5P_genplist_t *dc_plist=NULL;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
if (!nz) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
if (!ny) {
|
|
|
|
|
ndims = 1;
|
|
|
|
|
ny = nz = 1;
|
|
|
|
|
sprintf(dims, "%lu", (unsigned long) nx);
|
|
|
|
|
} else {
|
|
|
|
|
ndims = 2;
|
|
|
|
|
nz = 1;
|
|
|
|
|
sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
|
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
} else {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
ndims = 3;
|
|
|
|
|
sprintf(dims, "%lux%lux%lu",
|
|
|
|
|
(unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sprintf(s, "Testing istore extend: %s", dims);
|
|
|
|
|
printf("%-70s", s);
|
1998-06-23 11:41:22 +08:00
|
|
|
|
buf = H5MM_malloc(nx * ny * nz);
|
|
|
|
|
check = H5MM_malloc(nx * ny * nz);
|
|
|
|
|
whole = H5MM_calloc(nx*ny*nz);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
2002-04-26 02:02:17 +08:00
|
|
|
|
/* Get the default dataset creation property list */
|
|
|
|
|
if(NULL == (dc_plist = H5I_object(H5P_DATASET_CREATE_DEFAULT))) {
|
|
|
|
|
printf("not a dset creation property list\n");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/* Build the new empty object */
|
|
|
|
|
sprintf(name, "%s_%s", prefix, dims);
|
|
|
|
|
if (new_object(f, name, ndims, &handle) < 0) {
|
2001-01-10 05:22:30 +08:00
|
|
|
|
printf(" Cannot create %u-d object `%s'\n", ndims, name);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
2003-02-17 23:54:15 +08:00
|
|
|
|
if (NULL == H5O_read(&handle, H5O_LAYOUT_ID, 0, &layout, H5P_DATASET_XFER_DEFAULT)) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
puts(" Unable to read istore message.");
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
if (ndims != layout.ndims) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Header read error: istore.ndims != %d\n", ndims);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
whole_size[0] = nx;
|
|
|
|
|
whole_size[1] = ny;
|
|
|
|
|
whole_size[2] = nz;
|
|
|
|
|
max_corner[0] = 0;
|
|
|
|
|
max_corner[1] = 0;
|
|
|
|
|
max_corner[2] = 0;
|
|
|
|
|
|
1998-04-28 21:59:08 +08:00
|
|
|
|
for (ctr = 0;
|
|
|
|
|
H5V_vector_lt_s(ndims, max_corner, (hssize_t*)whole_size);
|
|
|
|
|
ctr++) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
|
|
|
|
|
/* Size and location */
|
|
|
|
|
if (0 == ctr) {
|
|
|
|
|
offset[0] = offset[1] = offset[2] = 0;
|
|
|
|
|
size[0] = size[1] = size[2] = 1;
|
|
|
|
|
nelmts = 1;
|
|
|
|
|
} else {
|
|
|
|
|
for (i=0, nelmts=1; i<(size_t)ndims; i++) {
|
|
|
|
|
if (ctr % ndims == i) {
|
|
|
|
|
offset[i] = max_corner[i];
|
|
|
|
|
size[i] = MIN(1, whole_size[i] - offset[i]);
|
|
|
|
|
} else {
|
|
|
|
|
offset[i] = 0;
|
|
|
|
|
size[i] = max_corner[i];
|
|
|
|
|
}
|
|
|
|
|
nelmts *= size[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
1997-10-21 07:14:35 +08:00
|
|
|
|
|
|
|
|
|
#if 0
|
1998-04-09 05:43:02 +08:00
|
|
|
|
if (0 == ctr)
|
|
|
|
|
printf("\n");
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Insert: ctr=%d, corner=(%d", ctr, offset[0]);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
if (ndims > 1)
|
|
|
|
|
printf(",%d", offset[1]);
|
|
|
|
|
if (ndims > 2)
|
|
|
|
|
printf(",%d", offset[2]);
|
|
|
|
|
printf("), size=(%d", size[0]);
|
|
|
|
|
if (ndims > 1)
|
|
|
|
|
printf(",%d", size[1]);
|
|
|
|
|
if (ndims > 2)
|
|
|
|
|
printf(",%d", size[2]);
|
|
|
|
|
printf("), %d element%s", nelmts, 1 == nelmts ? "" : "s");
|
|
|
|
|
if (0 == nelmts)
|
|
|
|
|
printf(" *SKIPPED*");
|
|
|
|
|
printf("\n");
|
1997-10-21 07:14:35 +08:00
|
|
|
|
#endif
|
1997-10-23 06:08:14 +08:00
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
/* Fill the source array */
|
|
|
|
|
if (0 == nelmts) continue;
|
|
|
|
|
memset(buf, (signed)(128+ctr), (size_t)nelmts);
|
|
|
|
|
|
|
|
|
|
/* Write to disk */
|
2002-04-26 02:02:17 +08:00
|
|
|
|
if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &layout, dc_plist, size,
|
1998-10-02 02:56:51 +08:00
|
|
|
|
size, zero, offset, buf)<0) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
/* Read from disk */
|
|
|
|
|
memset(check, 0xff, (size_t)nelmts);
|
2002-04-26 02:02:17 +08:00
|
|
|
|
if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &layout, dc_plist, size,
|
1998-10-02 02:56:51 +08:00
|
|
|
|
size, zero, offset, check)<0) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Read failed: ctr=%lu\n", (unsigned long)ctr);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
if (memcmp(buf, check, (size_t)nelmts)) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Read check failed: ctr=%lu\n", (unsigned long)ctr);
|
|
|
|
|
printf(" Wrote:\n");
|
|
|
|
|
print_array(buf, (size_t)size[0], (size_t)size[1],
|
|
|
|
|
(size_t)size[2]);
|
|
|
|
|
printf(" Read:\n");
|
|
|
|
|
print_array(check, (size_t)size[0], (size_t)size[1],
|
|
|
|
|
(size_t)size[2]);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
/* Write to `whole' buffer for later checking */
|
|
|
|
|
H5V_hyper_copy(ndims, size,
|
1998-11-25 22:58:22 +08:00
|
|
|
|
whole_size, offset, whole, /*dst*/
|
|
|
|
|
size, H5V_ZERO, buf); /*src*/
|
1998-04-09 05:43:02 +08:00
|
|
|
|
|
|
|
|
|
/* Update max corner */
|
|
|
|
|
for (i=0; i<(size_t)ndims; i++) {
|
|
|
|
|
max_corner[i] = MAX(max_corner[i], offset[i]+(hssize_t)size[i]);
|
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now read the entire array back out and check it */
|
|
|
|
|
memset(buf, 0xff, nx * ny * nz);
|
2002-04-26 02:02:17 +08:00
|
|
|
|
if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &layout, dc_plist, whole_size,
|
1998-10-01 02:50:49 +08:00
|
|
|
|
whole_size, zero, zero, buf)<0) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
puts(" Read failed for whole array.");
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
for (i=0; i<nx; i++) {
|
|
|
|
|
for (j=0; j<ny; j++) {
|
|
|
|
|
for (k=0; k<nz; k++) {
|
|
|
|
|
if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Check failed at i=%lu", (unsigned long)i);
|
|
|
|
|
if (ndims > 1) {
|
|
|
|
|
printf(", j=%lu", (unsigned long)j);
|
|
|
|
|
}
|
|
|
|
|
if (ndims > 2) {
|
|
|
|
|
printf(", k=%lu", (unsigned long)k);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf("\n Check array is:\n");
|
|
|
|
|
print_array(whole, nx, ny, nz);
|
|
|
|
|
printf(" Value read is:\n");
|
|
|
|
|
print_array(buf, nx, ny, nz);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
H5MM_xfree(buf);
|
|
|
|
|
H5MM_xfree(check);
|
|
|
|
|
H5MM_xfree(whole);
|
1998-11-25 22:58:22 +08:00
|
|
|
|
PASSED();
|
1998-01-17 06:23:43 +08:00
|
|
|
|
return SUCCEED;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
H5MM_xfree(buf);
|
|
|
|
|
H5MM_xfree(check);
|
|
|
|
|
H5MM_xfree(whole);
|
|
|
|
|
return FAIL;
|
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1997-10-23 06:08:14 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Function: test_sparse
|
1997-10-23 06:08:14 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed
|
|
|
|
|
* blocks each of size NX,NY,NZ.
|
1997-10-23 06:08:14 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Return: Success: SUCCEED
|
1997-10-23 06:08:14 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Failure: FAIL
|
1997-10-23 06:08:14 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, October 22, 1997
|
1997-10-23 06:08:14 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
1998-01-17 06:23:43 +08:00
|
|
|
|
test_sparse(H5F_t *f, const char *prefix, size_t nblocks,
|
1998-04-09 05:43:02 +08:00
|
|
|
|
size_t nx, size_t ny, size_t nz)
|
1997-10-23 06:08:14 +08:00
|
|
|
|
{
|
2001-08-15 06:09:56 +08:00
|
|
|
|
unsigned ndims;
|
1998-04-09 05:43:02 +08:00
|
|
|
|
hsize_t ctr;
|
|
|
|
|
char dims[64], s[256], name[256];
|
|
|
|
|
hssize_t offset[3];
|
|
|
|
|
hsize_t size[3], total = 0;
|
|
|
|
|
H5G_entry_t handle;
|
|
|
|
|
H5O_layout_t layout;
|
1998-11-19 02:40:09 +08:00
|
|
|
|
uint8_t *buf = NULL;
|
2002-04-26 02:02:17 +08:00
|
|
|
|
H5P_genplist_t *dc_plist=NULL;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
if (!nz) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
if (!ny) {
|
|
|
|
|
ndims = 1;
|
|
|
|
|
ny = nz = 1;
|
|
|
|
|
sprintf(dims, "%lu", (unsigned long) nx);
|
|
|
|
|
} else {
|
|
|
|
|
ndims = 2;
|
|
|
|
|
nz = 1;
|
|
|
|
|
sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
|
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
} else {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
ndims = 3;
|
|
|
|
|
sprintf(dims, "%lux%lux%lu",
|
|
|
|
|
(unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sprintf(s, "Testing istore sparse: %s", dims);
|
|
|
|
|
printf("%-70s", s);
|
1998-06-23 11:41:22 +08:00
|
|
|
|
buf = H5MM_malloc(nx * ny * nz);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
2002-04-26 02:02:17 +08:00
|
|
|
|
/* Get the default dataset creation property list */
|
|
|
|
|
if(NULL == (dc_plist = H5I_object(H5P_DATASET_CREATE_DEFAULT))) {
|
|
|
|
|
printf("not a dset creation property list\n");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/* Build the new empty object */
|
|
|
|
|
sprintf(name, "%s_%s", prefix, dims);
|
|
|
|
|
if (new_object(f, name, ndims, &handle) < 0) {
|
2001-01-10 05:22:30 +08:00
|
|
|
|
printf(" Cannot create %u-d object `%s'\n", ndims, name);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
2003-02-17 23:54:15 +08:00
|
|
|
|
if (NULL == H5O_read(&handle, H5O_LAYOUT_ID, 0, &layout, H5P_DATASET_XFER_DEFAULT)) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Unable to read istore message\n");
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-04-07 23:34:16 +08:00
|
|
|
|
for (ctr=0; ctr<nblocks; ctr++) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
offset[0] = rand() % 1000000;
|
|
|
|
|
offset[1] = rand() % 1000000;
|
|
|
|
|
offset[2] = rand() % 1000000;
|
|
|
|
|
size[0] = nx;
|
|
|
|
|
size[1] = ny;
|
|
|
|
|
size[2] = nz;
|
|
|
|
|
memset(buf, (signed)(128+ctr), nx * ny * nz);
|
|
|
|
|
|
|
|
|
|
/* write to disk */
|
2002-04-26 02:02:17 +08:00
|
|
|
|
if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &layout, dc_plist, size,
|
1998-10-02 02:56:51 +08:00
|
|
|
|
size, zero, offset, buf)<0) {
|
2001-01-26 01:03:29 +08:00
|
|
|
|
H5_FAILED();
|
1998-11-25 22:58:22 +08:00
|
|
|
|
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
|
|
|
|
|
printf(" offset=(%lu", (unsigned long) (offset[0]));
|
|
|
|
|
if (ndims > 1)
|
|
|
|
|
printf(",%lu", (unsigned long) (offset[1]));
|
|
|
|
|
if (ndims > 2)
|
|
|
|
|
printf(",%lu", (unsigned long) (offset[2]));
|
|
|
|
|
printf("), size=(%lu", (unsigned long) (size[0]));
|
|
|
|
|
if (ndims > 1)
|
|
|
|
|
printf(",%lu", (unsigned long) (size[1]));
|
|
|
|
|
if (ndims > 2)
|
|
|
|
|
printf(",%lu", (unsigned long) (size[2]));
|
|
|
|
|
printf(")\n");
|
1998-04-09 05:43:02 +08:00
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
total += nx * ny * nz;
|
1997-11-14 22:42:14 +08:00
|
|
|
|
#if 0
|
1998-04-09 05:43:02 +08:00
|
|
|
|
printf("ctr: ctr=%d, total=%lu\n", ctr, (unsigned long) total);
|
1997-11-14 22:42:14 +08:00
|
|
|
|
#endif
|
1997-10-23 06:08:14 +08:00
|
|
|
|
|
1998-04-09 05:43:02 +08:00
|
|
|
|
/* We don't test reading yet.... */
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1997-10-23 06:08:14 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
H5MM_xfree(buf);
|
1998-11-25 22:58:22 +08:00
|
|
|
|
PASSED();
|
1998-01-17 06:23:43 +08:00
|
|
|
|
return SUCCEED;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
H5MM_xfree(buf);
|
|
|
|
|
return FAIL;
|
|
|
|
|
}
|
1998-06-06 05:03:49 +08:00
|
|
|
|
|
1998-05-29 07:02:29 +08:00
|
|
|
|
|
1997-10-21 07:14:35 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Function: main
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Purpose: Tests indexed storage stuff.
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Return: Success: exit(0)
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Failure: exit(non-zero)
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
1998-04-09 05:43:02 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Wednesday, October 15, 1997
|
1997-10-21 07:14:35 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
int
|
1998-01-17 06:23:43 +08:00
|
|
|
|
main(int argc, char *argv[])
|
1997-10-21 07:14:35 +08:00
|
|
|
|
{
|
1998-11-25 22:58:22 +08:00
|
|
|
|
hid_t fapl=-1, file=-1, fcpl=-1;
|
|
|
|
|
H5F_t *f;
|
|
|
|
|
herr_t status;
|
|
|
|
|
int nerrors = 0;
|
2001-08-15 06:09:56 +08:00
|
|
|
|
unsigned size_of_test;
|
1998-11-25 22:58:22 +08:00
|
|
|
|
char filename[1024];
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
/* Parse arguments or assume `small' */
|
|
|
|
|
if (1 == argc) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
size_of_test = TEST_SMALL;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
} else {
|
2001-08-15 06:09:56 +08:00
|
|
|
|
int i;
|
1998-04-09 05:43:02 +08:00
|
|
|
|
for (i = 1, size_of_test = 0; i < argc; i++) {
|
|
|
|
|
if (!strcmp(argv[i], "small")) {
|
|
|
|
|
size_of_test |= TEST_SMALL;
|
|
|
|
|
} else if (!strcmp(argv[i], "medium")) {
|
|
|
|
|
size_of_test |= TEST_MEDIUM;
|
|
|
|
|
} else if (!strcmp(argv[i], "large")) {
|
|
|
|
|
size_of_test |= TEST_LARGE;
|
|
|
|
|
} else {
|
|
|
|
|
printf("unrecognized argument: %s\n", argv[i]);
|
1998-03-24 22:53:57 +08:00
|
|
|
|
#if 0
|
1998-04-09 05:43:02 +08:00
|
|
|
|
exit(1);
|
1998-03-24 22:53:57 +08:00
|
|
|
|
#endif
|
1998-04-09 05:43:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
printf("Test sizes: ");
|
|
|
|
|
if (size_of_test & TEST_SMALL)
|
1998-04-09 05:43:02 +08:00
|
|
|
|
printf(" SMALL");
|
1998-01-17 06:23:43 +08:00
|
|
|
|
if (size_of_test & TEST_MEDIUM)
|
1998-04-09 05:43:02 +08:00
|
|
|
|
printf(" MEDIUM");
|
1998-01-17 06:23:43 +08:00
|
|
|
|
if (size_of_test & TEST_LARGE)
|
1998-04-09 05:43:02 +08:00
|
|
|
|
printf(" LARGE");
|
1998-01-17 06:23:43 +08:00
|
|
|
|
printf("\n");
|
|
|
|
|
|
1998-11-25 22:58:22 +08:00
|
|
|
|
/* Reset library */
|
|
|
|
|
h5_reset();
|
|
|
|
|
fapl = h5_fileaccess();
|
|
|
|
|
|
|
|
|
|
/* Use larger file addresses... */
|
|
|
|
|
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
|
|
|
|
H5Pset_sizes(fcpl, 8, 0);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
/* Create the test file */
|
1998-11-25 22:58:22 +08:00
|
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
|
|
|
|
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0 ||
|
|
|
|
|
NULL==(f=H5I_object(file))) {
|
|
|
|
|
printf("Cannot create file %s; test aborted\n", filename);
|
1998-04-09 05:43:02 +08:00
|
|
|
|
exit(1);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/*
|
1998-11-25 22:58:22 +08:00
|
|
|
|
* For testing file families, fool the library into thinking it already
|
|
|
|
|
* allocated a whole bunch of data.
|
1998-01-17 06:23:43 +08:00
|
|
|
|
*/
|
1999-08-11 04:21:32 +08:00
|
|
|
|
if (H5FD_FAMILY==H5Pget_driver(fapl)) {
|
1998-11-25 22:58:22 +08:00
|
|
|
|
haddr_t addr;
|
1999-07-29 02:25:43 +08:00
|
|
|
|
addr = 8 * ((uint64_t)1<<30); /*8 GB */
|
1999-08-11 04:21:32 +08:00
|
|
|
|
if (H5FDset_eoa(f->shared->lf, addr)<0) {
|
|
|
|
|
printf("Cannot create large file family\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
}
|
1998-01-17 06:23:43 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Creation test: Creates empty objects with various raw data sizes
|
|
|
|
|
* and alignments.
|
|
|
|
|
*/
|
|
|
|
|
status = test_create(f, "create");
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
if (size_of_test & TEST_SMALL) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
status = test_extend(f, "extend", 10, 0, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_extend(f, "extend", 10, 10, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_extend(f, "extend", 10, 10, 10);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
if (size_of_test & TEST_MEDIUM) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
status = test_extend(f, "extend", 10000, 0, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_extend(f, "extend", 2500, 10, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_extend(f, "extend", 10, 400, 10);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
if (size_of_test & TEST_SMALL) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
status = test_sparse(f, "sparse", 100, 5, 0, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_sparse(f, "sparse", 100, 3, 4, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_sparse(f, "sparse", 100, 2, 3, 4);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
if (size_of_test & TEST_MEDIUM) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
status = test_sparse(f, "sparse", 1000, 30, 0, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_sparse(f, "sparse", 2000, 7, 3, 0);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
|
|
|
|
status = test_sparse(f, "sparse", 2000, 4, 2, 3);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
if (size_of_test & TEST_LARGE) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
status = test_sparse(f, "sparse", 800, 50, 50, 50);
|
|
|
|
|
nerrors += status < 0 ? 1 : 0;
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
/* Close the test file and exit */
|
1999-01-07 19:42:04 +08:00
|
|
|
|
H5Pclose(fcpl);
|
1998-11-25 22:58:22 +08:00
|
|
|
|
H5Fclose(file);
|
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
if (nerrors) {
|
1998-04-09 05:43:02 +08:00
|
|
|
|
printf("***** %d I-STORE TEST%s FAILED! *****\n",
|
|
|
|
|
nerrors, 1 == nerrors ? "" : "S");
|
|
|
|
|
exit(1);
|
1998-01-17 06:23:43 +08:00
|
|
|
|
}
|
1998-11-25 22:58:22 +08:00
|
|
|
|
|
1998-01-17 06:23:43 +08:00
|
|
|
|
printf("All i-store tests passed.\n");
|
2000-09-10 08:08:27 +08:00
|
|
|
|
h5_cleanup(FILENAME, fapl);
|
1998-02-10 03:37:40 +08:00
|
|
|
|
return 0;
|
1997-10-21 07:14:35 +08:00
|
|
|
|
}
|