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. *
|
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1997-08-27 01:01:18 +08:00
|
|
|
|
|
2003-02-17 23:54:15 +08:00
|
|
|
|
#define H5O_PACKAGE /*suppress error about including H5Opkg */
|
2000-10-10 15:43:38 +08:00
|
|
|
|
#define H5S_PACKAGE /*prevent warning from including H5Spkg.h */
|
|
|
|
|
|
2001-04-06 01:29:14 +08:00
|
|
|
|
#include "H5private.h"
|
|
|
|
|
#include "H5Eprivate.h"
|
|
|
|
|
#include "H5FLprivate.h" /*Free Lists */
|
|
|
|
|
#include "H5Gprivate.h"
|
|
|
|
|
#include "H5MMprivate.h"
|
2003-02-17 23:54:15 +08:00
|
|
|
|
#include "H5Opkg.h" /* Object header functions */
|
2001-04-06 01:29:14 +08:00
|
|
|
|
#include "H5Spkg.h"
|
1997-08-27 01:01:18 +08:00
|
|
|
|
|
|
|
|
|
|
2004-04-09 05:22:21 +08:00
|
|
|
|
/* PRIVATE PROTOTYPES */
|
2003-02-11 01:26:09 +08:00
|
|
|
|
static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
|
1998-11-19 02:40:09 +08:00
|
|
|
|
static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg);
|
2004-11-23 01:14:11 +08:00
|
|
|
|
static void *H5O_sdspace_copy(const void *_mesg, void *_dest, unsigned update_flags);
|
2004-12-29 22:26:20 +08:00
|
|
|
|
static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
static herr_t H5O_sdspace_reset(void *_mesg);
|
|
|
|
|
static herr_t H5O_sdspace_free (void *_mesg);
|
2003-02-11 01:26:09 +08:00
|
|
|
|
static herr_t H5O_sdspace_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg,
|
2001-08-15 06:09:56 +08:00
|
|
|
|
FILE * stream, int indent, int fwidth);
|
1997-08-27 01:01:18 +08:00
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
/* This message derives from H5O */
|
1998-02-10 03:37:40 +08:00
|
|
|
|
const H5O_class_t H5O_SDSPACE[1] = {{
|
1998-06-05 06:27:11 +08:00
|
|
|
|
H5O_SDSPACE_ID, /* message id number */
|
2004-04-18 04:31:50 +08:00
|
|
|
|
"simple_dspace", /* message name for debugging */
|
2004-04-09 05:22:21 +08:00
|
|
|
|
sizeof(H5S_extent_t), /* native message size */
|
1998-06-05 06:27:11 +08:00
|
|
|
|
H5O_sdspace_decode, /* decode message */
|
|
|
|
|
H5O_sdspace_encode, /* encode message */
|
|
|
|
|
H5O_sdspace_copy, /* copy the native value */
|
|
|
|
|
H5O_sdspace_size, /* size of symbol table entry */
|
|
|
|
|
H5O_sdspace_reset, /* default reset method */
|
[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
|
|
|
|
H5O_sdspace_free, /* free method */
|
2003-04-14 13:05:46 +08:00
|
|
|
|
NULL, /* file delete method */
|
2003-10-06 05:12:26 +08:00
|
|
|
|
NULL, /* link method */
|
1998-06-05 06:27:11 +08:00
|
|
|
|
NULL, /* get share method */
|
|
|
|
|
NULL, /* set share method */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
NULL, /* copy native value to file */
|
|
|
|
|
NULL, /* post copy native value to file */
|
|
|
|
|
H5O_sdspace_debug /* debug the message */
|
1998-01-31 07:32:28 +08:00
|
|
|
|
}};
|
1997-08-27 01:01:18 +08:00
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
/* Initial version of the "old" data space information */
|
1998-07-21 01:58:37 +08:00
|
|
|
|
#define H5O_SDSPACE_VERSION 1
|
2004-04-07 04:08:20 +08:00
|
|
|
|
/* Initial version of the "new" data space information */
|
|
|
|
|
#define H5O_SDSPACE_VERSION_2 2
|
1998-07-21 01:58:37 +08:00
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
/* Declare external the free list for H5S_extent_t's */
|
|
|
|
|
H5FL_EXTERN(H5S_extent_t);
|
|
|
|
|
|
2000-04-05 05:00:31 +08:00
|
|
|
|
/* Declare external the free list for hsize_t arrays */
|
|
|
|
|
H5FL_ARR_EXTERN(hsize_t);
|
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_decode
|
2004-04-07 04:08:20 +08:00
|
|
|
|
PURPOSE
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Decode a simple dimensionality message and return a pointer to a memory
|
2004-04-07 04:08:20 +08:00
|
|
|
|
struct with the decoded information
|
|
|
|
|
USAGE
|
|
|
|
|
void *H5O_sdspace_decode(f, raw_size, p)
|
|
|
|
|
H5F_t *f; IN: pointer to the HDF5 file struct
|
|
|
|
|
size_t raw_size; IN: size of the raw information buffer
|
|
|
|
|
const uint8 *p; IN: the raw information buffer
|
|
|
|
|
RETURNS
|
|
|
|
|
Pointer to the new message in native order on success, NULL on failure
|
|
|
|
|
DESCRIPTION
|
2004-04-18 04:31:50 +08:00
|
|
|
|
This function decodes the "raw" disk form of a simple dimensionality
|
2004-04-07 04:08:20 +08:00
|
|
|
|
message into a struct in memory native format. The struct is allocated
|
|
|
|
|
within this function using malloc() and is returned to the caller.
|
|
|
|
|
|
|
|
|
|
MODIFICATIONS
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Robb Matzke, 1998-04-09
|
|
|
|
|
The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes
|
|
|
|
|
instead of just four bytes.
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Robb Matzke, 1998-07-20
|
|
|
|
|
Added a version number and reformatted the message for aligment.
|
|
|
|
|
|
|
|
|
|
Raymond Lu
|
|
|
|
|
April 8, 2004
|
|
|
|
|
Added the type of dataspace into this header message using a reserved
|
|
|
|
|
byte.
|
2004-04-09 05:22:21 +08:00
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static void *
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *sh)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
{
|
|
|
|
|
H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */
|
|
|
|
|
void *ret_value;
|
|
|
|
|
unsigned i; /* local counting variable */
|
|
|
|
|
unsigned flags, version;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_decode);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2004-07-22 22:27:37 +08:00
|
|
|
|
assert(f);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
assert(p);
|
|
|
|
|
assert (!sh);
|
|
|
|
|
|
|
|
|
|
/* decode */
|
|
|
|
|
if ((sdim = H5FL_CALLOC(H5S_extent_t)) != NULL) {
|
2004-04-18 04:31:50 +08:00
|
|
|
|
/* Check version */
|
2004-04-07 04:08:20 +08:00
|
|
|
|
version = *p++;
|
|
|
|
|
if (version!=H5O_SDSPACE_VERSION && version!=H5O_SDSPACE_VERSION_2)
|
|
|
|
|
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "wrong version number in data space message");
|
2004-04-18 04:31:50 +08:00
|
|
|
|
|
|
|
|
|
/* Get rank */
|
2004-06-14 08:33:03 +08:00
|
|
|
|
sdim->rank = *p++;
|
|
|
|
|
if (sdim->rank>H5S_MAX_RANK)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "simple data space dimensionality is too large");
|
2004-04-18 04:31:50 +08:00
|
|
|
|
|
|
|
|
|
/* Get dataspace flags for later */
|
2004-04-07 04:08:20 +08:00
|
|
|
|
flags = *p++;
|
2004-04-18 04:31:50 +08:00
|
|
|
|
|
|
|
|
|
/* Get the type of the extent */
|
|
|
|
|
if(version>=H5O_SDSPACE_VERSION_2)
|
2004-06-24 01:56:57 +08:00
|
|
|
|
sdim->type = (H5S_class_t)*p++;
|
2004-04-18 04:31:50 +08:00
|
|
|
|
else {
|
|
|
|
|
/* Set the dataspace type to be simple or scalar as appropriate */
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if(sdim->rank>0)
|
2004-04-18 04:31:50 +08:00
|
|
|
|
sdim->type = H5S_SIMPLE;
|
|
|
|
|
else
|
|
|
|
|
sdim->type = H5S_SCALAR;
|
|
|
|
|
|
|
|
|
|
/* Increment past reserved byte */
|
|
|
|
|
p++;
|
|
|
|
|
} /* end else */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
p += 4; /*reserved*/
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if (sdim->rank > 0) {
|
|
|
|
|
if (NULL==(sdim->size=H5FL_ARR_MALLOC(hsize_t,sdim->rank)))
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
2004-06-14 08:33:03 +08:00
|
|
|
|
for (i = 0; i < sdim->rank; i++)
|
|
|
|
|
H5F_DECODE_LENGTH (f, p, sdim->size[i]);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
if (flags & H5S_VALID_MAX) {
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if (NULL==(sdim->max=H5FL_ARR_MALLOC(hsize_t,sdim->rank)))
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
2004-06-14 08:33:03 +08:00
|
|
|
|
for (i = 0; i < sdim->rank; i++)
|
|
|
|
|
H5F_DECODE_LENGTH (f, p, sdim->max[i]);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2004-04-18 04:31:50 +08:00
|
|
|
|
|
|
|
|
|
/* Compute the number of elements in the extent */
|
|
|
|
|
if(sdim->type == H5S_NULL)
|
|
|
|
|
sdim->nelem = 0;
|
|
|
|
|
else {
|
2004-06-14 08:33:03 +08:00
|
|
|
|
for(i=0, sdim->nelem=1; i<sdim->rank; i++)
|
|
|
|
|
sdim->nelem*=sdim->size[i];
|
2004-04-18 04:31:50 +08:00
|
|
|
|
}
|
2004-04-07 04:08:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set return value */
|
|
|
|
|
ret_value = (void*)sdim; /*success*/
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
done:
|
|
|
|
|
if (!ret_value && sdim) {
|
2004-04-18 04:31:50 +08:00
|
|
|
|
H5S_extent_release(sdim);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
H5FL_FREE(H5S_extent_t,sdim);
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value);
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
|
|
1997-08-27 01:01:18 +08:00
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_encode
|
2004-04-07 04:08:20 +08:00
|
|
|
|
PURPOSE
|
2005-08-14 04:53:35 +08:00
|
|
|
|
Encode a simple dimensionality message
|
2004-04-07 04:08:20 +08:00
|
|
|
|
USAGE
|
|
|
|
|
herr_t H5O_sdspace_encode(f, raw_size, p, mesg)
|
|
|
|
|
H5F_t *f; IN: pointer to the HDF5 file struct
|
|
|
|
|
size_t raw_size; IN: size of the raw information buffer
|
|
|
|
|
const uint8 *p; IN: the raw information buffer
|
|
|
|
|
const void *mesg; IN: Pointer to the extent dimensionality struct
|
|
|
|
|
RETURNS
|
|
|
|
|
Non-negative on success/Negative on failure
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
This function encodes the native memory form of the simple
|
|
|
|
|
dimensionality message in the "raw" disk form.
|
|
|
|
|
|
|
|
|
|
MODIFICATIONS
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Robb Matzke, 1998-04-09
|
|
|
|
|
The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes
|
|
|
|
|
instead of just four bytes.
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Robb Matzke, 1998-07-20
|
|
|
|
|
Added a version number and reformatted the message for aligment.
|
|
|
|
|
|
|
|
|
|
Raymond Lu
|
|
|
|
|
April 8, 2004
|
|
|
|
|
Added the type of dataspace into this header message using a reserved
|
|
|
|
|
byte.
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static herr_t
|
2004-07-22 05:30:26 +08:00
|
|
|
|
H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
{
|
|
|
|
|
const H5S_extent_t *sdim = (const H5S_extent_t *) mesg;
|
|
|
|
|
unsigned u; /* Local counting variable */
|
|
|
|
|
unsigned flags = 0;
|
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_encode);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2004-07-22 05:30:26 +08:00
|
|
|
|
assert(f);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
assert(p);
|
|
|
|
|
assert(sdim);
|
|
|
|
|
|
|
|
|
|
/* set flags */
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if (sdim->max)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
flags |= H5S_VALID_MAX;
|
|
|
|
|
|
|
|
|
|
/* encode */
|
2004-04-18 04:31:50 +08:00
|
|
|
|
if(sdim->type!=H5S_NULL)
|
|
|
|
|
*p++ = H5O_SDSPACE_VERSION;
|
|
|
|
|
else
|
|
|
|
|
*p++ = H5O_SDSPACE_VERSION_2;
|
2004-06-14 08:33:03 +08:00
|
|
|
|
*p++ = sdim->rank;
|
2004-04-07 04:08:20 +08:00
|
|
|
|
*p++ = flags;
|
2004-04-18 04:31:50 +08:00
|
|
|
|
if(sdim->type!=H5S_NULL)
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
else
|
|
|
|
|
*p++ = sdim->type;
|
2004-04-07 04:08:20 +08:00
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if (sdim->rank > 0) {
|
|
|
|
|
for (u = 0; u < sdim->rank; u++)
|
|
|
|
|
H5F_ENCODE_LENGTH (f, p, sdim->size[u]);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
if (flags & H5S_VALID_MAX) {
|
2005-08-14 04:53:35 +08:00
|
|
|
|
for (u = 0; u < sdim->rank; u++)
|
2004-06-14 08:33:03 +08:00
|
|
|
|
H5F_ENCODE_LENGTH (f, p, sdim->max[u]);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
|
|
1997-08-27 01:01:18 +08:00
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_copy
|
2004-04-07 04:08:20 +08:00
|
|
|
|
PURPOSE
|
|
|
|
|
Copies a message from MESG to DEST, allocating DEST if necessary.
|
|
|
|
|
USAGE
|
|
|
|
|
void *H5O_sdspace_copy(mesg, dest)
|
|
|
|
|
const void *mesg; IN: Pointer to the source extent dimensionality struct
|
|
|
|
|
const void *dest; IN: Pointer to the destination extent dimensionality struct
|
|
|
|
|
RETURNS
|
|
|
|
|
Pointer to DEST on success, NULL on failure
|
|
|
|
|
DESCRIPTION
|
2004-04-18 04:31:50 +08:00
|
|
|
|
This function copies a native (memory) simple dimensionality message,
|
2004-04-07 04:08:20 +08:00
|
|
|
|
allocating the destination structure if necessary.
|
2004-04-09 05:22:21 +08:00
|
|
|
|
MODIFICATIONS
|
|
|
|
|
Raymond Lu
|
|
|
|
|
April 8, 2004
|
|
|
|
|
Changed operation on H5S_simple_t to H5S_extent_t.
|
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static void *
|
2004-11-23 01:14:11 +08:00
|
|
|
|
H5O_sdspace_copy(const void *mesg, void *dest, unsigned UNUSED update_flags)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
{
|
|
|
|
|
const H5S_extent_t *src = (const H5S_extent_t *) mesg;
|
|
|
|
|
H5S_extent_t *dst = (H5S_extent_t *) dest;
|
|
|
|
|
void *ret_value; /* Return value */
|
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_copy);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
|
|
|
|
assert(src);
|
|
|
|
|
if (!dst && NULL==(dst = H5FL_MALLOC(H5S_extent_t)))
|
|
|
|
|
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
|
|
|
|
|
2004-06-14 04:11:38 +08:00
|
|
|
|
/* Copy extent information */
|
|
|
|
|
if(H5S_extent_copy(dst,src)<0)
|
|
|
|
|
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent");
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* Set return value */
|
|
|
|
|
ret_value=dst;
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value);
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
|
|
1997-08-27 01:01:18 +08:00
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_size
|
2004-04-07 04:08:20 +08:00
|
|
|
|
PURPOSE
|
|
|
|
|
Return the raw message size in bytes
|
|
|
|
|
USAGE
|
2004-04-09 05:22:21 +08:00
|
|
|
|
void *H5O_sdspace_size(f, mesg)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
H5F_t *f; IN: pointer to the HDF5 file struct
|
|
|
|
|
const void *mesg; IN: Pointer to the source extent dimensionality struct
|
|
|
|
|
RETURNS
|
|
|
|
|
Size of message on success, zero on failure
|
|
|
|
|
DESCRIPTION
|
2004-04-18 04:31:50 +08:00
|
|
|
|
This function returns the size of the raw simple dimensionality message on
|
2004-04-07 04:08:20 +08:00
|
|
|
|
success. (Not counting the message type or size fields, only the data
|
|
|
|
|
portion of the message). It doesn't take into account alignment.
|
|
|
|
|
|
|
|
|
|
MODIFICATIONS
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Robb Matzke, 1998-04-09
|
|
|
|
|
The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes
|
|
|
|
|
instead of just four bytes.
|
2004-04-07 04:08:20 +08:00
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static size_t
|
2004-12-29 22:26:20 +08:00
|
|
|
|
H5O_sdspace_size(const H5F_t *f, const void *mesg)
|
1997-08-27 01:01:18 +08:00
|
|
|
|
{
|
2004-04-09 05:22:21 +08:00
|
|
|
|
const H5S_extent_t *space = (const H5S_extent_t *) mesg;
|
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
|
|
|
|
/*
|
1998-07-21 01:58:37 +08:00
|
|
|
|
* All dimensionality messages are at least 8 bytes long.
|
[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-05-01 13:16:50 +08:00
|
|
|
|
size_t ret_value = 8;
|
1997-08-29 01:14:35 +08:00
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_size);
|
1997-08-29 01:14:35 +08:00
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
/* add in the dimension sizes */
|
2004-06-14 08:33:03 +08:00
|
|
|
|
ret_value += space->rank * H5F_SIZEOF_SIZE (f);
|
[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
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
/* add in the space for the maximum dimensions, if they are present */
|
2004-06-14 08:33:03 +08:00
|
|
|
|
ret_value += space->max ? space->rank * H5F_SIZEOF_SIZE (f) : 0;
|
1997-08-29 01:14:35 +08:00
|
|
|
|
|
2003-01-11 04:26:02 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value);
|
[svn-r139] ./src/*.[ch]
Removed the interface initialization argument from
FUNC_ENTER() and made it a locally-defined preprocessor
symbol, INTERFACE_INIT.
Changed `offset' to `address' and `length' to `size' in
documentation so it's more consistent. `Offset' still appears
occassionally when it refers to a byte offset within some
other data structure.
Moved interface termination function prototypes from public
header files to .c files and made them static.
./src/H5.c
./src/H5public.h
Added H5init() because it's possible that the predefined data
types are not initialized. This happens only if the first
call to the hdf5 library passes a predefined data type symbol
as an argument. There should be some way to fix this...
./src/H5A.c
./src/H5Aprivate.h
./src/H5Apublic.h
The free_func returns SUCCEED or FAIL, although the return
value is ignored by H5A. This is so we can use the various
H5*_close() functions to free things.
H5Ainc_ref() and H5Adec_ref() are no longer public. Many of
the other atom functions should also be made private, but I'll
save that for later...
Added additional template groups called H5_TEMPLATE_0 through
H5_TEMPLATE_7 that are used by the various template
subclasses.
Increased the number of bits used for atom groups to prevent
negative atoms.
./src/H5AC.c
./src/H5ACprivate.h
Changed H5AC_new() to H5AC_create() to make names more consistent.
./src/H5B.c
./src/H5Bprivate.h
Changed H5B_new() to H5B_create() to make names more consistent.
./src/H5C.c
./src/H5Cprivate.h
./src/H5Cpublic.h
Now supports multiple subclasses of templates, although it's
done with big switch statements. The default values for
templates are defined in the source file to which that
template belongs. This got rid of lots of needless
preprocessor constants.
Added H5Ccreate() to create a new template. Changed
H5C_release() to H5Cclose() to make the naming more
consistent.
./src/H5D.c
./src/H5Dprivate.h
./src/H5Dpublic.h
Enhanced to use the new dataset interface, and uses the enhanced
data type and data space interfaces, which haven't been
completely implemented. The dataset interface doesn't handle
non-contiguous storage, compression, or data type and space
conversions yet.
./src/H5F.c
./src/H5Fprivate.h
./src/H5Fpublic.h
Removed H5Fflush() since just calls H5F_flush(), which doesn't
do what the user would probably think it does, namely, flush
everything. It only flushes those things sitting in the H5AC
cache and the boot block.
Changed the `file_create_parms' field of H5F_low_t to just
`create_parms' since the `file' part is obvious.
./src/H5Fistore.c
Added some support for external files. Mostly just in the
file format and not supported much by the library yet. I need
to finish some dataset functions first.
Changed H5F_istore_new() to H5F_istore_create() to make names
more uniform across packages.
./src/H5Flow.c
Flushing a file causes the file to be physically extended to
the logical eof. This prevents H5F_open() from thinking a
file has been truncated. Most of the time the file will
already be that large, and when it isn't Unix will often just
allocate the final block anyway.
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5Gpkg.h
./src/H5Gprivate.h
./src/H5Gstab.c
Removed H5G_basename()
Removed (temporarily) data type information from symbol table
entries and renamed H5G_CACHED_SDATA to H5G_CACHED_SDSPACE to
reflect that it's a simple data space and has nothing to do
with raw data.
Changed H5G_node_new() to H5G_node_create() and H5G_stab_new()
to H5G_stab_create() to make names more uniform across
packages.
Fixed an undefined address bug that happens when H5G_node_debug()
program doesn't pass enough info to H5G_node_load().
./src/H5H.c
./src/H5Hprivate.h
Changed H5H_new() to H5H_create() to make the names more
uniform across packages.
./src/H5M.c
./src/H5Mprivate.h
./src/H5Mpublic.h
Nulled all the create functions. Most of the other callbacks
are to public functions. Removed H5Mcreate().
Changed hobjtype_t to group_t since it has to be the same
thing anyway.
./src/H5O.c
./src/H5Oprivate.h
./src/H5Osdim.c
./src/H5Osdtyp.c
Changed H5O_SIM_DIM to H5O_SDSPACE (simple data space) since
`simple data space' is its official name, not `simple
dimensions'. Will eventually add H5O_CDSPACE for comples data
spaces. Changed _sim_dim_ to _dspace_.
Replaced H5O_SIM_DTYPE and the compound data type messages
with a single H5O_DTYPE message. Changed _sim_dtype_ to _dtype_.
Changed H5O_STD_STORE to H5O_CSTORE (contiguous storage) since
contiguous storage is not necessarily standard. Changed
_std_store_ to _cstore_ in H5Ocstore.c
Added the H5O_EFL (external file list) message.
Changed H5O_new() to H5O_create() to make names more uniform
across packages.
./src/H5Oefl.c NEW
External file list message for specifying which non-hdf5 files
contain raw data for a dataset.
./src/H5P.c
./src/H5Pprivate.h
./src/H5Ppublic.h
Renamed and moved data structures to make the names conform to
our naming scheme.
./src/H5T.c
./src/H5Tprivate.h
./src/H5Tpublic.h
./src/H5Tpkg.h NEW
Data structures redesigned to be more flexible. The interface
was redesigned to make it more regular and to make some names
more uniform across packages.
./src/H5detect.c
Output was changed to produce a file that conforms to the hdf5
coding standard.
./src/Makefile.in
Generates H5Tinit.c by running H5detect.
./src/debug.c
Moved command argument processing.
1997-12-11 06:41:07 +08:00
|
|
|
|
}
|
1997-08-27 01:01:18 +08:00
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2004-04-09 05:22:21 +08:00
|
|
|
|
* Function: H5O_sdspace_reset
|
2004-04-07 04:08:20 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Frees the inside of a dataspace message and resets it to some
|
|
|
|
|
* initial value.
|
|
|
|
|
*
|
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
|
|
|
|
*
|
2004-06-14 04:11:38 +08:00
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* Thursday, April 30, 1998
|
2004-04-07 04:08:20 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2000-04-05 05:00:31 +08:00
|
|
|
|
H5O_sdspace_reset(void *_mesg)
|
|
|
|
|
{
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5S_extent_t *mesg = (H5S_extent_t*)_mesg;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_reset);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
2004-04-18 04:31:50 +08:00
|
|
|
|
H5S_extent_release(mesg);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2004-04-09 05:22:21 +08:00
|
|
|
|
* Function: H5O_sdsdpace_free
|
2004-04-07 04:08:20 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Free's the message
|
|
|
|
|
*
|
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
|
|
|
|
*
|
2004-06-14 04:11:38 +08:00
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* Thursday, March 30, 2000
|
2004-04-07 04:08:20 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2000-04-05 05:00:31 +08:00
|
|
|
|
H5O_sdspace_free (void *mesg)
|
|
|
|
|
{
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_free);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
|
|
|
|
assert (mesg);
|
|
|
|
|
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5FL_FREE(H5S_extent_t,mesg);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_debug
|
2004-04-07 04:08:20 +08:00
|
|
|
|
PURPOSE
|
2004-04-18 04:31:50 +08:00
|
|
|
|
Prints debugging information for a simple dimensionality message
|
2004-04-07 04:08:20 +08:00
|
|
|
|
USAGE
|
2004-04-09 05:22:21 +08:00
|
|
|
|
void *H5O_sdspace_debug(f, mesg, stream, indent, fwidth)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
H5F_t *f; IN: pointer to the HDF5 file struct
|
|
|
|
|
const void *mesg; IN: Pointer to the source extent dimensionality struct
|
|
|
|
|
FILE *stream; IN: Pointer to the stream for output data
|
|
|
|
|
int indent; IN: Amount to indent information by
|
|
|
|
|
int fwidth; IN: Field width (?)
|
|
|
|
|
RETURNS
|
|
|
|
|
Non-negative on success/Negative on failure
|
|
|
|
|
DESCRIPTION
|
2005-08-14 04:53:35 +08:00
|
|
|
|
This function prints debugging output to the stream passed as a
|
2004-04-07 04:08:20 +08:00
|
|
|
|
parameter.
|
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static herr_t
|
2004-04-09 05:22:21 +08:00
|
|
|
|
H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg,
|
2004-04-07 04:08:20 +08:00
|
|
|
|
FILE * stream, int indent, int fwidth)
|
|
|
|
|
{
|
|
|
|
|
const H5S_extent_t *sdim = (const H5S_extent_t *) mesg;
|
|
|
|
|
unsigned u; /* local counting variable */
|
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_debug);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
|
|
|
|
assert(f);
|
|
|
|
|
assert(sdim);
|
|
|
|
|
assert(stream);
|
|
|
|
|
assert(indent >= 0);
|
|
|
|
|
assert(fwidth >= 0);
|
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
|
|
|
|
|
"Rank:",
|
2004-06-14 08:33:03 +08:00
|
|
|
|
(unsigned long) (sdim->rank));
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if(sdim->rank>0) {
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
|
2004-06-14 08:33:03 +08:00
|
|
|
|
for (u = 0; u < sdim->rank; u++)
|
|
|
|
|
HDfprintf (stream, "%s%Hu", u?", ":"", sdim->size[u]);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf (stream, "}\n");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Dim Max:");
|
2004-06-14 08:33:03 +08:00
|
|
|
|
if (sdim->max) {
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf (stream, "{");
|
2004-06-14 08:33:03 +08:00
|
|
|
|
for (u = 0; u < sdim->rank; u++) {
|
|
|
|
|
if (H5S_UNLIMITED==sdim->max[u]) {
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf (stream, "%sINF", u?", ":"");
|
|
|
|
|
} else {
|
2004-06-14 08:33:03 +08:00
|
|
|
|
HDfprintf (stream, "%s%Hu", u?", ":"", sdim->max[u]);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
HDfprintf (stream, "}\n");
|
|
|
|
|
} else {
|
|
|
|
|
HDfprintf (stream, "CONSTANT\n");
|
|
|
|
|
}
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
2004-06-23 23:36:35 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
}
|