2003-02-17 23:54:15 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
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 *
|
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-02-17 23:54:15 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
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 */
|
|
|
|
|
|
2006-12-01 05:38:30 +08:00
|
|
|
|
#include "H5private.h" /* Generic Functions */
|
[svn-r17281] Description:
Further refactoring of the dataset layout information, to separate the
storage information from the layout info.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-31 11:08:12 +08:00
|
|
|
|
#include "H5Dprivate.h" /* Datasets */
|
2006-12-01 05:38:30 +08:00
|
|
|
|
#include "H5Eprivate.h" /* Error handling */
|
|
|
|
|
#include "H5FLprivate.h" /* Free lists */
|
|
|
|
|
#include "H5Gprivate.h" /* Groups */
|
|
|
|
|
#include "H5MMprivate.h" /* Memory management */
|
|
|
|
|
#include "H5Opkg.h" /* Object headers */
|
|
|
|
|
#include "H5Spkg.h" /* Dataspaces */
|
1997-08-27 01:01:18 +08:00
|
|
|
|
|
|
|
|
|
|
2004-04-09 05:22:21 +08:00
|
|
|
|
/* PRIVATE PROTOTYPES */
|
2009-02-13 02:47:04 +08:00
|
|
|
|
static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
|
|
|
|
|
unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
|
1998-11-19 02:40:09 +08:00
|
|
|
|
static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg);
|
2006-12-07 06:19:52 +08:00
|
|
|
|
static void *H5O_sdspace_copy(const void *_mesg, void *_dest);
|
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);
|
2007-01-30 06:06:36 +08:00
|
|
|
|
static herr_t H5O_sdspace_free(void *_mesg);
|
2007-02-04 15:37:15 +08:00
|
|
|
|
static herr_t H5O_sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src,
|
|
|
|
|
hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata);
|
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
|
|
|
|
|
2007-01-23 22:09:31 +08:00
|
|
|
|
/* Set up & include shared message "interface" info */
|
|
|
|
|
#define H5O_SHARED_TYPE H5O_MSG_SDSPACE
|
|
|
|
|
#define H5O_SHARED_DECODE H5O_sdspace_shared_decode
|
|
|
|
|
#define H5O_SHARED_DECODE_REAL H5O_sdspace_decode
|
|
|
|
|
#define H5O_SHARED_ENCODE H5O_sdspace_shared_encode
|
|
|
|
|
#define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode
|
|
|
|
|
#define H5O_SHARED_SIZE H5O_sdspace_shared_size
|
|
|
|
|
#define H5O_SHARED_SIZE_REAL H5O_sdspace_size
|
|
|
|
|
#define H5O_SHARED_DELETE H5O_sdspace_shared_delete
|
|
|
|
|
#undef H5O_SHARED_DELETE_REAL
|
|
|
|
|
#define H5O_SHARED_LINK H5O_sdspace_shared_link
|
|
|
|
|
#undef H5O_SHARED_LINK_REAL
|
|
|
|
|
#define H5O_SHARED_COPY_FILE H5O_sdspace_shared_copy_file
|
|
|
|
|
#undef H5O_SHARED_COPY_FILE_REAL
|
2007-05-31 05:35:57 +08:00
|
|
|
|
#define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file
|
|
|
|
|
#undef H5O_SHARED_POST_COPY_FILE_REAL
|
2012-03-29 03:45:49 +08:00
|
|
|
|
#undef H5O_SHARED_POST_COPY_FILE_UPD
|
2007-02-04 15:37:15 +08:00
|
|
|
|
#define H5O_SHARED_DEBUG H5O_sdspace_shared_debug
|
|
|
|
|
#define H5O_SHARED_DEBUG_REAL H5O_sdspace_debug
|
2007-01-23 22:09:31 +08:00
|
|
|
|
#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
|
|
|
|
|
|
2005-12-04 10:27:37 +08:00
|
|
|
|
/* This message derives from H5O message class */
|
|
|
|
|
const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{
|
1998-06-05 06:27:11 +08:00
|
|
|
|
H5O_SDSPACE_ID, /* message id number */
|
2005-12-04 10:27:37 +08:00
|
|
|
|
"dataspace", /* message name for debugging */
|
2004-04-09 05:22:21 +08:00
|
|
|
|
sizeof(H5S_extent_t), /* native message size */
|
2007-05-15 04:24:08 +08:00
|
|
|
|
H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */
|
2007-01-30 06:06:36 +08:00
|
|
|
|
H5O_sdspace_shared_decode, /* decode message */
|
|
|
|
|
H5O_sdspace_shared_encode, /* encode message */
|
1998-06-05 06:27:11 +08:00
|
|
|
|
H5O_sdspace_copy, /* copy the native value */
|
2007-01-30 06:06:36 +08:00
|
|
|
|
H5O_sdspace_shared_size, /* size of symbol table entry */
|
1998-06-05 06:27:11 +08:00
|
|
|
|
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 */
|
2007-01-30 06:06:36 +08:00
|
|
|
|
H5O_sdspace_shared_delete, /* file delete method */
|
|
|
|
|
H5O_sdspace_shared_link, /* link method */
|
2007-05-15 04:24:08 +08:00
|
|
|
|
NULL, /* set share method */
|
2007-01-17 01:19:11 +08:00
|
|
|
|
NULL, /*can share method */
|
2006-12-01 05:38:30 +08:00
|
|
|
|
H5O_sdspace_pre_copy_file, /* pre copy native value to file */
|
2007-01-30 06:06:36 +08:00
|
|
|
|
H5O_sdspace_shared_copy_file,/* copy native value to file */
|
2011-10-14 07:10:50 +08:00
|
|
|
|
H5O_sdspace_shared_post_copy_file,/* post copy native value to file */
|
2007-01-19 22:54:46 +08:00
|
|
|
|
NULL, /* get creation index */
|
|
|
|
|
NULL, /* set creation index */
|
2007-02-04 15:37:15 +08:00
|
|
|
|
H5O_sdspace_shared_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
|
|
|
|
/* 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
|
2007-01-23 11:46:31 +08:00
|
|
|
|
void *H5O_sdspace_decode(f, dxpl_id, mesg_flags, p)
|
|
|
|
|
H5F_t *f; IN: pointer to the HDF5 file struct
|
|
|
|
|
hid_t dxpl_id; IN: DXPL for any I/O
|
|
|
|
|
unsigned mesg_flags; IN: Message flags to influence decoding
|
2004-04-07 04:08:20 +08:00
|
|
|
|
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.
|
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static void *
|
2009-02-13 02:47:04 +08:00
|
|
|
|
H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
|
|
|
|
|
unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p)
|
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
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2006-10-09 12:18:18 +08:00
|
|
|
|
HDassert(f);
|
|
|
|
|
HDassert(p);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* decode */
|
2006-10-09 12:18:18 +08:00
|
|
|
|
if(NULL == (sdim = H5FL_CALLOC(H5S_extent_t)))
|
|
|
|
|
HGOTO_ERROR(H5E_DATASPACE, H5E_NOSPACE, NULL, "dataspace structure allocation failed")
|
|
|
|
|
|
|
|
|
|
/* Check version */
|
|
|
|
|
version = *p++;
|
|
|
|
|
if(version < H5O_SDSPACE_VERSION_1 || version > H5O_SDSPACE_VERSION_2)
|
|
|
|
|
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "wrong version number in dataspace message")
|
2007-07-25 05:43:59 +08:00
|
|
|
|
sdim->version = version;
|
2006-10-09 12:18:18 +08:00
|
|
|
|
|
|
|
|
|
/* Get rank */
|
|
|
|
|
sdim->rank = *p++;
|
|
|
|
|
if(sdim->rank > H5S_MAX_RANK)
|
|
|
|
|
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "simple dataspace dimensionality is too large")
|
|
|
|
|
|
|
|
|
|
/* Get dataspace flags for later */
|
|
|
|
|
flags = *p++;
|
|
|
|
|
|
|
|
|
|
/* Get or determine the type of the extent */
|
|
|
|
|
if(version >= H5O_SDSPACE_VERSION_2)
|
|
|
|
|
sdim->type = (H5S_class_t)*p++;
|
|
|
|
|
else {
|
|
|
|
|
/* Set the dataspace type to be simple or scalar as appropriate */
|
|
|
|
|
if(sdim->rank > 0)
|
|
|
|
|
sdim->type = H5S_SIMPLE;
|
|
|
|
|
else
|
|
|
|
|
sdim->type = H5S_SCALAR;
|
|
|
|
|
|
|
|
|
|
/* Increment past reserved byte */
|
|
|
|
|
p++;
|
|
|
|
|
} /* end else */
|
2007-07-25 05:43:59 +08:00
|
|
|
|
HDassert(sdim->type != H5S_NULL || sdim->version >= H5O_SDSPACE_VERSION_2);
|
2006-10-09 12:18:18 +08:00
|
|
|
|
|
|
|
|
|
/* Only Version 1 has these reserved bytes */
|
|
|
|
|
if(version == H5O_SDSPACE_VERSION_1)
|
2004-04-18 04:31:50 +08:00
|
|
|
|
p += 4; /*reserved*/
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2006-10-09 12:18:18 +08:00
|
|
|
|
/* Decode dimension sizes */
|
|
|
|
|
if(sdim->rank > 0) {
|
2007-01-31 02:43:28 +08:00
|
|
|
|
if(NULL == (sdim->size = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank)))
|
2006-10-09 12:18:18 +08:00
|
|
|
|
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
2007-09-13 23:44:56 +08:00
|
|
|
|
|
2007-11-08 05:52:42 +08:00
|
|
|
|
for(i = 0; i < sdim->rank; i++)
|
|
|
|
|
H5F_DECODE_LENGTH(f, p, sdim->size[i]);
|
2006-10-09 12:18:18 +08:00
|
|
|
|
|
|
|
|
|
if(flags & H5S_VALID_MAX) {
|
2007-01-31 02:43:28 +08:00
|
|
|
|
if(NULL == (sdim->max = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank)))
|
2006-10-09 12:18:18 +08:00
|
|
|
|
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
|
|
|
|
for(i = 0; i < sdim->rank; i++)
|
|
|
|
|
H5F_DECODE_LENGTH (f, p, sdim->max[i]);
|
|
|
|
|
} /* end if */
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
/* Compute the number of elements in the extent */
|
|
|
|
|
if(sdim->type == H5S_NULL)
|
|
|
|
|
sdim->nelem = 0;
|
|
|
|
|
else {
|
|
|
|
|
for(i = 0, sdim->nelem = 1; i < sdim->rank; i++)
|
|
|
|
|
sdim->nelem *= sdim->size[i];
|
|
|
|
|
} /* end else */
|
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:
|
2006-10-09 12:18:18 +08:00
|
|
|
|
if(!ret_value && sdim) {
|
2004-04-18 04:31:50 +08:00
|
|
|
|
H5S_extent_release(sdim);
|
2010-04-21 02:26:41 +08:00
|
|
|
|
sdim = H5FL_FREE(H5S_extent_t, sdim);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
} /* end if */
|
|
|
|
|
|
2006-10-09 12:18:18 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
|
} /* end H5O_sdspace_decode() */
|
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_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
|
2006-10-09 12:18:18 +08:00
|
|
|
|
H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
{
|
2006-10-09 12:18:18 +08:00
|
|
|
|
const H5S_extent_t *sdim = (const H5S_extent_t *)_mesg;
|
2004-04-07 04:08:20 +08:00
|
|
|
|
unsigned flags = 0;
|
2006-10-09 12:18:18 +08:00
|
|
|
|
unsigned u; /* Local counting variable */
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2006-10-09 12:18:18 +08:00
|
|
|
|
HDassert(f);
|
|
|
|
|
HDassert(p);
|
|
|
|
|
HDassert(sdim);
|
|
|
|
|
|
|
|
|
|
/* Version */
|
2007-07-25 05:43:59 +08:00
|
|
|
|
HDassert(sdim->version > 0);
|
|
|
|
|
HDassert(sdim->type != H5S_NULL || sdim->version >= H5O_SDSPACE_VERSION_2);
|
2010-07-31 02:06:32 +08:00
|
|
|
|
*p++ = (uint8_t)sdim->version;
|
2006-10-09 12:18:18 +08:00
|
|
|
|
|
|
|
|
|
/* Rank */
|
2010-07-31 02:06:32 +08:00
|
|
|
|
*p++ = (uint8_t)sdim->rank;
|
2006-10-09 12:18:18 +08:00
|
|
|
|
|
|
|
|
|
/* Flags */
|
|
|
|
|
if(sdim->max)
|
|
|
|
|
flags |= H5S_VALID_MAX;
|
2010-07-31 02:06:32 +08:00
|
|
|
|
*p++ = (uint8_t)flags;
|
2006-10-09 12:18:18 +08:00
|
|
|
|
|
|
|
|
|
/* Dataspace type */
|
2007-07-25 05:43:59 +08:00
|
|
|
|
if(sdim->version > H5O_SDSPACE_VERSION_1)
|
2004-04-18 04:31:50 +08:00
|
|
|
|
*p++ = sdim->type;
|
2006-10-09 12:18:18 +08:00
|
|
|
|
else {
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
*p++ = 0; /*reserved*/
|
|
|
|
|
} /* end else */
|
|
|
|
|
|
|
|
|
|
/* Current & maximum dimensions */
|
|
|
|
|
if(sdim->rank > 0) {
|
|
|
|
|
for(u = 0; u < sdim->rank; u++)
|
|
|
|
|
H5F_ENCODE_LENGTH(f, p, sdim->size[u]);
|
|
|
|
|
if(flags & H5S_VALID_MAX) {
|
|
|
|
|
for(u = 0; u < sdim->rank; u++)
|
|
|
|
|
H5F_ENCODE_LENGTH(f, p, sdim->max[u]);
|
|
|
|
|
} /* end if */
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* end H5O_sdspace_encode() */
|
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
|
2010-02-15 11:23:19 +08:00
|
|
|
|
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
|
2004-04-07 04:08:20 +08:00
|
|
|
|
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.
|
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
static void *
|
2010-02-15 11:23:19 +08:00
|
|
|
|
H5O_sdspace_copy(const void *_mesg, void *_dest)
|
2004-04-07 04:08:20 +08:00
|
|
|
|
{
|
2010-02-15 11:23:19 +08:00
|
|
|
|
const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg;
|
|
|
|
|
H5S_extent_t *dest = (H5S_extent_t *)_dest;
|
2004-04-07 04:08:20 +08:00
|
|
|
|
void *ret_value; /* Return value */
|
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2010-02-15 11:23:19 +08:00
|
|
|
|
HDassert(mesg);
|
|
|
|
|
if(!dest && NULL == (dest = H5FL_MALLOC(H5S_extent_t)))
|
2006-12-01 05:38:30 +08:00
|
|
|
|
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
2004-06-14 04:11:38 +08:00
|
|
|
|
/* Copy extent information */
|
2010-02-15 11:23:19 +08:00
|
|
|
|
if(H5S_extent_copy(dest, mesg, TRUE) < 0)
|
2006-12-01 05:38:30 +08:00
|
|
|
|
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent")
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* Set return value */
|
2010-02-15 11:23:19 +08:00
|
|
|
|
ret_value = dest;
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
done:
|
2010-02-15 11:23:19 +08:00
|
|
|
|
if(NULL == ret_value)
|
2010-07-31 02:06:32 +08:00
|
|
|
|
if(dest && NULL == _dest)
|
2010-02-15 11:23:19 +08:00
|
|
|
|
dest = H5FL_FREE(H5S_extent_t, dest);
|
|
|
|
|
|
2006-12-01 05:38:30 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2007-05-15 04:24:08 +08:00
|
|
|
|
} /* end H5O_sdspace_copy() */
|
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_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
|
2006-10-09 12:18:18 +08:00
|
|
|
|
H5O_sdspace_size(const H5F_t *f, const void *_mesg)
|
1997-08-27 01:01:18 +08:00
|
|
|
|
{
|
2006-10-09 12:18:18 +08:00
|
|
|
|
const H5S_extent_t *space = (const H5S_extent_t *)_mesg;
|
|
|
|
|
size_t ret_value;
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
1997-08-29 01:14:35 +08:00
|
|
|
|
|
2006-10-09 12:18:18 +08:00
|
|
|
|
/* Basic information for all dataspace messages */
|
|
|
|
|
ret_value = 1 + /* Version */
|
|
|
|
|
1 + /* Rank */
|
|
|
|
|
1 + /* Flags */
|
|
|
|
|
1 + /* Dataspace type/reserved */
|
2007-07-25 05:43:59 +08:00
|
|
|
|
((space->version > H5O_SDSPACE_VERSION_1) ? 0 : 4); /* Eliminated/reserved */
|
[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
|
|
|
|
|
2006-10-09 12:18:18 +08:00
|
|
|
|
/* Add in the dimension sizes */
|
|
|
|
|
ret_value += space->rank * H5F_SIZEOF_SIZE(f);
|
1997-08-29 01:14:35 +08:00
|
|
|
|
|
2006-10-09 12:18:18 +08:00
|
|
|
|
/* Add in the space for the maximum dimensions, if they are present */
|
|
|
|
|
ret_value += space->max ? (space->rank * H5F_SIZEOF_SIZE(f)) : 0;
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
|
} /* end H5O_sdspace_size() */
|
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
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
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
|
|
|
|
|
2006-12-01 05:38:30 +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
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2007-02-04 15:37:15 +08:00
|
|
|
|
H5O_sdspace_free(void *mesg)
|
2000-04-05 05:00:31 +08:00
|
|
|
|
{
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
2007-02-04 15:37:15 +08:00
|
|
|
|
HDassert(mesg);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
2010-04-21 02:26:41 +08:00
|
|
|
|
mesg = H5FL_FREE(H5S_extent_t, mesg);
|
2000-04-05 05:00:31 +08:00
|
|
|
|
|
2006-12-01 05:38:30 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2007-02-04 15:37:15 +08:00
|
|
|
|
} /* end H5O_sdspace_free() */
|
2006-12-01 05:38:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5O_sdspace_pre_copy_file
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Perform any necessary actions before copying message between
|
|
|
|
|
* files
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: Non-negative
|
|
|
|
|
*
|
|
|
|
|
* Failure: Negative
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* November 30, 2006
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
[svn-r14204] Description:
Move H5Pinsert() out of old "compat v1.6" section and into API
versioning, switching internal usage to H5Pinsert2().
Add regression test for H5Pinsert1()
Clean up some other minor warnings.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 09:29:45 +08:00
|
|
|
|
H5O_sdspace_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src,
|
2007-02-04 15:37:15 +08:00
|
|
|
|
hbool_t UNUSED *deleted, const H5O_copy_t UNUSED *cpy_info, void *_udata)
|
2006-12-01 05:38:30 +08:00
|
|
|
|
{
|
|
|
|
|
const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */
|
|
|
|
|
H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */
|
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT
|
2006-12-01 05:38:30 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
|
|
|
|
HDassert(file_src);
|
|
|
|
|
HDassert(src_space_extent);
|
|
|
|
|
|
|
|
|
|
/* If the user data is non-NULL, assume we are copying a dataset
|
|
|
|
|
* and make a copy of the dataspace extent for later in the object copying
|
|
|
|
|
* process. (We currently only need to make a copy of the dataspace extent
|
|
|
|
|
* if the layout is an early version, but that information isn't
|
|
|
|
|
* available here, so we just make a copy of it in all cases)
|
|
|
|
|
*/
|
|
|
|
|
if(udata) {
|
|
|
|
|
/* Allocate copy of dataspace extent */
|
|
|
|
|
if(NULL == (udata->src_space_extent = H5FL_MALLOC(H5S_extent_t)))
|
|
|
|
|
HGOTO_ERROR(H5E_DATASPACE, H5E_NOSPACE, FAIL, "dataspace extent allocation failed")
|
|
|
|
|
|
|
|
|
|
/* Create a copy of the dataspace extent */
|
[svn-r14271] Description:
Avoid copying maximum dimensions for temporary dataspaces used for
describing chunks during raw data I/O.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-20 18:50:18 +08:00
|
|
|
|
if(H5S_extent_copy(udata->src_space_extent, src_space_extent, TRUE) < 0)
|
2006-12-01 05:38:30 +08:00
|
|
|
|
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent")
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
|
} /* end H5O_dspace_pre_copy_file() */
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2007-02-04 15:37:15 +08:00
|
|
|
|
const H5S_extent_t *sdim = (const H5S_extent_t *)mesg;
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2007-02-04 15:37:15 +08:00
|
|
|
|
HDassert(f);
|
|
|
|
|
HDassert(sdim);
|
|
|
|
|
HDassert(stream);
|
|
|
|
|
HDassert(indent >= 0);
|
|
|
|
|
HDassert(fwidth >= 0);
|
2004-04-07 04:08:20 +08:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2007-02-04 15:37:15 +08:00
|
|
|
|
if(sdim->rank > 0) {
|
|
|
|
|
unsigned u; /* local counting variable */
|
|
|
|
|
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
|
2007-02-04 15:37:15 +08:00
|
|
|
|
for(u = 0; u < sdim->rank; u++)
|
2004-06-14 08:33:03 +08:00
|
|
|
|
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:");
|
2007-02-04 15:37:15 +08:00
|
|
|
|
if(sdim->max) {
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf (stream, "{");
|
2007-02-04 15:37:15 +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?", ":"");
|
2007-02-04 15:37:15 +08:00
|
|
|
|
else
|
2004-06-14 08:33:03 +08:00
|
|
|
|
HDfprintf (stream, "%s%Hu", u?", ":"", sdim->max[u]);
|
2007-02-04 15:37:15 +08:00
|
|
|
|
} /* end for */
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf (stream, "}\n");
|
2007-02-04 15:37:15 +08:00
|
|
|
|
} /* end if */
|
|
|
|
|
else
|
2004-04-07 04:08:20 +08:00
|
|
|
|
HDfprintf (stream, "CONSTANT\n");
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
2006-12-01 05:38:30 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
2007-02-04 15:37:15 +08:00
|
|
|
|
} /* end H5O_sdspace_debug() */
|
2005-11-15 10:55:39 +08:00
|
|
|
|
|